This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Args, Broadcast, Input, Nsp, Socket, SocketService, SocketSession} from "ts-express-decorators/socketio"; | |
import {$log} from "ts-log-debug"; | |
import {PlayerSG} from "../models/PlayerSG"; | |
@SocketService("/square-game") | |
export class SquareGameService { | |
private AUTO_INCREMENT = 0; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Chai from "chai"; | |
import * as ChaiAsPromised from "chai-as-promised"; | |
import * as SinonLib from "sinon"; | |
import {SinonStub} from "sinon"; | |
import * as SinonChai from "sinon-chai"; | |
import {$log} from "ts-log-debug"; // your logger | |
Chai.should(); | |
Chai.use(SinonChai); | |
Chai.use(ChaiAsPromised); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HOST = '' | |
export async function getCars() { | |
// should be axios | |
// const { data } = await axios.get(`${HOST}/cars`) | |
// return data | |
// | |
// Right now we don't have server so we create mocked data | |
return [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import PropTypes from 'prop-types' | |
import cloneDeep from 'lodash/cloneDeep' | |
import AllComponents from 'formiojs/components' | |
import Components from 'formiojs/components/Components' | |
import FormioFormBuilder from 'formiojs/FormBuilder' | |
Components.setComponents(AllComponents) | |
const EVENTS = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Service} from "@tsed/common" | |
// add all imports | |
export interface AtlassianRequestOptions { | |
headers: { | |
[key: string]: string; | |
}, | |
[key: string]: any | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Type, nameOf} from "@tsed/core"; | |
const {paramCase} = require("change-case"); | |
export interface ICrudControllerOptions { | |
path?: string; | |
model: Type<any> | |
} | |
export function CrudController(options: ICrudControllerOptions) { | |
return (target: Type<any>) =>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {GlobalProviders, Provider, TypedProvidersRegistry} from "@tsed/di"; | |
export const PROVIDER_TYPE_BOT_COMPONENTS = "botComponents"; | |
export const botComponentsRegistry: TypedProvidersRegistry = GlobalProviders.createRegistry(PROVIDER_TYPE_BOT_COMPONENTS, Provider, { | |
injectable: true | |
}); | |
export const registerBotComponent = GlobalProviders.createRegisterFn(PROVIDER_TYPE_BOT_COMPONENTS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
CollectionOf, | |
Default, | |
Description, | |
Integer, | |
MaxItems, | |
Min, | |
MinLength, | |
Property, | |
Required, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, OnInit, OnDestroy } from "@tsed/common"; | |
import { PrismaClient } from "@prisma/client"; | |
@Injectable() | |
export class PrismaService extends PrismaClient implements OnInit, OnDestroy { | |
async $onInit() { | |
await this.$connect(); | |
} | |
async $onDestroy() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {BodyParams, Controller, Get, PathParams, Post} from "@tsed/common"; | |
import {Inject} from "@tsed/di"; | |
import {PrismaService} from "../services/PrismaService"; | |
import {Groups, Required, Email, Returns, Summary} from "@tsed/schema"; | |
import {User} from "@prisma/client"; | |
class UserModel implements User { | |
@Required() | |
@Groups("!creation") | |
id: number; |
OlderNewer