@keystrokehq/cli 0.0.19 → 0.0.20
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/dist/{accept.handler-BVmNNAgL.mjs → accept.handler-CiqqUxKN.mjs} +1 -1
- package/dist/{admin-DQlHFuXn.mjs → admin-B0U2Aghv.mjs} +9 -9
- package/dist/{agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs → agent-bundle-package-DWV6B_5q-BsbCEeMw.mjs} +1 -1
- package/dist/{agents-Dd7UeQCw.mjs → agents-DBebUEwk.mjs} +6 -6
- package/dist/{api-nR61stdq.mjs → api-BjBpWWlm.mjs} +1 -1
- package/dist/{api-keys-BsMBFiD_.mjs → api-keys-BHAgmC4E.mjs} +5 -5
- package/dist/{auth-ZTuuEoD6.mjs → auth-D-PZAjdd.mjs} +5 -5
- package/dist/{auth.handler-C1dZBdaG.mjs → auth.handler-CxTDSO6O.mjs} +1 -1
- package/dist/{build-agents-DseUtzd4-CthuIecx.mjs → build-agents-DseUtzd4-BNtZrqoY.mjs} +5 -5
- package/dist/{build-metadata-C8Ra_Gi--L3l8w0rh.mjs → build-metadata-BB_L45ZS-d5-QLDZ5.mjs} +10 -10
- package/dist/{build-progress-AR8xow4_.mjs → build-progress-BVwDg6lC.mjs} +1 -1
- package/dist/{build-tasks-GVuMLS0h-BaPhhGXO.mjs → build-tasks-C09SdfjC-DxKcmENc.mjs} +4 -4
- package/dist/{build-workflows-CV4tBo6S-szwrAGWT.mjs → build-workflows-BZ_m97Pr-DwcnRlyh.mjs} +9 -10
- package/dist/{build.handler-DJrEMCBw.mjs → build.handler-CTX80S1K.mjs} +4 -4
- package/dist/{chunk-CH6r78ws.mjs → chunk-DYxdGL9S.mjs} +2 -1
- package/dist/{clear.handler-BgeAg2de.mjs → clear.handler-Bksm2HI4.mjs} +1 -1
- package/dist/{commander-C5qcOo8m.mjs → commander-DQLrBSIW.mjs} +1 -1
- package/dist/{connect-BtBKoXpi.mjs → connect-DV_EztVs.mjs} +2 -2
- package/dist/{connect.handler-E8CmLRSF.mjs → connect.handler-DbuGt3Xb.mjs} +3 -3
- package/dist/{context-BydAGTiB.mjs → context-BUzxM3QI.mjs} +2 -2
- package/dist/{create.handler-CBxIPC3r.mjs → create.handler-CQCRk-Na.mjs} +1 -1
- package/dist/{credentials-BGaRMclS.mjs → credentials-m18a1_hw.mjs} +6 -6
- package/dist/{credentials-jRiXEr6P.mjs → credentials-xPtLFTjW.mjs} +2 -2
- package/dist/{current-deployment-workflow-BVliROAz.mjs → current-deployment-workflow-pyBoobIm.mjs} +4 -4
- package/dist/{current.handler-DBl9S67d.mjs → current.handler-BJGJgdGP.mjs} +1 -1
- package/dist/{delete.handler-Buu7Ip0D.mjs → delete.handler-DNoehdOH.mjs} +1 -1
- package/dist/{deploy-CzTlgAFj.mjs → deploy-3tHCBGky.mjs} +2 -2
- package/dist/{deploy-BPDUTKZD.mjs → deploy-BKjcO_sm.mjs} +1 -1
- package/dist/{deploy-progress-DK87VKJ-.mjs → deploy-progress-CyolzjRB.mjs} +1 -1
- package/dist/{deploy.handler-CCcJ7y3A.mjs → deploy.handler-TnPNBYXZ.mjs} +27 -15
- package/dist/{detect-env-access-CwkOYeYM-CNTyUzme.mjs → detect-env-access-CwkOYeYM-D8-hxij0.mjs} +2 -2
- package/dist/{diff.handler-DUVFixeG.mjs → diff.handler-DO2WzdGB.mjs} +3 -3
- package/dist/{dist-Cx0RV8s7.mjs → dist-BGrWr5fp.mjs} +32 -37
- package/dist/{env.handler-C8kNFz2U.mjs → env.handler-C5GNyiJt.mjs} +6 -6
- package/dist/{error-boundary-B8cmSwJH.mjs → error-boundary-GtRvP2oP.mjs} +1 -1
- package/dist/{file-metadata-lrX05iRt.mjs → file-metadata-B8c7Y5yg.mjs} +2 -7
- package/dist/{import-module--8x5SLum-DjPUZr4i.mjs → import-module-y0glInUe-CfNsQNia.mjs} +48 -840
- package/dist/{init-DeeOVc9m.mjs → init-D9RIT2CY.mjs} +3 -3
- package/dist/{init.handler-BMdhpusQ.mjs → init.handler-0TJY1YNy.mjs} +2 -2
- package/dist/{inspect.handler-QyTo8rWO.mjs → inspect.handler-BrYFfN4H.mjs} +3 -3
- package/dist/{integration-catalog-CmvYPvI6.mjs → integration-catalog-BrJsBkfx.mjs} +1 -1
- package/dist/{integrations-tXZM-84g.mjs → integrations-vSyAQ6HA.mjs} +5 -5
- package/dist/{invites-ClyAatBW.mjs → invites-BASM4PJr.mjs} +4 -4
- package/dist/{invites.list.handler-CPkK_tPM.mjs → invites.list.handler-c-aw6g5o.mjs} +1 -1
- package/dist/{invites.resend.handler-DIRI7tS2.mjs → invites.resend.handler-MnMEjP_Z.mjs} +1 -1
- package/dist/{invites.revoke.handler-CcXcDBlU.mjs → invites.revoke.handler-CHX6Z8kj.mjs} +1 -1
- package/dist/keystroke.mjs +21 -21
- package/dist/{list-enrichment-B9238wom.mjs → list-enrichment-DcplcioC.mjs} +1 -1
- package/dist/{list.handler-Cbc9rlBx.mjs → list.handler-BBzB1_1l.mjs} +1 -1
- package/dist/{list.handler-DdFGHkqt.mjs → list.handler-BsgCd1oF.mjs} +5 -5
- package/dist/{list.handler-BB-Dcm5B.mjs → list.handler-CDtjm-6d.mjs} +1 -1
- package/dist/{list.handler-Xl_F89kq.mjs → list.handler-DJNtXw7C.mjs} +1 -1
- package/dist/{list.handler-ClPAPSWm.mjs → list.handler-DXwKdfIv.mjs} +2 -2
- package/dist/{list.handler-tnsRn-Rj.mjs → list2.handler-BdE1k2kl.mjs} +3 -3
- package/dist/{listen-ksMVpdNa.mjs → listen-Ca9KdiB2.mjs} +2 -2
- package/dist/{listen.handler-DEJSBg8y.mjs → listen.handler-KWPN03S8.mjs} +2 -2
- package/dist/{logs-C-JxXsgc.mjs → logs-BEDf7hZ0.mjs} +3 -3
- package/dist/{logs.handler-BIegqc2p.mjs → logs.handler-mk1lcZbU.mjs} +2 -2
- package/dist/{members.add.handler-D4ggN2Xi.mjs → members.add.handler-CTvlxBZU.mjs} +1 -1
- package/dist/{members.invite.handler-BYIt6Oib.mjs → members.invite.handler-wFO0r7Pi.mjs} +1 -1
- package/dist/{members.list.handler-CvpeYKC4.mjs → members.list.handler-PPdqs4nI.mjs} +1 -1
- package/dist/{members.remove.handler-C4GBUVYE.mjs → members.remove.handler-a5WI6zE4.mjs} +1 -1
- package/dist/{members.update.handler-TpM1oi0L.mjs → members.update.handler-3xblTzmz.mjs} +1 -1
- package/dist/{metadata-layout-Bv-B0nHj-B1c5giJ7.mjs → metadata-layout-Bv-B0nHj-DtMWZ7Cc.mjs} +1 -1
- package/dist/{normalize-path-CojS-CgQ-D4wSBHgG.mjs → normalize-path-CojS-CgQ-CRqBc6D6.mjs} +1 -1
- package/dist/{org-DIGyb7XZ.mjs → org-CzLw3neZ.mjs} +15 -15
- package/dist/{orgs.create.handler-RIYhse_Q.mjs → orgs.create.handler-CcPpDweZ.mjs} +1 -1
- package/dist/{orgs.get.handler-BfOpbSom.mjs → orgs.get.handler-BACPg7vR.mjs} +1 -1
- package/dist/{orgs.list.handler-BMgj9yTD.mjs → orgs.list.handler-DEF8OyvM.mjs} +1 -1
- package/dist/{paused.handler-DAZ1EaLN.mjs → paused.handler-D4j8_Za4.mjs} +1 -1
- package/dist/{projects-Cy6CH3fI.mjs → projects-CJCKxG2u.mjs} +4 -4
- package/dist/{projects-BndElPAx.mjs → projects-s5ehKLil.mjs} +2 -2
- package/dist/{requirements.handler-C5vobjdJ.mjs → requirements.handler-Bk-sAE9C.mjs} +5 -5
- package/dist/{run-polling-BhOdFyh3.mjs → run-polling-DKclfet-.mjs} +3 -3
- package/dist/{run.handler-BpLmwF_a.mjs → run.handler-x0B-CjNF.mjs} +4 -4
- package/dist/{runs-DaSd4eXn.mjs → runs-DoMVOCNj.mjs} +2 -2
- package/dist/{skills-sync.handler-DOxudKmV.mjs → skills-sync.handler-CYkCeuQn.mjs} +1 -1
- package/dist/{skills.command-DQc_qGAF.mjs → skills.command-DeAgMGGw.mjs} +4 -4
- package/dist/{source-analysis-BBg2E_6G-Ut7kYHOz.mjs → source-analysis-BBg2E_6G-BJTRqWrQ.mjs} +3 -3
- package/dist/{source-analysis-Cs0CTBQk.mjs → source-analysis-BMMPIHN9.mjs} +1 -1
- package/dist/src-BHTjsZ9V.mjs +456 -0
- package/dist/{src-0XVwHXNp.mjs → src-BYQwp8Ig.mjs} +1 -1
- package/dist/{switch.handler-CCjMrRZN.mjs → switch.handler-CV4ZBXAu.mjs} +1 -1
- package/dist/{sync-BdTQDZjP.mjs → sync-KCVM02IY.mjs} +2 -2
- package/dist/{sync.handler-DjY8nqbB.mjs → sync.handler-Cuw89341.mjs} +6 -6
- package/dist/task-BSCN9cU4.mjs +945 -0
- package/dist/{task-target-build-DCV0UDaz.mjs → task-target-build-B0HF2_At.mjs} +41 -55
- package/dist/task-target-deploy-ClbwKJ8K.mjs +4 -0
- package/dist/{task-target-deploy-CZBGNC0H-I-tvkGCC.mjs → task-target-deploy-dQYnMO8n-CeTmRcDw.mjs} +15 -17
- package/dist/task-target-deploy-runner.mjs +4 -4
- package/dist/{test-TTQXrhHm.mjs → test-Rm3thni3.mjs} +2 -2
- package/dist/{test.handler-B7Ahe9ta.mjs → test.handler-CTd-heRS.mjs} +8 -8
- package/dist/{test.handler-CkkplyX6.mjs → test.handler-DhhcsvHN.mjs} +1 -1
- package/dist/{tool.handler-DMfFZCRg.mjs → tool.handler-C3LNyQbc.mjs} +9 -63
- package/dist/{trigger-artifacts-RizI57RC-DjhOsdOm.mjs → trigger-artifacts-BcRScRSp-DqFgzl_B.mjs} +53 -119
- package/dist/trigger-manifest-DTni4NaZ.mjs +42 -0
- package/dist/{upgrade-Cx-bUWUc.mjs → upgrade-Cf7y38xR.mjs} +2 -2
- package/dist/{upload-BbcMkyVl.mjs → upload-CJWApEgz.mjs} +1 -1
- package/dist/{upload.handler-_d2WZwxd.mjs → upload.handler-BHIWYPph.mjs} +7 -7
- package/dist/{users.get.handler-DIooG7Wy.mjs → users.get.handler-spWaHG8h.mjs} +1 -1
- package/dist/{users.list.handler-DdGW-DSg.mjs → users.list.handler-DLuU7cd_.mjs} +1 -1
- package/dist/{users.set-role.handler-Ek-kntLp.mjs → users.set-role.handler-CojFmpcD.mjs} +1 -1
- package/dist/{utils-BMUWnz1P.mjs → utils-Ddltm1sR.mjs} +1 -1
- package/dist/{validate.handler-Cq2uJjXY.mjs → validate.handler-DIJBuX1P.mjs} +4 -4
- package/dist/{workflow-build-C8AiYxqp.mjs → workflow-build-IGYhEC8Y.mjs} +22 -22
- package/dist/{workflow-bundler-BzHk73PM-WI31RJjH.mjs → workflow-bundler-BzHk73PM-Cs-4Ml-p.mjs} +2 -2
- package/dist/{workflows-K6zetcqI.mjs → workflows-MANdvLft.mjs} +19 -21
- package/dist/{writer-B-SpZ0G2-CLh7sXRd.mjs → writer-byNNUjRm-w5O7-VT_.mjs} +24 -33
- package/package.json +11 -11
- package/dist/common-AK0q0Oz0.mjs +0 -20
- package/dist/credential-requirements-Ob-7H-0F.mjs +0 -250
- package/dist/cron-parser-Dw_cWzFu.mjs +0 -393
- package/dist/declared-credential-requirements-D6KT-r-e.mjs +0 -103
- package/dist/task-BRmL2lmw.mjs +0 -486
- package/dist/task-target-deploy-DmpCWE3u.mjs +0 -4
- package/dist/trigger-manifest-DxdCjGz_.mjs +0 -29
- package/dist/workflow-build-manifest-BKKW9D05.mjs +0 -259
- /package/dist/{agent-manifest-tIsqF2OP.mjs → agent-manifest-CZ7BeUSG.mjs} +0 -0
- /package/dist/{browser-BpJ8ut9z.mjs → browser-Cu4k-wT_.mjs} +0 -0
- /package/dist/{clear-cache.handler-CTLQ1PIN.mjs → clear-cache.handler-8RFmjHoo.mjs} +0 -0
- /package/dist/{clear.handler-C_pXAeBG.mjs → clear.handler-mfNmIUYP.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-BTlfau8D.mjs → concurrency-gXn9Rw8x-BSBbRfVp.mjs} +0 -0
- /package/dist/{credential-env-map-BA4LNI7x.mjs → credential-env-map-qLCR_QbO.mjs} +0 -0
- /package/dist/{credential-schema-mismatch-z74ud-YZ.mjs → credential-schema-mismatch-BHI_B-U-.mjs} +0 -0
- /package/dist/{diff-utils-B0ED-Igv.mjs → diff-utils-x5pi8SrL.mjs} +0 -0
- /package/dist/{layout-P1v-Gssz.mjs → layout-DRf9qUf8.mjs} +0 -0
- /package/dist/{list.handler-BLkQKiV1.mjs → list.handler-CynN-ezD.mjs} +0 -0
- /package/dist/{logs.handler-DyRoevtO.mjs → logs.handler-CcA1UzJm.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-Cvx4Z-4H.mjs → oxc-B3KI3rf_-Cnk0L10M.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-B0eiobOd.mjs → read-credential-keys-77a91T8M-CzXPGxdU.mjs} +0 -0
- /package/dist/{register.handler-BXeh5mdb.mjs → register.handler-CSvlOMF6.mjs} +0 -0
- /package/dist/{resolve-project-CNQtOWE4.mjs → resolve-project-CWP2fji3.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-8uqgIurC.mjs → rolldown-runtime-twds-ZHy-BoF7MLzP.mjs} +0 -0
- /package/dist/{run-polling-DARidqo-.mjs → run-polling-CzyVv7Ba.mjs} +0 -0
- /package/dist/{schema-BjH_e4Fo.mjs → schema-CvSZqa3t.mjs} +0 -0
- /package/dist/{schema-display-NVEl_DFY.mjs → schema-display-DxLA3j5H.mjs} +0 -0
- /package/dist/{schemas-BxFPUGWT.mjs → schemas-U2OzP9gP.mjs} +0 -0
- /package/dist/{skill-installer-BBgN2tzW.mjs → skill-installer-CYFshTBy.mjs} +0 -0
- /package/dist/{skills.handler-Do9I3dQS.mjs → skills.handler-Bma-MJX-.mjs} +0 -0
- /package/dist/{spinner-progress-Bx-fYItP.mjs → spinner-progress-DV28G4tP.mjs} +0 -0
- /package/dist/{status.handler-BsVtDW_V.mjs → status.handler-BOV0eX3J.mjs} +0 -0
- /package/dist/{types-BMBuhHhW.mjs → types-DamInJD6.mjs} +0 -0
- /package/dist/{upgrade.handler-5qSzPC7D.mjs → upgrade.handler-Bz_oQcAw.mjs} +0 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BWcVRt-T.mjs";
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
5
|
-
import {
|
|
6
|
-
import { c as TriggerUploadDataSchema } from "./credential-requirements-Ob-7H-0F.mjs";
|
|
7
|
-
import { a as FlowGraphSchema, r as WorkflowBuildManifestSchema } from "./workflow-build-manifest-BKKW9D05.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-DQLrBSIW.mjs";
|
|
5
|
+
import { i as WorkflowBuildManifestSchema, l as JsonSchemaSchema, o as FlowGraphSchema, t as src_exports, u as SHA256HashSchema } from "./src-BHTjsZ9V.mjs";
|
|
8
6
|
import { z } from "zod";
|
|
9
7
|
const GitProviderSchema = z.enum(["codestorage", "github"]);
|
|
10
8
|
const GitTreeEntryTypeSchema = z.enum(["file", "directory"]);
|
|
@@ -108,8 +106,8 @@ const activationSharedFields = {
|
|
|
108
106
|
logicalTriggerKey: z.string(),
|
|
109
107
|
status: ActivationStatusSchema,
|
|
110
108
|
/**
|
|
111
|
-
* Per-
|
|
112
|
-
* Key: "
|
|
109
|
+
* Per-poll-export trigger credential bindings.
|
|
110
|
+
* Key: "poll:<credentialDefinitionId>" (e.g. "poll:slack").
|
|
113
111
|
* Value: credential set ID or "<scope>.default".
|
|
114
112
|
*/
|
|
115
113
|
triggerCredentialBindings: z.record(z.string(), z.string()).optional(),
|
|
@@ -320,7 +318,7 @@ function createWorkflowsBuildCommand() {
|
|
|
320
318
|
description: "Build workflows locally",
|
|
321
319
|
schema: WorkflowsBuildOptionsSchema,
|
|
322
320
|
optionsConfig: BUILD_OPTIONS_CONFIG,
|
|
323
|
-
loadHandler: async () => (await import("./build.handler-
|
|
321
|
+
loadHandler: async () => (await import("./build.handler-CTX80S1K.mjs")).handleWorkflowsBuild
|
|
324
322
|
});
|
|
325
323
|
}
|
|
326
324
|
//#endregion
|
|
@@ -347,7 +345,7 @@ function createWorkflowsDiffCommand() {
|
|
|
347
345
|
description: "Authored workflow id (preferred) or workflow name",
|
|
348
346
|
key: "workflow"
|
|
349
347
|
},
|
|
350
|
-
loadHandler: async () => (await import("./diff.handler-
|
|
348
|
+
loadHandler: async () => (await import("./diff.handler-DO2WzdGB.mjs")).handleWorkflowsDiff
|
|
351
349
|
});
|
|
352
350
|
}
|
|
353
351
|
//#endregion
|
|
@@ -380,7 +378,7 @@ function createWorkflowsEnvCommand() {
|
|
|
380
378
|
key: "workflow",
|
|
381
379
|
required: false
|
|
382
380
|
},
|
|
383
|
-
loadHandler: async () => (await import("./env.handler-
|
|
381
|
+
loadHandler: async () => (await import("./env.handler-C5GNyiJt.mjs")).handleWorkflowsEnv
|
|
384
382
|
});
|
|
385
383
|
}
|
|
386
384
|
//#endregion
|
|
@@ -412,7 +410,7 @@ function createWorkflowsInspectCommand() {
|
|
|
412
410
|
description: "Authored workflow id (preferred) or workflow name",
|
|
413
411
|
key: "workflow"
|
|
414
412
|
},
|
|
415
|
-
loadHandler: async () => (await import("./inspect.handler-
|
|
413
|
+
loadHandler: async () => (await import("./inspect.handler-BrYFfN4H.mjs")).handleWorkflowsInspect
|
|
416
414
|
});
|
|
417
415
|
}
|
|
418
416
|
//#endregion
|
|
@@ -508,15 +506,15 @@ function createWorkflowsLogsCommand() {
|
|
|
508
506
|
key: "workflow",
|
|
509
507
|
required: false
|
|
510
508
|
},
|
|
511
|
-
loadHandler: async () => (await import("./logs.handler-
|
|
509
|
+
loadHandler: async () => (await import("./logs.handler-mk1lcZbU.mjs")).handleWorkflowsLogs
|
|
512
510
|
});
|
|
513
511
|
}
|
|
514
512
|
//#endregion
|
|
515
513
|
//#region ../../packages/shared-types/src/workflows/api/request.ts
|
|
516
514
|
/** Key format: <stepNodeId>:<credentialDefinitionId> (e.g. step_1:slack). */
|
|
517
515
|
const WORKFLOW_CREDENTIAL_BINDING_KEY_REGEX = /^[a-zA-Z0-9_]+:[a-zA-Z0-9.:_-]+$/;
|
|
518
|
-
/** Key format:
|
|
519
|
-
const TRIGGER_CREDENTIAL_BINDING_KEY_REGEX = /^
|
|
516
|
+
/** Key format: poll:<credentialDefinitionId> (e.g. poll:slack). */
|
|
517
|
+
const TRIGGER_CREDENTIAL_BINDING_KEY_REGEX = /^poll:[a-zA-Z0-9.:_-]+$/;
|
|
520
518
|
/** Value: credential set ID (cset_ + ULID) or <scope>.default */
|
|
521
519
|
const CREDENTIAL_BINDING_VALUE_CREDSET = /^cset_[A-Za-z0-9]{26}$/;
|
|
522
520
|
const CREDENTIAL_BINDING_VALUE_SCOPE_DEFAULT = /^(organization|user|project)\.default$/;
|
|
@@ -533,7 +531,7 @@ const TriggerCredentialBindingsRecordSchema = z.record(z.string(), z.string()).r
|
|
|
533
531
|
if (!CREDENTIAL_BINDING_VALUE_CREDSET.test(value) && !CREDENTIAL_BINDING_VALUE_SCOPE_DEFAULT.test(value)) return false;
|
|
534
532
|
}
|
|
535
533
|
return true;
|
|
536
|
-
}, { message: "triggerCredentialBindings keys must be \"
|
|
534
|
+
}, { message: "triggerCredentialBindings keys must be \"poll:<credentialDefinitionId>\"; values must be credential set ID (cset_...) or \"<scope>.default\"" }).optional();
|
|
537
535
|
z.object({
|
|
538
536
|
workflowName: z.string().min(1),
|
|
539
537
|
args: z.array(z.unknown()).optional().default([]),
|
|
@@ -612,7 +610,7 @@ z.object({
|
|
|
612
610
|
exportName: z.string().min(1),
|
|
613
611
|
manifest: WorkflowBuildManifestSchema,
|
|
614
612
|
flowJson: FlowGraphSchema.optional(),
|
|
615
|
-
triggers: z.array(TriggerUploadDataSchema).optional(),
|
|
613
|
+
triggers: z.array(src_exports.TriggerUploadDataSchema).optional(),
|
|
616
614
|
bundleHash: SHA256HashSchema,
|
|
617
615
|
bundleSize: z.number(),
|
|
618
616
|
args: z.array(z.unknown()).optional().default([]),
|
|
@@ -698,7 +696,7 @@ function createWorkflowsPausedCommand() {
|
|
|
698
696
|
key: "workflow",
|
|
699
697
|
required: false
|
|
700
698
|
},
|
|
701
|
-
loadHandler: async () => (await import("./paused.handler-
|
|
699
|
+
loadHandler: async () => (await import("./paused.handler-D4j8_Za4.mjs")).handleWorkflowsPaused
|
|
702
700
|
});
|
|
703
701
|
}
|
|
704
702
|
//#endregion
|
|
@@ -792,7 +790,7 @@ function createWorkflowsRunCommand() {
|
|
|
792
790
|
key: "payload",
|
|
793
791
|
required: false
|
|
794
792
|
}],
|
|
795
|
-
loadHandler: async () => (await import("./run.handler-
|
|
793
|
+
loadHandler: async () => (await import("./run.handler-x0B-CjNF.mjs")).handleWorkflowsRun
|
|
796
794
|
});
|
|
797
795
|
}
|
|
798
796
|
//#endregion
|
|
@@ -847,7 +845,7 @@ function createWorkflowsTestCommand() {
|
|
|
847
845
|
description: "Authored workflow id (preferred) or workflow name. Multiple workflows with the same name run sequentially.",
|
|
848
846
|
key: "workflow"
|
|
849
847
|
},
|
|
850
|
-
loadHandler: async () => (await import("./test.handler-
|
|
848
|
+
loadHandler: async () => (await import("./test.handler-CTd-heRS.mjs")).handleWorkflowsTest
|
|
851
849
|
});
|
|
852
850
|
}
|
|
853
851
|
//#endregion
|
|
@@ -885,7 +883,7 @@ function createWorkflowsValidateCommand() {
|
|
|
885
883
|
key: "workflow",
|
|
886
884
|
required: false
|
|
887
885
|
},
|
|
888
|
-
loadHandler: async () => (await import("./validate.handler-
|
|
886
|
+
loadHandler: async () => (await import("./validate.handler-DIJBuX1P.mjs")).handleWorkflowsValidate
|
|
889
887
|
});
|
|
890
888
|
}
|
|
891
889
|
//#endregion
|
|
@@ -904,14 +902,14 @@ function createWorkflowsCommand() {
|
|
|
904
902
|
description: "Manage, run, inspect, and debug workflows",
|
|
905
903
|
schema: WorkflowsOptionsSchema,
|
|
906
904
|
optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
|
|
907
|
-
loadHandler: async () => (await import("./
|
|
905
|
+
loadHandler: async () => (await import("./list2.handler-BdE1k2kl.mjs")).handleWorkflowsList,
|
|
908
906
|
subcommands: [
|
|
909
907
|
createTypedCommand({
|
|
910
908
|
name: "list",
|
|
911
909
|
description: "List all workflows in the project",
|
|
912
910
|
schema: WorkflowsOptionsSchema,
|
|
913
911
|
optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
|
|
914
|
-
loadHandler: async () => (await import("./
|
|
912
|
+
loadHandler: async () => (await import("./list2.handler-BdE1k2kl.mjs")).handleWorkflowsList
|
|
915
913
|
}),
|
|
916
914
|
createWorkflowsBuildCommand(),
|
|
917
915
|
createWorkflowsTestCommand(),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as __exportAll } from "./chunk-
|
|
4
|
-
import { f as getTriggersDir, n as BUILD_OUTPUT_DIR_NAME, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-
|
|
5
|
-
import { t as TriggerBuildManifestSchema } from "./trigger-manifest-
|
|
6
|
-
import { t as __exportAll$1 } from "./rolldown-runtime-twds-ZHy-
|
|
7
|
-
import { s as sha256String } from "./metadata-layout-Bv-B0nHj-
|
|
8
|
-
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-
|
|
3
|
+
import { n as __exportAll } from "./chunk-DYxdGL9S.mjs";
|
|
4
|
+
import { f as getTriggersDir, n as BUILD_OUTPUT_DIR_NAME, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-DRf9qUf8.mjs";
|
|
5
|
+
import { t as TriggerBuildManifestSchema } from "./trigger-manifest-DTni4NaZ.mjs";
|
|
6
|
+
import { t as __exportAll$1 } from "./rolldown-runtime-twds-ZHy-BoF7MLzP.mjs";
|
|
7
|
+
import { s as sha256String } from "./metadata-layout-Bv-B0nHj-DtMWZ7Cc.mjs";
|
|
8
|
+
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-BSBbRfVp.mjs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { access, mkdir, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
|
-
//#region ../../packages/workflow-builder/dist/writer-
|
|
13
|
-
var
|
|
12
|
+
//#region ../../packages/workflow-builder/dist/writer-byNNUjRm.mjs
|
|
13
|
+
var writer_byNNUjRm_exports = /* @__PURE__ */ __exportAll({
|
|
14
14
|
a: () => getAgentArtifactPaths,
|
|
15
15
|
d: () => allOutputFilesExist,
|
|
16
16
|
f: () => hashAgentManifestForDisk,
|
|
@@ -34,10 +34,10 @@ function releaseBundleCode(bundle) {
|
|
|
34
34
|
if ("sourceMap" in bundle) bundle.sourceMap = null;
|
|
35
35
|
bundle.released = true;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function markPollBundleDiskBacked(bundle, outputPath) {
|
|
38
38
|
bundle.outputPath = outputPath;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function releasePollBundleCode(bundle) {
|
|
41
41
|
bundle.code = "";
|
|
42
42
|
bundle.released = true;
|
|
43
43
|
}
|
|
@@ -352,8 +352,7 @@ function toTriggerWriteArtifact(trigger, triggerDir) {
|
|
|
352
352
|
triggerId: trigger.triggerId,
|
|
353
353
|
triggerDir,
|
|
354
354
|
manifestPath: path.join(triggerDir, "manifest.json"),
|
|
355
|
-
...trigger.
|
|
356
|
-
...trigger.transformCallbackBundle ? { transformCallbackBundlePath: path.join(triggerDir, "transform.js") } : {}
|
|
355
|
+
...trigger.pollBundle ? { pollBundlePath: path.join(triggerDir, "poll-bundle.js") } : {}
|
|
357
356
|
};
|
|
358
357
|
}
|
|
359
358
|
async function writeTriggerArtifacts(triggers, buildDir, options) {
|
|
@@ -370,36 +369,28 @@ async function writeTriggerArtifacts(triggers, buildDir, options) {
|
|
|
370
369
|
await mkdir(triggerDir, { recursive: true });
|
|
371
370
|
const triggerManifest = TriggerBuildManifestSchema.parse({
|
|
372
371
|
id: trigger.triggerId,
|
|
372
|
+
authoredTriggerId: trigger.authoredTriggerId,
|
|
373
373
|
type: trigger.triggerType,
|
|
374
374
|
...trigger.triggerSource ? { triggerSource: trigger.triggerSource } : {},
|
|
375
|
+
...trigger.webhookAuthGroupKey ? { webhookAuthGroupKey: trigger.webhookAuthGroupKey } : {},
|
|
375
376
|
enabled: trigger.enabled,
|
|
376
377
|
...trigger.schedule ? { schedule: trigger.schedule } : {},
|
|
377
378
|
...trigger.timezone ? { timezone: trigger.timezone } : {},
|
|
378
|
-
...trigger.path ? { path: trigger.path } : {},
|
|
379
|
-
...trigger.method ? { method: trigger.method } : {},
|
|
380
379
|
config: trigger.config ?? (trigger.staticPayload !== void 0 ? { payload: trigger.staticPayload } : {}),
|
|
381
|
-
...trigger.requiredCredentials ? { requiredCredentials: trigger.requiredCredentials } : {}
|
|
380
|
+
...trigger.requiredCredentials ? { requiredCredentials: trigger.requiredCredentials } : {},
|
|
381
|
+
...trigger.filterSchema ? { filterSchema: trigger.filterSchema } : {},
|
|
382
|
+
...trigger.idempotencyConfig ? { idempotencyConfig: trigger.idempotencyConfig } : {}
|
|
382
383
|
});
|
|
383
|
-
if (trigger.
|
|
384
|
-
js: "
|
|
385
|
-
export: exportName
|
|
386
|
-
}]));
|
|
387
|
-
if (trigger.transformCallbackExports && trigger.transformCallbackBundle) triggerManifest.attachmentFunctions = Object.fromEntries(Object.entries(trigger.transformCallbackExports).map(([key, exportName]) => [key, {
|
|
388
|
-
js: "transform.js",
|
|
384
|
+
if (trigger.pollExports && trigger.pollBundle) triggerManifest.functions = Object.fromEntries(Object.entries(trigger.pollExports).map(([key, exportName]) => [key, {
|
|
385
|
+
js: "poll-bundle.js",
|
|
389
386
|
export: exportName
|
|
390
387
|
}]));
|
|
391
388
|
await writeFile(path.join(triggerDir, "manifest.json"), `${JSON.stringify(triggerManifest, null, 2)}\n`, "utf-8");
|
|
392
|
-
if (trigger.
|
|
393
|
-
const
|
|
394
|
-
await writeFile(
|
|
395
|
-
|
|
396
|
-
if (options?.releaseBundleMemory)
|
|
397
|
-
}
|
|
398
|
-
if (trigger.transformCallbackBundle) {
|
|
399
|
-
const transformBundlePath = path.join(triggerDir, "transform.js");
|
|
400
|
-
await writeFile(transformBundlePath, trigger.transformCallbackBundle.code, "utf-8");
|
|
401
|
-
markCallbackBundleDiskBacked(trigger.transformCallbackBundle, transformBundlePath);
|
|
402
|
-
if (options?.releaseBundleMemory) releaseCallbackBundleCode(trigger.transformCallbackBundle);
|
|
389
|
+
if (trigger.pollBundle) {
|
|
390
|
+
const pollBundlePath = path.join(triggerDir, "poll-bundle.js");
|
|
391
|
+
await writeFile(pollBundlePath, trigger.pollBundle.code, "utf-8");
|
|
392
|
+
markPollBundleDiskBacked(trigger.pollBundle, pollBundlePath);
|
|
393
|
+
if (options?.releaseBundleMemory) releasePollBundleCode(trigger.pollBundle);
|
|
403
394
|
}
|
|
404
395
|
results.push(toTriggerWriteArtifact(trigger, triggerDir));
|
|
405
396
|
}
|
|
@@ -423,4 +414,4 @@ var writer_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
423
414
|
writeTargetedBuildOutput: () => writeTargetedBuildOutput
|
|
424
415
|
});
|
|
425
416
|
//#endregion
|
|
426
|
-
export { getAgentArtifactPaths as a, hashWorkflowManifestForDisk as c, resolveOutputDir as d,
|
|
417
|
+
export { getAgentArtifactPaths as a, hashWorkflowManifestForDisk as c, resolveOutputDir as d, writer_byNNUjRm_exports as f, createAgentOutputFiles as i, removeAgentArtifacts as l, BUILD_CACHE_FILE_NAME as n, hashAgentManifestForDisk as o, allOutputFilesExist as r, hashWorkflowFlowForDisk as s, AGENT_ARTIFACT_DIR_PREFIX as t, removeWorkflowArtifacts as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Command-line interface for creating, managing, and deploying Keystroke automations.",
|
|
6
6
|
"type": "module",
|
|
@@ -33,25 +33,25 @@
|
|
|
33
33
|
"rolldown": "1.0.0",
|
|
34
34
|
"tsx": "^4.21.0",
|
|
35
35
|
"zod": "^4.3.6",
|
|
36
|
-
"@keystrokehq/skills": "0.0.
|
|
36
|
+
"@keystrokehq/skills": "0.0.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"tsdown": "0.21.10",
|
|
40
40
|
"typescript": "^5.9.3",
|
|
41
41
|
"vitest": "^4.1.5",
|
|
42
42
|
"@keystroke/env-utils": "0.0.0",
|
|
43
|
-
"@keystroke/local-memory": "0.0.
|
|
43
|
+
"@keystroke/local-memory": "0.0.1",
|
|
44
44
|
"@keystrokehq/config": "0.0.2",
|
|
45
|
-
"@keystroke/
|
|
46
|
-
"@keystroke/test-utils": "0.0.2",
|
|
45
|
+
"@keystroke/test-utils": "0.0.3",
|
|
47
46
|
"@keystroke/typescript-config": "0.0.0",
|
|
48
47
|
"@keystroke/utils": "0.0.0",
|
|
49
|
-
"@keystroke/workflow-builder": "0.0.
|
|
50
|
-
"@keystrokehq/core": "0.0.
|
|
51
|
-
"@keystrokehq/
|
|
52
|
-
"@
|
|
53
|
-
"@keystroke/
|
|
54
|
-
"@
|
|
48
|
+
"@keystroke/workflow-builder": "0.0.6",
|
|
49
|
+
"@keystrokehq/core": "0.0.7",
|
|
50
|
+
"@keystrokehq/workflow-build-contracts": "0.0.3",
|
|
51
|
+
"@keystrokehq/testing": "0.2.2",
|
|
52
|
+
"@keystroke/shared-types": "0.0.4",
|
|
53
|
+
"@keystroke/workflow-deploy": "0.0.5",
|
|
54
|
+
"@keystroke/workflow-sdk": "0.0.3"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"automation",
|
package/dist/common-AK0q0Oz0.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const SHA256HashSchema = z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
|
|
5
|
-
const JsonSchemaSchema = z.record(z.string(), z.unknown());
|
|
6
|
-
z.object({
|
|
7
|
-
constant: z.object({
|
|
8
|
-
attempts: z.number().int().min(1).max(10),
|
|
9
|
-
seconds: z.number().positive()
|
|
10
|
-
}).optional(),
|
|
11
|
-
exponential: z.object({
|
|
12
|
-
attempts: z.number().int().min(1).max(10),
|
|
13
|
-
base: z.number().min(1).optional(),
|
|
14
|
-
multiplier: z.number().positive().optional()
|
|
15
|
-
}).optional()
|
|
16
|
-
}).refine((data) => {
|
|
17
|
-
return data.constant !== void 0 !== (data.exponential !== void 0);
|
|
18
|
-
}, { error: "Retry config must specify exactly one of constant or exponential strategy" });
|
|
19
|
-
//#endregion
|
|
20
|
-
export { SHA256HashSchema as n, JsonSchemaSchema as t };
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { t as JsonSchemaSchema } from "./common-AK0q0Oz0.mjs";
|
|
4
|
-
import { n as credentialSetProxyConfigSchema } from "./schemas-BxFPUGWT.mjs";
|
|
5
|
-
import { a as SourceLocationSchema, i as ImportSourceSchema, t as CallKindSchema } from "./source-analysis-Cs0CTBQk.mjs";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
const IntegrationScopeSchema = z.enum([
|
|
8
|
-
"organization",
|
|
9
|
-
"project",
|
|
10
|
-
"user_provided_credential"
|
|
11
|
-
]);
|
|
12
|
-
const IntegrationCredentialRefSchema = z.discriminatedUnion("type", [z.object({
|
|
13
|
-
type: z.literal("id"),
|
|
14
|
-
id: z.string().startsWith("cset_")
|
|
15
|
-
}), z.object({
|
|
16
|
-
type: z.literal("name"),
|
|
17
|
-
name: z.string().trim().min(1)
|
|
18
|
-
})]);
|
|
19
|
-
function hasProjectOrOrganizationScope(scope) {
|
|
20
|
-
return scope === "organization" || scope === "project";
|
|
21
|
-
}
|
|
22
|
-
const CredentialRefTokenKeyNameSchema = z.string().regex(/^[A-Za-z0-9_]+$/, "Credential key must contain only letters, digits, and underscores (required for ref-token proxying)");
|
|
23
|
-
/** Shared enum for top-level credential-set `onCredentialRevoked` policy. */
|
|
24
|
-
const OnCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
25
|
-
/** A credential set after resolution in a built manifest. Contains definition id, scope, alias, and credential keys.*/
|
|
26
|
-
const ResolvedCredentialSetSchema = z.object({
|
|
27
|
-
resolvedId: z.string(),
|
|
28
|
-
scope: IntegrationScopeSchema.optional(),
|
|
29
|
-
alias: z.string().optional(),
|
|
30
|
-
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
31
|
-
/** Auth-shape keys expected post-resolve. */
|
|
32
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
33
|
-
/** Subset of `credentialKeys` that are optional in the auth shape. */
|
|
34
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
35
|
-
/** Stored-shape keys required for vault reads and upload flows. */
|
|
36
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
37
|
-
/** Subset of `storedCredentialKeys` that may be absent from the vault without
|
|
38
|
-
* failing resolution. Derived from the credential set's `stored` schema:
|
|
39
|
-
* a Zod field wrapped in `.optional()` / `.default()` or a JSON Schema
|
|
40
|
-
* property not listed in `required` is considered optional. */
|
|
41
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
42
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
43
|
-
/** When true, resolved values are passed raw (no ref-token proxy) for this set. */
|
|
44
|
-
needsRawSecret: z.boolean().optional(),
|
|
45
|
-
/** When true, this requirement uses a registered dynamic resolver phase. */
|
|
46
|
-
needsDynamicResolution: z.boolean().optional(),
|
|
47
|
-
/** Cache TTL in milliseconds for registered dynamic resolver output.
|
|
48
|
-
* `0` or absence means no cache hint. */
|
|
49
|
-
dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
|
|
50
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
51
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
52
|
-
/** Persistence-layer schema fingerprint stamped at build time. The
|
|
53
|
-
* resolver's phase 2 compares this against the vault row's stored
|
|
54
|
-
* fingerprint and raises `CredentialSchemaMismatchError` on drift.
|
|
55
|
-
* Optional here so pre-fingerprint artifacts still parse; the
|
|
56
|
-
* workflow builder populates it for every authored credential set
|
|
57
|
-
* that has a resolvable fingerprint. */
|
|
58
|
-
schemaFingerprint: z.string().optional()
|
|
59
|
-
}).superRefine((value, ctx) => {
|
|
60
|
-
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
61
|
-
code: z.ZodIssueCode.custom,
|
|
62
|
-
path: ["credentialRef"],
|
|
63
|
-
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
const DeclaredCredentialRequirementSchema = z.object({
|
|
67
|
-
credentialSetId: z.string(),
|
|
68
|
-
/** Auth-shape keys expected post-resolve. */
|
|
69
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
70
|
-
/** Optional subset of the auth-shape keys. */
|
|
71
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
72
|
-
/** Stored-shape keys required for vault reads. */
|
|
73
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
74
|
-
/** Optional subset of the stored-shape keys. */
|
|
75
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
76
|
-
schemaFingerprint: z.string().optional(),
|
|
77
|
-
needsDynamicResolution: z.boolean().optional(),
|
|
78
|
-
/** Cache TTL in milliseconds for registered dynamic resolver output.
|
|
79
|
-
* `0` or absence means no cache hint. */
|
|
80
|
-
dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
|
|
81
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
82
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
83
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
84
|
-
needsRawSecret: z.boolean().optional(),
|
|
85
|
-
requiredOAuthScopes: z.array(z.string()).optional()
|
|
86
|
-
});
|
|
87
|
-
const CredentialRequirementEntrySchema = z.object({
|
|
88
|
-
credentialSetId: z.string(),
|
|
89
|
-
scope: IntegrationScopeSchema.optional(),
|
|
90
|
-
alias: z.string().optional(),
|
|
91
|
-
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
92
|
-
/** Auth-shape keys expected post-resolve. */
|
|
93
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
94
|
-
/** Optional subset of the auth-shape keys. */
|
|
95
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
96
|
-
/** Stored-shape keys required for vault reads. */
|
|
97
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
98
|
-
/** Optional subset of the stored-shape keys. */
|
|
99
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
100
|
-
schemaFingerprint: z.string().optional(),
|
|
101
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
102
|
-
needsRawSecret: z.boolean().optional(),
|
|
103
|
-
/** When true, this requirement uses a registered dynamic resolver phase. */
|
|
104
|
-
needsDynamicResolution: z.boolean().optional(),
|
|
105
|
-
/** Cache TTL in milliseconds for registered dynamic resolver output.
|
|
106
|
-
* `0` or absence means no cache hint. */
|
|
107
|
-
dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
|
|
108
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
109
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
110
|
-
requiredOAuthScopes: z.array(z.string()).optional()
|
|
111
|
-
}).superRefine((value, ctx) => {
|
|
112
|
-
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
113
|
-
code: z.ZodIssueCode.custom,
|
|
114
|
-
path: ["credentialRef"],
|
|
115
|
-
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
const CredentialRequirementsSchema = z.object({
|
|
119
|
-
required: z.array(z.string()),
|
|
120
|
-
byStep: z.record(z.string(), z.array(CredentialRequirementEntrySchema))
|
|
121
|
-
});
|
|
122
|
-
const TriggerCallbackNameSchema = z.enum([
|
|
123
|
-
"filter",
|
|
124
|
-
"idempotencyKey",
|
|
125
|
-
"verify",
|
|
126
|
-
"callback"
|
|
127
|
-
]);
|
|
128
|
-
const TriggerCredentialRequirementEntrySchema = CredentialRequirementEntrySchema;
|
|
129
|
-
const TriggerCredentialRequirementsSchema = z.object({
|
|
130
|
-
required: z.array(z.string()),
|
|
131
|
-
byCallback: z.partialRecord(TriggerCallbackNameSchema, z.array(TriggerCredentialRequirementEntrySchema))
|
|
132
|
-
});
|
|
133
|
-
function buildCredentialRequirementEntryKey(entry) {
|
|
134
|
-
const credentialRefKey = entry.credentialRef ? entry.credentialRef.type === "id" ? `id:${entry.credentialRef.id}` : `name:${entry.credentialRef.name}` : "";
|
|
135
|
-
return [
|
|
136
|
-
entry.credentialSetId,
|
|
137
|
-
entry.scope ?? "",
|
|
138
|
-
entry.alias ?? "",
|
|
139
|
-
credentialRefKey,
|
|
140
|
-
entry.schemaFingerprint ?? "",
|
|
141
|
-
[...entry.credentialKeys].sort().join(","),
|
|
142
|
-
[...entry.optionalCredentialKeys ?? []].sort().join(","),
|
|
143
|
-
[...entry.storedCredentialKeys ?? []].sort().join(","),
|
|
144
|
-
[...entry.optionalStoredCredentialKeys ?? []].sort().join(","),
|
|
145
|
-
entry.needsRawSecret === true ? "1" : "0",
|
|
146
|
-
entry.needsDynamicResolution === true ? "1" : "0",
|
|
147
|
-
typeof entry.dynamicResolutionCacheMs === "number" ? String(entry.dynamicResolutionCacheMs) : "",
|
|
148
|
-
entry.onCredentialRevoked ?? "",
|
|
149
|
-
entry.proxy ? JSON.stringify(entry.proxy) : ""
|
|
150
|
-
].join("|");
|
|
151
|
-
}
|
|
152
|
-
function deduplicateCredentialRequirementEntries(entries) {
|
|
153
|
-
const deduped = /* @__PURE__ */ new Map();
|
|
154
|
-
for (const entry of entries) {
|
|
155
|
-
const key = buildCredentialRequirementEntryKey(entry);
|
|
156
|
-
const existing = deduped.get(key);
|
|
157
|
-
if (!existing) deduped.set(key, {
|
|
158
|
-
...entry,
|
|
159
|
-
credentialKeys: [...entry.credentialKeys].sort(),
|
|
160
|
-
...entry.optionalCredentialKeys ? { optionalCredentialKeys: [...entry.optionalCredentialKeys].sort() } : {},
|
|
161
|
-
...entry.storedCredentialKeys ? { storedCredentialKeys: [...entry.storedCredentialKeys].sort() } : {},
|
|
162
|
-
...entry.optionalStoredCredentialKeys ? { optionalStoredCredentialKeys: [...entry.optionalStoredCredentialKeys].sort() } : {}
|
|
163
|
-
});
|
|
164
|
-
else if (entry.requiredOAuthScopes?.length) {
|
|
165
|
-
const merged = new Set([...existing.requiredOAuthScopes ?? [], ...entry.requiredOAuthScopes]);
|
|
166
|
-
deduped.set(key, {
|
|
167
|
-
...existing,
|
|
168
|
-
requiredOAuthScopes: [...merged].sort()
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return [...deduped.values()];
|
|
173
|
-
}
|
|
174
|
-
function collectCredentialRequirementEntries(credentialRequirements) {
|
|
175
|
-
if (!credentialRequirements) return [];
|
|
176
|
-
return deduplicateCredentialRequirementEntries(Object.values(credentialRequirements.byStep ?? {}).flat());
|
|
177
|
-
}
|
|
178
|
-
z.object({ subjectMode: z.enum(["never", "requiredWhenUserProvidedCredential"]) });
|
|
179
|
-
/** A step's entry within a WorkflowManifest. Describes how a step is used in a workflow, not what the step itself is. */
|
|
180
|
-
const WorkflowStepEntrySchema = z.object({
|
|
181
|
-
nodeId: z.string().min(1),
|
|
182
|
-
stepName: z.string().min(1),
|
|
183
|
-
label: z.string().min(1),
|
|
184
|
-
callKind: CallKindSchema,
|
|
185
|
-
stepId: z.string().min(1).optional(),
|
|
186
|
-
source: SourceLocationSchema.optional(),
|
|
187
|
-
astKind: z.string().min(1).optional(),
|
|
188
|
-
importSource: ImportSourceSchema.optional(),
|
|
189
|
-
outputBinding: z.string().min(1).optional(),
|
|
190
|
-
scopeOverride: IntegrationScopeSchema.optional(),
|
|
191
|
-
description: z.string().optional(),
|
|
192
|
-
sourceCode: z.string().optional(),
|
|
193
|
-
exportName: z.string().optional(),
|
|
194
|
-
inputSchema: JsonSchemaSchema.optional(),
|
|
195
|
-
outputSchema: JsonSchemaSchema.optional(),
|
|
196
|
-
credentialSets: z.array(ResolvedCredentialSetSchema).optional()
|
|
197
|
-
});
|
|
198
|
-
const TriggerTypeSchema = z.enum([
|
|
199
|
-
"webhook",
|
|
200
|
-
"cron",
|
|
201
|
-
"polling"
|
|
202
|
-
]);
|
|
203
|
-
/**
|
|
204
|
-
* Persisted on `deployment_triggers.trigger_source`. Mirrors the
|
|
205
|
-
* `webhookTrigger({ source: { type } })` discriminator so the server
|
|
206
|
-
* can index-filter app-source rows during provider-webhook fanout.
|
|
207
|
-
*/
|
|
208
|
-
const TriggerSourceSchema = z.enum(["custom", "app"]);
|
|
209
|
-
const WebhookMethodSchema = z.enum([
|
|
210
|
-
"GET",
|
|
211
|
-
"POST",
|
|
212
|
-
"PUT",
|
|
213
|
-
"PATCH"
|
|
214
|
-
]);
|
|
215
|
-
const TriggerCallbackBundleUploadSchema = z.object({
|
|
216
|
-
code: z.string(),
|
|
217
|
-
hash: z.string(),
|
|
218
|
-
size: z.number()
|
|
219
|
-
});
|
|
220
|
-
const TriggerCallbackExportsSchema = z.object({
|
|
221
|
-
verify: z.string().min(1).optional(),
|
|
222
|
-
filter: z.string().min(1).optional(),
|
|
223
|
-
idempotencyKey: z.string().min(1).optional(),
|
|
224
|
-
callback: z.string().min(1).optional()
|
|
225
|
-
});
|
|
226
|
-
const TransformCallbackExportsSchema = z.object({ transform: z.string().min(1).optional() });
|
|
227
|
-
const TriggerUploadDataSchema = z.object({
|
|
228
|
-
id: z.string(),
|
|
229
|
-
type: TriggerTypeSchema,
|
|
230
|
-
/**
|
|
231
|
-
* Source-of-truth discriminator for webhook triggers. `'custom'` means
|
|
232
|
-
* the trigger owns its own HTTP path; `'app'` means it is fanned out by
|
|
233
|
-
* a Keystroke-managed provider app. Undefined for non-webhook triggers.
|
|
234
|
-
*/
|
|
235
|
-
triggerSource: TriggerSourceSchema.optional(),
|
|
236
|
-
enabled: z.boolean(),
|
|
237
|
-
path: z.string().optional(),
|
|
238
|
-
method: WebhookMethodSchema.optional(),
|
|
239
|
-
schedule: z.string().optional(),
|
|
240
|
-
timezone: z.string().optional(),
|
|
241
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
242
|
-
requiredCredentials: TriggerCredentialRequirementsSchema.optional(),
|
|
243
|
-
storagePath: z.string().min(1).optional(),
|
|
244
|
-
callbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
245
|
-
callbackExports: TriggerCallbackExportsSchema.optional(),
|
|
246
|
-
transformCallbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
247
|
-
transformCallbackExports: TransformCallbackExportsSchema.optional()
|
|
248
|
-
});
|
|
249
|
-
//#endregion
|
|
250
|
-
export { TriggerCredentialRequirementsSchema as a, TriggerUploadDataSchema as c, collectCredentialRequirementEntries as d, deduplicateCredentialRequirementEntries as f, ResolvedCredentialSetSchema as i, WebhookMethodSchema as l, DeclaredCredentialRequirementSchema as n, TriggerSourceSchema as o, IntegrationScopeSchema as r, TriggerTypeSchema as s, CredentialRequirementsSchema as t, WorkflowStepEntrySchema as u };
|