actionsflow-interface
Advanced tools
Comparing version 0.0.8 to 0.0.10
@@ -6,2 +6,20 @@ # Change Log | ||
## [0.0.10](https://github.com/actionsflow/actionsflow/compare/actionsflow-interface@0.0.9...actionsflow-interface@0.0.10) (2020-09-05) | ||
### Features | ||
- change package ([f81623f](https://github.com/actionsflow/actionsflow/commit/f81623f282c215f2b1a8064507d2beeddb4a927d)) | ||
## [0.0.9](https://github.com/actionsflow/actionsflow/compare/actionsflow-interface@0.0.8...actionsflow-interface@0.0.9) (2020-09-05) | ||
### Bug Fixes | ||
- event request ([71607e8](https://github.com/actionsflow/actionsflow/commit/71607e8b1ee7b8ef67fca4ce986490963cb3aefd)) | ||
### Features | ||
- suppor webhook getItemKey ([fd99cf0](https://github.com/actionsflow/actionsflow/commit/fd99cf030a711e1a436a568089ea57c594fff6b9)) | ||
- support no promise run ([0aef166](https://github.com/actionsflow/actionsflow/commit/0aef166e1c939414218bb514b3751c5c81c56a5c)) | ||
- telegram to sperate ([f45aa43](https://github.com/actionsflow/actionsflow/commit/f45aa4379f71ff320ccb6a785b28e206aaa51ac2)) | ||
## [0.0.8](https://github.com/actionsflow/actionsflow/compare/actionsflow-interface@0.0.7...actionsflow-interface@0.0.8) (2020-08-31) | ||
@@ -8,0 +26,0 @@ |
@@ -0,1 +1,6 @@ | ||
/// <reference types="node" /> | ||
import { URLSearchParams, URL } from "url"; | ||
import { ParsedUrlQuery } from "querystring"; | ||
import { Logger } from "loglevel"; | ||
export declare type HTTP_METHODS_LOWERCASE = "head" | "get" | "post" | "put" | "patch" | "delete" | "options"; | ||
export declare type AnyObject = Record<string, unknown>; | ||
@@ -14,2 +19,3 @@ export interface IGithub { | ||
}; | ||
log: Logger; | ||
} | ||
@@ -25,10 +31,38 @@ export interface ITriggerContext extends AnyObject { | ||
} | ||
export interface ITriggerRunFunctionResult { | ||
export interface ITriggerResult { | ||
items: AnyObject[]; | ||
} | ||
export interface IWebhookRequestRawPayload { | ||
method?: HTTP_METHODS_LOWERCASE; | ||
headers?: Record<string, string>; | ||
path?: string; | ||
body?: string | AnyObject | undefined; | ||
} | ||
export interface IWebhookRequestPayload { | ||
method: HTTP_METHODS_LOWERCASE; | ||
headers: Record<string, string>; | ||
originPath: string; | ||
path: string; | ||
query: ParsedUrlQuery; | ||
querystring: string; | ||
search: string; | ||
body?: string | AnyObject | undefined; | ||
searchParams: URLSearchParams; | ||
URL: URL; | ||
} | ||
export interface IWebhookRequest extends IWebhookRequestPayload { | ||
params: AnyObject; | ||
} | ||
export declare type IWebhookHandler = (request: IWebhookRequest) => Promise<ITriggerResult> | ITriggerResult; | ||
export interface IWebhook { | ||
path?: string; | ||
method?: string; | ||
getItemKey?: (item: AnyObject) => string; | ||
handler: IWebhookHandler; | ||
} | ||
export interface ITriggerClassType { | ||
every?: number; | ||
shouldDeduplicate?: boolean; | ||
getItemKey?: (item: AnyObject) => string; | ||
run(): Promise<ITriggerRunFunctionResult>; | ||
run?(): Promise<ITriggerResult> | ITriggerResult; | ||
webhooks?: IWebhook[]; | ||
} | ||
@@ -41,6 +75,14 @@ export interface ITriggerClassTypeConstructable { | ||
options: AnyObject; | ||
payload?: AnyObject; | ||
} | ||
export interface ITriggerResult { | ||
export declare type OutcomeStatus = "success" | "failure" | "skipped"; | ||
export declare type ConclusionStatus = "success" | "failure" | "skipped"; | ||
export interface ITriggerBuildResult { | ||
outputs?: AnyObject; | ||
outcome: OutcomeStatus; | ||
conclusion: ConclusionStatus; | ||
} | ||
export interface ITriggerInternalResult { | ||
items: AnyObject[]; | ||
outcome: OutcomeStatus; | ||
conclusion: ConclusionStatus; | ||
helpers?: IHelpers; | ||
@@ -51,4 +93,15 @@ } | ||
relativePath: string; | ||
filename: string; | ||
data: AnyObject; | ||
rawTriggers: ITrigger[]; | ||
} | ||
export declare type TriggerEventType = "manual" | "schedule" | "webhook"; | ||
export interface ITriggerEvent { | ||
type: TriggerEventType; | ||
request?: IWebhookRequestPayload; | ||
} | ||
export interface ITask { | ||
workflow: IWorkflow; | ||
trigger: ITrigger; | ||
event: ITriggerEvent; | ||
} |
{ | ||
"version": "0.0.8", | ||
"version": "0.0.10", | ||
"license": "MIT", | ||
@@ -22,3 +22,6 @@ "main": "dist/src/index.js", | ||
"author": "Owen Young", | ||
"gitHead": "664296f1056c8fdf4e442bacc3b1451942f2586a" | ||
"gitHead": "8830c9ddaca6c81a4205b567b04f2d009a1e681c", | ||
"dependencies": { | ||
"loglevel": "^1.7.0" | ||
} | ||
} |
@@ -0,1 +1,14 @@ | ||
import { URLSearchParams, URL } from "url"; | ||
import { ParsedUrlQuery } from "querystring"; | ||
import { Logger } from "loglevel"; | ||
export type HTTP_METHODS_LOWERCASE = | ||
| "head" | ||
| "get" | ||
| "post" | ||
| "put" | ||
| "patch" | ||
| "delete" | ||
| "options"; | ||
export type AnyObject = Record<string, unknown>; | ||
@@ -14,2 +27,3 @@ export interface IGithub { | ||
}; | ||
log: Logger; | ||
} | ||
@@ -27,11 +41,40 @@ export interface ITriggerContext extends AnyObject { | ||
export interface ITriggerRunFunctionResult { | ||
export interface ITriggerResult { | ||
items: AnyObject[]; | ||
} | ||
export interface IWebhookRequestRawPayload { | ||
method?: HTTP_METHODS_LOWERCASE; | ||
headers?: Record<string, string>; | ||
path?: string; | ||
body?: string | AnyObject | undefined; | ||
} | ||
export interface IWebhookRequestPayload { | ||
method: HTTP_METHODS_LOWERCASE; | ||
headers: Record<string, string>; | ||
originPath: string; | ||
path: string; | ||
query: ParsedUrlQuery; | ||
querystring: string; | ||
search: string; | ||
body?: string | AnyObject | undefined; | ||
searchParams: URLSearchParams; | ||
URL: URL; | ||
} | ||
export interface IWebhookRequest extends IWebhookRequestPayload { | ||
params: AnyObject; | ||
} | ||
export type IWebhookHandler = ( | ||
request: IWebhookRequest | ||
) => Promise<ITriggerResult> | ITriggerResult; | ||
export interface IWebhook { | ||
path?: string; | ||
method?: string; | ||
getItemKey?: (item: AnyObject) => string; | ||
handler: IWebhookHandler; | ||
} | ||
export interface ITriggerClassType { | ||
every?: number; | ||
shouldDeduplicate?: boolean; | ||
getItemKey?: (item: AnyObject) => string; | ||
run(): Promise<ITriggerRunFunctionResult>; | ||
run?(): Promise<ITriggerResult> | ITriggerResult; | ||
webhooks?: IWebhook[]; | ||
} | ||
@@ -44,6 +87,14 @@ export interface ITriggerClassTypeConstructable { | ||
options: AnyObject; | ||
payload?: AnyObject; | ||
} | ||
export interface ITriggerResult { | ||
export type OutcomeStatus = "success" | "failure" | "skipped"; | ||
export type ConclusionStatus = "success" | "failure" | "skipped"; | ||
export interface ITriggerBuildResult { | ||
outputs?: AnyObject; | ||
outcome: OutcomeStatus; | ||
conclusion: ConclusionStatus; | ||
} | ||
export interface ITriggerInternalResult { | ||
items: AnyObject[]; | ||
outcome: OutcomeStatus; | ||
conclusion: ConclusionStatus; | ||
helpers?: IHelpers; | ||
@@ -54,4 +105,17 @@ } | ||
relativePath: string; | ||
filename: string; | ||
data: AnyObject; | ||
rawTriggers: ITrigger[]; | ||
} | ||
export type TriggerEventType = "manual" | "schedule" | "webhook"; | ||
export interface ITriggerEvent { | ||
type: TriggerEventType; | ||
request?: IWebhookRequestPayload; | ||
} | ||
export interface ITask { | ||
workflow: IWorkflow; | ||
trigger: ITrigger; | ||
event: ITriggerEvent; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10694
216
1
+ Addedloglevel@^1.7.0
+ Addedloglevel@1.9.2(transitive)