@doflo/flow-interfaces
Advanced tools
Comparing version 1.16.2 to 1.16.3
@@ -0,5 +1,8 @@ | ||
import { IResponse } from '../..'; | ||
import { ExecutionWrapper } from '../../executionWrapper'; | ||
export interface actionAPI { | ||
execute: <O = any, I = void>(job: ExecutionWrapper<I>) => Promise<O>; | ||
run: <O = any>(namespace: string, actionName: string, credential?: any) => Promise<O>; | ||
execute<O = IResponse, I = any>(job: ExecutionWrapper<I>): Promise<O>; | ||
run<O = IResponse>(namespace: string, actionName: string): Promise<O>; | ||
run<O = IResponse>(namespace: string, actionName: string, credential: any): Promise<O>; | ||
run<O = IResponse>(namespace: string, actionName: string, credential?: any): Promise<O>; | ||
} |
@@ -45,16 +45,4 @@ /// <reference types="node" /> | ||
} | ||
export interface IRPCContext { | ||
export interface IStash { | ||
/** | ||
*  | ||
* | ||
* **env** holds environmental data as well as the secrets specified for the name space | ||
*/ | ||
env: EnvironmentData; | ||
/** | ||
*  | ||
* | ||
* **node-fetch** http client for making requests use it if you need it | ||
*/ | ||
fetch: (url: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
/** | ||
*  | ||
@@ -65,3 +53,18 @@ * | ||
*/ | ||
stash: (data: any) => string; | ||
stash(data: any): Promise<{ | ||
key: string; | ||
stashedDate: Date; | ||
}>; | ||
stash(data: any, type: 'JSON' | 'BASE64' | 'STRING'): Promise<{ | ||
key: string; | ||
stashedDate: Date; | ||
}>; | ||
stash(data: any, ttl: number): Promise<{ | ||
key: string; | ||
stashedDate: Date; | ||
}>; | ||
stash(data: any, ttl: number, type: 'JSON' | 'BASE64' | 'STRING'): Promise<{ | ||
key: string; | ||
stashedDate: Date; | ||
}>; | ||
/** | ||
@@ -73,4 +76,16 @@ *  | ||
*/ | ||
pickup: <T>(ticket: string, preserve: boolean) => T; | ||
pickup<T>(ticket: string): Promise<{ | ||
stashedDate: Date; | ||
data: T; | ||
expired: boolean; | ||
}>; | ||
/** | ||
* | ||
*/ | ||
pickup<T>(ticket: string, preserve: boolean): Promise<{ | ||
stashedDate: Date; | ||
data: T; | ||
expired: boolean; | ||
}>; | ||
/** | ||
*  | ||
@@ -81,4 +96,22 @@ * | ||
*/ | ||
expire: (ticket: string) => void; | ||
expire(ticket: string): Promise<boolean>; | ||
} | ||
export interface IFetch { | ||
/** | ||
*  | ||
* | ||
* **node-fetch** http client for making requests use it if you need it | ||
*/ | ||
fetch: (url: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
} | ||
export interface IRPCContext extends IFetch, IStash, IContext { | ||
} | ||
export interface IContext { | ||
/** | ||
*  | ||
* | ||
* **env** holds environmental data as well as the secrets specified for the name space | ||
*/ | ||
env: EnvironmentData; | ||
/** | ||
*  | ||
@@ -93,4 +126,27 @@ * | ||
} | ||
export interface IResponse { | ||
export declare type IResponse<T = any> = IVoidResponse | IValueResponse<T> | ICredentialCreationResponse; | ||
export interface ICredentialCreationResponse extends IValueResponse { | ||
data: { | ||
credentialName: string; | ||
id: string; | ||
}; | ||
} | ||
export interface IVoidResponse { | ||
deferred?: boolean; | ||
/** | ||
*  | ||
* | ||
* **httpData** refers to the data that utilized in the workflow | ||
* this data object is almost immediately striped from the | ||
* response and wrapped into a new object that is passed | ||
* into the workflow | ||
*/ | ||
httpData?: any; | ||
httpOptions?: { | ||
doNotRespond?: boolean; | ||
status?: HTTPStatus; | ||
}; | ||
} | ||
export interface IValueResponse<T = undefined | any> { | ||
/** | ||
*  | ||
@@ -103,3 +159,3 @@ * | ||
*/ | ||
data?: any; | ||
data: T; | ||
deferred?: boolean; | ||
@@ -106,0 +162,0 @@ /** |
{ | ||
"name": "@doflo/flow-interfaces", | ||
"version": "1.16.2", | ||
"version": "1.16.3", | ||
"description": "Public Interfaces, Schemas, & GRPC Signatures for doFlo developers", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
290687
4688