This file contains hidden or 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
export const SLACK_CONFIG = 'SLACK_CONFIG'; | |
export interface SlackConfig { | |
serviceName: string; | |
enable?: boolean; | |
domain: string; | |
tag: string; | |
channel: string; | |
accessToken: string; | |
} |
This file contains hidden or 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
map $sent_http_content_type $expires { | |
"text/html" epoch; | |
"text/html; charset=utf-8" epoch; | |
default off; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} |
This file contains hidden or 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
map $sent_http_content_type $expires { | |
"text/html" epoch; | |
"text/html; charset=utf-8" epoch; | |
default off; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} |
This file contains hidden or 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 { ConsoleLogger } from '@nestjs/common'; | |
export class CoreLogger extends ConsoleLogger { | |
public static excludeContexts: string[] = []; | |
public static addExcludeContexts(excludeContext: string) { | |
CoreLogger.excludeContexts.push(excludeContext); | |
} | |
/** | |
* Write a 'log' level log. | |
*/ |
This file contains hidden or 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 { CallHandler, ClassSerializerInterceptor, ExecutionContext, Injectable, Logger, Module, PlainLiteralObject, SetMetadata, Type } from '@nestjs/common'; | |
import { APP_INTERCEPTOR, Reflector } from '@nestjs/core'; | |
import { ClassTransformOptions, plainToClass } from 'class-transformer'; | |
import { Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; | |
export const GQL_RETURN_TYPE = 'GQL_RETURN_TYPE'; | |
export const GqlReturn = (type: Type<any>) => SetMetadata('GQL_RETURN_TYPE', type); |
This file contains hidden or 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 { Module } from '@nestjs/common'; | |
import { CustomInjectorService } from './CustomInjectorService'; | |
@Module({ | |
providers: [CustomInjectorService], | |
exports: [CustomInjectorService], | |
}) | |
export class CustomInjectorModule {} |
This file contains hidden or 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 { Inject, Injectable } from '@nestjs/common'; | |
import { from, Observable } from 'rxjs'; | |
/** | |
* Костыль который превращает функции сервиса с калбак аргументом в обзервабл, | |
* для поддержки типизации в тестах | |
* | |
* @param service сервис созданный через загрузку прото файла (GRPC.loadPackageDefinition) | |
*/ | |
// tslint:disable-next-line: typedef |
This file contains hidden or 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 { ExecutionContext, Injectable, Logger } from '@nestjs/common'; | |
import { Reflector } from '@nestjs/core'; | |
import { AuthGuard } from '@nestjs/passport'; | |
import { User } from '../entities/user.entity'; | |
import { GqlExecutionContext } from '@nestjs/graphql'; | |
import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context.host'; | |
@Injectable() | |
export class AccessGuard extends AuthGuard('jwt') { | |
constructor(private readonly reflector: Reflector) { |
This file contains hidden or 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
{ | |
"/api/(.*)": "https://core-nestjs.rucken.io/api/" | |
} |