@keystrokehq/cli 0.0.18 → 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/README.md +1 -1
- package/dist/{accept.handler-B7QzdKCh.mjs → accept.handler-CiqqUxKN.mjs} +1 -1
- package/dist/{admin-CYpulx_A.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-Co6Jy_N8.mjs → agents-DBebUEwk.mjs} +6 -6
- package/dist/{api-DsK8M-ZH.mjs → api-BjBpWWlm.mjs} +4 -5
- package/dist/{api-keys-BUCLzRv_.mjs → api-keys-BHAgmC4E.mjs} +5 -5
- package/dist/{auth-niNm-yNT.mjs → auth-D-PZAjdd.mjs} +6 -6
- package/dist/{auth.handler-BTH-Qb00.mjs → auth.handler-CxTDSO6O.mjs} +3 -3
- 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-CCxCqd02.mjs → build-tasks-C09SdfjC-DxKcmENc.mjs} +4 -4
- package/dist/{build-workflows-CV4tBo6S-DhFBlp6m.mjs → build-workflows-BZ_m97Pr-DwcnRlyh.mjs} +9 -10
- package/dist/{build.handler-BmlXPhed.mjs → build.handler-CTX80S1K.mjs} +4 -4
- package/dist/{chunk-CH6r78ws.mjs → chunk-DYxdGL9S.mjs} +2 -1
- package/dist/{clear.handler-BDlwBzX4.mjs → clear.handler-Bksm2HI4.mjs} +1 -1
- package/dist/{commander-BE37hxR3.mjs → commander-DQLrBSIW.mjs} +1 -1
- package/dist/{connect-C9NMD8Ky.mjs → connect-DV_EztVs.mjs} +2 -2
- package/dist/{connect.handler-C7kysvhz.mjs → connect.handler-DbuGt3Xb.mjs} +3 -3
- package/dist/{context-Bid-Rqj7.mjs → context-BUzxM3QI.mjs} +2 -2
- package/dist/{create.handler-Cp9CV6SN.mjs → create.handler-CQCRk-Na.mjs} +1 -1
- package/dist/{credentials-fMfKVlEn.mjs → credentials-m18a1_hw.mjs} +6 -6
- package/dist/{credentials-DUkVbhvj.mjs → credentials-xPtLFTjW.mjs} +2 -2
- package/dist/{current-deployment-workflow-DiwUcKoB.mjs → current-deployment-workflow-pyBoobIm.mjs} +4 -4
- package/dist/{current.handler-eCR4nClu.mjs → current.handler-BJGJgdGP.mjs} +1 -1
- package/dist/{default-urls-CTQqM1_A.mjs → default-urls-BoSm4s9C.mjs} +1 -1
- package/dist/{delete.handler-D4ElSAcr.mjs → delete.handler-DNoehdOH.mjs} +1 -1
- package/dist/{deploy-B7LRWcp6.mjs → deploy-3tHCBGky.mjs} +2 -2
- package/dist/{deploy-DyZh--f7.mjs → deploy-BKjcO_sm.mjs} +1 -1
- package/dist/{deploy-progress-DK87VKJ-.mjs → deploy-progress-CyolzjRB.mjs} +1 -1
- package/dist/{deploy.handler-DVnH-Niv.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-lIA2pRBX.mjs → diff.handler-DO2WzdGB.mjs} +3 -3
- package/dist/{dist-WFPTDQB3.mjs → dist-BGrWr5fp.mjs} +32 -37
- package/dist/{env.handler-BIzQLlmo.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-D7EiPjwl.mjs → import-module-y0glInUe-CfNsQNia.mjs} +48 -839
- package/dist/{init-jaqNLGmB.mjs → init-D9RIT2CY.mjs} +3 -3
- package/dist/{init.handler-DamvbPEw.mjs → init.handler-0TJY1YNy.mjs} +2 -2
- package/dist/{inspect.handler-_UcN7dxE.mjs → inspect.handler-BrYFfN4H.mjs} +3 -3
- package/dist/{integration-catalog-m8tj_XlD.mjs → integration-catalog-BrJsBkfx.mjs} +1 -1
- package/dist/integrations-vSyAQ6HA.mjs +185 -0
- package/dist/{invites-VntHNMYk.mjs → invites-BASM4PJr.mjs} +4 -4
- package/dist/{invites.list.handler-CPl4QHfc.mjs → invites.list.handler-c-aw6g5o.mjs} +1 -1
- package/dist/{invites.resend.handler-BAtb3AX4.mjs → invites.resend.handler-MnMEjP_Z.mjs} +1 -1
- package/dist/{invites.revoke.handler-qXOF1Vgx.mjs → invites.revoke.handler-CHX6Z8kj.mjs} +1 -1
- package/dist/keystroke.mjs +25 -24
- package/dist/{list-enrichment-DYvr3XDb.mjs → list-enrichment-DcplcioC.mjs} +1 -1
- package/dist/{list.handler-C_iBLBmS.mjs → list.handler-BBzB1_1l.mjs} +1 -1
- package/dist/{list.handler-pHnPFep8.mjs → list.handler-BsgCd1oF.mjs} +5 -5
- package/dist/{list.handler-BdRsjRlf.mjs → list.handler-CDtjm-6d.mjs} +1 -1
- package/dist/{list.handler-DUz1bJ4x.mjs → list.handler-DJNtXw7C.mjs} +1 -1
- package/dist/{list.handler-CEjKSezx.mjs → list.handler-DXwKdfIv.mjs} +2 -2
- package/dist/{list.handler-CJUFdmaU.mjs → list2.handler-BdE1k2kl.mjs} +3 -3
- package/dist/{listen-DLGZEQRL.mjs → listen-Ca9KdiB2.mjs} +2 -2
- package/dist/{listen.handler-kaAvYk-B.mjs → listen.handler-KWPN03S8.mjs} +2 -2
- package/dist/{logs-CcYqFKRU.mjs → logs-BEDf7hZ0.mjs} +3 -3
- package/dist/{logs.handler-lboRKNoE.mjs → logs.handler-mk1lcZbU.mjs} +2 -2
- package/dist/{members.add.handler-DBydP0SR.mjs → members.add.handler-CTvlxBZU.mjs} +1 -1
- package/dist/{members.invite.handler-D4-7fiYC.mjs → members.invite.handler-wFO0r7Pi.mjs} +1 -1
- package/dist/{members.list.handler-Z4cIbcNg.mjs → members.list.handler-PPdqs4nI.mjs} +1 -1
- package/dist/{members.remove.handler-J56D83O7.mjs → members.remove.handler-a5WI6zE4.mjs} +1 -1
- package/dist/{members.update.handler-B5rBv6dt.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-DGS91uc-.mjs → org-CzLw3neZ.mjs} +15 -15
- package/dist/{orgs.create.handler-B4naNUSN.mjs → orgs.create.handler-CcPpDweZ.mjs} +1 -1
- package/dist/{orgs.get.handler-Ci_JrT08.mjs → orgs.get.handler-BACPg7vR.mjs} +1 -1
- package/dist/{orgs.list.handler-CJ2byIEj.mjs → orgs.list.handler-DEF8OyvM.mjs} +1 -1
- package/dist/{paused.handler-BQSQvQhB.mjs → paused.handler-D4j8_Za4.mjs} +1 -1
- package/dist/{projects-D90_uEC2.mjs → projects-CJCKxG2u.mjs} +4 -4
- package/dist/{projects-fWvIJQ80.mjs → projects-s5ehKLil.mjs} +6 -4
- package/dist/{register.handler-CleQJhtQ.mjs → register.handler-CSvlOMF6.mjs} +18 -9
- package/dist/{requirements.handler-B51sxQSy.mjs → requirements.handler-Bk-sAE9C.mjs} +5 -5
- package/dist/{run-polling-CC6y2XXI.mjs → run-polling-DKclfet-.mjs} +3 -3
- package/dist/{run.handler-B31BpZJP.mjs → run.handler-x0B-CjNF.mjs} +4 -4
- package/dist/{runs-Bg_qDeQi.mjs → runs-DoMVOCNj.mjs} +2 -2
- package/dist/{schemas-B8c7Z5Iy.mjs → schemas-U2OzP9gP.mjs} +3 -2
- package/dist/{skills-sync.handler-DOxudKmV.mjs → skills-sync.handler-CYkCeuQn.mjs} +1 -1
- package/dist/{skills.command-JwKWpGvU.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-B0tNjKMg.mjs → src-BYQwp8Ig.mjs} +1 -1
- package/dist/{switch.handler-Cu81T2HY.mjs → switch.handler-CV4ZBXAu.mjs} +1 -1
- package/dist/{sync-CXNveL61.mjs → sync-KCVM02IY.mjs} +2 -2
- package/dist/{sync.handler-7g1yDt0H.mjs → sync.handler-Cuw89341.mjs} +6 -6
- package/dist/task-BSCN9cU4.mjs +945 -0
- package/dist/{task-target-build-BaMtXnN7.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 +6 -6
- package/dist/{test-A5hz3c7j.mjs → test-Rm3thni3.mjs} +2 -2
- package/dist/{test.handler-CJtaMZVy.mjs → test.handler-CTd-heRS.mjs} +8 -8
- package/dist/{test.handler-Cq2l7SAr.mjs → test.handler-DhhcsvHN.mjs} +1 -1
- package/dist/{tool.handler-B-mOL128.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-DhfpoyRV.mjs → upgrade-Cf7y38xR.mjs} +2 -2
- package/dist/{upload-BbcMkyVl.mjs → upload-CJWApEgz.mjs} +1 -1
- package/dist/{upload.handler-D3-W_1kq.mjs → upload.handler-BHIWYPph.mjs} +7 -7
- package/dist/{users.get.handler-Bd0OBI-E.mjs → users.get.handler-spWaHG8h.mjs} +1 -1
- package/dist/{users.list.handler-CacJz6eC.mjs → users.list.handler-DLuU7cd_.mjs} +1 -1
- package/dist/{users.set-role.handler-bZMQtUR0.mjs → users.set-role.handler-CojFmpcD.mjs} +1 -1
- package/dist/{utils-BMUWnz1P.mjs → utils-Ddltm1sR.mjs} +1 -1
- package/dist/{validate.handler-Ccq66ki4.mjs → validate.handler-DIJBuX1P.mjs} +4 -4
- package/dist/{workflow-build-_WNsLKwW.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-Dy2M9bEr.mjs → workflows-MANdvLft.mjs} +19 -21
- package/dist/{writer-B-SpZ0G2-tq1MFgid.mjs → writer-byNNUjRm-w5O7-VT_.mjs} +24 -33
- package/package.json +11 -11
- package/dist/common-AK0q0Oz0.mjs +0 -20
- package/dist/credential-requirements-DrrQ9x9P.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/integrations-DRL3JmC8.mjs +0 -85
- package/dist/task-BguWXIiH.mjs +0 -486
- package/dist/task-target-deploy-DmpCWE3u.mjs +0 -4
- package/dist/trigger-manifest-Bq2zRbkV.mjs +0 -29
- package/dist/workflow-build-manifest-B2GqHyWE.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/{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/{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,393 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/utils.js
|
|
4
|
-
function extractDateElements(date) {
|
|
5
|
-
return {
|
|
6
|
-
second: date.getSeconds(),
|
|
7
|
-
minute: date.getMinutes(),
|
|
8
|
-
hour: date.getHours(),
|
|
9
|
-
day: date.getDate(),
|
|
10
|
-
month: date.getMonth(),
|
|
11
|
-
weekday: date.getDay(),
|
|
12
|
-
year: date.getFullYear()
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function getDaysInMonth(year, month) {
|
|
16
|
-
return new Date(year, month + 1, 0).getDate();
|
|
17
|
-
}
|
|
18
|
-
function getDaysBetweenWeekdays(weekday1, weekday2) {
|
|
19
|
-
if (weekday1 <= weekday2) return weekday2 - weekday1;
|
|
20
|
-
return 6 - weekday1 + weekday2 + 1;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron.js
|
|
24
|
-
var Cron = class {
|
|
25
|
-
constructor({ seconds, minutes, hours, days, months, weekdays }) {
|
|
26
|
-
if (!seconds || seconds.size === 0) throw new Error("There must be at least one allowed second.");
|
|
27
|
-
if (!minutes || minutes.size === 0) throw new Error("There must be at least one allowed minute.");
|
|
28
|
-
if (!hours || hours.size === 0) throw new Error("There must be at least one allowed hour.");
|
|
29
|
-
if (!months || months.size === 0) throw new Error("There must be at least one allowed month.");
|
|
30
|
-
if ((!weekdays || weekdays.size === 0) && (!days || days.size === 0)) throw new Error("There must be at least one allowed day or weekday.");
|
|
31
|
-
this.seconds = Array.from(seconds).sort((a, b) => a - b);
|
|
32
|
-
this.minutes = Array.from(minutes).sort((a, b) => a - b);
|
|
33
|
-
this.hours = Array.from(hours).sort((a, b) => a - b);
|
|
34
|
-
this.days = Array.from(days).sort((a, b) => a - b);
|
|
35
|
-
this.months = Array.from(months).sort((a, b) => a - b);
|
|
36
|
-
this.weekdays = Array.from(weekdays).sort((a, b) => a - b);
|
|
37
|
-
const validateData = (name, data, constraint) => {
|
|
38
|
-
if (data.some((x) => typeof x !== "number" || x % 1 !== 0 || x < constraint.min || x > constraint.max)) throw new Error(`${name} must only consist of integers which are within the range of ${constraint.min} and ${constraint.max}`);
|
|
39
|
-
};
|
|
40
|
-
validateData("seconds", this.seconds, {
|
|
41
|
-
min: 0,
|
|
42
|
-
max: 59
|
|
43
|
-
});
|
|
44
|
-
validateData("minutes", this.minutes, {
|
|
45
|
-
min: 0,
|
|
46
|
-
max: 59
|
|
47
|
-
});
|
|
48
|
-
validateData("hours", this.hours, {
|
|
49
|
-
min: 0,
|
|
50
|
-
max: 23
|
|
51
|
-
});
|
|
52
|
-
validateData("days", this.days, {
|
|
53
|
-
min: 1,
|
|
54
|
-
max: 31
|
|
55
|
-
});
|
|
56
|
-
validateData("months", this.months, {
|
|
57
|
-
min: 0,
|
|
58
|
-
max: 11
|
|
59
|
-
});
|
|
60
|
-
validateData("weekdays", this.weekdays, {
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 6
|
|
63
|
-
});
|
|
64
|
-
this.reversed = {
|
|
65
|
-
seconds: this.seconds.map((x) => x).reverse(),
|
|
66
|
-
minutes: this.minutes.map((x) => x).reverse(),
|
|
67
|
-
hours: this.hours.map((x) => x).reverse(),
|
|
68
|
-
days: this.days.map((x) => x).reverse(),
|
|
69
|
-
months: this.months.map((x) => x).reverse(),
|
|
70
|
-
weekdays: this.weekdays.map((x) => x).reverse()
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Find the next or previous hour, starting from the given start hour that matches the hour constraint.
|
|
75
|
-
* startHour itself might also be allowed.
|
|
76
|
-
*/
|
|
77
|
-
findAllowedHour(dir, startHour) {
|
|
78
|
-
return dir === "next" ? this.hours.find((x) => x >= startHour) : this.reversed.hours.find((x) => x <= startHour);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Find the next or previous minute, starting from the given start minute that matches the minute constraint.
|
|
82
|
-
* startMinute itself might also be allowed.
|
|
83
|
-
*/
|
|
84
|
-
findAllowedMinute(dir, startMinute) {
|
|
85
|
-
return dir === "next" ? this.minutes.find((x) => x >= startMinute) : this.reversed.minutes.find((x) => x <= startMinute);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Find the next or previous second, starting from the given start second that matches the second constraint.
|
|
89
|
-
* startSecond itself IS NOT allowed.
|
|
90
|
-
*/
|
|
91
|
-
findAllowedSecond(dir, startSecond) {
|
|
92
|
-
return dir === "next" ? this.seconds.find((x) => x > startSecond) : this.reversed.seconds.find((x) => x < startSecond);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Find the next or previous time, starting from the given start time that matches the hour, minute
|
|
96
|
-
* and second constraints. startTime itself might also be allowed.
|
|
97
|
-
*/
|
|
98
|
-
findAllowedTime(dir, startTime) {
|
|
99
|
-
let hour = this.findAllowedHour(dir, startTime.hour);
|
|
100
|
-
if (hour !== void 0) if (hour === startTime.hour) {
|
|
101
|
-
let minute = this.findAllowedMinute(dir, startTime.minute);
|
|
102
|
-
if (minute !== void 0) if (minute === startTime.minute) {
|
|
103
|
-
const second = this.findAllowedSecond(dir, startTime.second);
|
|
104
|
-
if (second !== void 0) return {
|
|
105
|
-
hour,
|
|
106
|
-
minute,
|
|
107
|
-
second
|
|
108
|
-
};
|
|
109
|
-
minute = this.findAllowedMinute(dir, dir === "next" ? startTime.minute + 1 : startTime.minute - 1);
|
|
110
|
-
if (minute !== void 0) return {
|
|
111
|
-
hour,
|
|
112
|
-
minute,
|
|
113
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
114
|
-
};
|
|
115
|
-
} else return {
|
|
116
|
-
hour,
|
|
117
|
-
minute,
|
|
118
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
119
|
-
};
|
|
120
|
-
hour = this.findAllowedHour(dir, dir === "next" ? startTime.hour + 1 : startTime.hour - 1);
|
|
121
|
-
if (hour !== void 0) return {
|
|
122
|
-
hour,
|
|
123
|
-
minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
|
|
124
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
125
|
-
};
|
|
126
|
-
} else return {
|
|
127
|
-
hour,
|
|
128
|
-
minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
|
|
129
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Find the next or previous day in the given month, starting from the given startDay
|
|
134
|
-
* that matches either the day or the weekday constraint. startDay itself might also be allowed.
|
|
135
|
-
*/
|
|
136
|
-
findAllowedDayInMonth(dir, year, month, startDay) {
|
|
137
|
-
var _a, _b;
|
|
138
|
-
if (startDay < 1) throw new Error("startDay must not be smaller than 1.");
|
|
139
|
-
const daysInMonth = getDaysInMonth(year, month);
|
|
140
|
-
const daysRestricted = this.days.length !== 31;
|
|
141
|
-
const weekdaysRestricted = this.weekdays.length !== 7;
|
|
142
|
-
if (!daysRestricted && !weekdaysRestricted) {
|
|
143
|
-
if (startDay > daysInMonth) return dir === "next" ? void 0 : daysInMonth;
|
|
144
|
-
return startDay;
|
|
145
|
-
}
|
|
146
|
-
let allowedDayByDays;
|
|
147
|
-
if (daysRestricted) {
|
|
148
|
-
allowedDayByDays = dir === "next" ? this.days.find((x) => x >= startDay) : this.reversed.days.find((x) => x <= startDay);
|
|
149
|
-
if (allowedDayByDays !== void 0 && allowedDayByDays > daysInMonth) allowedDayByDays = void 0;
|
|
150
|
-
}
|
|
151
|
-
let allowedDayByWeekdays;
|
|
152
|
-
if (weekdaysRestricted) {
|
|
153
|
-
const startWeekday = new Date(year, month, startDay).getDay();
|
|
154
|
-
const nearestAllowedWeekday = dir === "next" ? (_a = this.weekdays.find((x) => x >= startWeekday)) !== null && _a !== void 0 ? _a : this.weekdays[0] : (_b = this.reversed.weekdays.find((x) => x <= startWeekday)) !== null && _b !== void 0 ? _b : this.reversed.weekdays[0];
|
|
155
|
-
if (nearestAllowedWeekday !== void 0) {
|
|
156
|
-
const daysBetweenWeekdays = dir === "next" ? getDaysBetweenWeekdays(startWeekday, nearestAllowedWeekday) : getDaysBetweenWeekdays(nearestAllowedWeekday, startWeekday);
|
|
157
|
-
allowedDayByWeekdays = dir === "next" ? startDay + daysBetweenWeekdays : startDay - daysBetweenWeekdays;
|
|
158
|
-
if (allowedDayByWeekdays > daysInMonth || allowedDayByWeekdays < 1) allowedDayByWeekdays = void 0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (allowedDayByDays !== void 0 && allowedDayByWeekdays !== void 0) return dir === "next" ? Math.min(allowedDayByDays, allowedDayByWeekdays) : Math.max(allowedDayByDays, allowedDayByWeekdays);
|
|
162
|
-
if (allowedDayByDays !== void 0) return allowedDayByDays;
|
|
163
|
-
if (allowedDayByWeekdays !== void 0) return allowedDayByWeekdays;
|
|
164
|
-
}
|
|
165
|
-
/** Gets the next date starting from the given start date or now. */
|
|
166
|
-
getNextDate(startDate = /* @__PURE__ */ new Date()) {
|
|
167
|
-
const startDateElements = extractDateElements(startDate);
|
|
168
|
-
let minYear = startDateElements.year;
|
|
169
|
-
let startIndexMonth = this.months.findIndex((x) => x >= startDateElements.month);
|
|
170
|
-
if (startIndexMonth === -1) {
|
|
171
|
-
startIndexMonth = 0;
|
|
172
|
-
minYear++;
|
|
173
|
-
}
|
|
174
|
-
const maxIterations = this.months.length * 5;
|
|
175
|
-
for (let i = 0; i < maxIterations; i++) {
|
|
176
|
-
const year = minYear + Math.floor((startIndexMonth + i) / this.months.length);
|
|
177
|
-
const month = this.months[(startIndexMonth + i) % this.months.length];
|
|
178
|
-
const isStartMonth = year === startDateElements.year && month === startDateElements.month;
|
|
179
|
-
let day = this.findAllowedDayInMonth("next", year, month, isStartMonth ? startDateElements.day : 1);
|
|
180
|
-
let isStartDay = isStartMonth && day === startDateElements.day;
|
|
181
|
-
if (day !== void 0 && isStartDay) {
|
|
182
|
-
const nextTime = this.findAllowedTime("next", startDateElements);
|
|
183
|
-
if (nextTime !== void 0) return new Date(year, month, day, nextTime.hour, nextTime.minute, nextTime.second);
|
|
184
|
-
day = this.findAllowedDayInMonth("next", year, month, day + 1);
|
|
185
|
-
isStartDay = false;
|
|
186
|
-
}
|
|
187
|
-
if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.hours[0], this.minutes[0], this.seconds[0]);
|
|
188
|
-
}
|
|
189
|
-
throw new Error("No valid next date was found.");
|
|
190
|
-
}
|
|
191
|
-
/** Gets the specified amount of future dates starting from the given start date or now. */
|
|
192
|
-
getNextDates(amount, startDate) {
|
|
193
|
-
const dates = [];
|
|
194
|
-
let nextDate;
|
|
195
|
-
for (let i = 0; i < amount; i++) {
|
|
196
|
-
nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
|
|
197
|
-
dates.push(nextDate);
|
|
198
|
-
}
|
|
199
|
-
return dates;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now.
|
|
203
|
-
* The iterator runs until the optional endDate is reached or forever.
|
|
204
|
-
*/
|
|
205
|
-
*getNextDatesIterator(startDate, endDate) {
|
|
206
|
-
let nextDate;
|
|
207
|
-
while (true) {
|
|
208
|
-
nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
|
|
209
|
-
if (endDate && endDate.getTime() < nextDate.getTime()) return;
|
|
210
|
-
yield nextDate;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/** Gets the previous date starting from the given start date or now. */
|
|
214
|
-
getPrevDate(startDate = /* @__PURE__ */ new Date()) {
|
|
215
|
-
const startDateElements = extractDateElements(startDate);
|
|
216
|
-
let maxYear = startDateElements.year;
|
|
217
|
-
let startIndexMonth = this.reversed.months.findIndex((x) => x <= startDateElements.month);
|
|
218
|
-
if (startIndexMonth === -1) {
|
|
219
|
-
startIndexMonth = 0;
|
|
220
|
-
maxYear--;
|
|
221
|
-
}
|
|
222
|
-
const maxIterations = this.reversed.months.length * 5;
|
|
223
|
-
for (let i = 0; i < maxIterations; i++) {
|
|
224
|
-
const year = maxYear - Math.floor((startIndexMonth + i) / this.reversed.months.length);
|
|
225
|
-
const month = this.reversed.months[(startIndexMonth + i) % this.reversed.months.length];
|
|
226
|
-
const isStartMonth = year === startDateElements.year && month === startDateElements.month;
|
|
227
|
-
let day = this.findAllowedDayInMonth("prev", year, month, isStartMonth ? startDateElements.day : getDaysInMonth(year, month));
|
|
228
|
-
let isStartDay = isStartMonth && day === startDateElements.day;
|
|
229
|
-
if (day !== void 0 && isStartDay) {
|
|
230
|
-
const prevTime = this.findAllowedTime("prev", startDateElements);
|
|
231
|
-
if (prevTime !== void 0) return new Date(year, month, day, prevTime.hour, prevTime.minute, prevTime.second);
|
|
232
|
-
if (day > 1) {
|
|
233
|
-
day = this.findAllowedDayInMonth("prev", year, month, day - 1);
|
|
234
|
-
isStartDay = false;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.reversed.hours[0], this.reversed.minutes[0], this.reversed.seconds[0]);
|
|
238
|
-
}
|
|
239
|
-
throw new Error("No valid previous date was found.");
|
|
240
|
-
}
|
|
241
|
-
/** Gets the specified amount of previous dates starting from the given start date or now. */
|
|
242
|
-
getPrevDates(amount, startDate) {
|
|
243
|
-
const dates = [];
|
|
244
|
-
let prevDate;
|
|
245
|
-
for (let i = 0; i < amount; i++) {
|
|
246
|
-
prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
|
|
247
|
-
dates.push(prevDate);
|
|
248
|
-
}
|
|
249
|
-
return dates;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now.
|
|
253
|
-
* The iterator runs until the optional endDate is reached or forever.
|
|
254
|
-
*/
|
|
255
|
-
*getPrevDatesIterator(startDate, endDate) {
|
|
256
|
-
let prevDate;
|
|
257
|
-
while (true) {
|
|
258
|
-
prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
|
|
259
|
-
if (endDate && endDate.getTime() > prevDate.getTime()) return;
|
|
260
|
-
yield prevDate;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
/** Returns true when there is a cron date at the given date. */
|
|
264
|
-
matchDate(date) {
|
|
265
|
-
const { second, minute, hour, day, month, weekday } = extractDateElements(date);
|
|
266
|
-
if (this.seconds.indexOf(second) === -1 || this.minutes.indexOf(minute) === -1 || this.hours.indexOf(hour) === -1 || this.months.indexOf(month) === -1) return false;
|
|
267
|
-
if (this.days.length !== 31 && this.weekdays.length !== 7) return this.days.indexOf(day) !== -1 || this.weekdays.indexOf(weekday) !== -1;
|
|
268
|
-
return this.days.indexOf(day) !== -1 && this.weekdays.indexOf(weekday) !== -1;
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron-parser.js
|
|
273
|
-
const secondConstraint = {
|
|
274
|
-
min: 0,
|
|
275
|
-
max: 59
|
|
276
|
-
};
|
|
277
|
-
const minuteConstraint = {
|
|
278
|
-
min: 0,
|
|
279
|
-
max: 59
|
|
280
|
-
};
|
|
281
|
-
const hourConstraint = {
|
|
282
|
-
min: 0,
|
|
283
|
-
max: 23
|
|
284
|
-
};
|
|
285
|
-
const dayConstraint = {
|
|
286
|
-
min: 1,
|
|
287
|
-
max: 31
|
|
288
|
-
};
|
|
289
|
-
const monthConstraint = {
|
|
290
|
-
min: 1,
|
|
291
|
-
max: 12,
|
|
292
|
-
aliases: {
|
|
293
|
-
jan: "1",
|
|
294
|
-
feb: "2",
|
|
295
|
-
mar: "3",
|
|
296
|
-
apr: "4",
|
|
297
|
-
may: "5",
|
|
298
|
-
jun: "6",
|
|
299
|
-
jul: "7",
|
|
300
|
-
aug: "8",
|
|
301
|
-
sep: "9",
|
|
302
|
-
oct: "10",
|
|
303
|
-
nov: "11",
|
|
304
|
-
dec: "12"
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
const weekdayConstraint = {
|
|
308
|
-
min: 0,
|
|
309
|
-
max: 7,
|
|
310
|
-
aliases: {
|
|
311
|
-
mon: "1",
|
|
312
|
-
tue: "2",
|
|
313
|
-
wed: "3",
|
|
314
|
-
thu: "4",
|
|
315
|
-
fri: "5",
|
|
316
|
-
sat: "6",
|
|
317
|
-
sun: "7"
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
const timeNicknames = {
|
|
321
|
-
"@yearly": "0 0 1 1 *",
|
|
322
|
-
"@annually": "0 0 1 1 *",
|
|
323
|
-
"@monthly": "0 0 1 * *",
|
|
324
|
-
"@weekly": "0 0 * * 0",
|
|
325
|
-
"@daily": "0 0 * * *",
|
|
326
|
-
"@hourly": "0 * * * *",
|
|
327
|
-
"@minutely": "* * * * *"
|
|
328
|
-
};
|
|
329
|
-
function parseElement(element, constraint) {
|
|
330
|
-
const result = /* @__PURE__ */ new Set();
|
|
331
|
-
if (element === "*") {
|
|
332
|
-
for (let i = constraint.min; i <= constraint.max; i = i + 1) result.add(i);
|
|
333
|
-
return result;
|
|
334
|
-
}
|
|
335
|
-
const listElements = element.split(",");
|
|
336
|
-
if (listElements.length > 1) {
|
|
337
|
-
for (const listElement of listElements) {
|
|
338
|
-
const parsedListElement = parseElement(listElement, constraint);
|
|
339
|
-
for (const x of parsedListElement) result.add(x);
|
|
340
|
-
}
|
|
341
|
-
return result;
|
|
342
|
-
}
|
|
343
|
-
const parseSingleElement = (singleElement) => {
|
|
344
|
-
var _a, _b;
|
|
345
|
-
singleElement = (_b = (_a = constraint.aliases) === null || _a === void 0 ? void 0 : _a[singleElement.toLowerCase()]) !== null && _b !== void 0 ? _b : singleElement;
|
|
346
|
-
const parsedElement = Number.parseInt(singleElement, 10);
|
|
347
|
-
if (Number.isNaN(parsedElement)) throw new Error(`Failed to parse ${element}: ${singleElement} is NaN.`);
|
|
348
|
-
if (parsedElement < constraint.min || parsedElement > constraint.max) throw new Error(`Failed to parse ${element}: ${singleElement} is outside of constraint range of ${constraint.min} - ${constraint.max}.`);
|
|
349
|
-
return parsedElement;
|
|
350
|
-
};
|
|
351
|
-
const rangeSegments = /^(([0-9a-zA-Z]+)-([0-9a-zA-Z]+)|\*)(\/([0-9]+))?$/.exec(element);
|
|
352
|
-
if (rangeSegments === null) {
|
|
353
|
-
result.add(parseSingleElement(element));
|
|
354
|
-
return result;
|
|
355
|
-
}
|
|
356
|
-
let parsedStart = rangeSegments[1] === "*" ? constraint.min : parseSingleElement(rangeSegments[2]);
|
|
357
|
-
const parsedEnd = rangeSegments[1] === "*" ? constraint.max : parseSingleElement(rangeSegments[3]);
|
|
358
|
-
if (constraint === weekdayConstraint && parsedStart === 7 && parsedEnd !== 7) parsedStart = 0;
|
|
359
|
-
if (parsedStart > parsedEnd) throw new Error(`Failed to parse ${element}: Invalid range (start: ${parsedStart}, end: ${parsedEnd}).`);
|
|
360
|
-
const step = rangeSegments[5];
|
|
361
|
-
let parsedStep = 1;
|
|
362
|
-
if (step !== void 0) {
|
|
363
|
-
parsedStep = Number.parseInt(step, 10);
|
|
364
|
-
if (Number.isNaN(parsedStep)) throw new Error(`Failed to parse step: ${step} is NaN.`);
|
|
365
|
-
if (parsedStep < 1) throw new Error(`Failed to parse step: Expected ${step} to be greater than 0.`);
|
|
366
|
-
}
|
|
367
|
-
for (let i = parsedStart; i <= parsedEnd; i = i + parsedStep) result.add(i);
|
|
368
|
-
return result;
|
|
369
|
-
}
|
|
370
|
-
/** Parses a cron expression into a Cron instance. */
|
|
371
|
-
function parseCronExpression(cronExpression) {
|
|
372
|
-
var _a;
|
|
373
|
-
if (typeof cronExpression !== "string") throw new TypeError("Invalid cron expression: must be of type string.");
|
|
374
|
-
cronExpression = (_a = timeNicknames[cronExpression.toLowerCase()]) !== null && _a !== void 0 ? _a : cronExpression;
|
|
375
|
-
const elements = cronExpression.split(" ").filter((elem) => elem.length > 0);
|
|
376
|
-
if (elements.length < 5 || elements.length > 6) throw new Error("Invalid cron expression: expected 5 or 6 elements.");
|
|
377
|
-
const rawSeconds = elements.length === 6 ? elements[0] : "0";
|
|
378
|
-
const rawMinutes = elements.length === 6 ? elements[1] : elements[0];
|
|
379
|
-
const rawHours = elements.length === 6 ? elements[2] : elements[1];
|
|
380
|
-
const rawDays = elements.length === 6 ? elements[3] : elements[2];
|
|
381
|
-
const rawMonths = elements.length === 6 ? elements[4] : elements[3];
|
|
382
|
-
const rawWeekdays = elements.length === 6 ? elements[5] : elements[4];
|
|
383
|
-
return new Cron({
|
|
384
|
-
seconds: parseElement(rawSeconds, secondConstraint),
|
|
385
|
-
minutes: parseElement(rawMinutes, minuteConstraint),
|
|
386
|
-
hours: parseElement(rawHours, hourConstraint),
|
|
387
|
-
days: parseElement(rawDays, dayConstraint),
|
|
388
|
-
months: new Set(Array.from(parseElement(rawMonths, monthConstraint)).map((x) => x - 1)),
|
|
389
|
-
weekdays: new Set(Array.from(parseElement(rawWeekdays, weekdayConstraint)).map((x) => x % 7))
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
//#endregion
|
|
393
|
-
export { parseCronExpression as t };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import "zod";
|
|
4
|
-
import { createHash } from "node:crypto";
|
|
5
|
-
//#region ../../packages/workflow-build-contracts/src/schema-fingerprint.ts
|
|
6
|
-
/**
|
|
7
|
-
* schema-fingerprint.ts
|
|
8
|
-
*
|
|
9
|
-
* Computes a deterministic fingerprint (hash) of a credential set's schema.
|
|
10
|
-
* Used as a persistence-layer identity stamp: the workflow-builder stamps each
|
|
11
|
-
* credential requirement with its fingerprint at build time, the server stamps
|
|
12
|
-
* each vault row with the fingerprint at upload time, and the executor's
|
|
13
|
-
* credential resolver compares the two at read time so schema drift surfaces
|
|
14
|
-
* as a `CredentialSchemaMismatchError` rather than a silent decode into a
|
|
15
|
-
* stale shape.
|
|
16
|
-
*
|
|
17
|
-
* The fingerprint is deterministic: identical JSON schemas always produce the
|
|
18
|
-
* same hash regardless of property ordering, timestamps, or other
|
|
19
|
-
* non-structural differences.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* This is the *persistence* fingerprint. The construction-time registry in
|
|
23
|
-
* `credential-set/registry.ts` uses a different (Zod-structural) fingerprint
|
|
24
|
-
* purely for in-process identity collision detection; the two fingerprints
|
|
25
|
-
* serve different purposes and do not need to match.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Compute a deterministic fingerprint for a JSON schema object.
|
|
29
|
-
*
|
|
30
|
-
* The schema is the output of `schemaToJsonSchema(zodSchema)` — a plain JSON
|
|
31
|
-
* object describing the shape of the Zod schema.
|
|
32
|
-
*
|
|
33
|
-
* Properties are sorted recursively before hashing to ensure deterministic
|
|
34
|
-
* output regardless of insertion order.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const auth = schemaToJsonSchema(credentialSet.auth);
|
|
39
|
-
* const stored = credentialSet.stored ? schemaToJsonSchema(credentialSet.stored) : undefined;
|
|
40
|
-
* const fingerprint = computeSchemaFingerprint(auth, stored);
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @see CredentialSchemaMismatchError
|
|
44
|
-
*/
|
|
45
|
-
function computeSchemaFingerprint(authSchema, storedSchema) {
|
|
46
|
-
const normalized = sortDeep({
|
|
47
|
-
auth: authSchema,
|
|
48
|
-
...storedSchema ? { stored: storedSchema } : {}
|
|
49
|
-
});
|
|
50
|
-
const json = JSON.stringify(normalized);
|
|
51
|
-
return createHash("sha256").update(json).digest("hex").substring(0, 16);
|
|
52
|
-
}
|
|
53
|
-
function sortDeep(value) {
|
|
54
|
-
if (value === null || value === void 0) return value;
|
|
55
|
-
if (Array.isArray(value)) return value.map(sortDeep);
|
|
56
|
-
if (typeof value === "object") {
|
|
57
|
-
const sorted = {};
|
|
58
|
-
for (const key of Object.keys(value).sort()) sorted[key] = sortDeep(value[key]);
|
|
59
|
-
return sorted;
|
|
60
|
-
}
|
|
61
|
-
return value;
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region ../../packages/workflow-build-contracts/src/declared-credential-requirements.ts
|
|
65
|
-
function readSchemaKeys(schema, propertyKey) {
|
|
66
|
-
if (schema === null || typeof schema !== "object") return [];
|
|
67
|
-
const candidate = schema[propertyKey];
|
|
68
|
-
if (candidate === null || typeof candidate !== "object" || Array.isArray(candidate)) return [];
|
|
69
|
-
return Object.keys(candidate).sort();
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Returns sorted keys that are NOT listed in the JSON Schema `required` array.
|
|
73
|
-
*/
|
|
74
|
-
function readOptionalJsonSchemaKeys(schema) {
|
|
75
|
-
if (schema === null || typeof schema !== "object") return [];
|
|
76
|
-
const record = schema;
|
|
77
|
-
const properties = record.properties;
|
|
78
|
-
if (properties === null || typeof properties !== "object" || Array.isArray(properties)) return [];
|
|
79
|
-
const requiredSet = new Set(Array.isArray(record.required) ? record.required : []);
|
|
80
|
-
return Object.keys(properties).filter((key) => !requiredSet.has(key)).sort();
|
|
81
|
-
}
|
|
82
|
-
function manifestToDeclaredCredentialRequirement(credentialSet) {
|
|
83
|
-
const authKeys = readSchemaKeys(credentialSet.auth, "properties");
|
|
84
|
-
const optionalAuthKeys = readOptionalJsonSchemaKeys(credentialSet.auth);
|
|
85
|
-
const storedSchema = credentialSet.auth;
|
|
86
|
-
const storedKeys = readSchemaKeys(storedSchema, "properties");
|
|
87
|
-
const optionalStoredKeys = readOptionalJsonSchemaKeys(storedSchema);
|
|
88
|
-
const schemaFingerprint = credentialSet.auth ? computeSchemaFingerprint(credentialSet.auth) : void 0;
|
|
89
|
-
const onCredentialRevoked = credentialSet.onCredentialRevoked;
|
|
90
|
-
return {
|
|
91
|
-
credentialSetId: credentialSet.id,
|
|
92
|
-
credentialKeys: authKeys,
|
|
93
|
-
...optionalAuthKeys.length > 0 ? { optionalCredentialKeys: optionalAuthKeys } : {},
|
|
94
|
-
storedCredentialKeys: storedKeys,
|
|
95
|
-
...optionalStoredKeys.length > 0 ? { optionalStoredCredentialKeys: optionalStoredKeys } : {},
|
|
96
|
-
...schemaFingerprint ? { schemaFingerprint } : {},
|
|
97
|
-
...onCredentialRevoked ? { onCredentialRevoked } : {},
|
|
98
|
-
...credentialSet.proxy ? { proxy: credentialSet.proxy } : {},
|
|
99
|
-
...credentialSet.needsRawSecret === true ? { needsRawSecret: true } : {}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { readOptionalJsonSchemaKeys as n, manifestToDeclaredCredentialRequirement as t };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BWcVRt-T.mjs";
|
|
4
|
-
import { t as createTypedCommand } from "./commander-BE37hxR3.mjs";
|
|
5
|
-
import { t as ConnectionKindValues } from "./api-DsK8M-ZH.mjs";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
//#region src/commands/integrations/integrations.command.ts
|
|
8
|
-
const IntegrationsListOptionsSchema = JsonOptionSchema.extend({
|
|
9
|
-
kind: z.enum(ConnectionKindValues).optional(),
|
|
10
|
-
search: z.string().optional(),
|
|
11
|
-
connected: z.boolean().optional(),
|
|
12
|
-
details: z.boolean().optional()
|
|
13
|
-
});
|
|
14
|
-
const INTEGRATIONS_LIST_OPTIONS_CONFIG = {
|
|
15
|
-
...JSON_OPTION_CONFIG,
|
|
16
|
-
kind: {
|
|
17
|
-
flag: "--kind <kind>",
|
|
18
|
-
description: `Filter by connection kind: ${ConnectionKindValues.join(" | ")}`
|
|
19
|
-
},
|
|
20
|
-
search: {
|
|
21
|
-
flag: "--search <query>",
|
|
22
|
-
description: "Case-insensitive substring match against publicId, name, and aliases"
|
|
23
|
-
},
|
|
24
|
-
connected: {
|
|
25
|
-
flag: "--connected",
|
|
26
|
-
description: "Only show integrations with at least one configured connection in the current org"
|
|
27
|
-
},
|
|
28
|
-
details: {
|
|
29
|
-
flag: "--details",
|
|
30
|
-
description: "Show connection names, IDs, scope, status, and default selection"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const IntegrationsRegisterOptionsSchema = JsonOptionSchema.extend({
|
|
34
|
-
integrationId: z.string().optional(),
|
|
35
|
-
clientApp: z.string().optional().describe("Internal credential set id holding clientId + clientSecret"),
|
|
36
|
-
displayName: z.string().optional().describe("Human-readable display name for the workspace integration")
|
|
37
|
-
});
|
|
38
|
-
const INTEGRATIONS_REGISTER_OPTIONS_CONFIG = {
|
|
39
|
-
...JSON_OPTION_CONFIG,
|
|
40
|
-
clientApp: {
|
|
41
|
-
flag: "--client-app <credentialSetId>",
|
|
42
|
-
description: "Internal credential set id holding clientId + clientSecret (required)"
|
|
43
|
-
},
|
|
44
|
-
displayName: {
|
|
45
|
-
flag: "--display-name <name>",
|
|
46
|
-
description: "Human-readable display name for the workspace integration"
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
function createIntegrationsCommand() {
|
|
50
|
-
return createTypedCommand({
|
|
51
|
-
name: "integrations",
|
|
52
|
-
description: "List Keystroke integrations available to your organization",
|
|
53
|
-
schema: IntegrationsListOptionsSchema,
|
|
54
|
-
optionsConfig: INTEGRATIONS_LIST_OPTIONS_CONFIG,
|
|
55
|
-
loadHandler: async () => (await import("./list.handler-CEjKSezx.mjs")).handleIntegrationsList,
|
|
56
|
-
subcommands: [createTypedCommand({
|
|
57
|
-
name: "list",
|
|
58
|
-
description: "List Keystroke integrations available to your organization",
|
|
59
|
-
schema: IntegrationsListOptionsSchema,
|
|
60
|
-
optionsConfig: INTEGRATIONS_LIST_OPTIONS_CONFIG,
|
|
61
|
-
loadHandler: async () => (await import("./list.handler-CEjKSezx.mjs")).handleIntegrationsList
|
|
62
|
-
}), createTypedCommand({
|
|
63
|
-
name: "register",
|
|
64
|
-
description: "Register a workspace provider app for future workspace-authored OAuth support",
|
|
65
|
-
schema: IntegrationsRegisterOptionsSchema,
|
|
66
|
-
optionsConfig: INTEGRATIONS_REGISTER_OPTIONS_CONFIG,
|
|
67
|
-
handler: async (opts, ctx) => {
|
|
68
|
-
const { handleIntegrationsRegister } = await import("./register.handler-CleQJhtQ.mjs");
|
|
69
|
-
await handleIntegrationsRegister({
|
|
70
|
-
integrationId: opts.integrationId,
|
|
71
|
-
clientAppCredentialSetId: opts.clientApp,
|
|
72
|
-
displayName: opts.displayName,
|
|
73
|
-
json: opts.json
|
|
74
|
-
}, ctx);
|
|
75
|
-
},
|
|
76
|
-
argument: {
|
|
77
|
-
name: "integrationId",
|
|
78
|
-
description: "Workspace integration id to register (e.g., acmeCrm)",
|
|
79
|
-
key: "integrationId"
|
|
80
|
-
}
|
|
81
|
-
})]
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { createIntegrationsCommand };
|