-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from vh13294/dev
Support NestJs 8
- Loading branch information
Showing
13 changed files
with
15,691 additions
and
5,735 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,67 @@ | ||
import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface'; | ||
import { Request } from 'express'; | ||
import { Controller } from '@nestjs/common/interfaces'; | ||
|
||
export interface ControllerClass extends Controller { | ||
name: string; | ||
} | ||
|
||
export type ControllerMethod = (...args: any[]) => Promise<any> | any; | ||
|
||
export interface Query { | ||
[key: string]: any; | ||
} | ||
export interface Params { | ||
[key: string]: string; | ||
} | ||
|
||
export interface ReservedQuery { | ||
signed?: string; | ||
expirationDate?: string; | ||
} | ||
|
||
type SignedQuery = Query & ReservedQuery; | ||
|
||
type Not<T> = { | ||
[Key in keyof T]?: never; | ||
}; | ||
|
||
type NotReservedQuery = Query & Not<ReservedQuery>; | ||
|
||
export interface RequestWithSignature extends Request { | ||
query: SignedQuery; | ||
} | ||
|
||
export interface GenerateUrlFromControllerArgs { | ||
controller: Controller; | ||
controller: ControllerClass; | ||
controllerMethod: ControllerMethod; | ||
query?: any; | ||
params?: any; | ||
query?: Query; | ||
params?: Params; | ||
} | ||
|
||
export interface GenerateUrlFromPathArgs { | ||
relativePath: string; | ||
query?: any; | ||
params?: any; | ||
query?: Query; | ||
params?: Params; | ||
} | ||
|
||
export interface SignedControllerUrlArgs { | ||
controller: Controller; | ||
export interface SignControllerUrlArgs { | ||
controller: ControllerClass; | ||
controllerMethod: ControllerMethod; | ||
expirationDate?: Date; | ||
query?: any; | ||
params?: any; | ||
query?: NotReservedQuery; | ||
params?: Params; | ||
} | ||
|
||
export interface SignedUrlArgs { | ||
export interface SignUrlArgs { | ||
relativePath: string; | ||
expirationDate?: Date; | ||
query?: any; | ||
params?: any; | ||
query?: NotReservedQuery; | ||
params?: Params; | ||
} | ||
|
||
export interface IsSignatureValidArgs { | ||
protocol: string; | ||
host: string; | ||
routePath: string; | ||
query?: any; | ||
query: SignedQuery; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export const URL_GENERATOR_MODULE_OPTIONS = 'UrlGeneratorModuleOptions'; | ||
|
||
export const RESERVED_QUERY_PARAM_NAMES = ['expirationDate', 'signed']; |
Oops, something went wrong.