Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
2fd8219849 | |||
ea56e2218f |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@apiglobal/typedrequest",
|
||||
"version": "1.0.58",
|
||||
"version": "1.0.59",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@apiglobal/typedrequest",
|
||||
"version": "1.0.58",
|
||||
"version": "1.0.59",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedrequest",
|
||||
"version": "1.0.58",
|
||||
"version": "1.0.59",
|
||||
"private": false,
|
||||
"description": "make typed requests towards apis",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -21,7 +21,7 @@ export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest
|
||||
public method: string;
|
||||
|
||||
/**
|
||||
* note the overloading is thought to deak with promises
|
||||
* note the overloading is thought to deal with promises
|
||||
* @param postEndPointArg
|
||||
* @param methodArg
|
||||
*/
|
||||
|
@ -91,7 +91,7 @@ export class TypedRouter {
|
||||
* if typedrequest object has correlation.phase === 'response' -> routes a typed request object to request fire event
|
||||
* @param typedRequestArg
|
||||
*/
|
||||
public async routeAndAddResponse(typedRequestArg: plugins.typedRequestInterfaces.ITypedRequest) {
|
||||
public async routeAndAddResponse<T extends plugins.typedRequestInterfaces.ITypedRequest = any>(typedRequestArg: T) {
|
||||
if (!typedRequestArg?.correlation?.phase || typedRequestArg.correlation.phase === 'request') {
|
||||
const typedHandler = this.getTypedHandlerForMethod(typedRequestArg.method);
|
||||
|
||||
|
@ -6,6 +6,7 @@ export type IPostMethod = (
|
||||
) => Promise<plugins.typedRequestInterfaces.ITypedRequest>;
|
||||
|
||||
/**
|
||||
* this is an alternative to a post url supplied in `new Typedrequest(new TypedTarget(...), 'someMethodName')`
|
||||
* enables the use of custom post functions
|
||||
* used for things like broadcast channels
|
||||
* e.g. @designestate/dees-comms
|
||||
|
Reference in New Issue
Block a user