@acmekit/core-flows 2.13.33 → 2.13.35

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.
@@ -8,6 +8,7 @@ export * from "./steps/update-remote-links";
8
8
  export * from "./steps/use-query-graph";
9
9
  export * from "./steps/use-remote-query";
10
10
  export * from "./steps/validate-presence-of";
11
+ export * from "./steps/wait-for-approval";
11
12
  export * from "./workflows/batch-links";
12
13
  export * from "./workflows/create-links";
13
14
  export * from "./workflows/dismiss-links";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA"}
@@ -24,6 +24,7 @@ __exportStar(require("./steps/update-remote-links"), exports);
24
24
  __exportStar(require("./steps/use-query-graph"), exports);
25
25
  __exportStar(require("./steps/use-remote-query"), exports);
26
26
  __exportStar(require("./steps/validate-presence-of"), exports);
27
+ __exportStar(require("./steps/wait-for-approval"), exports);
27
28
  __exportStar(require("./workflows/batch-links"), exports);
28
29
  __exportStar(require("./workflows/create-links"), exports);
29
30
  __exportStar(require("./workflows/dismiss-links"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,8DAA2C;AAC3C,+DAA4C;AAC5C,0DAAuC;AACvC,qDAAkC;AAClC,8DAA2C;AAC3C,8DAA2C;AAC3C,0DAAuC;AACvC,2DAAwC;AACxC,+DAA4C;AAC5C,0DAAuC;AACvC,2DAAwC;AACxC,4DAAyC;AACzC,2DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,8DAA2C;AAC3C,+DAA4C;AAC5C,0DAAuC;AACvC,qDAAkC;AAClC,8DAA2C;AAC3C,8DAA2C;AAC3C,0DAAuC;AACvC,2DAAwC;AACxC,+DAA4C;AAC5C,4DAAyC;AACzC,0DAAuC;AACvC,2DAAwC;AACxC,4DAAyC;AACzC,2DAAwC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Configuration for the wait-for-approval step.
3
+ */
4
+ type WaitForApprovalInput = {
5
+ /**
6
+ * A human-readable description of what approval is being requested.
7
+ * Surfaced in dashboards and audit logs.
8
+ */
9
+ description?: string;
10
+ /**
11
+ * Timeout in seconds. If no approval/rejection is received
12
+ * within this window the step will fail permanently.
13
+ */
14
+ timeout?: number;
15
+ };
16
+ export declare const waitForApprovalStepId = "wait-for-approval";
17
+ /**
18
+ * An async step that pauses the workflow until an external actor
19
+ * calls `registerStepSuccess` (approve) or `registerStepFailure` (reject)
20
+ * via the workflow engine API.
21
+ *
22
+ * This leverages the existing `async: true` mechanism so the step
23
+ * goes into WAITING status and the transaction is checkpointed.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { createWorkflow, WorkflowResponse } from "@acmekit/framework/workflows-sdk"
28
+ * import { waitForApprovalStep } from "@acmekit/core-flows"
29
+ *
30
+ * const approvalWorkflow = createWorkflow("approval-workflow", () => {
31
+ * // ... earlier steps ...
32
+ * const approval = waitForApprovalStep({
33
+ * description: "Manager must approve the refund",
34
+ * timeout: 86400, // 24 hours
35
+ * })
36
+ * // ... later steps only run after approval ...
37
+ * return new WorkflowResponse(approval)
38
+ * })
39
+ * ```
40
+ */
41
+ export declare const waitForApprovalStep: import("@acmekit/framework/workflows-sdk").StepFunction<WaitForApprovalInput, {
42
+ approved: boolean;
43
+ description: string | undefined;
44
+ }>;
45
+ export {};
46
+ //# sourceMappingURL=wait-for-approval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-approval.d.ts","sourceRoot":"","sources":["../../../src/common/steps/wait-for-approval.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,KAAK,oBAAoB,GAAG;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,qBAAqB,sBAAsB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB;;;EAgB/B,CAAA"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.waitForApprovalStep = exports.waitForApprovalStepId = void 0;
4
+ const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
5
+ exports.waitForApprovalStepId = "wait-for-approval";
6
+ /**
7
+ * An async step that pauses the workflow until an external actor
8
+ * calls `registerStepSuccess` (approve) or `registerStepFailure` (reject)
9
+ * via the workflow engine API.
10
+ *
11
+ * This leverages the existing `async: true` mechanism so the step
12
+ * goes into WAITING status and the transaction is checkpointed.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import { createWorkflow, WorkflowResponse } from "@acmekit/framework/workflows-sdk"
17
+ * import { waitForApprovalStep } from "@acmekit/core-flows"
18
+ *
19
+ * const approvalWorkflow = createWorkflow("approval-workflow", () => {
20
+ * // ... earlier steps ...
21
+ * const approval = waitForApprovalStep({
22
+ * description: "Manager must approve the refund",
23
+ * timeout: 86400, // 24 hours
24
+ * })
25
+ * // ... later steps only run after approval ...
26
+ * return new WorkflowResponse(approval)
27
+ * })
28
+ * ```
29
+ */
30
+ exports.waitForApprovalStep = (0, workflows_sdk_1.createStep)({
31
+ name: exports.waitForApprovalStepId,
32
+ async: true,
33
+ timeout: 86400, // default: 24 hours
34
+ }, async (input) => {
35
+ // The step handler returns immediately. Because `async: true`,
36
+ // the orchestrator puts this step into WAITING status.
37
+ // An external call to registerStepSuccess/registerStepFailure
38
+ // will resume the workflow.
39
+ return new workflows_sdk_1.StepResponse({
40
+ approved: true,
41
+ description: input?.description,
42
+ });
43
+ });
44
+ //# sourceMappingURL=wait-for-approval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-approval.js","sourceRoot":"","sources":["../../../src/common/steps/wait-for-approval.ts"],"names":[],"mappings":";;;AAAA,oEAGyC;AAkB5B,QAAA,qBAAqB,GAAG,mBAAmB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,mBAAmB,GAAG,IAAA,0BAAU,EAC3C;IACE,IAAI,EAAE,6BAAqB;IAC3B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK,EAAE,oBAAoB;CACrC,EACD,KAAK,EAAE,KAA2B,EAAE,EAAE;IACpC,+DAA+D;IAC/D,uDAAuD;IACvD,8DAA8D;IAC9D,4BAA4B;IAC5B,OAAO,IAAI,4BAAY,CAAC;QACtB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,KAAK,EAAE,WAAW;KAChC,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/api-key/index.ts","../src/api-key/steps/create-api-keys.ts","../src/api-key/steps/delete-api-keys.ts","../src/api-key/steps/index.ts","../src/api-key/steps/revoke-api-keys.ts","../src/api-key/steps/update-api-keys.ts","../src/api-key/workflows/create-api-keys.ts","../src/api-key/workflows/delete-api-keys.ts","../src/api-key/workflows/index.ts","../src/api-key/workflows/revoke-api-keys.ts","../src/api-key/workflows/update-api-keys.ts","../src/auth/index.ts","../src/auth/steps/index.ts","../src/auth/steps/set-auth-app-metadata.ts","../src/auth/workflows/generate-reset-password-token.ts","../src/auth/workflows/index.ts","../src/auth/workflows/set-auth-app-metadata.ts","../src/common/index.ts","../src/common/steps/create-entities.ts","../src/common/steps/create-remote-links.ts","../src/common/steps/delete-entities.ts","../src/common/steps/dismiss-remote-links.ts","../src/common/steps/emit-event.ts","../src/common/steps/release-event.ts","../src/common/steps/remove-remote-links.ts","../src/common/steps/update-remote-links.ts","../src/common/steps/use-query-graph.ts","../src/common/steps/use-remote-query.ts","../src/common/steps/validate-presence-of.ts","../src/common/steps/__fixtures__/remote-query.ts","../src/common/steps/__tests__/use-query-graph-step.spec.ts","../src/common/workflows/batch-links.ts","../src/common/workflows/create-links.ts","../src/common/workflows/dismiss-links.ts","../src/common/workflows/update-links.ts","../src/defaults/index.ts","../src/defaults/steps/index.ts","../src/defaults/workflows/create-defaults.ts","../src/defaults/workflows/index.ts","../src/file/index.ts","../src/file/steps/delete-files.ts","../src/file/steps/index.ts","../src/file/steps/upload-files.ts","../src/file/workflows/delete-files.ts","../src/file/workflows/index.ts","../src/file/workflows/upload-files.ts","../src/invite/index.ts","../src/invite/steps/create-invites.ts","../src/invite/steps/delete-invites.ts","../src/invite/steps/get-invite-roles.ts","../src/invite/steps/index.ts","../src/invite/steps/refresh-invite-tokens.ts","../src/invite/steps/validate-roles-exist.ts","../src/invite/steps/validate-token.ts","../src/invite/workflows/accept-invite.ts","../src/invite/workflows/create-invites.ts","../src/invite/workflows/delete-invites.ts","../src/invite/workflows/index.ts","../src/invite/workflows/refresh-invite-tokens.ts","../src/locking/index.ts","../src/locking/steps/acquire-lock.ts","../src/locking/steps/release-lock.ts","../src/notification/index.ts","../src/notification/steps/index.ts","../src/notification/steps/notify-on-failure.ts","../src/notification/steps/send-notifications.ts","../src/rbac/index.ts","../src/rbac/steps/create-rbac-policies.ts","../src/rbac/steps/create-rbac-role-parents.ts","../src/rbac/steps/create-rbac-role-policies.ts","../src/rbac/steps/create-rbac-roles.ts","../src/rbac/steps/delete-rbac-policies.ts","../src/rbac/steps/delete-rbac-role-policies.ts","../src/rbac/steps/delete-rbac-roles.ts","../src/rbac/steps/index.ts","../src/rbac/steps/set-role-parent.ts","../src/rbac/steps/update-rbac-policies.ts","../src/rbac/steps/update-rbac-role-policies.ts","../src/rbac/steps/update-rbac-roles.ts","../src/rbac/steps/validate-user-permissions.ts","../src/rbac/workflows/create-rbac-policies.ts","../src/rbac/workflows/create-rbac-role-policies.ts","../src/rbac/workflows/create-rbac-roles.ts","../src/rbac/workflows/delete-rbac-policies.ts","../src/rbac/workflows/delete-rbac-role-policies.ts","../src/rbac/workflows/delete-rbac-roles.ts","../src/rbac/workflows/index.ts","../src/rbac/workflows/update-rbac-policies.ts","../src/rbac/workflows/update-rbac-role-policies.ts","../src/rbac/workflows/update-rbac-roles.ts","../src/settings/index.ts","../src/settings/steps/create-view-configuration.ts","../src/settings/steps/index.ts","../src/settings/steps/set-active-view-configuration.ts","../src/settings/steps/update-view-configuration.ts","../src/settings/workflows/create-view-configuration.ts","../src/settings/workflows/index.ts","../src/settings/workflows/update-view-configuration.ts","../src/translation/index.ts","../src/translation/steps/create-translation-settings.ts","../src/translation/steps/create-translations.ts","../src/translation/steps/delete-translation-settings.ts","../src/translation/steps/delete-translations.ts","../src/translation/steps/index.ts","../src/translation/steps/update-translation-settings.ts","../src/translation/steps/update-translations.ts","../src/translation/steps/validate-translations.ts","../src/translation/workflows/batch-translation-settings.ts","../src/translation/workflows/batch-translations.ts","../src/translation/workflows/create-translations.ts","../src/translation/workflows/delete-translations.ts","../src/translation/workflows/index.ts","../src/translation/workflows/update-translations.ts","../src/user/index.ts","../src/user/steps/create-users.ts","../src/user/steps/delete-users.ts","../src/user/steps/index.ts","../src/user/steps/update-users.ts","../src/user/workflows/create-user-account.ts","../src/user/workflows/create-users.ts","../src/user/workflows/delete-users.ts","../src/user/workflows/index.ts","../src/user/workflows/remove-user-account.ts","../src/user/workflows/update-users.ts"],"version":"5.9.3"}
1
+ {"root":["../src/index.ts","../src/api-key/index.ts","../src/api-key/steps/create-api-keys.ts","../src/api-key/steps/delete-api-keys.ts","../src/api-key/steps/index.ts","../src/api-key/steps/revoke-api-keys.ts","../src/api-key/steps/update-api-keys.ts","../src/api-key/workflows/create-api-keys.ts","../src/api-key/workflows/delete-api-keys.ts","../src/api-key/workflows/index.ts","../src/api-key/workflows/revoke-api-keys.ts","../src/api-key/workflows/update-api-keys.ts","../src/auth/index.ts","../src/auth/steps/index.ts","../src/auth/steps/set-auth-app-metadata.ts","../src/auth/workflows/generate-reset-password-token.ts","../src/auth/workflows/index.ts","../src/auth/workflows/set-auth-app-metadata.ts","../src/common/index.ts","../src/common/steps/create-entities.ts","../src/common/steps/create-remote-links.ts","../src/common/steps/delete-entities.ts","../src/common/steps/dismiss-remote-links.ts","../src/common/steps/emit-event.ts","../src/common/steps/release-event.ts","../src/common/steps/remove-remote-links.ts","../src/common/steps/update-remote-links.ts","../src/common/steps/use-query-graph.ts","../src/common/steps/use-remote-query.ts","../src/common/steps/validate-presence-of.ts","../src/common/steps/wait-for-approval.ts","../src/common/steps/__fixtures__/remote-query.ts","../src/common/steps/__tests__/use-query-graph-step.spec.ts","../src/common/workflows/batch-links.ts","../src/common/workflows/create-links.ts","../src/common/workflows/dismiss-links.ts","../src/common/workflows/update-links.ts","../src/defaults/index.ts","../src/defaults/steps/index.ts","../src/defaults/workflows/create-defaults.ts","../src/defaults/workflows/index.ts","../src/file/index.ts","../src/file/steps/delete-files.ts","../src/file/steps/index.ts","../src/file/steps/upload-files.ts","../src/file/workflows/delete-files.ts","../src/file/workflows/index.ts","../src/file/workflows/upload-files.ts","../src/invite/index.ts","../src/invite/steps/create-invites.ts","../src/invite/steps/delete-invites.ts","../src/invite/steps/get-invite-roles.ts","../src/invite/steps/index.ts","../src/invite/steps/refresh-invite-tokens.ts","../src/invite/steps/validate-roles-exist.ts","../src/invite/steps/validate-token.ts","../src/invite/workflows/accept-invite.ts","../src/invite/workflows/create-invites.ts","../src/invite/workflows/delete-invites.ts","../src/invite/workflows/index.ts","../src/invite/workflows/refresh-invite-tokens.ts","../src/locking/index.ts","../src/locking/steps/acquire-lock.ts","../src/locking/steps/release-lock.ts","../src/notification/index.ts","../src/notification/steps/index.ts","../src/notification/steps/notify-on-failure.ts","../src/notification/steps/send-notifications.ts","../src/rbac/index.ts","../src/rbac/steps/create-rbac-policies.ts","../src/rbac/steps/create-rbac-role-parents.ts","../src/rbac/steps/create-rbac-role-policies.ts","../src/rbac/steps/create-rbac-roles.ts","../src/rbac/steps/delete-rbac-policies.ts","../src/rbac/steps/delete-rbac-role-policies.ts","../src/rbac/steps/delete-rbac-roles.ts","../src/rbac/steps/index.ts","../src/rbac/steps/set-role-parent.ts","../src/rbac/steps/update-rbac-policies.ts","../src/rbac/steps/update-rbac-role-policies.ts","../src/rbac/steps/update-rbac-roles.ts","../src/rbac/steps/validate-user-permissions.ts","../src/rbac/workflows/create-rbac-policies.ts","../src/rbac/workflows/create-rbac-role-policies.ts","../src/rbac/workflows/create-rbac-roles.ts","../src/rbac/workflows/delete-rbac-policies.ts","../src/rbac/workflows/delete-rbac-role-policies.ts","../src/rbac/workflows/delete-rbac-roles.ts","../src/rbac/workflows/index.ts","../src/rbac/workflows/update-rbac-policies.ts","../src/rbac/workflows/update-rbac-role-policies.ts","../src/rbac/workflows/update-rbac-roles.ts","../src/settings/index.ts","../src/settings/steps/create-view-configuration.ts","../src/settings/steps/index.ts","../src/settings/steps/set-active-view-configuration.ts","../src/settings/steps/update-view-configuration.ts","../src/settings/workflows/create-view-configuration.ts","../src/settings/workflows/index.ts","../src/settings/workflows/update-view-configuration.ts","../src/translation/index.ts","../src/translation/steps/create-translation-settings.ts","../src/translation/steps/create-translations.ts","../src/translation/steps/delete-translation-settings.ts","../src/translation/steps/delete-translations.ts","../src/translation/steps/index.ts","../src/translation/steps/update-translation-settings.ts","../src/translation/steps/update-translations.ts","../src/translation/steps/validate-translations.ts","../src/translation/workflows/batch-translation-settings.ts","../src/translation/workflows/batch-translations.ts","../src/translation/workflows/create-translations.ts","../src/translation/workflows/delete-translations.ts","../src/translation/workflows/index.ts","../src/translation/workflows/update-translations.ts","../src/user/index.ts","../src/user/steps/create-users.ts","../src/user/steps/delete-users.ts","../src/user/steps/index.ts","../src/user/steps/update-users.ts","../src/user/workflows/create-user-account.ts","../src/user/workflows/create-users.ts","../src/user/workflows/delete-users.ts","../src/user/workflows/index.ts","../src/user/workflows/remove-user-account.ts","../src/user/workflows/update-users.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/core-flows",
3
- "version": "2.13.33",
3
+ "version": "2.13.35",
4
4
  "description": "Set of workflow definitions for AcmeKit",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -26,14 +26,14 @@
26
26
  "author": "AcmeKit",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@acmekit/framework": "2.13.33"
29
+ "@acmekit/framework": "2.13.35"
30
30
  },
31
31
  "dependencies": {
32
32
  "csv-parse": "^5.6.0",
33
33
  "json-2-csv": "^5.5.4"
34
34
  },
35
35
  "peerDependencies": {
36
- "@acmekit/framework": "2.13.33"
36
+ "@acmekit/framework": "2.13.35"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "yarn run -T rimraf dist && yarn run -T tsc --build",