@powerhousedao/switchboard 6.2.3-dev.30 → 6.2.3-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tsbuild/test/workflow/harness.d.ts +12 -1
- package/.tsbuild/test/workflow/harness.d.ts.map +1 -1
- package/.tsbuild/test/workflow/oauth.test.d.ts +2 -0
- package/.tsbuild/test/workflow/oauth.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +27 -0
- package/dist/index.mjs +1 -1
- package/dist/{server-Cf0DB8sW.mjs → server-CKKn0aXV.mjs} +429 -45
- package/dist/server-CKKn0aXV.mjs.map +1 -0
- package/dist/server.d.mts +2 -0
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +3 -3
- package/package.json +15 -15
- package/test/workflow/harness.ts +61 -9
- package/test/workflow/oauth.test.ts +214 -0
- package/test/workflow/resolvers.test.ts +194 -3
- package/test/workflow/webhook-dedupe.test.ts +3 -3
- package/test/workflow/webhook-signed.test.ts +2 -2
- package/test/workflow/webhook-trigger-test.test.ts +82 -0
- package/test/workflow/webhook-unsigned.test.ts +19 -6
- package/test/workflow-runtime.test.ts +14 -0
- package/dist/server-Cf0DB8sW.mjs.map +0 -1
|
@@ -10,6 +10,12 @@ export interface FiredRun {
|
|
|
10
10
|
payload: unknown;
|
|
11
11
|
kind: string;
|
|
12
12
|
}
|
|
13
|
+
export interface TriggerFields {
|
|
14
|
+
pieceName: string;
|
|
15
|
+
pieceVersion: string;
|
|
16
|
+
triggerName: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const WEBHOOK_TRIGGER: TriggerFields;
|
|
13
19
|
export interface WebhookHost {
|
|
14
20
|
/** Origin the endpoint is served from, e.g. `http://127.0.0.1:53124`. */
|
|
15
21
|
readonly url: string;
|
|
@@ -18,7 +24,7 @@ export interface WebhookHost {
|
|
|
18
24
|
readonly service: WorkflowRuntimeService;
|
|
19
25
|
/** Publishes an ENABLED workflow with `config`; returns its endpoint. */
|
|
20
26
|
arm(config: Record<string, unknown>, options?: {
|
|
21
|
-
|
|
27
|
+
trigger?: TriggerFields;
|
|
22
28
|
workflowId?: string;
|
|
23
29
|
}): Promise<{
|
|
24
30
|
token: string;
|
|
@@ -26,6 +32,10 @@ export interface WebhookHost {
|
|
|
26
32
|
}>;
|
|
27
33
|
/** Publishes the same workflow as DISABLED, keeping its endpoint row. */
|
|
28
34
|
disarm(workflowId?: string): Promise<void>;
|
|
35
|
+
/** Deletes the workflow document, as the reactor reports it. */
|
|
36
|
+
remove(workflowId?: string): Promise<void>;
|
|
37
|
+
/** Whether the reactor's webhook store still holds this token. */
|
|
38
|
+
hasToken(token: string): Promise<boolean>;
|
|
29
39
|
/** The policy the service hands the reactor for one endpoint. */
|
|
30
40
|
policyFor(workflowId?: string): Promise<unknown>;
|
|
31
41
|
deliver(token: string, init?: {
|
|
@@ -40,6 +50,7 @@ export declare const DEFAULT_WORKFLOW = "wf-integration";
|
|
|
40
50
|
export declare function workflowOperation(state: Record<string, unknown>, workflowId?: string): OperationWithContext;
|
|
41
51
|
export declare function startWebhookHost(options?: {
|
|
42
52
|
fire?: (run: FiredRun) => unknown;
|
|
53
|
+
reactorClient?: unknown;
|
|
43
54
|
}): Promise<WebhookHost>;
|
|
44
55
|
export declare function waitForRuns(host: WebhookHost, count: number, timeoutMs?: number): Promise<FiredRun[]>;
|
|
45
56
|
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../test/workflow/harness.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAKzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAA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-0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-trigger-test.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/webhook-trigger-test.test.ts"],"names":[],"mappings":""}
|