Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
708c5d8a5b | |||
d63621fe82 | |||
8e1459bc86 | |||
4161c8f8b0 | |||
38df866c05 | |||
d3fc1d3256 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedrequest-interfaces",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.16",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedrequest-interfaces",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.16",
|
||||
"private": false,
|
||||
"description": "interfaces for making typed requests",
|
||||
"main": "dist/index.js",
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedrequest-interfaces',
|
||||
version: '1.0.16',
|
||||
description: 'interfaces for making typed requests'
|
||||
}
|
49
ts/index.ts
49
ts/index.ts
@ -1,12 +1,54 @@
|
||||
export interface ITypedRequest {
|
||||
/**
|
||||
* the method that the request response data is meant for
|
||||
*/
|
||||
method: string;
|
||||
|
||||
/**
|
||||
* any needed auth data
|
||||
*/
|
||||
authInfo?: {
|
||||
jwt: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* server data that is added for dealing with the request server side. Will be omitted when sending the response
|
||||
*/
|
||||
serverData?: {
|
||||
jwtData: any;
|
||||
jwtValid: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* the request data
|
||||
*/
|
||||
request: object;
|
||||
|
||||
/**
|
||||
* the response data
|
||||
*/
|
||||
response: object;
|
||||
|
||||
/**
|
||||
* any error information that might be encountered while dealing with a request
|
||||
*/
|
||||
error?: { text: string; data: any };
|
||||
|
||||
/**
|
||||
* retry information for smartly advising the client to retry at a later point in time
|
||||
*/
|
||||
retry?: {
|
||||
waitForMs: number;
|
||||
reason: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* a correlation id that
|
||||
*/
|
||||
correlation?: {
|
||||
id: string;
|
||||
phase: 'request' | 'response'
|
||||
};
|
||||
}
|
||||
|
||||
export type implementsTR<T, U extends T> = {};
|
||||
@ -16,3 +58,10 @@ export interface ITypedEvent<T> {
|
||||
uniqueEventId: string;
|
||||
payload: T;
|
||||
}
|
||||
|
||||
export interface ITag {
|
||||
name: string;
|
||||
payload: any;
|
||||
}
|
||||
|
||||
export type implementsTag<T, U extends T> = {};
|
||||
|
Reference in New Issue
Block a user