twenty 2.54.2 → 2.55.0
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/CONTRIBUTING.md +1 -0
- package/dist/app-template/example/files/AGENTS.md +1 -1
- package/dist/app-template/yarn.lock +99 -99
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/application-ChMyraCB.cjs +5 -0
- package/dist/chunks/{build-source-manifest-BJyDykpG.cjs → build-source-manifest-CS9qVNh-.cjs} +1 -1
- package/dist/chunks/build-source-snapshot-CpGCu13I.cjs +26 -0
- package/dist/chunks/check-node-requirement-CIDuA1s-.cjs +1 -0
- package/dist/chunks/{cli-version.constant-ByxyxCr8.cjs → cli-version.constant-Cu5tVcCH.cjs} +1 -1
- package/dist/chunks/{collect-translatable-strings-BWzloBoB.cjs → collect-translatable-strings-DCyYBNLJ.cjs} +1 -1
- package/dist/chunks/compile-application-translations-Bp686pj4.cjs +870 -0
- package/dist/chunks/{constants-Cbb71hpl-CrSqydxj.cjs → constants-BF6GWIop-98tUMN2U.cjs} +1 -1
- package/dist/chunks/{create-http-status-error-CSxveq4d.cjs → create-http-status-error-C0btwkS0.cjs} +1 -1
- package/dist/chunks/create-metadata-client-FcJiT9Hx.cjs +6 -0
- package/dist/chunks/{create-pull-base-write-BAapBdLz.cjs → create-pull-base-write-anQPBDx-.cjs} +1 -1
- package/dist/chunks/{create-rest-client-eb80-tts.cjs → create-rest-client-YAG6kSAm.cjs} +1 -1
- package/dist/chunks/extract-manifest-from-file-DA5fSI0W.cjs +1 -0
- package/dist/chunks/{extract-source-translations-BHy14v8o.cjs → extract-source-translations-DhYrd7jw.cjs} +1 -1
- package/dist/chunks/{fetch-metadata-inspection-IuAwjjQT.cjs → fetch-metadata-inspection-DzssW2Dw.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-BFxRufRI.cjs → fetch-signed-in-identity-CId23qtn.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-or-throw-CgPc8IBL.cjs → fetch-workspace-or-throw-BroNuadP.cjs} +1 -1
- package/dist/chunks/{format-data-value-Cln0Hv7L.cjs → format-data-value-pZjy4e4h.cjs} +1 -1
- package/dist/chunks/{format-metadata-fields-BltFjIsO.cjs → format-metadata-fields-Dh6CmU5G.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-DpOc_B3P.cjs → format-metadata-owner-CCxXpga0.cjs} +1 -1
- package/dist/chunks/{generate-application-client-CL8nm0q9.cjs → generate-application-client-pMdNJ3g0.cjs} +1 -1
- package/dist/chunks/{get-client-generation-skip-reason-BJFlVAos.cjs → get-client-generation-skip-reason-DruQtHYQ.cjs} +1 -1
- package/dist/chunks/get-engine-version-range-DZGIWoR6.cjs +1 -0
- package/dist/chunks/get-local-status-D52rgA2e.cjs +1 -0
- package/dist/chunks/{get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs → get-system-view-universal-identifier.util-BjGghzoH-Cg8Rg3uX.cjs} +1 -1
- package/dist/chunks/global-flags.constant-BU7HyPk3.cjs +1 -0
- package/dist/chunks/has-yarn-plug-and-play-BGlTmmrM.cjs +1 -0
- package/dist/chunks/{is-access-token-expiring-B3WtsewG.cjs → is-access-token-expiring-BcJiLtlE.cjs} +1 -1
- package/dist/chunks/{is-application-not-found-error-BC7jyU0p.cjs → is-application-not-found-error-C8ifQUn8.cjs} +1 -1
- package/dist/chunks/is-exported-manifest-mJcgLfg0.cjs +1 -0
- package/dist/chunks/is-valid-package-name-YNq-0I2a.cjs +1 -0
- package/dist/chunks/list-ancestor-directories-BtB2hNt6.cjs +1 -0
- package/dist/chunks/{locale-catalog-format-C_5EGBEn.cjs → locale-catalog-format-CFYxqgvL.cjs} +1 -1
- package/dist/chunks/ltr-BS5BTFWS.cjs +1 -0
- package/dist/chunks/max-satisfying-BNYDQrne.cjs +1 -0
- package/dist/chunks/metadata-Cu3_OTI1.cjs +1 -0
- package/dist/chunks/{metadata-page.constant-7kxmFenL.cjs → metadata-page.constant-qMNOJLjJ.cjs} +1 -1
- package/dist/chunks/{parse-app-export-CpZxFIlO.cjs → parse-app-export-DAfsN3RE.cjs} +1 -1
- package/dist/chunks/parse-graphql-response-C_4SPebO.cjs +1 -0
- package/dist/chunks/{parse-json-input-kEwLo8mG.cjs → parse-json-input-B87VP1pj.cjs} +1 -1
- package/dist/chunks/pull-minimum-sdk-version.constant-Dm7g3dNP.cjs +5 -0
- package/dist/chunks/{pull-source-CpAYRk5s.cjs → pull-source-DvVJhvaO.cjs} +1 -1
- package/dist/chunks/{read-app-identity-CJZThpUC.cjs → read-app-identity-DK9znGhT.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-D6YPuiA7.cjs → read-application-identifier-BXkar-mo.cjs} +1 -1
- package/dist/chunks/{read-application-identity-CWSIB1Jd.cjs → read-application-identity-D7fnqlw6.cjs} +1 -1
- package/dist/chunks/read-bounded-body-BHRu5J2Y.cjs +1 -0
- package/dist/chunks/{read-config-9Dv5cmvw.cjs → read-config-DWLaxc3C.cjs} +1 -1
- package/dist/chunks/{read-infer-deletion-option-DtCw0TsU.cjs → read-infer-deletion-option-BrShRRHT.cjs} +1 -1
- package/dist/chunks/read-json-object-B5Q55dbM.cjs +1 -0
- package/dist/chunks/read-local-container-C_kAPeoE.cjs +1 -0
- package/dist/chunks/read-snapshot-file-BPLzlSH_.cjs +1 -0
- package/dist/chunks/{read-source-identity-BQ_YGISo.cjs → read-source-identity-BXYVcnXR.cjs} +1 -1
- package/dist/chunks/{record-pull-base-BIlU7Fj1.cjs → record-pull-base-CkpPTblT.cjs} +1 -1
- package/dist/chunks/{record-typecheck-config-inputs-BGVirGsR.cjs → record-typecheck-config-inputs-DKn7fk11.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-BkL-WsAM.cjs → request-oauth-tokens-C59XNnQs.cjs} +1 -1
- package/dist/chunks/resolve-app-project-Cu1DLASA.cjs +1 -0
- package/dist/chunks/{resolve-command-target-C4r6LuWk.cjs → resolve-command-target-DXXwJ9aE.cjs} +1 -1
- package/dist/chunks/{resolve-metadata-object-C3sDavWu.cjs → resolve-metadata-object-xK90Ursp.cjs} +1 -1
- package/dist/chunks/resolve-project-typescript-Dozy60cc.cjs +1 -0
- package/dist/chunks/resolve-request-url-I1EOOumy.cjs +1 -0
- package/dist/chunks/resolve-source-sdk-CizL-ZLW.cjs +1 -0
- package/dist/chunks/{run-api-graphql-command-D-Pu9EdU.cjs → run-api-graphql-command-D_Gxp4_P.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-BuDANSQa.cjs → run-api-rest-command-Bm9KC7bB.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-C0b2LVQN.cjs → run-app-add-command-BcuwnGCB.cjs} +4 -4
- package/dist/chunks/{run-app-apply-command-BDimcFdx.cjs → run-app-apply-command-pqnuwLNJ.cjs} +1 -1
- package/dist/chunks/{run-app-build-command-LK-V8mco.cjs → run-app-build-command-DRslTZoC.cjs} +1 -1
- package/dist/chunks/{run-app-dev-command-BnSJIUgg.cjs → run-app-dev-command-9CKFKDBQ.cjs} +1 -1
- package/dist/chunks/{run-app-exec-command-BPlfFt9-.cjs → run-app-exec-command-Bu_SM816.cjs} +2 -2
- package/dist/chunks/{run-app-generate-client-command-7t5Hs10P.cjs → run-app-generate-client-command-BKfbtgIG.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-CCTOr_Nf.cjs → run-app-init-command-BDu78coZ.cjs} +1 -1
- package/dist/chunks/{run-app-install-command-DOzp9bOL.cjs → run-app-install-command-BNpFqYXx.cjs} +1 -1
- package/dist/chunks/run-app-logs-command-DzQj1tdd.cjs +9 -0
- package/dist/chunks/{run-app-operation-BkbulYeD.cjs → run-app-operation-Bj0hut-D.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-CqFauRLP.cjs → run-app-plan-command-CIFK-61b.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-C4LkGgHH.cjs → run-app-publish-command-CuLrcX3d.cjs} +1 -1
- package/dist/chunks/{run-app-pull-command-Bo00XMOR.cjs → run-app-pull-command-CKoe_QKd.cjs} +2 -2
- package/dist/chunks/{run-app-translations-extract-command-LUAa7jb9.cjs → run-app-translations-extract-command-riW4Ozc-.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-BdNa6fFY.cjs → run-app-typecheck-command-CPDDSwEm.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-BK-JAeo2.cjs → run-app-uninstall-command-DFOMGmKw.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-CN6Xqgpx.cjs → run-auth-login-command-DOILzUGB.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-Dw6CLfIY.cjs → run-auth-logout-command-DjUjq_ug.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-CXRrXjvh.cjs → run-auth-status-command-OAibzgLu.cjs} +1 -1
- package/dist/chunks/{run-cli-B6yyUJ--.cjs → run-cli-BjMuvO_y.cjs} +5 -5
- package/dist/chunks/{run-commands-command-Dz7piZQN.cjs → run-commands-command-BhPkYc2t.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-BD7i13MO.cjs → run-data-get-command-tV2bf5h6.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-tcCgbeZj.cjs → run-data-list-command-D16ADH_r.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-Y_jubJ67.cjs → run-doctor-command-CEFSxor5.cjs} +2 -2
- package/dist/chunks/run-local-logs-command-CkDxKsj7.cjs +1 -0
- package/dist/chunks/run-local-reset-command-pPzlL7jd.cjs +2 -0
- package/dist/chunks/run-local-start-command-B_vDDsVi.cjs +1 -0
- package/dist/chunks/run-local-status-command-CKh4246H.cjs +1 -0
- package/dist/chunks/run-local-stop-command-BWJbZxK2.cjs +1 -0
- package/dist/chunks/run-local-upgrade-command-CFDAkOsj.cjs +1 -0
- package/dist/chunks/{run-metadata-field-describe-command-BX5_s1m0.cjs → run-metadata-field-describe-command-D7q8KpLp.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-BVFDiJv2.cjs → run-metadata-field-list-command-yLteJu7m.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-CWYI0V42.cjs → run-metadata-object-describe-command-CHKnSf0E.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-Y3yebZrT.cjs → run-metadata-object-list-command-D8CLvav9.cjs} +1 -1
- package/dist/chunks/{run-open-command-BUEQSKSk.cjs → run-open-command-CyBcIK9P.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-BExGjyKO.cjs → run-remote-list-command-WKiOwCbu.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-D2thQnCU.cjs → run-remote-remove-command-DPKQXI17.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-DI0Adm5U.cjs → run-remote-rename-command-CwuCickV.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-CXnu5zDY.cjs → run-remote-use-command-BlB3SFV7.cjs} +1 -1
- package/dist/chunks/{run-version-command-iRMLBmH6.cjs → run-version-command-BuWJdr6h.cjs} +1 -1
- package/dist/chunks/satisfies-Jm-ashRt.cjs +1 -0
- package/dist/chunks/{select-target-CJ2FyoVQ.cjs → select-target-DiY6zT7M.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-CwXAgGif.cjs → sign-in-to-remote-again-DalF_h0k.cjs} +1 -1
- package/dist/chunks/{sign-in-with-browser-DdjoPq5d.cjs → sign-in-with-browser-B2nBTir7.cjs} +1 -1
- package/dist/chunks/{to-worker-output-diagnostics-Hj6aQiK9.cjs → to-worker-output-diagnostics-CUKNJ_L6.cjs} +1 -1
- package/dist/chunks/{typecheck-application-nkgv6qiA.cjs → typecheck-application-BcS7ldNI.cjs} +1 -1
- package/dist/chunks/{update-config-XYMqGokt.cjs → update-config-D63n0BNZ.cjs} +1 -1
- package/dist/chunks/{utils-RCpFyoX5-DF7Gq1IH.cjs → utils-BJdjZ6I2-DgqSVlwy.cjs} +2 -2
- package/dist/chunks/{valid-DnUN-PQ0.cjs → valid-BPaM0XRk.cjs} +1 -1
- package/dist/chunks/wait-for-local-environment-j4IZq_Nn.cjs +1 -0
- package/dist/chunks/{write-config-atomically-BxCEc8_P.cjs → write-config-atomically-CkC-GT16.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +63 -0
- package/package.json +2 -2
- package/dist/chunks/application-pYRHxplP.cjs +0 -5
- package/dist/chunks/build-source-snapshot-Ds_ZZGnl.cjs +0 -865
- package/dist/chunks/check-node-requirement-CnwHKQBp.cjs +0 -1
- package/dist/chunks/compile-application-translations-qdigcX2V.cjs +0 -1
- package/dist/chunks/create-metadata-client-CJRFQ20Z.cjs +0 -6
- package/dist/chunks/extract-manifest-from-file-CEK5X5YP.cjs +0 -1
- package/dist/chunks/global-flags.constant-BJ3B_dc8.cjs +0 -1
- package/dist/chunks/has-yarn-plug-and-play-X3ay5Xl0.cjs +0 -1
- package/dist/chunks/is-exported-manifest-D8cwSas4.cjs +0 -1
- package/dist/chunks/is-valid-package-name-CiTztEPu.cjs +0 -1
- package/dist/chunks/metadata-CY9y5wYc.cjs +0 -1
- package/dist/chunks/parse-graphql-response-Di8aFmnF.cjs +0 -1
- package/dist/chunks/pull-minimum-sdk-version.constant-JDRwzl32.cjs +0 -5
- package/dist/chunks/read-json-object-BlyNzzdk.cjs +0 -1
- package/dist/chunks/read-snapshot-file-Dgc3WCDM.cjs +0 -1
- package/dist/chunks/resolve-app-project-DP27LYGR.cjs +0 -1
- package/dist/chunks/resolve-project-typescript-BOAxXiKm.cjs +0 -1
- package/dist/chunks/resolve-request-url-BwELN2oQ.cjs +0 -1
- package/dist/chunks/resolve-source-sdk-CyvER2l1.cjs +0 -1
- package/dist/chunks/run-app-logs-command-CQDO_gce.cjs +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs");var t=e.t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),n=e.t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),r=e.t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=e.t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=e.t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};var c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.t={},f=0,p=`[a-zA-Z0-9-]`,m=[[`\\s`,1],[`\\d`,o],[p,a]],h=e=>{for(let[t,n]of m)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},g=(e,t,n)=>{let r=h(t),i=f++;s(e,i,t),d[e]=i,u[i]=t,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};g(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),g(`NUMERICIDENTIFIERLOOSE`,`\\d+`),g(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${p}*`),g(`MAINVERSION`,`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),g(`MAINVERSIONLOOSE`,`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),g(`PRERELEASEIDENTIFIER`,`(?:${u[d.NUMERICIDENTIFIER]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[d.NUMERICIDENTIFIERLOOSE]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASE`,`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),g(`PRERELEASELOOSE`,`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g(`BUILDIDENTIFIER`,`${p}+`),g(`BUILD`,`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),g(`FULLPLAIN`,`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),g(`FULL`,`^${u[d.FULLPLAIN]}$`),g(`LOOSEPLAIN`,`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),g(`LOOSE`,`^${u[d.LOOSEPLAIN]}$`),g(`GTLT`,`((?:<|>)?=?)`),g(`XRANGEIDENTIFIERLOOSE`,`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g(`XRANGEIDENTIFIER`,`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),g(`XRANGEPLAIN`,`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),g(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),g(`XRANGE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),g(`XRANGELOOSE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),g(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g(`COERCE`,`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),g(`COERCEFULL`,u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`),g(`COERCERTL`,u[d.COERCE],!0),g(`COERCERTLFULL`,u[d.COERCEFULL],!0),g(`LONETILDE`,`(?:~>?)`),g(`TILDETRIM`,`(\\s*)${u[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,g(`TILDE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),g(`TILDELOOSE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),g(`LONECARET`,`(?:\\^)`),g(`CARETTRIM`,`(\\s*)${u[d.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,g(`CARET`,`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),g(`CARETLOOSE`,`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),g(`COMPARATORLOOSE`,`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),g(`COMPARATOR`,`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),g(`COMPARATORTRIM`,`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,g(`HYPHENRANGE`,`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),g(`HYPHENRANGELOOSE`,`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),g(`STAR`,`(<|>)?=?\\s*\\*`),g(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),g(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=e.t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),s=e.t(((e,t)=>{var s=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=n(),{compareIdentifiers:p}=o();t.exports=class e{constructor(t,n){if(n=f(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);s(`SemVer`,t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?u[d.LOOSE]:u[d.FULL]);if(!r)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);r[4]?this.prerelease=r[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(s(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),p(this.major,t.major)||p(this.minor,t.minor)||p(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(s(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let e=this.build[n],r=t.build[n];if(s(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}inc(e,t,n){switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),p(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),c=e.t(((e,t)=>{var n=s();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),l=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)===0})),u=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)!==0})),d=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>0})),f=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>=0})),p=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<0})),m=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<=0})),h=e.t(((e,t)=>{var n=l(),r=u(),i=d(),a=f(),o=p(),s=m();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),g=e.t(((e,t)=>{var r=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return r}constructor(t,n){if(n=o(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===r?this.value=``:this.value=this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new f(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===r||e===r)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=o(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var o=n(),{safeRe:c,t:l}=a(),u=h(),d=i(),f=s(),p=_()})),_=e.t(((e,o)=>{var c=/\s+/g;o.exports=class e{constructor(t,n){if(n=u(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof d)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(c,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!S(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&C(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&b)|(this.options.loose&&x))+`:`+e,n=l.get(t);if(n)return n;let r=this.options.loose,i=r?m[h.HYPHENRANGELOOSE]:m[h.HYPHENRANGE];e=e.replace(i,F(this.options.includePrerelease)),f(`hyphen replace`,e),e=e.replace(m[h.COMPARATORTRIM],_),f(`comparator trim`,e),e=e.replace(m[h.TILDETRIM],v),f(`tilde trim`,e),e=e.replace(m[h.CARETTRIM],y),f(`caret trim`,e);let a=e.split(` `).map(e=>T(e,this.options)).join(` `).split(/\s+/).map(e=>P(e,this.options));r&&(a=a.filter(e=>(f(`loose invalid filter`,e,this.options),!!e.match(m[h.COMPARATORLOOSE])))),f(`range list`,a);let o=new Map,s=a.map(e=>new d(e,this.options));for(let e of s){if(S(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return l.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>w(e,n)&&t.set.some(t=>w(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new p(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}};var l=new(t()),u=n(),d=g(),f=i(),p=s(),{safeRe:m,t:h,comparatorTrimReplace:_,tildeTrimReplace:v,caretTrimReplace:y}=a(),{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:x}=r(),S=e=>e.value===`<0.0.0-0`,C=e=>e.value===``,w=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},T=(e,t)=>(f(`comp`,e,t),e=k(e,t),f(`caret`,e),e=D(e,t),f(`tildes`,e),e=j(e,t),f(`xrange`,e),e=N(e,t),f(`stars`,e),e),E=e=>!e||e.toLowerCase()===`x`||e===`*`,D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(` `),O=(e,t)=>{let n=t.loose?m[h.TILDELOOSE]:m[h.TILDE];return e.replace(n,(t,n,r,i,a)=>{f(`tilde`,e,t,n,r,i,a);let o;return E(n)?o=``:E(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:E(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(f(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,f(`tilde return`,o),o})},k=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(` `),A=(e,t)=>{f(`caret`,e,t);let n=t.loose?m[h.CARETLOOSE]:m[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{f(`caret`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(f(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(f(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),f(`caret return`,s),s})},j=(e,t)=>(f(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>M(e,t)).join(` `)),M=(e,t)=>{e=e.trim();let n=t.loose?m[h.XRANGELOOSE]:m[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{f(`xRange`,e,n,r,i,a,o,s);let c=E(i),l=c||E(a),u=l||E(o),d=u;return r===`=`&&d&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&d?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),f(`xRange return`,n),n})},N=(e,t)=>(f(`replaceStars`,e,t),e.trim().replace(m[h.STAR],``)),P=(e,t)=>(f(`replaceGTE0`,e,t),e.trim().replace(m[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),F=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=E(r)?``:E(i)?`>=${r}.0.0${e?`-0`:``}`:E(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=E(l)?``:E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),I=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(f(e[n].semver),e[n].semver!==d.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),v=e.t(((e,t)=>{var n=_();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),y=e.t(((e,t)=>{var n=s(),r=g(),{ANY:i}=r,a=_(),o=v(),c=d(),l=p(),u=m(),h=f();t.exports=(e,t,s,d)=>{e=new n(e,d),t=new a(t,d);let f,p,m,g,_;switch(s){case`>`:f=c,p=u,m=l,g=`>`,_=`>=`;break;case`<`:f=l,p=h,m=c,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,f(e.semver,o.semver,d)?o=e:m(e.semver,s.semver,d)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&p(e,s.semver)||s.operator===_&&m(e,s.semver))return!1}return!0}})),b=e.t(((e,t)=>{var n=y();t.exports=(e,t,r)=>n(e,t,`<`,r)})),x=e.t(((e,t)=>{var n=_();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}}));Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return r}});
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs");var t=e.t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),n=e.t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),r=e.t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=e.t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=e.t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};var c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.t={},f=0,p=`[a-zA-Z0-9-]`,m=[[`\\s`,1],[`\\d`,o],[p,a]],h=e=>{for(let[t,n]of m)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},g=(e,t,n)=>{let r=h(t),i=f++;s(e,i,t),d[e]=i,u[i]=t,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};g(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),g(`NUMERICIDENTIFIERLOOSE`,`\\d+`),g(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${p}*`),g(`MAINVERSION`,`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),g(`MAINVERSIONLOOSE`,`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),g(`PRERELEASEIDENTIFIER`,`(?:${u[d.NUMERICIDENTIFIER]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[d.NUMERICIDENTIFIERLOOSE]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASE`,`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),g(`PRERELEASELOOSE`,`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g(`BUILDIDENTIFIER`,`${p}+`),g(`BUILD`,`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),g(`FULLPLAIN`,`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),g(`FULL`,`^${u[d.FULLPLAIN]}$`),g(`LOOSEPLAIN`,`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),g(`LOOSE`,`^${u[d.LOOSEPLAIN]}$`),g(`GTLT`,`((?:<|>)?=?)`),g(`XRANGEIDENTIFIERLOOSE`,`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g(`XRANGEIDENTIFIER`,`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),g(`XRANGEPLAIN`,`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),g(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),g(`XRANGE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),g(`XRANGELOOSE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),g(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g(`COERCE`,`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),g(`COERCEFULL`,u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`),g(`COERCERTL`,u[d.COERCE],!0),g(`COERCERTLFULL`,u[d.COERCEFULL],!0),g(`LONETILDE`,`(?:~>?)`),g(`TILDETRIM`,`(\\s*)${u[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,g(`TILDE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),g(`TILDELOOSE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),g(`LONECARET`,`(?:\\^)`),g(`CARETTRIM`,`(\\s*)${u[d.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,g(`CARET`,`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),g(`CARETLOOSE`,`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),g(`COMPARATORLOOSE`,`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),g(`COMPARATOR`,`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),g(`COMPARATORTRIM`,`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,g(`HYPHENRANGE`,`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),g(`HYPHENRANGELOOSE`,`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),g(`STAR`,`(<|>)?=?\\s*\\*`),g(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),g(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=e.t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),s=e.t(((e,t)=>{var s=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=n(),{compareIdentifiers:p}=o();t.exports=class e{constructor(t,n){if(n=f(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);s(`SemVer`,t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?u[d.LOOSE]:u[d.FULL]);if(!r)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);r[4]?this.prerelease=r[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(s(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),p(this.major,t.major)||p(this.minor,t.minor)||p(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(s(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let e=this.build[n],r=t.build[n];if(s(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}inc(e,t,n){switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),p(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),c=e.t(((e,t)=>{var n=s();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),l=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)===0})),u=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)!==0})),d=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>0})),f=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>=0})),p=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<0})),m=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<=0})),h=e.t(((e,t)=>{var n=l(),r=u(),i=d(),a=f(),o=p(),s=m();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),g=e.t(((e,t)=>{var r=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return r}constructor(t,n){if(n=o(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===r?this.value=``:this.value=this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new f(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===r||e===r)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=o(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var o=n(),{safeRe:c,t:l}=a(),u=h(),d=i(),f=s(),p=_()})),_=e.t(((e,o)=>{var c=/\s+/g;o.exports=class e{constructor(t,n){if(n=u(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof d)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(c,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!S(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&C(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&b)|(this.options.loose&&x))+`:`+e,n=l.get(t);if(n)return n;let r=this.options.loose,i=r?m[h.HYPHENRANGELOOSE]:m[h.HYPHENRANGE];e=e.replace(i,F(this.options.includePrerelease)),f(`hyphen replace`,e),e=e.replace(m[h.COMPARATORTRIM],_),f(`comparator trim`,e),e=e.replace(m[h.TILDETRIM],v),f(`tilde trim`,e),e=e.replace(m[h.CARETTRIM],y),f(`caret trim`,e);let a=e.split(` `).map(e=>T(e,this.options)).join(` `).split(/\s+/).map(e=>P(e,this.options));r&&(a=a.filter(e=>(f(`loose invalid filter`,e,this.options),!!e.match(m[h.COMPARATORLOOSE])))),f(`range list`,a);let o=new Map,s=a.map(e=>new d(e,this.options));for(let e of s){if(S(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return l.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>w(e,n)&&t.set.some(t=>w(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new p(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}};var l=new(t()),u=n(),d=g(),f=i(),p=s(),{safeRe:m,t:h,comparatorTrimReplace:_,tildeTrimReplace:v,caretTrimReplace:y}=a(),{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:x}=r(),S=e=>e.value===`<0.0.0-0`,C=e=>e.value===``,w=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},T=(e,t)=>(f(`comp`,e,t),e=k(e,t),f(`caret`,e),e=D(e,t),f(`tildes`,e),e=j(e,t),f(`xrange`,e),e=N(e,t),f(`stars`,e),e),E=e=>!e||e.toLowerCase()===`x`||e===`*`,D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(` `),O=(e,t)=>{let n=t.loose?m[h.TILDELOOSE]:m[h.TILDE];return e.replace(n,(t,n,r,i,a)=>{f(`tilde`,e,t,n,r,i,a);let o;return E(n)?o=``:E(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:E(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(f(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,f(`tilde return`,o),o})},k=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(` `),A=(e,t)=>{f(`caret`,e,t);let n=t.loose?m[h.CARETLOOSE]:m[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{f(`caret`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(f(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(f(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),f(`caret return`,s),s})},j=(e,t)=>(f(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>M(e,t)).join(` `)),M=(e,t)=>{e=e.trim();let n=t.loose?m[h.XRANGELOOSE]:m[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{f(`xRange`,e,n,r,i,a,o,s);let c=E(i),l=c||E(a),u=l||E(o),d=u;return r===`=`&&d&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&d?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),f(`xRange return`,n),n})},N=(e,t)=>(f(`replaceStars`,e,t),e.trim().replace(m[h.STAR],``)),P=(e,t)=>(f(`replaceGTE0`,e,t),e.trim().replace(m[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),F=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=E(r)?``:E(i)?`>=${r}.0.0${e?`-0`:``}`:E(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=E(l)?``:E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),I=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(f(e[n].semver),e[n].semver!==d.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),v=e.t(((e,t)=>{var n=_();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}}));Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return l}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./valid-BPaM0XRk.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-BF6GWIop-98tUMN2U.cjs"),a=require("./list-ancestor-directories-BtB2hNt6.cjs"),o=require("./cli-error-CrUD8uMp.cjs"),s=require("./get-engine-version-range-DZGIWoR6.cjs"),c=require("./read-bounded-body-BHRu5J2Y.cjs"),l=require("./max-satisfying-BNYDQrne.cjs"),u=require("./read-local-container-C_kAPeoE.cjs"),d=require("./get-local-status-D52rgA2e.cjs");let f=require("node:timers/promises");var p=async({environment:e,image:t,port:n,containerPort:r=n,environmentVariables:i=e.environmentVariables,shouldStart:a=!0,signal:o})=>{let s=[`NODE_PORT=${r}`,...i];return i.some(e=>e.startsWith(`SERVER_URL=`))||s.push(`SERVER_URL=http://localhost:${n}`),u.s({args:[...a?[`run`,`--detach`]:[`create`],`--name`,e.name,`--publish`,`127.0.0.1:${n}:${r}`,...s.flatMap(e=>[`--env`,e]),...Object.entries(e.volumes).flatMap(([e,t])=>[`--volume`,`${t}:${e}`]),t],signal:o})},m=e.r(l.n()),h=t.t(),g=async({imageId:e,signal:t})=>{let n=JSON.parse(await u.s({args:[`image`,`inspect`,`--format`,`{{json .Config.Env}}`,e],signal:t}));if(!(0,h.isArray)(n)||!n.every(h.isString))throw new o.t({code:`INVALID_RESPONSE`,message:`Docker returned invalid image environment variables.`});return n},_=async({imageId:e,signal:t})=>{let n=(0,m.default)((await g({imageId:e,signal:t})).find(e=>e.startsWith(`APP_VERSION=`))?.slice(12));if(!r.t(n))throw new o.t({code:`INVALID_RESPONSE`,message:`Cannot determine the Twenty version of image ${e}.`,hint:`Upgrade requires images with a valid APP_VERSION to prevent database downgrades. The existing instance is unchanged.`});return n},v=e.r(n.t()),y=e.r(l.t()),b=()=>a.t(process.cwd()).map(s.t).find(r.t),x=e=>{let t=(0,m.default)(e)??(/^\d+\.\d+$/.test(e)?e:void 0),n=r.t(t)?`v${t}`:e;if(!/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$/.test(n))throw new o.t({code:`INVALID_INPUT`,message:`Use a server version such as 2.53.1 or a valid image tag such as latest.`});return`${u.i}:${n}`},S=async({version:e,signal:t})=>{if(r.t(e))return x(e);let n=b();if(!r.t(n))return x(`latest`);if(!(0,v.default)(n))throw new o.t({code:`INVALID_INPUT`,message:`The app engines.twenty range is invalid.`,hint:`Fix engines.twenty or pass a version explicitly.`});let a=[],s=AbortSignal.any([t,AbortSignal.timeout(15e3)]);try{for(let e=1;e<=20;e++){let t=await c.n(`https://hub.docker.com/v2/repositories/${u.i}/tags?page_size=100&page=${e}`,{signal:s});if(!t.ok)throw await t.body?.cancel(),Error(`Image registry request failed (HTTP ${t.status})`);let o=JSON.parse(Buffer.from(await c.t(t,2*1024*1024)).toString());if(!i.a(o)||!(0,h.isArray)(o.results))throw Error(`Invalid image registry response`);for(let e of o.results)i.a(e)&&(0,h.isString)(e.name)&&(0,m.default)(e.name)&&a.push(e.name);if(!r.t(o.next)){let e=(0,y.default)(a,n);if(r.t(e))return x(e);throw Error(`No published image matches engines.twenty`)}}throw Error(`Image registry listing exceeded 2000 tags`)}catch(e){throw t.throwIfAborted(),new o.t({code:`LOCAL_ENVIRONMENT_FAILED`,message:`Could not select a published Twenty image matching ${n}: ${e instanceof Error?e.message:String(e)}`,hint:`Check the range and your connection, or pass a version explicitly.`,cause:e})}},C=async({port:e,signal:t})=>{let n=Date.now()+3e5;for(;Date.now()<n;){if(await d.n({port:e,signal:t}))return;await(0,f.setTimeout)(1e3,void 0,{signal:t})}throw new o.t({code:`TIMEOUT`,message:`The local environment did not become healthy within five minutes.`,hint:`The container was left in place. Run twenty local logs (add --test for the test instance).`})},w=async({environment:e,signal:t})=>{await C({port:e.port,signal:t});let n=await d.t({environment:e,container:await u.n({environment:e,signal:t}),signal:t});if(n.status!==`healthy`)throw new o.t({code:`LOCAL_ENVIRONMENT_FAILED`,message:`The local environment stopped responding during startup.`,hint:`Check twenty local logs (add --test for the test instance). Data volumes are preserved.`});return n};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return w}});
|
package/dist/chunks/{write-config-atomically-BxCEc8_P.cjs → write-config-atomically-CkC-GT16.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-
|
|
1
|
+
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-BF6GWIop-98tUMN2U.cjs"),r=require("./has-error-code-DsJeqbZq.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./request-timeout-milliseconds.constant-BkZTOtpY.cjs"),o=require("./config-file-mode.constant-DLBzKKUl.cjs");let s=require("node:crypto"),c=require("node:fs/promises"),l=require("node:path"),u=require("node:timers/promises");var d=e.t(),f={TIMEOUT_MILLISECONDS:2*a.t+5e3,RETRY_MILLISECONDS:50},p=async e=>{try{let t=JSON.parse(await(0,c.readFile)(e,`utf8`));return n.a(t)&&(0,d.isNumber)(t.pid)&&(0,d.isString)(t.token)?{pid:t.pid,token:t.token}:void 0}catch{return}},m=e=>{try{return process.kill(e,0),!0}catch(e){return r.t(e,`EPERM`)}},h=async e=>{let n=await p(e),r=t.t(n)&&!m(n.pid),a=t.t(n)?` (pid ${n.pid})`:``;return new i.t({code:`CONFIG_LOCKED`,message:r?`A twenty command (pid ${n.pid}) stopped without releasing ${e}.`:`Another twenty command${a} is changing ${(0,l.dirname)(e)}.`,hint:r?`Delete ${e} and try again.`:`Try again when it finishes. If no twenty command is running, delete ${e}.`,details:{lockPath:e,ownerPid:n?.pid??null}})},g=async(e,t)=>{try{let n=await(0,c.open)(e,`wx`,o.t.PRIVATE_FILE);return await n.writeFile(JSON.stringify({pid:process.pid,token:t})),await n.close(),!0}catch(e){if(r.t(e,`EEXIST`))return!1;throw e}},_=async({lockPath:e,token:n,signal:r})=>{let i=Date.now()+f.TIMEOUT_MILLISECONDS,a=await g(e,n);for(;!a;){r.throwIfAborted();let o=await p(e);if(t.t(o)&&!m(o.pid)||Date.now()>i)throw await h(e);await(0,u.setTimeout)(f.RETRY_MILLISECONDS,void 0,{signal:r}),a=await g(e,n)}},v=async(e,t)=>{(await p(e))?.token===t&&await(0,c.rm)(e,{force:!0})},y=async({configPath:e,signal:t,operation:n})=>{let r=`${e}.lock`,i=(0,s.randomUUID)();await(0,c.mkdir)((0,l.dirname)(e),{recursive:!0,mode:o.t.PRIVATE_DIRECTORY}),await _({lockPath:r,token:i,signal:t});try{return await n()}finally{await v(r,i)}},b=async(e,t)=>{let n=`${e}.${process.pid}.${(0,s.randomUUID)()}.tmp`,r=await(0,c.open)(n,`wx`,o.t.PRIVATE_FILE);try{await r.writeFile(`${JSON.stringify(t,null,2)}\n`),await r.sync(),await r.close(),await(0,c.rename)(n,e)}catch(e){throw await r.close().catch(()=>void 0),await(0,c.rm)(n,{force:!0}),e}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const e=require("./chunks/check-node-requirement-
|
|
2
|
+
const e=require("./chunks/check-node-requirement-CIDuA1s-.cjs"),t=require("./chunks/cli-node-version-range.constant-D3XrqV07.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-BjMuvO_y.cjs"))});
|
package/docs/commands.md
CHANGED
|
@@ -11,6 +11,7 @@ failure recovery. See the [README](../README.md) to build and start the CLI.
|
|
|
11
11
|
- [Open](#open-the-workspace)
|
|
12
12
|
- [Metadata](#inspect-the-data-model)
|
|
13
13
|
- [Records](#read-records)
|
|
14
|
+
- [Local development environment](#run-a-local-development-environment)
|
|
14
15
|
- [App init](#create-an-app) and [add](#add-definitions-to-an-app)
|
|
15
16
|
- [Build and typecheck](#build-and-check-an-app)
|
|
16
17
|
- [Plan](#preview-app-changes), [apply](#apply-an-app) and [dev](#develop-an-app)
|
|
@@ -19,6 +20,68 @@ failure recovery. See the [README](../README.md) to build and start the CLI.
|
|
|
19
20
|
- [Expired browser sessions](#expired-browser-sessions)
|
|
20
21
|
- [Output and exit codes](#output)
|
|
21
22
|
|
|
23
|
+
## Run a local development environment
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
twenty local start
|
|
27
|
+
twenty local status
|
|
28
|
+
twenty auth login --url http://localhost:2020 --name local
|
|
29
|
+
twenty local logs --no-follow
|
|
30
|
+
twenty local stop
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`local` runs the full Twenty development environment, including the web UI,
|
|
34
|
+
API, worker and databases. Docker must be installed and running with a local
|
|
35
|
+
socket context; remote Docker endpoints are rejected. These commands need
|
|
36
|
+
neither an app directory nor a saved workspace connection. They do not sign in,
|
|
37
|
+
change remotes or apply an app.
|
|
38
|
+
|
|
39
|
+
`start [version]` creates an instance or starts the existing one, and waits up
|
|
40
|
+
to five minutes for `/healthz`. For a new instance, version selection is:
|
|
41
|
+
explicit version or image tag, the highest published version matching the nearest
|
|
42
|
+
`package.json`'s `engines.twenty`, then `latest` when no range exists. A failed
|
|
43
|
+
lookup or unmatched range is an error, never a fallback to another version.
|
|
44
|
+
Versions such as `2.53` and `2.53.1` select `v2.53` and `v2.53.1`, respectively;
|
|
45
|
+
`2.53` keeps the floating minor tag. Other image tags are used as given.
|
|
46
|
+
New instances pull the selected image before creation, including when the tag
|
|
47
|
+
is cached locally. Existing instances keep their image and port; use `upgrade` to change versions.
|
|
48
|
+
Compatibility with `engines.twenty` uses the existing image's `APP_VERSION`.
|
|
49
|
+
A missing, invalid or incompatible version warns without preventing startup.
|
|
50
|
+
A readiness failure leaves the container and data in place for diagnosis.
|
|
51
|
+
|
|
52
|
+
New instances bind to loopback on port `2020`. Use `--port <port>` when creating
|
|
53
|
+
one. `--test` selects the separate test instance, default port `2021`; pass it
|
|
54
|
+
to every command intended for that instance. Data and file storage use separate
|
|
55
|
+
named volumes for each instance. Existing SDK development containers and their
|
|
56
|
+
volumes are reused.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
twenty local start 2.53.1 --test
|
|
60
|
+
twenty local logs --test --lines 100 --no-follow
|
|
61
|
+
twenty local upgrade 2.53.1 --test
|
|
62
|
+
twenty local reset --test --yes
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`status` reports `not-created`, `stopped`, `starting` or `healthy`; unavailable
|
|
66
|
+
Docker is an error. `logs` follows by default; `--no-follow` prints recent logs
|
|
67
|
+
and exits. It supports human or NDJSON output, with a terminal result or error;
|
|
68
|
+
other local commands support human or JSON output. Ctrl+C cancels the CLI
|
|
69
|
+
operation, without stopping the environment or deleting data.
|
|
70
|
+
|
|
71
|
+
`stop` preserves the container and all data. `upgrade [version]` uses the same
|
|
72
|
+
version selection as a new start. It pulls the image before stopping the old
|
|
73
|
+
instance, then recreates it with the same ports, named volumes and user-provided
|
|
74
|
+
environment overrides. The old container is kept until the replacement is created.
|
|
75
|
+
If creation fails or is cancelled, the CLI restores the old container and its
|
|
76
|
+
previous running state. If the image digest is unchanged, no restart occurs.
|
|
77
|
+
Custom storage layouts are rejected. Data volumes survive a failed upgrade,
|
|
78
|
+
but database migrations are not automatically rolled back.
|
|
79
|
+
|
|
80
|
+
`reset` removes the selected container and its database, analytics and file
|
|
81
|
+
volumes. It requires confirmation, or `--yes` in scripts. It does not affect
|
|
82
|
+
other containers or saved remote credentials. Run `start` afterward for a fresh
|
|
83
|
+
instance. This development environment is not a production deployment tool.
|
|
84
|
+
|
|
22
85
|
## Connections and authentication
|
|
23
86
|
|
|
24
87
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.55.0",
|
|
4
4
|
"description": "The Twenty command line.",
|
|
5
5
|
"homepage": "https://twenty.com",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"npm-pick-manifest": "^11.0.1",
|
|
35
35
|
"semver": "7.6.3",
|
|
36
36
|
"string-width": "^8.2.0",
|
|
37
|
-
"twenty-client-sdk": "2.
|
|
37
|
+
"twenty-client-sdk": "2.55.0",
|
|
38
38
|
"twenty-shared": "0.0.0",
|
|
39
39
|
"undici": "^7.30.1",
|
|
40
40
|
"uuid": "^13.0.2",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const e=require("./build--4zYt4wd.cjs"),t=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Cbb71hpl-CrSqydxj.cjs"),i=require("./get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs");var a={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},o;o||={};function s(e){if(!i.p(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}function c(e){return e instanceof Boolean||typeof e==`boolean`}function l(e){return e instanceof String||typeof e==`string`}function u(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&!Array.isArray(e)}function d(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function f(e,...t){if(!d(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function p(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function m(e,t){f(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function h(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function g(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function _(e,t){return e<<32-t|e>>>t}var ee=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,te=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ne(e){if(f(e),ee)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=te[e[n]];return t}function v(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function y(e){return typeof e==`string`&&(e=v(e)),f(e),e}var re=class{};function b(e){let t=t=>e().update(y(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ie(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function ae(e,t,n){return e&t^~e&n}function oe(e,t,n){return e&t^e&n^t&n}var x=class extends re{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=g(this.buffer)}update(e){p(this),e=y(e),f(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=g(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){p(this),m(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,h(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;ie(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=g(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},S=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),C=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),w=BigInt(2**32-1),se=BigInt(32);function ce(e,t=!1){return t?{h:Number(e&w),l:Number(e>>se&w)}:{h:Number(e>>se&w)|0,l:Number(e&w)|0}}function le(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=ce(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var ue=(e,t,n)=>e>>>n,de=(e,t,n)=>e<<32-n|t>>>n,T=(e,t,n)=>e>>>n|t<<32-n,E=(e,t,n)=>e<<32-n|t>>>n,D=(e,t,n)=>e<<64-n|t>>>n-32,O=(e,t,n)=>e>>>n-32|t<<64-n;function k(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var fe=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),pe=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,me=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),he=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,ge=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),_e=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,ve=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),A=new Uint32Array(64),ye=class extends x{constructor(e=32){super(64,e,8,!1),this.A=S[0]|0,this.B=S[1]|0,this.C=S[2]|0,this.D=S[3]|0,this.E=S[4]|0,this.F=S[5]|0,this.G=S[6]|0,this.H=S[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)A[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=A[e-15],n=A[e-2],r=_(t,7)^_(t,18)^t>>>3;A[e]=(_(n,17)^_(n,19)^n>>>10)+A[e-7]+r+A[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=_(o,6)^_(o,11)^_(o,25),u=l+t+ae(o,s,c)+ve[e]+A[e]|0,d=(_(n,2)^_(n,13)^_(n,22))+oe(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){h(A)}destroy(){this.set(0,0,0,0,0,0,0,0),h(this.buffer)}},be=le(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),xe=be[0],Se=be[1],j=new Uint32Array(80),M=new Uint32Array(80),Ce=class extends x{constructor(e=64){super(128,e,16,!1),this.Ah=C[0]|0,this.Al=C[1]|0,this.Bh=C[2]|0,this.Bl=C[3]|0,this.Ch=C[4]|0,this.Cl=C[5]|0,this.Dh=C[6]|0,this.Dl=C[7]|0,this.Eh=C[8]|0,this.El=C[9]|0,this.Fh=C[10]|0,this.Fl=C[11]|0,this.Gh=C[12]|0,this.Gl=C[13]|0,this.Hh=C[14]|0,this.Hl=C[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)j[n]=e.getUint32(t),M[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=j[e-15]|0,n=M[e-15]|0,r=T(t,n,1)^T(t,n,8)^ue(t,n,7),i=E(t,n,1)^E(t,n,8)^de(t,n,7),a=j[e-2]|0,o=M[e-2]|0,s=T(a,o,19)^D(a,o,61)^ue(a,o,6),c=me(i,E(a,o,19)^O(a,o,61)^de(a,o,6),M[e-7],M[e-16]);j[e]=he(c,r,s,j[e-7],j[e-16])|0,M[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=T(u,d,14)^T(u,d,18)^D(u,d,41),ee=E(u,d,14)^E(u,d,18)^O(u,d,41),te=u&f^~u&m,ne=d&p^~d&h,v=ge(_,ee,ne,Se[e],M[e]),y=_e(v,g,t,te,xe[e],j[e]),re=v|0,b=T(n,r,28)^D(n,r,34)^D(n,r,39),ie=E(n,r,28)^O(n,r,34)^O(n,r,39),ae=n&i^n&o^i&o,oe=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=k(c|0,l|0,y|0,re|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let x=fe(re,ie,oe);n=pe(x,y,b,ae),r=x|0}({h:n,l:r}=k(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=k(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=k(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=k(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=k(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=k(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=k(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=k(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){h(j,M)}destroy(){h(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},we=b(()=>new ye),Te=b(()=>new Ce),Ee=[`choice`,`score`,`boolean`],De=/^[a-zA-Z0-9_.-]{1,64}$/,Oe=e=>De.test(e),N=e.t(),ke=`trigger`,Ae=e=>{let t=[],n=``,r=!1,i=0;for(;i<e.length;){let a=e[i];if(a===`[`&&!r){n.length>0&&(t.push(n),n=``),r=!0,i++;continue}if(a===`]`&&r){t.push(n),n=``,r=!1,i++,i<e.length&&e[i]===`.`&&i++;continue}if(a===`.`&&!r){n.length>0&&(t.push(n),n=``),i++;continue}n+=a,i++}return n.length>0&&t.push(n),t},je=/{{([^{}]+)}}/g;function*Me(e){if((0,N.isString)(e)){for(let[,t]of e.matchAll(je))n.t(t)&&(yield t);return}if((0,N.isObject)(e))for(let t of Object.values(e))yield*Me(t)}var Ne=e=>[...Me(e)],Pe=(e,t)=>{let n=e.length+1,r=t.length+1,i=Array.from({length:n},()=>Array(r).fill(0));for(let e=0;e<n;e++)i[e][0]=e;for(let e=0;e<r;e++)i[0][e]=e;for(let a=1;a<n;a++){let n=i[a-1],o=i[a];for(let i=1;i<r;i++){let r=e[a-1]===t[i-1]?0:1;o[i]=Math.min(n[i]+1,o[i-1]+1,n[i-1]+r)}}return i[e.length][t.length]},Fe=e=>{if(!n.t(e)||!u(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length!==0&&t.every(e=>n.t(e)&&u(e)&&c(e.isLeaf))},Ie=(e,t=[])=>{let n=[];if(!(0,N.isObject)(e))return n;for(let[r,i]of Object.entries(e)){if(!(0,N.isObject)(i))continue;let e=[...t,r];n.push(e.join(`.`)),!i.isLeaf&&(0,N.isObject)(i.value)&&n.push(...Ie(i.value,e))}return n},Le=({schema:e,propertyPath:t})=>{let r=e;for(let e=0;e<t.length;e++){let i=t[e];if(!n.t(i))return;if(!(0,N.isObject)(r))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:[]};let a=r[i];if(!n.t(a))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:Object.keys(r)};if(a.isLeaf){let r=t[e+1];return n.t(r)?{validPrefix:t.slice(0,e+1),failedSegment:r,availableKeys:[]}:void 0}r=a.value}},P={found:!1},F=e=>r.i(e)&&c(e.isLeaf),I=e=>r.i(e)&&e._outputSchemaType===`RECORD`&&r.i(e.fields),Re=e=>r.i(e)&&!(`_outputSchemaType`in e)&&F(e.first)&&e.first.isLeaf===!1&&I(e.first.value)&&F(e.totalCount),L=e=>({found:!0,type:l(e.type)?e.type:void 0,label:l(e.label)?e.label:void 0}),ze=(e,t)=>t.length===0?L(e):R(e.value,t),Be=(e,t)=>{for(let n=1;n<=t.length;n++){let r=e[t.slice(0,n).join(`.`)];if(F(r))return ze(r,t.slice(n))}return P},Ve=(e,t)=>{let[n,...r]=t;if(n===`first`)return r.length===0?L(e.first):R(e.first.value,r);if(n===`all`||n===`totalCount`){let t=e[n];return r.length===0&&F(t)?L(t):P}return P},He=(e,t)=>{let[i,...a]=t;if(!n.t(i))return P;let o=e[i];return F(o)?ze(o,a):n.t(o)?a.length===0?{found:!0}:r.i(o)?He(o,a):P:P},R=(e,t)=>t.length===0||!r.i(e)?P:I(e)?Be(e.fields,t):Re(e)?Ve(e,t):He(e,t),Ue=({schema:e,propertyPath:t})=>R(e,t),z=e=>{let t=[];for(let[i,a]of Object.entries(e))if(F(a)){if(t.push(i),a.isLeaf)continue;let e=a.value;if(I(e))for(let n of z(e.fields))t.push(`${i}.${n}`);else if(r.i(e))for(let n of z(e))t.push(`${i}.${n}`)}else if(n.t(a)&&(t.push(i),r.i(a)))for(let e of z(a))t.push(`${i}.${e}`);return t},B=e=>{if(!r.i(e))return[];if(I(e))return z(e.fields);if(Re(e)){let t=[];if(F(e.first)){t.push(`first`);for(let n of B(e.first.value))t.push(`first.${n}`)}return n.t(e.all)&&t.push(`all`),t.push(`totalCount`),t}return z(e)},We=3,Ge=e=>r.i(e)?e._outputSchemaType===`RECORD`||Object.values(e).some(e=>r.i(e)&&Ge(e.value)):!1,V=(e,t)=>t.map(t=>({candidate:t,distance:Pe(e,t)})).filter(({candidate:e,distance:t})=>t<=Math.ceil(e.length/2)).sort((e,t)=>e.distance-t.distance).slice(0,We).map(({candidate:e})=>e),Ke=({schema:e,propertyPath:t,referencedStepId:r})=>{if(!Fe(e)||Ge(e)){let n=B(e);return V(t.join(`.`),n).map(e=>[r,e].join(`.`))}let i=Le({schema:e,propertyPath:t});if(!n.t(i))return[];let a=V(i.failedSegment,i.availableKeys).map(e=>[r,...i.validPrefix,e].join(`.`));if((0,N.isNonEmptyArray)(a))return a;let o=Ie(e);return V(t.join(`.`),o).map(e=>[r,e].join(`.`))},qe=({workflow:e,graph:t,stepsById:r})=>{let i=[],a=new Set(e.steps?.map(e=>e.id)??[]);for(let o of e.steps??[]){let s=Ne(o.settings?.input),c=t.ancestorsByStepId.get(o.id)??new Set;for(let t of s){let s=Ae(t),l=s[0];if(!n.t(l)){i.push({severity:`error`,code:`VARIABLE_INVALID_PATH`,message:`Step "${o.name??o.id}" has a variable "{{${t}}}" with an invalid path. Variable references must start with a step ID, e.g. "{{stepId.property}}".`,stepId:o.id,path:t});continue}let u=l===ke;if(!u&&!a.has(l)){i.push({severity:`error`,code:`VARIABLE_UNKNOWN_STEP`,message:`Step "${o.name??o.id}" references variable "{{${t}}}" from an unknown step "${l}".`,stepId:o.id,path:t});continue}let d=l===o.id;if(!u&&!d&&!c.has(l)){let e=r.get(l)?.name??l;i.push({severity:`error`,code:`VARIABLE_NOT_UPSTREAM`,message:`Step "${o.name??o.id}" references variable "{{${t}}}" from step "${e}", which does not run before it. Ensure step "${e}" is an ancestor (connected via nextStepIds chain from the trigger, before this step).`,stepId:o.id,path:t});continue}i.push(...Je({step:o,variable:t,pathSegments:s,referencedStepId:l,isTriggerReference:u,trigger:e.trigger,stepsById:r}))}}return i},Je=({step:e,variable:t,pathSegments:r,referencedStepId:i,isTriggerReference:a,trigger:o,stepsById:s})=>{let c=r.slice(1);if(c.length===0)return[];let l=a?o?.settings?.outputSchema:s.get(i)?.settings?.outputSchema,u=n.t(l)&&(0,N.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.t(l)||u)return[];if(!Ue({schema:l,propertyPath:c}).found){let r=Ke({schema:l,propertyPath:c,referencedStepId:i}),a=Xe(l,i),o=(0,N.isNonEmptyArray)(r)?`Did you mean "{{${r[0]}}}"?${r.length>1?` Other options: ${r.slice(1).map(e=>`{{${e}}}`).join(`, `)}.`:``}`:(0,N.isNonEmptyArray)(a)?`Available paths: ${a.map(e=>`{{${e}}}`).join(`, `)}.`:void 0;return[{severity:`error`,code:`VARIABLE_PATH_NOT_FOUND`,message:`Step "${e.name??e.id}" references variable "{{${t}}}" but the path "${c.join(`.`)}" was not found in the output of step "${i}".`,stepId:e.id,path:t,...n.t(o)?{hint:o}:{},...(0,N.isNonEmptyArray)(r)?{suggestions:r}:{},...(0,N.isNonEmptyArray)(a)?{availablePaths:a}:{}}]}return[]},Ye=20,Xe=(e,t)=>B(e).slice(0,Ye).map(e=>`${t}.${e}`),Ze=r.tt({type:r.Z(`object`),properties:r.rt(r.at(),r.tt({type:r.H([`string`,`number`,`boolean`]),description:r.at().optional()})).refine(e=>Object.keys(e).every(Oe),{message:`Output field names can only contain letters, numbers, underscores, dots or hyphens (max 64 characters)`}),required:r.G(r.at()).optional(),additionalProperties:r.Z(!1).optional()}),Qe=r.q(`type`,[r.tt({type:r.Z(`text`)}),r.tt({type:r.Z(`json`),schema:Ze})]),$e=[1e3,5e3,15e3],H=r.tt({input:r.Q({}).describe(`Input data for the workflow action. Structure depends on the action type.`),outputSchema:r.Q({}).describe(`Schema defining the output data structure. This data can be referenced in subsequent steps using {{stepId.fieldName}}.`),errorHandlingOptions:r.tt({retryOnFailure:r.tt({value:r.nt(e=>typeof e==`boolean`?Number(e):e,r.et().int().min(0).max($e.length).describe(`How many times to retry the action if it fails, between 0 and ${$e.length}. 0 disables retries.`))}),continueOnFailure:r.tt({value:r.K().describe(`Whether to continue to the next step if this action fails.`)})})}),et={expectedOutputSchema:r.Q({}).optional().describe(`A sample output value declared by the user for steps whose output structure is only known at runtime.`)},tt=H.extend({input:r.tt({url:r.at(),method:r.H([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`]),headers:r.rt(r.at(),r.at()).optional(),body:r.rt(r.at(),r.st([r.at(),r.et(),r.K(),r.U(),r.G(r.st([r.at(),r.et(),r.K(),r.U()]))])).or(r.at()).optional()}),...et}),nt=/^[a-zA-Z0-9_-]{1,64}$/,rt=r.tt({id:r.lt().describe(`Stable identifier for this criterion row.`),name:r.at().describe(`Option name for a choice question, or the label of one score level.`),description:r.at().optional().describe(`What the model should understand this option to mean.`)}),it=r.tt({id:r.lt().describe(`Stable identifier for this question row.`),name:r.at().regex(nt,`Answer name must be empty or contain 1 to 64 characters using only letters, digits, underscores and dashes`).or(r.Z(``)).describe(`Answer key for this question, made of letters, digits, underscores and dashes. Downstream steps read {{stepId.answers.<name>}}.`),type:r.H(Ee).describe(`choice picks one option, score grades an ordered rubric, boolean estimates the probability that a statement holds.`),instructions:r.at().describe(`What the model should decide about the shared state.`),criteria:r.G(rt).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),at=H.extend({input:r.tt({state:r.at().describe(`The shared state every question is asked about. Supports variables.`),questions:r.G(it)})}),ot=H.extend({input:r.tt({items:r.st([r.G(r.st([r.at(),r.et(),r.K(),r.U(),r.rt(r.at(),r.W()),r.W()])),r.at()]).optional(),initialLoopStepIds:r.G(r.at()).optional(),shouldContinueOnIterationFailure:r.K().optional()})}),st=H.extend({input:r.tt({delayType:r.H([`SCHEDULED_DATE`,`DURATION`]),scheduledDateTime:r.at().nullable().optional(),duration:r.tt({days:r.st([r.et().min(0),r.at()]).optional(),hours:r.st([r.et().min(0),r.at()]).optional(),minutes:r.st([r.et().min(0),r.at()]).optional(),seconds:r.st([r.et().min(0),r.at()]).optional()}).optional()})}),ct=H.extend({input:r.tt({eventName:r.at().describe(`Event to wait for, in format objectName.action (e.g., "company.updated", "task.created", "person.deleted").`),recordId:r.at().nullable().optional().describe(`Only resume for this record. Usually a variable such as {{trigger.properties.after.id}}. Leave empty to resume on any record.`),updatedFields:r.G(r.at()).nullable().optional().describe(`For update events, only resume when one of these fields changed.`),timeout:r.tt({days:r.st([r.et().min(0),r.at()]).optional(),hours:r.st([r.et().min(0),r.at()]).optional(),minutes:r.st([r.et().min(0),r.at()]).optional()}).nullable().optional().describe(`Stop waiting after this duration. The step then succeeds with hasTimedOut set to true.`)})}),lt=H.extend({input:r.tt({})}),U=r.rt(r.at(),r.W()).describe(`Record data object. Use nested objects for relationships (e.g., "company": {"id": "{{reference}}"}). Common patterns:
|
|
2
|
-
- Person: {"name": {"firstName": "John", "lastName": "Doe"}, "emails": {"primaryEmail": "john@example.com"}, "company": {"id": "{{trigger.properties.after.id}}"}}
|
|
3
|
-
- Company: {"name": "Acme Corp", "domainName": {"primaryLinkUrl": "https://acme.com"}}
|
|
4
|
-
- Task: {"title": "Follow up", "status": "TODO", "assignee": {"id": "{{user.id}}"}}`),ut=H.extend({input:r.tt({objectName:r.at().describe(`The name of the object to create a record in. Must be lowercase (e.g., "person", "company", "task").`),objectRecord:U.describe(`The record data to create.`)})}),dt=H.extend({input:r.tt({objectName:r.at(),objectRecord:U,objectRecordId:r.at(),fieldsToUpdate:r.G(r.at())})}),ft=H.extend({input:r.tt({objectName:r.at(),objectRecord:U})}),pt=H.extend({input:r.tt({objectName:r.at(),objectRecordId:r.at()})}),mt=r.tt({id:r.at(),logicalOperator:r.H(r.L),parentRecordFilterGroupId:r.at().nullable().optional(),positionInRecordFilterGroup:r.et().nullable().optional()}),ht=r.tt({id:r.at().optional(),fieldMetadataId:r.at(),operand:r.H(r.h),value:r.at().nullable().optional(),recordFilterGroupId:r.at().nullable().optional(),positionInRecordFilterGroup:r.et().nullable().optional(),subFieldName:r.at().nullable().optional(),relationTargetFieldMetadataId:r.at().nullable().optional()}),W=r.at().regex(/^{{[^{}]+}}$/,`Expected a workflow variable reference like {{stepId.path}}`),gt=H.extend({input:r.tt({objectName:r.at(),limit:r.st([r.et(),W]).optional(),offset:r.st([r.et().int().nonnegative(),W]).optional(),filter:r.tt({recordFilterGroups:r.G(mt).optional(),recordFilters:r.G(ht).optional()}).optional(),orderBy:r.tt({recordSorts:r.G(r.W()).optional(),gqlOperationOrderBy:r.G(r.rt(r.at(),r.W())).optional()}).optional()})}),_t=r.tt({id:r.at(),name:r.at(),label:r.at(),type:r.st([r.Z(r.I.TEXT),r.Z(r.I.NUMBER),r.Z(r.I.DATE),r.Z(r.I.SELECT),r.Z(r.I.MULTI_SELECT),r.Z(`RECORD`)]),placeholder:r.at().optional(),settings:r.rt(r.at(),r.W()).optional(),value:r.W().optional()}),vt=H.extend({input:r.G(_t),instructions:r.at().optional()}),G=r.tt({id:r.at(),logicalOperator:r.H(r.g),parentStepFilterGroupId:r.at().optional(),positionInStepFilterGroup:r.et().optional()}),K=r.tt({id:r.at(),type:r.at(),stepOutputKey:r.at(),operand:r.H(r.h).or(r.H(r.S)),value:r.at(),stepFilterGroupId:r.at(),positionInStepFilterGroup:r.et().optional(),fieldMetadataId:r.at().optional(),compositeFieldSubFieldName:r.at().optional(),isFullRecord:r.K().optional()}),yt=H.extend({input:r.tt({stepFilterGroups:r.G(G),stepFilters:r.G(K)})}),bt=r.tt({id:r.at(),nextStepIds:r.G(r.at()),filterGroupId:r.at().optional()}),xt=H.extend({input:r.tt({stepFilterGroups:r.G(G),stepFilters:r.G(K),branches:r.G(bt)})}),St=r.tt({id:r.at().refine(e=>t.u(e)),name:r.at(),size:r.et(),type:r.at(),createdAt:r.at()}),Ct=r.G(r.st([St,W.describe(`A workflow variable reference resolving to files`)])).optional().default([]),wt=H.extend({input:r.tt({connectedAccountId:r.at(),fromHandle:r.at().trim().optional(),recipients:r.tt({to:r.at().optional().default(``),cc:r.at().optional().default(``),bcc:r.at().optional().default(``)}),subject:r.at().optional(),body:r.at().optional().describe(`The email body as a serialized email document: JSON.stringify of {"type":"doc","attrs":{"schemaVersion":1},"content":[...]} with paragraph, heading, bulletList, orderedList, image, button, divider and html blocks. Use {{stepId.field}} for variables. To send a complete HTML email verbatim, including HTML produced by an earlier step such as {{stepId.html}}, make the body a single htmlDocument block ({"type":"htmlDocument","attrs":{"html":"..."}}): it is sent without the email layout and its variables are inserted as raw HTML, while an html block is embedded in the layout with escaped variables. HTML or plain text strings are rejected.`),files:Ct,inReplyTo:r.at().trim().optional()})}),Tt=H.extend({input:r.tt({connectedAccountId:r.at(),title:r.at(),description:r.at().optional(),location:r.at().optional(),startsAt:r.at(),endsAt:r.at(),isFullDay:r.K(),timeZone:r.at().optional(),attendees:r.at().optional().default(``),sendInvitations:r.K(),addConferencing:r.K()})}),Et=r.H([`RANDOM`,`ROUND_ROBIN`,`LOAD_BALANCED`]);H.extend({input:r.tt({objectName:r.at(),strategy:Et,recordIds:r.G(r.at()),loadBalance:r.tt({objectNameSingular:r.at(),fieldName:r.at()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.t(e.loadBalance)&&t.addIssue({code:a.custom,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})});var Dt=r.tt({name:r.at().optional().describe(`Human-readable name for the trigger. Optional but recommended for clarity.`),type:r.H([`DATABASE_EVENT`,`MANUAL`,`CRON`,`WEBHOOK`]).describe(`Type of trigger. DATABASE_EVENT for record changes, MANUAL for user-initiated, CRON for scheduled, WEBHOOK for external calls.`),position:r.tt({x:r.et(),y:r.et()}).optional().nullable().describe(`Position coordinates for the trigger in the workflow diagram. Use (0, 0) for the trigger step.`),nextStepIds:r.G(r.at()).optional().nullable().describe(`Array of step IDs that the trigger connects to. These are the first steps in the workflow.`)}),Ot=Dt.extend({type:r.Z(`CRON`),settings:r.q(`type`,[r.tt({type:r.Z(`DAYS`),schedule:r.tt({day:r.et().min(1),hour:r.et().min(0).max(23),minute:r.et().min(0).max(59)}),outputSchema:r.Q({})}),r.tt({type:r.Z(`HOURS`),schedule:r.tt({hour:r.et().min(1),minute:r.et().min(0).max(59)}),outputSchema:r.Q({})}),r.tt({type:r.Z(`MINUTES`),schedule:r.tt({minute:r.et().min(1).max(60)}),outputSchema:r.Q({})}),r.tt({type:r.Z(`CUSTOM`),pattern:r.at(),outputSchema:r.Q({})})])}),kt=Dt.extend({type:r.Z(`WEBHOOK`),settings:r.q(`httpMethod`,[r.tt({outputSchema:r.Q({}),httpMethod:r.Z(`GET`),authentication:r.Z(`API_KEY`).nullable()}),r.tt({outputSchema:r.Q({}),expectedOutputSchema:r.Q({}).optional(),httpMethod:r.Z(`POST`),expectedBody:r.Q({}),authentication:r.Z(`API_KEY`).nullable()})])}),q=function(e){return e.CODE=`CODE`,e.LOGIC_FUNCTION=`LOGIC_FUNCTION`,e.SEND_EMAIL=`SEND_EMAIL`,e.SEND_CHAT_MESSAGE=`SEND_CHAT_MESSAGE`,e.DRAFT_EMAIL=`DRAFT_EMAIL`,e.CREATE_CALENDAR_EVENT=`CREATE_CALENDAR_EVENT`,e.CREATE_RECORD=`CREATE_RECORD`,e.UPDATE_RECORD=`UPDATE_RECORD`,e.DELETE_RECORD=`DELETE_RECORD`,e.UPSERT_RECORD=`UPSERT_RECORD`,e.FIND_RECORDS=`FIND_RECORDS`,e.PICK_RECORD=`PICK_RECORD`,e.FORM=`FORM`,e.FILTER=`FILTER`,e.IF_ELSE=`IF_ELSE`,e.HTTP_REQUEST=`HTTP_REQUEST`,e.AI_AGENT=`AI_AGENT`,e.CLASSIFY=`CLASSIFY`,e.ITERATOR=`ITERATOR`,e.EMPTY=`EMPTY`,e.DELAY=`DELAY`,e.WAIT_FOR_EVENT=`WAIT_FOR_EVENT`,e}({}),At=e=>{let t=e.settings?.input;return e.type===q.IF_ELSE&&(0,N.isObject)(t)&&`branches`in t&&Array.isArray(t.branches)},jt=e=>{let t=e.settings?.input;return e.type===q.ITERATOR&&(0,N.isObject)(t)&&`initialLoopStepIds`in t&&(0,N.isNonEmptyArray)(t.initialLoopStepIds)},Mt=e=>{let t=e.settings?.input;if(n.t(t)&&(0,N.isObject)(t))return t},Nt=e=>{let t=new Set(e.nextStepIds??[]);if(At(e))for(let n of e.settings.input.branches??[])for(let e of n?.nextStepIds??[])t.add(e);if(jt(e))for(let n of e.settings.input.initialLoopStepIds??[])t.add(n);return[...t]},Pt=({trigger:e,steps:t})=>{let r=new Map,i=n.t(e?.nextStepIds)?e.nextStepIds.filter(n.t):[];r.set(ke,i);for(let e of t??[])r.set(e.id,Nt(e));let a=new Set,o=[ke];for(;o.length>0;){let e=o.shift();if(!(!n.t(e)||a.has(e))){a.add(e);for(let t of r.get(e)??[])a.has(t)||o.push(t)}}return{childrenByStepId:r,reachableFromTrigger:a,ancestorsByStepId:Ft(r)}},Ft=e=>{let t=new Map;for(let[n,r]of e.entries())for(let e of r){let r=t.get(e)??new Set;r.add(n),t.set(e,r)}let n=new Map;for(let r of e.keys()){if(n.has(r))continue;let e=new Set,i=[...t.get(r)??[]];for(;i.length>0;){let n=i.shift();if(!e.has(n)){e.add(n);for(let r of t.get(n)??[])e.has(r)||i.push(r)}}n.set(r,e)}return n},It=({workflow:e,graph:t})=>{let r=[],i=new Set,a=new Set,o=new Map((e.steps??[]).map(e=>[e.id,e])),s=(e,c=[],l)=>{let u=c[c.length-1];if(i.has(e)){if(e!==l&&u===e)return;r.push({severity:`error`,code:`WORKFLOW_CYCLE`,stepId:e,message:`Workflow contains a cycle at step ${e}`});return}let d=o.get(e),f=`${e}:${c.join(`,`)}`;if(!n.t(d)||a.has(f))return;i.add(e),jt(d)&&(d.settings.input.initialLoopStepIds??[]).forEach(t=>s(t,[...c,e],e));let p=d.type===q.ITERATOR?d.nextStepIds??[]:t.childrenByStepId.get(e)??[];n.t(u)&&p.length===0&&r.push({severity:`error`,code:`ITERATOR_MISSING_RETURN`,stepId:e,message:`Loop body step ${e} must return to iterator ${u}`}),p.forEach(t=>s(t,c,e)),i.delete(e),a.add(f)};return e.trigger?.nextStepIds?.forEach(e=>s(e)),r},Lt=({workflow:e,graph:r})=>{let i=[],a=e.steps??[],o=new Set(a.map(e=>e.id)),s=new Set;for(let e of a)s.has(e.id)&&i.push({severity:`error`,code:`DUPLICATE_STEP_ID`,message:`Duplicate step id "${e.id}". Every step id must be unique within the workflow.`,stepId:e.id}),s.add(e.id);let c=(e.trigger?.nextStepIds??[]).filter(n.t);t.n(a)&&c.length===0&&i.push({severity:`error`,code:`TRIGGER_HAS_NO_NEXT_STEP`,message:`The trigger is not connected to any step. The trigger must have a "nextStepIds" array pointing to the first step (e.g. nextStepIds: ["${a[0].id}"]). If you used edges, also set trigger.nextStepIds.`});for(let e of c)o.has(e)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`The trigger references a non-existent step "${e}".`});for(let e of a){for(let t of r.childrenByStepId.get(e.id)??[])o.has(t)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`Step "${e.name??e.id}" references a non-existent step "${t}".`,stepId:e.id});i.push(...Rt(e))}for(let e of a)r.reachableFromTrigger.has(e.id)||i.push({severity:`error`,code:`UNREACHABLE_STEP`,message:`Step "${e.name??e.id}" is not reachable from the trigger. Ensure a chain of nextStepIds connects the trigger to this step. Check that the preceding step includes this step's id ("${e.id}") in its nextStepIds array.`,stepId:e.id});return i},Rt=e=>{let t=[],r=Mt(e);if(e.type===q.IF_ELSE){let i=r?.branches,a=Array.isArray(i)?i:[];a.length<2&&t.push({severity:`warning`,code:`IF_ELSE_INSUFFICIENT_BRANCHES`,message:`If/Else step "${e.name??e.id}" should have at least two branches (a condition branch and an else branch).`,stepId:e.id});let o=r?.stepFilterGroups,s=new Set((Array.isArray(o)?o:[]).filter(n.t).map(e=>e.id));for(let r of a){let i=r?.nextStepIds;(!Array.isArray(i)||i.length===0)&&t.push({severity:`error`,code:`IF_ELSE_BRANCH_HAS_NO_NEXT_STEP`,message:`A branch of If/Else step "${e.name??e.id}" is not connected to any step.`,stepId:e.id}),n.t(r?.filterGroupId)&&!s.has(r.filterGroupId)&&t.push({severity:`error`,code:`INVALID_STEP_PARAMS`,message:`A branch of If/Else step "${e.name??e.id}" references filter group "${r.filterGroupId}", which does not exist.`,stepId:e.id})}}if(e.type===q.ITERATOR){let n=r,i=n?.items,a=typeof i==`string`&&i.length>0||Array.isArray(i)&&i.length>0,o=n?.initialLoopStepIds,s=Array.isArray(o)&&o.length>0;a&&!s&&t.push({severity:`error`,code:`ITERATOR_MISSING_LOOP_BODY`,message:`Iterator step "${e.name??e.id}" has items to iterate over but no steps inside the loop.`,stepId:e.id})}return t},J=function(e){return e.OK=`OK`,e.SUCCESS=`SUCCESS`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.NEUTRAL=`NEUTRAL`,e.UNKNOWN=`UNKNOWN`,e}({});Object.values(J).filter(e=>e!==J.OK&&e!==J.UNKNOWN),r.I.TEXT,r.I.ARRAY,r.I.BOOLEAN,r.I.DATE,r.I.DATE_TIME,r.I.NUMBER,r.I.NUMERIC,r.I.RAW_JSON,r.I.RICH_TEXT,r.I.SELECT,r.I.MULTI_SELECT;var zt=`dependencies/yarn.lock`,Bt=`public`,Vt=`front-component-shared-dependencies.mjs`;r.E.RECORD_PAGE,r.E.DASHBOARD;var Ht={js:`import { createRequire as __createRequire } from 'module';
|
|
5
|
-
const require = __createRequire(import.meta.url);`},Ut=`.twenty/output`,Wt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,fieldUniversalIdentifier:n})=>i.u({entityNamespace:`fieldPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),Gt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,objectUniversalIdentifier:n})=>i.u({entityNamespace:`objectPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),Kt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>i.t({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:r.E.RECORD_FORM}),qt=({pageLayoutTabManifest:e,pageLayoutType:i})=>{let a=e.layoutMode??(i===r.E.STANDALONE_PAGE?r.R.VERTICAL_LIST:r.R.GRID),o=e.widgets??[],s=[];if(!Object.values(r.R).some(e=>e===a))return{status:`fail`,errors:[`Page layout tab "${e.title}" defines unsupported layoutMode "${a}". Expected GRID, VERTICAL_LIST or CANVAS.`]};for(let t of o){let i=[t.heightBehavior,r.i(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.t);i.length>0&&a!==r.R.VERTICAL_LIST&&s.push(`Page layout widget "${t.title}" defines heightBehavior, but its parent tab "${e.title}" uses ${a}. heightBehavior is only supported for VERTICAL_LIST tabs.`);for(let e of i)Object.values(r.b).some(t=>t===e)||s.push(`Page layout widget "${t.title}" defines unsupported heightBehavior "${e}". Expected FIT_CONTENT or TAB_VIEWPORT.`)}if(s.length>0)return{status:`fail`,errors:s};let c={...e,layoutMode:a,widgets:o.map(({heightBehavior:e,position:i,gridPosition:o,...s},c)=>{if(n.t(i))return{...s,position:i.layoutMode===r.R.VERTICAL_LIST&&n.t(e)?{...i,heightBehavior:e}:i};if(n.t(o))return{...s,position:{layoutMode:r.R.GRID,...o}};switch(a){case r.R.GRID:return{...s,position:{layoutMode:a,row:0,column:0,rowSpan:r.s.default.h,columnSpan:r.s.default.w}};case r.R.VERTICAL_LIST:return{...s,position:{layoutMode:a,index:c,...n.t(e)?{heightBehavior:e}:{}}};case r.R.CANVAS:return{...s,position:{layoutMode:a}};default:return t.t(a)}})};for(let e of c.widgets)e.position.layoutMode!==a&&s.push(`Page layout widget "${e.title}" uses a ${e.position.layoutMode} position, but its parent tab "${c.title}" uses ${a}.`);if(a===r.R.VERTICAL_LIST){let e=c.widgets.filter(({type:e,position:n})=>n.layoutMode===r.R.VERTICAL_LIST&&t.i({widgetType:e,heightBehavior:n.heightBehavior})===r.b.TAB_VIEWPORT);e.length>1&&s.push(`Page layout tab "${c.title}" can contain only one TAB_VIEWPORT widget.`);let i=e.length===1?e[0]:void 0;n.t(i)&&c.widgets.some(e=>e!==i&&e.position.layoutMode===r.R.VERTICAL_LIST&&i.position.layoutMode===r.R.VERTICAL_LIST&&e.position.index>=i.position.index)&&s.push(`Page layout tab "${c.title}" must place its TAB_VIEWPORT widget last.`)}return s.length>0?{status:`fail`,errors:s}:{status:`success`,pageLayoutTab:c}},Y=[`canReadObjectRecords`,`canUpdateObjectRecords`,`canSoftDeleteObjectRecords`,`canDestroyObjectRecords`],Jt=e=>ne(Te(v(e))).slice(0,32),Yt=e=>Jt(JSON.stringify(JSON.parse(e))),X={canReadObjectRecords:`canReadAllObjectRecords`,canUpdateObjectRecords:`canUpdateAllObjectRecords`,canSoftDeleteObjectRecords:`canSoftDeleteAllObjectRecords`,canDestroyObjectRecords:`canDestroyAllObjectRecords`},Xt=({role:e,objectUniversalIdentifier:t})=>{let n=e.objectPermissions?.find(e=>e.objectUniversalIdentifier===t);return{canReadObjectRecords:n?.canReadObjectRecords??e[X.canReadObjectRecords]??!1,canUpdateObjectRecords:n?.canUpdateObjectRecords??e[X.canUpdateObjectRecords]??!1,canSoftDeleteObjectRecords:n?.canSoftDeleteObjectRecords??e[X.canSoftDeleteObjectRecords]??!1,canDestroyObjectRecords:n?.canDestroyObjectRecords??e[X.canDestroyObjectRecords]??!1}},Zt=e=>JSON.stringify(e,(e,t)=>r.i(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),Qt=({groupsByUniversalIdentifier:e,predicateGroupUniversalIdentifier:t})=>{let r=[],i=new Set,a=t;for(;n.t(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.t(t))break;r.push(t.logicalOperator),a=t.parentPredicateGroupUniversalIdentifier}return r},$t=({role:e,objectUniversalIdentifier:t})=>{let n=new Map((e.rowLevelPermissionPredicateGroups??[]).map(e=>[e.universalIdentifier,e]));return(e.rowLevelPermissionPredicates??[]).filter(e=>e.objectUniversalIdentifier===t).map(e=>Zt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:Qt({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},en=r.n.map(e=>r.r[e]),tn=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),nn=({role:e,superset:t})=>[...Y.filter(n=>{let r=X[n];return e[r]&&!t[r]}).map(e=>({type:`ALL_OBJECT_RECORDS`,action:e})),...e.canUpdateAllSettings&&!t.canUpdateAllSettings?[{type:`ALL_SETTINGS`}]:[],...e.canAccessAllTools&&!t.canAccessAllTools?[{type:`ALL_TOOLS`}]:[]],rn=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...en,...n]),i=new Set(t.permissionFlagUniversalIdentifiers??[]);return[...new Set(e.permissionFlagUniversalIdentifiers??[])].filter(e=>!(r.has(e)?t.canAccessAllTools:t.canUpdateAllSettings)&&!i.has(e)).map(e=>({type:`PERMISSION_FLAG`,permissionFlagUniversalIdentifier:e}))},an=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=Xt({role:e,objectUniversalIdentifier:n}),i=Xt({role:t,objectUniversalIdentifier:n}),a=Y.filter(e=>r[e]&&!i[e]).map(e=>({type:`OBJECT_RECORDS`,objectUniversalIdentifier:n,action:e})),o=Y.some(e=>r[e]),s=$t({role:t,objectUniversalIdentifier:n}),c=$t({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!tn({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),on=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=Xt({role:e,objectUniversalIdentifier:n}),a=e.fieldPermissions?.find(e=>e.objectUniversalIdentifier===n&&e.fieldUniversalIdentifier===r),o=t.canReadFieldValue===!1&&i.canReadObjectRecords&&a?.canReadFieldValue!==!1,s=t.canUpdateFieldValue===!1&&i.canUpdateObjectRecords&&a?.canUpdateFieldValue!==!1;return[...o?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canReadFieldValue`}]:[],...s?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canUpdateFieldValue`}]:[]]}),sn=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...nn({role:e,superset:t}),...rn({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...an({role:e,superset:t}),...on({role:e,superset:t})],cn=e=>i.p(e)&&s(e)>=4,ln=r.tt({x:r.et(),y:r.et()}),un={universalIdentifier:r.lt(),name:r.at().min(1),nextStepIds:r.G(r.lt()),position:ln.nullable().optional(),outputSchema:r.rt(r.at(),r.ct()).optional(),expectedOutputSchema:r.rt(r.at(),r.ct()).optional(),errorHandlingOptions:H.shape.errorHandlingOptions.optional()},Z=(e,t)=>r.it({...un,type:r.Z(e),input:t}),dn=r.Q({fieldMetadataUniversalIdentifier:r.lt(),fieldMetadataId:r.$().optional()}),fn=K.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:r.lt().optional()}).strict(),pn=ht.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:r.lt()}).strict(),Q={objectUniversalIdentifier:r.lt()},mn={connectedAccountId:r.at().optional(),connectedAccountHandle:r.at().trim().min(1).optional()},hn=(e,t)=>{n.t(e.connectedAccountId)===n.t(e.connectedAccountHandle)&&t.addIssue({code:`custom`,path:[`connectedAccountHandle`],message:`Set exactly one of connectedAccountId and connectedAccountHandle`})},gn=wt.shape.input.extend(mn).superRefine(hn),_n=[r.it({...un,type:r.Z(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:r.lt(),input:r.rt(r.at(),r.ct())}),Z(`HTTP_REQUEST`,tt.shape.input),Z(`CLASSIFY`,at.shape.input),Z(`ITERATOR`,ot.shape.input),Z(`DELAY`,st.shape.input),Z(`WAIT_FOR_EVENT`,ct.shape.input),Z(`EMPTY`,lt.shape.input),Z(`CREATE_RECORD`,ut.shape.input.omit({objectName:!0}).extend(Q).strict()),Z(`UPDATE_RECORD`,dt.shape.input.omit({objectName:!0}).extend(Q).strict()),Z(`UPSERT_RECORD`,ft.shape.input.omit({objectName:!0}).extend(Q).strict()),Z(`DELETE_RECORD`,pt.shape.input.omit({objectName:!0}).extend(Q).strict()),Z(`FIND_RECORDS`,gt.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...Q,filter:r.it({recordFilterGroups:r.G(mt).optional(),recordFilters:r.G(pn).optional()}).optional(),orderBy:r.it({recordSorts:r.G(dn.extend({direction:r.H([`ASC`,`DESC`]),subFieldName:r.at().nullable().optional()})).optional()}).optional()}).strict()),Z(`PICK_RECORD`,r.it({...Q,strategy:Et,recordIds:r.G(r.at()),loadBalance:r.it({objectUniversalIdentifier:r.lt(),fieldUniversalIdentifier:r.lt()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.t(e.loadBalance)&&t.addIssue({code:`custom`,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})),Z(`FILTER`,yt.shape.input.extend({stepFilters:r.G(fn)})),Z(`IF_ELSE`,xt.shape.input.extend({stepFilters:r.G(fn)})),Z(`FORM`,r.G(vt.shape.input.element.extend({settings:r.rt(r.at(),r.ct()).optional()}).superRefine((e,t)=>{e.type===`RECORD`&&!r.lt().safeParse(e.settings?.objectUniversalIdentifier).success&&t.addIssue({code:`custom`,path:[`settings`,`objectUniversalIdentifier`],message:`Record picker fields require an object universal identifier`}),(e.type===`SELECT`||e.type===`MULTI_SELECT`)&&!r.lt().safeParse(e.settings?.selectedFieldUniversalIdentifier).success&&t.addIssue({code:`custom`,path:[`settings`,`selectedFieldUniversalIdentifier`],message:`Select fields require the universal identifier of the field whose options they offer`})}))),Z(`SEND_EMAIL`,gn),Z(`DRAFT_EMAIL`,gn),Z(`CREATE_CALENDAR_EVENT`,Tt.shape.input.extend(mn).superRefine(hn)),Z(`AI_AGENT`,r.it({agentUniversalIdentifier:r.lt(),prompt:r.at(),responseFormat:Qe.optional()}))],vn=_n.map(e=>e.shape.type.value),yn=r.q(`type`,_n,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${vn.join(`, `)}`:void 0}),bn=[`updated`,`upserted`],xn=r.q(`type`,[r.it({type:r.Z(`GLOBAL`)}),r.it({type:r.Z(`SINGLE_RECORD`),objectUniversalIdentifier:r.lt()}),r.it({type:r.Z(`BULK_RECORDS`),objectUniversalIdentifier:r.lt()})]),[Sn,Cn,wn,Tn]=Ot.shape.settings.options,En=r.q(`type`,[Sn.omit({outputSchema:!0}).extend({schedule:Sn.shape.schedule.strict()}).strict(),Cn.omit({outputSchema:!0}).extend({schedule:Cn.shape.schedule.strict()}).strict(),wn.omit({outputSchema:!0}).extend({schedule:wn.shape.schedule.strict()}).strict(),Tn.omit({outputSchema:!0}).strict()]),[Dn,On]=kt.shape.settings.options,kn=r.q(`httpMethod`,[Dn.omit({outputSchema:!0,authentication:!0}).strict(),On.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),$={universalIdentifier:r.lt().optional(),name:r.at().min(1).optional(),nextStepIds:r.G(r.lt()).min(1),position:ln.nullable().optional(),outputSchema:r.rt(r.at(),r.ct()).optional()},An=[r.it({...$,type:r.Z(`MANUAL`),settings:r.it({availability:xn.optional(),icon:r.at().optional(),isPinned:r.K().optional()}).superRefine((e,t)=>{!n.t(e.availability)&&(n.t(e.icon)||n.t(e.isPinned))&&t.addIssue({code:`custom`,path:[`availability`],message:`Set an availability for the icon and pin to show in the command menu`})}).optional()}),r.it({...$,type:r.Z(`CRON`),settings:En}),r.it({...$,type:r.Z(`DATABASE_EVENT`),settings:r.it({objectUniversalIdentifier:r.lt(),action:r.H([`created`,`updated`,`deleted`,`upserted`]),fieldUniversalIdentifiers:r.G(r.lt()).optional(),filter:r.it({stepFilterGroups:r.G(G),stepFilters:r.G(fn.extend({operand:r.H(r.h)}))}).optional()}).superRefine((e,r)=>{if(t.n(e.fieldUniversalIdentifiers)&&!bn.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${bn.join(` and `)} events`}),!n.t(e.filter))return;let i=new Map;e.filter.stepFilterGroups.forEach((e,t)=>{i.has(e.id)&&r.addIssue({code:`custom`,path:[`filter`,`stepFilterGroups`,t,`id`],message:`Filter group ${e.id} is declared more than once`}),i.set(e.id,e.parentStepFilterGroupId)}),e.filter.stepFilterGroups.forEach((e,t)=>{let a=e.parentStepFilterGroupId,o=[`filter`,`stepFilterGroups`,t,`parentStepFilterGroupId`];if(!n.t(a))return;if(!i.has(a)){r.addIssue({code:`custom`,path:o,message:`Filter group ${a} is not declared in stepFilterGroups`});return}let s=new Set([e.id]);for(let t=a;n.t(t);t=i.get(t)){if(s.has(t)){r.addIssue({code:`custom`,path:o,message:`Filter group ${e.id} is not reachable from a root group`});return}s.add(t)}}),e.filter.stepFilters.forEach((e,t)=>{i.has(e.stepFilterGroupId)||r.addIssue({code:`custom`,path:[`filter`,`stepFilters`,t,`stepFilterGroupId`],message:`Filter group ${e.stepFilterGroupId} is not declared in stepFilterGroups`})})})}),r.it({...$,type:r.Z(`WEBHOOK`),settings:kn})],jn=An.map(e=>e.shape.type.value),Mn=r.q(`type`,An,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${jn.join(`, `)}`:void 0});r.it({universalIdentifier:r.lt(),name:r.at().min(1),isSystem:r.K().optional(),version:r.it({trigger:Mn,steps:r.G(yn).min(1)})}).superRefine((e,t)=>{let{steps:r,trigger:i}=e.version,a=[e.universalIdentifier,i.universalIdentifier,...r.map(e=>e.universalIdentifier)].filter(n.t);new Set(a).size!==a.length&&t.addIssue({code:`custom`,message:`Workflow, trigger and steps must have distinct universal identifiers`});let o={trigger:{type:i.type,nextStepIds:i.nextStepIds},steps:r.map(e=>({...e,id:e.universalIdentifier,settings:{input:e.input}}))},s=Pt(o);for(let e of[...Lt({workflow:o,graph:s}),...It({workflow:o,graph:s}),...qe({workflow:o,graph:s,stepsById:new Map(o.steps.map(e=>[e.id,e]))})])e.severity===`error`&&t.addIssue({code:`custom`,message:e.message})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Bt}});
|