repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
Emeshka/graphytica
src/app/vertices-category/vertices-category.component.ts
import { Component, OnInit, Input, OnDestroy, SimpleChanges } from '@angular/core'; import { KeyValue } from '@angular/common'; import { DbServiceService } from '../db-service.service'; @Component({ selector: 'edit-category', templateUrl: './vertices-category.component.html', styleUrls: ['./vertices-category.com...
Emeshka/graphytica
src/app/sq-predicate/sq-predicate.component.ts
import { Component, Input, OnInit } from '@angular/core'; @Component({ selector: 'sq-predicate', templateUrl: './sq-predicate.component.html', styleUrls: ['./sq-predicate.component.css'] }) export class SqPredicateComponent implements OnInit { constructor() { } @Input() tree: any = {}; block = false; i...
Emeshka/graphytica
src/app/app.component.ts
import { Component, NgZone, ViewChild, OnInit } from '@angular/core'; //import { FormsModule, NgForm } from '@angular/forms'; import { ElectronService } from 'ngx-electron'; //import { LastDirectoryService } from './last-directory.service' import { DbServiceService } from './db-service.service' import { UpdateRecentSer...
Emeshka/graphytica
src/app/action-button/action-button.component.ts
import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'action-button', templateUrl: './action-button.component.html', styleUrls: ['./action-button.component.css'] }) export class ActionButtonComponent implements OnInit { constructor() { } ngOnInit(): void { } @Input() text: ...
Emeshka/graphytica
src/app/view-category/view-category.component.ts
<filename>src/app/view-category/view-category.component.ts<gh_stars>1-10 import { Component, OnInit, Input } from '@angular/core'; import { DbServiceService } from '../db-service.service'; import { SelectQuery } from '../selection-category/SelectQuery'; @Component({ selector: 'view-category', templateUrl: './view-...
Emeshka/graphytica
src/app/sq-operator/sq-operator.component.ts
import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'sq-operator', templateUrl: './sq-operator.component.html', styleUrls: ['./sq-operator.component.css'] }) export class SqOperatorComponent implements OnInit { constructor() { } @Input() tree: any = {}; single = false; isFi...
Emeshka/graphytica
src/app/main-view/main-view.component.ts
<filename>src/app/main-view/main-view.component.ts import { Component, Input, ViewChild, NgZone, OnInit, ErrorHandler } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import { DbServiceService } from '../db-service.service'; import { UpdateRecentService } from '../update-recent.service'; import {...
Emeshka/graphytica
src/app/sq-selector/sq-selector.component.spec.ts
<gh_stars>1-10 import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SqSelectorComponent } from './sq-selector.component'; describe('SqSelectorComponent', () => { let component: SqSelectorComponent; let fixture: ComponentFixture<SqSelectorComponent>; beforeEach(async () => { await Tes...
Emeshka/graphytica
src/app/app-open-file-button-big/app-open-file-button-big.component.ts
import { Component, OnInit, Input } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import { LastDirectoryService } from '../last-directory.service'; @Component({ selector: 'app-save-file-tile-button', styleUrls: ['./app-open-file-button-big.component.css', '../tile-button-styles.css'], te...
Emeshka/graphytica
src/app/app.module.ts
<reponame>Emeshka/graphytica<filename>src/app/app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule, NgForm } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component';...
Emeshka/graphytica
src/app/tree-branch/tree-branch.component.ts
import { Component, Input, OnInit } from '@angular/core'; import { DbServiceService } from '../db-service.service'; import { ElectronService } from 'ngx-electron'; @Component({ selector: 'tree-branch', templateUrl: './tree-branch.component.html', styleUrls: ['./tree-branch.component.css'] }) export class TreeBra...
Emeshka/graphytica
src/app/tiny-button/tiny-button.component.ts
import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'tiny-button', templateUrl: './tiny-button.component.html', styleUrls: ['./tiny-button.component.css'] }) export class TinyButtonComponent { constructor() { } @Input() title: string; @Input() iconSrc: string; @Input() call...
Emeshka/graphytica
src/app/main-view/Selection.ts
<reponame>Emeshka/graphytica /* Коллекция без дубликатов с сохранением порядка элементов и доступом по индексу с событиями на добавление, удаление и замену элемента */ export class OSelection { _array = []; _handlers = { itemadded: [], itemremoved: [], itemset: [] }; raiseEvent(ev...
Emeshka/graphytica
src/app/date-picker/date-picker.component.ts
import { Component, OnInit, Input, Output, EventEmitter, ViewChild, SimpleChanges } from '@angular/core'; @Component({ selector: 'date-picker', templateUrl: './date-picker.component.html', styleUrls: ['./date-picker.component.css'] }) export class DatePickerComponent implements OnInit { constructor() { } @...
Emeshka/graphytica
src/app/pretty-button/pretty-button.component.ts
import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-pretty-button', templateUrl: './pretty-button.component.html', styleUrls: ['./pretty-button.component.css'] }) export class PrettyButtonComponent implements OnInit { constructor() { } ngOnInit(): void { } @Input() te...
Emeshka/graphytica
src/app/sq-selector/sq-selector.component.ts
<filename>src/app/sq-selector/sq-selector.component.ts import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'sq-selector', templateUrl: './sq-selector.component.html', styleUrls: ['./sq-selector.component.css'] }) export class SqSelectorComponent implements OnInit { constructor() {...
Emeshka/graphytica
src/app/sq-predicate/sq-predicate.component.spec.ts
<reponame>Emeshka/graphytica<gh_stars>1-10 import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SqPredicateComponent } from './sq-predicate.component'; describe('SqPredicateComponent', () => { let component: SqPredicateComponent; let fixture: ComponentFixture<SqPredicateComponent>; befor...
Emeshka/graphytica
src/app/main-view/SandboxFunction.ts
/* Коллекция без дубликатов с сохранением порядка элементов и доступом по индексу с событиями на добавление, удаление и замену элемента */ export class SandboxFunction { private static readonly blackList = [ 'Worker', 'WebSocket', 'XMLHttpRequest', 'WorkerGlobalScope', 'DOMRequest', 'DOMCursor', 'Work...
Emeshka/graphytica
src/app/selection-category/selection-category.component.ts
<reponame>Emeshka/graphytica import { Component, OnInit, Input, OnDestroy } from '@angular/core'; import { KeyValue } from '@angular/common'; import { ElectronService } from 'ngx-electron'; import { DbServiceService } from '../db-service.service'; import { SelectQuery } from './SelectQuery'; @Component({ selector: '...
Emeshka/graphytica
src/app/db-service.service.ts
import { Injectable } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import { BehaviorSubject } from 'rxjs'; import { SelectQuery } from './selection-category/SelectQuery'; @Injectable({ providedIn: 'root' }) export class DbServiceService { constructor( private _electronService: Electro...
Emeshka/graphytica
src/app/classes-category/classes-category.component.ts
<filename>src/app/classes-category/classes-category.component.ts import { Component, OnInit, Input, ViewChildren } from '@angular/core'; import { DbServiceService } from '../db-service.service'; import { ElectronService } from 'ngx-electron'; @Component({ selector: 'app-classes-category', templateUrl: './classes-c...
Emeshka/graphytica
src/app/code-mirror/code-mirror.component.ts
<filename>src/app/code-mirror/code-mirror.component.ts import { Component, Input, OnInit, ViewChild, SimpleChanges, Output, EventEmitter } from '@angular/core'; import 'codemirror/mode/javascript/javascript'; import 'codemirror/mode/sql/sql'; import 'codemirror/addon/hint/show-hint'; import { SandboxFunction } from '.....
Emeshka/graphytica
src/app/autosized-textarea/autosized-textarea.component.ts
import {Component, NgZone, ViewChild, Input, Output, EventEmitter} from '@angular/core'; import {take} from 'rxjs/operators'; @Component({ selector: 'autosized-textarea', templateUrl: './autosized-textarea.component.html', styleUrls: ['./autosized-textarea.component.css'] }) export class AutosizedTextareaCompone...
Emeshka/graphytica
src/app/update-recent.service.ts
import { Injectable } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import { BehaviorSubject } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class UpdateRecentService { constructor( private _electronService: ElectronService ) { this.readRecentProjects() } private fs...
Emeshka/graphytica
src/app/filepath-selector/filepath-selector.component.ts
<filename>src/app/filepath-selector/filepath-selector.component.ts import { Component, OnInit, Input } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import { LastDirectoryService } from '../last-directory.service'; @Component({ selector: 'app-filepath-selector', templateUrl: './filepath-se...
Emeshka/graphytica
src/app/selection-category/SelectQuery.ts
<reponame>Emeshka/graphytica /* Коллекция без дубликатов с сохранением порядка элементов и доступом по индексу с событиями на добавление, удаление и замену элемента */ export class SelectQuery { public static readonly operators = [ { name: '.unify', //regex: /(\d+)\.unify\((\d+)\)/g, ...
Emeshka/graphytica
src/app/filepath-selector/filepath-selector.component.spec.ts
<filename>src/app/filepath-selector/filepath-selector.component.spec.ts import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FilepathSelectorComponent } from './filepath-selector.component'; describe('FilepathSelectorComponent', () => { let component: FilepathSelectorComponent; let fixture:...
Emeshka/graphytica
src/app/tile-button/tile-button.component.ts
import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-tile-button', templateUrl: './tile-button.component.html', styleUrls: ['./tile-button.component.css', '../tile-button-styles.css'] }) export class TileButtonComponent implements OnInit { constructor() { } ngOnInit(): void...
guoshuangyang/images-editor
src/imagesEditor.ts
/** * @description 入口文件 * @author yyy <<EMAIL>> */ import imagesEditor from './editor' // 非浏览器不可用 try { document } catch (ex) { throw new Error('请在浏览器环境下运行') } export default imagesEditor
guoshuangyang/images-editor
src/types/index.d.ts
<reponame>guoshuangyang/images-editor /** * @param image 必要的参数,图片 * @param x 绘制的x坐标位置 * @param y 绘制的y坐标的开始 * @param w 绘制的宽度 * @param h 绘制图片的高度 */ interface Options { image: CanvasImageSource; x?: number; y?: number; w?: number; h?: number; shape?: string; eventStatus?: number; } /*...
guoshuangyang/images-editor
src/editor/index.ts
import { version } from '../../package.json' import { drawCircle, drawEllipse, drawImage, drawLine, drawRect, getCtx } from './draw' import { GetElement, getCanvasPosition, getEventPos } from './getInfo' import { update, destroy } from '../config' import { throttle } from '../tools' import * as datas from './data' /** ...
guoshuangyang/images-editor
src/editor/draw/index.ts
<filename>src/editor/draw/index.ts import { isString } from '../../tools' /** * 创建一个图片的背景 * @param context * @param image * @param dx x轴坐标 * @param dy y轴坐标 * @param dw canvas的宽度 * @param dh canvas的高度 */ export function drawImage(context: CanvasRenderingContext2D, image: CanvasImageSource, dx: number, dy: number...
guoshuangyang/images-editor
src/editor/data/index.ts
<filename>src/editor/data/index.ts<gh_stars>0 export let data: Data; // 请求参数 可通过updateConfig方法修改 export let option: Options; // canvast图 export let canvasImage: HTMLCanvasElement; // 画笔工具 export let ctx: CanvasRenderingContext2D;
guoshuangyang/images-editor
src/editor/export/exportImg.ts
/** * 将svg导出成图片 * @param node svg节点 => document.querySelector('svg') * @param name 生成的图片名称 * @param width 生成的图片宽度 * @param height 生成的图片高度 * @param type 生成的图片类型 */ // export const covertSVG2Image = (node, name, width, height, type = 'png') => { // let serializer = new XMLSerializer() // let source = '<?x...
guoshuangyang/images-editor
src/tools/judeg.ts
<filename>src/tools/judeg.ts /*** * @description 判断是不是某个值的内容,统一返回Boolean * @author yyy */ /** * 是不是dom元素 * @param element */ export const isDom = (element: string | HTMLElement ) => { return typeof HTMLElement === 'object' ? element instanceof HTMLElement : element && typeof element === 'obje...
guoshuangyang/images-editor
src/editor/getInfo/index.ts
<reponame>guoshuangyang/images-editor /** * @description 获取各个dom 或者事件的信息 */ export * from './getInfo'
guoshuangyang/images-editor
src/tools/index.ts
/** * @description 常用的工具描述 * @function throttle 节流 */ export * from './judeg' /** * 简单的节流函数 * @param func * @param wait * @param mustRun * @returns */ export function throttle(func: Function, wait: number, mustRun: number) { let timeout: any; let startTime = new Date(); return function () { ...
guoshuangyang/images-editor
src/config/index.ts
<reponame>guoshuangyang/images-editor // 配置相关文件 export const update = function (ctx: CanvasRenderingContext2D,colorOption: object):void{ const options = { borderColor: 'red', textColor: 'black', fillColor: 'red', borderStyle: 'rect' } let option = Object.assign(options,colorO...
guoshuangyang/images-editor
src/editor/getInfo/getInfo.ts
/** * 根据无论是元素还是id都拿到对应元素 * @param id 元素或者id * @returns */ export const GetElement = function (id: string | HTMLElement): HTMLElement { let ele; if (typeof id === 'string') { console.log('string',id) ele = document.getElementById(id) } else { ele = id } console.log('ele',e...
javaadpatel/tech-pays-eu-graphs
my-app/src/DataSourceMessage.tsx
<reponame>javaadpatel/tech-pays-eu-graphs import { Button, Message } from "semantic-ui-react" const DataSourceMessage: React.FC = () => { return( <Message info> <Message.Header>What is the data source for this?</Message.Header> <Message.Content> The data comes from techpays.eu whi...
javaadpatel/tech-pays-eu-graphs
my-app/src/CompensationDataVisualization.tsx
<gh_stars>0 import { useState } from "react"; import { Checkbox, CheckboxProps, Dropdown, DropdownProps } from "semantic-ui-react"; import { DataService } from "./data-service"; import { SeniorityLevels } from "./enums/seniority-levels-enum"; import Graph from "./Graph"; import { CompanySalaryData } from "./interfaces/...
javaadpatel/tech-pays-eu-graphs
my-app/src/DataDisclaimerMessage.tsx
import { Message } from "semantic-ui-react"; const DataDisclaimerMessage: React.FC = () => { return( <Message warning icon='warning sign' content=' This data is currently filtering out any data points relating to product owners/managers, engineering manag...
javaadpatel/tech-pays-eu-graphs
my-app/src/enums/seniority-levels-enum.ts
export enum SeniorityLevels { JUNIOR, MIDLEVEL, SENIOR, ABOVESENIOR }
javaadpatel/tech-pays-eu-graphs
my-app/src/data/tier-3-companies.ts
export const data = [ { title: 'Principal Developer', guid: 'oakvkx94htkgyhboaamzh', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€206,000', totalCompensationNumber: 206000, totalCompensationDetails: '€132K salary, €34K bonus, ...
javaadpatel/tech-pays-eu-graphs
my-app/src/data/tier-1-companies.ts
export const data = [ { title: '🔒 Senior-level position within project management', guid: '8hkvhy34wc5c8h3vz06im', specialization: '', city: 'Veldhoven', companyName: 'ASML', totalCompensation: '€81,000', totalCompensationNumber: 81000, totalCompensationDetails: '€81K...
javaadpatel/tech-pays-eu-graphs
my-app/src/data-service.ts
import { data as tierOneDataSource } from './data/tier-1-companies'; import { data as tierTwoDataSource } from './data/tier-2-companies'; import { data as tierThreeDataSource } from './data/tier-3-companies'; import { SeniorityLevels } from './enums/seniority-levels-enum'; import { CompanySalaryData } from "./interface...
javaadpatel/tech-pays-eu-graphs
my-app/src/data/tier-2-companies.ts
<reponame>javaadpatel/tech-pays-eu-graphs export const data = [ { title: 'Senior Software Engineer', guid: 'sukt1dp5xj1g5q3ci86lfh', specialization: '', city: 'Amsterdam (remote within country)', companyName: 'MessageBird ', totalCompensation: '€83,000', totalCompensationNum...
javaadpatel/tech-pays-eu-graphs
my-app/src/interfaces/salary-data-point.ts
<filename>my-app/src/interfaces/salary-data-point.ts export interface SalaryDataPoint { title: string, companyName: string, baseSalaryNumber: number, totalCompensationNumber: number }
javaadpatel/tech-pays-eu-graphs
my-app/src/interfaces/company-salary-data.ts
import { SalaryDataPoint } from "./salary-data-point"; export interface CompanySalaryData { tierOneData: SalaryDataPoint[], tierTwoData: SalaryDataPoint[], tierThreeData: SalaryDataPoint[] }
javaadpatel/tech-pays-eu-graphs
my-app/src/App.tsx
<reponame>javaadpatel/tech-pays-eu-graphs import { Container, Divider, Header, Image, Icon, Button } from 'semantic-ui-react'; import './App.css'; import CompensationDataVisualization from './CompensationDataVisualization'; import DataDisclaimerMessage from './DataDisclaimerMessage'; import DataSourceMessage from './Da...
javaadpatel/tech-pays-eu-graphs
my-app/src/Graph.tsx
import percentile from 'percentile'; import { LineChart, Line, CartesianGrid, YAxis, XAxis, Tooltip, Legend, Text, ResponsiveContainer } from 'recharts'; import { CompanySalaryData } from './interfaces/company-salary-data'; interface GraphProps { companySalaryData: CompanySalaryData, useTotalCompensation: bool...
Gekkeiju/dev-test-nodejs
src/api/model/country.ts
module.exports = { name: 'string', code: 'string', population: 'number' }
Gekkeiju/dev-test-nodejs
src/api/route/index.ts
import number2 from '../controller/country' import generic from '../controller/generic' import { Server } from 'restify' export default (server: Server) => { server.get('/src/api/country', number2) server.get('/:route', generic.readAll) server.get('/:route/:id', generic.read) server.post('/:route', ge...
Gekkeiju/dev-test-nodejs
src/api/controller/generic.ts
import Model from '../model/index' import {Request, Response, Next} from 'restify' class GenericController { async create(req: Request, res: Response, next: Next) { const { route, token } = req.params const params = req.body console.log(params) const element = await Model[route].c...
Gekkeiju/dev-test-nodejs
src/api/controller/country.ts
import {Request, Response, Next} from 'restify' import country from '../country' export default (req: Request, res: Response, next: Next) => country() .then(countries => { res.send(countries) next() }) .catch(err => { next(new Error('Something we...
Gekkeiju/dev-test-nodejs
src/api/model/index.ts
import fs from 'fs' import mongoose from 'mongoose' const { Schema } = mongoose export default (() => { //get files with schema values let files = fs.readdirSync(__dirname) //remove self from array files = files.filter(f => f !== 'index.ts') const Models = {} //create models files.map(f =...
Gekkeiju/dev-test-nodejs
src/index.ts
require('dotenv').config() import restify from 'restify' import corsMiddleware from 'restify-cors-middleware' import routes from './api/route/index' import countries from "./configs/country"; import mongoose from 'mongoose' const { PORT, DB, DB_NAME } = process.env const DB_OPTIONS = { dbName: DB_NAM...
nuduja/msclub-backend
src/app.ts
import express, { Express, Request, Response, NextFunction } from 'express'; import dotenv from 'dotenv'; import logger from './util/logger'; import responseHandler from './util/response.handler'; import routes from './api/routes'; import { configuration } from './config'; import connect from './util/database.connectio...
nuduja/msclub-backend
src/api/models/User.model.ts
import mongoose, { Schema } from "mongoose"; import jwt from "jsonwebtoken"; import bcrypt from "bcryptjs"; import { IUser } from "../interfaces"; import validator from 'validator'; const UserSchema = new Schema<IUser>({ firstName: { type: String, required: true }, middleName: { type: String, required: false }, ...
nuduja/msclub-backend
src/api/routes/index.ts
<gh_stars>1-10 import { Express } from "express"; import controller from "../controllers"; import middleware from "../middleware"; import multer from "multer"; const upload = multer(); export default function (app: Express) { // User endpoints app.post("/user/", upload.single('profileImage'), controller.createUser...
nuduja/msclub-backend
src/util/email.handler.ts
<reponame>nuduja/msclub-backend import nodemailer from 'nodemailer'; import handlebars from 'handlebars'; import fs from 'fs'; import logger from './logger'; import { configuration } from '../config'; import path from 'path'; import moment from 'moment'; // HTML Configuration require.extensions['.html'] = (module: any...
nuduja/msclub-backend
src/api/services/User.service.ts
import { DocumentDefinition } from 'mongoose'; import { IUser } from '../interfaces'; import UserModel from '../models/User.model'; import bcrypt from 'bcrypt'; /** * @param {IUser} userData * @returns {Document} User document */ export const insertUser = async (userData: DocumentDefinition<IUser>) => { return aw...
nuduja/msclub-backend
src/api/interfaces/IConfig.ts
<filename>src/api/interfaces/IConfig.ts interface IConfig { ip: string; port: string; environment: string; mongodb: { uri: string; }, auth: { secret: string; }, email: { host: string; port: number; secure: boolean; pool: boolean; secureConnection: boolean; auth: { u...
nuduja/msclub-backend
src/api/controllers/ExecutiveBoard.controller.ts
<reponame>nuduja/msclub-backend<filename>src/api/controllers/ExecutiveBoard.controller.ts import { Express, Request, Response, NextFunction } from "express"; import ExecutiveBoardService from "../services"; import logger from "../../util/logger"; /** * @param request * @param response * @param next * @returns void ...
nuduja/msclub-backend
src/api/interfaces/IUser.ts
<gh_stars>1-10 import { Document, Schema } from 'mongoose'; interface IUser extends Document { firstName: string; middleName?: string; lastName: string; email: string; phoneNumber01: string; phoneNumber02: string; addressLine01: string; addressLine02: string; city: string; province: string; userN...
nuduja/msclub-backend
src/api/controllers/index.ts
<reponame>nuduja/msclub-backend import { createUser } from "./User.controller"; import { createContact, getAllContacts, removeContact } from "./Contact.controller"; import { insertEvent, getEvent, getEvents, getPastEvents, getUpcomingEvent, updateEvent, deleteEvent, } from "./Event.controller";...
nuduja/msclub-backend
src/api/controllers/Application.controller.ts
/** * @todo implement a @function addApplication that calls * @function addApplication in the ApplicationService * * @param {Request} request - Request from the frontend * @param {Response} response - Response that need to send to the client * @param {NextFunction} next - Next function * @returns {IApplication} ...
nuduja/msclub-backend
src/api/controllers/User.controller.ts
import { Express, Request, Response, NextFunction } from 'express'; import UserService from '../services'; import logger from '../../util/logger'; /** * @param {Request} request - Request from the frontend * @param {Response} response - Response that need to send to the client * @param {NextFunction} next - Next fu...
nuduja/msclub-backend
src/util/image.handler.ts
<reponame>nuduja/msclub-backend<gh_stars>1-10 import firebase from "../config/firebase.config"; import imagemin from "imagemin"; import sharp from "sharp"; import { v4 as uuidv4 } from 'uuid'; import logger from "./logger"; /** * @param {Buffer | any} file File to upload to the bucket * @param {string} directory Sto...
nuduja/msclub-backend
src/config/index.ts
<filename>src/config/index.ts import { IConfig } from "../api/interfaces"; const environment = process.env.ENVIRONMENT as string; let configuration: IConfig; if (environment === 'Development') { configuration = { ip: process.env.IP || 'localhost', port: process.env.PORT as string || '8087', environment: ...
nuduja/msclub-backend
src/api/services/Application.service.ts
<filename>src/api/services/Application.service.ts import { DocumentDefinition, FilterQuery } from "mongoose"; import { IApplication } from "../interfaces"; import ApplicationModel from "../models/Application.model"; /** * Application Service * @param {IApplication} application * @returns {Promise<IApplication>} */...
nuduja/msclub-backend
src/api/interfaces/IApplication.ts
<filename>src/api/interfaces/IApplication.ts import { Document } from 'mongoose'; interface IApplication extends Document { studentId : string; name : string; email : string contactNumber : string; currentAcademicYear : number; selfIntroduction : string; reasonForJoin : string; linkedIn...
nuduja/msclub-backend
src/config/firebase.config.ts
<gh_stars>1-10 import firebase from 'firebase-admin'; import { configuration } from './index'; const serviceAccount = require('./service-account-file.json'); firebase.initializeApp({ credential: firebase.credential.cert(serviceAccount), storageBucket: process.env.FIREBASE_STORAGE_BUCKET, projectId: configuratio...
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/schemes/ws.d.ts
<gh_stars>0 import { URISchemeHandler, URIComponents } from "uri-js/dist/esnext/uri"; export interface WSComponents extends URIComponents { resourceName?: string; secure?: boolean; } declare const handler: URISchemeHandler; export default handler;
sidorovpavel/writing-javascript-actions
.github/actions/issue-maker/node_modules/@octokit/types/dist-types/VERSION.d.ts
<reponame>sidorovpavel/writing-javascript-actions export declare const VERSION = "6.17.3";
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/regexps-iri.d.ts
import { URIRegExps } from "uri-js/dist/esnext/uri"; declare const _default: URIRegExps; export default _default;
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/schemes/http.d.ts
import { URISchemeHandler } from "uri-js/dist/esnext/uri"; declare const handler: URISchemeHandler; export default handler;
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/regexps-uri.d.ts
import { URIRegExps } from "uri-js/dist/esnext/uri"; export declare function buildExps(isIRI: boolean): URIRegExps; declare const _default: URIRegExps; export default _default;
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/index.d.ts
export * from "uri-js/dist/esnext/uri";
sidorovpavel/writing-javascript-actions
.github/actions/joke-action/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts
import { URISchemeHandler, URIOptions } from "uri-js/dist/esnext/uri"; import { URNComponents } from "uri-js/dist/esnext/schemes/urn"; export interface UUIDComponents extends URNComponents { uuid?: string; } declare const handler: URISchemeHandler<UUIDComponents, URIOptions, URNComponents>; export default handler;
sidorovpavel/writing-javascript-actions
.github/actions/issue-maker/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts
export declare const VERSION = "5.3.6";
ACM-VIT/uniauth-backend
src/auxiliary/validators/registrationNumber.validator.ts
<reponame>ACM-VIT/uniauth-backend<filename>src/auxiliary/validators/registrationNumber.validator.ts<gh_stars>10-100 import { ValidatorConstraint, ValidatorConstraintInterface } from 'class-validator'; import RegistrationValidator from '@vitspot/vit-registration-number'; /** * Validator for Registration Number as a d...
ACM-VIT/uniauth-backend
src/dashboard/dashboard.controller.ts
<reponame>ACM-VIT/uniauth-backend import { Controller, Get, Logger, Res, UseGuards, Request, Inject } from '@nestjs/common'; import { DashboardService } from './dashboard.service'; import { Response } from 'express'; import { JwtAuthGuard } from 'src/auth/guards/jwt.guard'; import { UserService } from 'src/user/user.se...
ACM-VIT/uniauth-backend
src/account/minions/scopeMapper.minion.ts
export const SCOPE = { name: { display: '<NAME>', id: 'name' }, registrationNumber: { display: 'Registration Number', id: 'registrationNumber' }, github: { display: 'Github Username', id: 'github' }, twitter: { display: '<NAME>', id: 'twitter' }, linkedIn: { display: 'LinkedIn ID', id: 'linkedIn' }, previou...
ACM-VIT/uniauth-backend
src/auxiliary/validators/applicationScope.validator.ts
<gh_stars>10-100 import { ValidatorConstraint, ValidatorConstraintInterface } from 'class-validator'; /** * Validator for Strings containing scope strings */ @ValidatorConstraint({ name: 'ApplicationScopes', async: false }) export class ApplicationScopes implements ValidatorConstraintInterface { validate(scopes: s...
ACM-VIT/uniauth-backend
src/user/user.service.ts
<filename>src/user/user.service.ts import RegistrationNumberWorker from '@vitspot/vit-registration-number'; import { ConflictException, Injectable, Logger, NotFoundException, UnauthorizedException } from '@nestjs/common'; import { CreateUserDto } from './dto/create-user.dto'; import { UpdateUserDto } from './dto/upda...
ACM-VIT/uniauth-backend
src/main.ts
<reponame>ACM-VIT/uniauth-backend import * as config from 'config'; import * as cookieParser from 'cookie-parser'; import * as helmet from 'helmet'; import * as rateLimit from 'express-rate-limit'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { AppModule } from './app.module'; import { Nes...
ACM-VIT/uniauth-backend
src/account/dto/access-user-details.dto.ts
import { ApiProperty } from '@nestjs/swagger'; import { IsNotEmpty } from 'class-validator'; export class AccessUserDetailsDto { @ApiProperty({ name: 'clientId', description: 'client id of application requesting access', example: '<KEY>', required: true, }) @IsNotEmpty() clientId: string; @A...
ACM-VIT/uniauth-backend
src/account/account.module.ts
<gh_stars>0 import { AccountController } from './account.controller'; import { AccountService } from './account.service'; import { ApplicationModule } from 'src/application/application.module'; import { AuthModule } from 'src/auth/auth.module'; import { JwtModule } from '@nestjs/jwt'; import { Module } from '@nestjs/co...
ACM-VIT/uniauth-backend
src/auth/stratergy/jwt.stratergy.ts
import { ExtractJwt, Strategy } from 'passport-jwt'; import { Injectable } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { Request } from 'express'; import { newJWTConstants } from '../constants/auth.constants'; @Injectable() export class JwtStrategy extends PassportStrategy(Strat...
ACM-VIT/uniauth-backend
src/dashboard/dashboard.module.ts
import { ApplicationModule } from 'src/application/application.module'; import { DashboardController } from './dashboard.controller'; import { DashboardService } from './dashboard.service'; import { Module } from '@nestjs/common'; import { UserModule } from 'src/user/user.module'; @Module({ imports: [UserModule, App...
ACM-VIT/uniauth-backend
src/app.controller.ts
import { Controller, Get, Res } from '@nestjs/common'; import { Response } from 'express'; import { ApiTags } from '@nestjs/swagger'; @ApiTags('root') @Controller('') export class AppController { /** to show homepage */ @Get() showIndexPage(@Res() res: Response) { const templateData = { header: 'the ne...
ACM-VIT/uniauth-backend
src/user/dto/create-user.dto.ts
import { IsEmail, IsNotEmpty, MaxLength, MinLength, Validate } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; import { RegistrationNumber } from 'src/auxiliary/validators/registrationNumber.validator'; /** * **Create User DTO** * * [[CreateUserDto]] is responsible for handling input and val...
ACM-VIT/uniauth-backend
src/account/dto/update-account.dto.ts
<gh_stars>10-100 import { PartialType } from '@nestjs/mapped-types'; import { CreateAccountDto } from './create-account.dto'; export class UpdateAccountDto extends PartialType(CreateAccountDto) {}
ACM-VIT/uniauth-backend
src/account/dto/incoming-auth.dto.ts
<filename>src/account/dto/incoming-auth.dto.ts<gh_stars>10-100 import { IsEmail, IsNotEmpty } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; export class IncomingAuthDto { /** client ID */ @ApiProperty({ description: 'client ID of application that has initiated the auth', example:...
ACM-VIT/uniauth-backend
src/auth/stratergy/cookie.stratergy.ts
<filename>src/auth/stratergy/cookie.stratergy.ts import { ExtractJwt, Strategy } from 'passport-jwt'; import { Injectable } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { Request } from 'express'; import { UserService } from 'src/user/user.service'; import { newJWTConstants } from...
ACM-VIT/uniauth-backend
src/config/mongoose.config.ts
import {} from '@nestjs/mongoose'; import * as config from 'config'; /** * initialize database connection based on config file(s) */ export const mongooseConfig = { useNewUrlParser: true, useFindAndModify: false, useCreateIndex: true };
ACM-VIT/uniauth-backend
src/user/interface/user.interface.ts
<filename>src/user/interface/user.interface.ts export interface AuthorizedUser { id?: string; _id?: string; collegeEmail: string; }
ACM-VIT/uniauth-backend
src/auth/auth.controller.ts
<gh_stars>10-100 import { Controller, Post, UsePipes, ValidationPipe, Body, Get, UseGuards } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { AuthService } from './auth.service'; import { LoginDto } from './dto/login.dto'; import { JwtAuthGuard } from './guards/jwt.guard'; @ApiTags('auth') @C...
ACM-VIT/uniauth-backend
src/user/user.schema.ts
<gh_stars>0 // import * as mongoose from 'mongoose'; import * as mongoose from 'mongoose'; import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Application } from 'src/application/application.schema'; import { Document } from 'mongoose'; export type UserDocument = User & Document; @Schema() exp...