twenty 2.53.0 → 2.54.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 +5 -1
- package/dist/app-template/example/scripts.json +6 -0
- package/dist/app-template/package.json +1 -4
- package/dist/app-template/yarn.lock +30 -30
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{application-BxIKWsoy.cjs → application-pYRHxplP.cjs} +3 -3
- package/dist/chunks/{build-source-manifest-BIq-ByiX.cjs → build-source-manifest-DPsTlw7Z.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-d23K-Ikr.cjs → build-source-snapshot-BMjdktTk.cjs} +19 -19
- package/dist/chunks/{cli-version.constant-YNWQ9cC0.cjs → cli-version.constant-M53Gu1CK.cjs} +1 -1
- package/dist/chunks/{collect-translatable-strings-rQ3M474u.cjs → collect-translatable-strings-BWzloBoB.cjs} +1 -1
- package/dist/chunks/compile-application-translations-DB-cG9Im.cjs +1 -0
- package/dist/chunks/{constants-Bod2d_GP-CQVvzM4m.cjs → constants-Cbb71hpl-CrSqydxj.cjs} +1 -1
- package/dist/chunks/{create-http-status-error-BMaFl1lt.cjs → create-http-status-error-CSxveq4d.cjs} +1 -1
- package/dist/chunks/create-metadata-client-CJRFQ20Z.cjs +6 -0
- package/dist/chunks/create-pull-base-write-BAapBdLz.cjs +1 -0
- package/dist/chunks/{create-rest-client-Cqmhix9V.cjs → create-rest-client-eb80-tts.cjs} +1 -1
- package/dist/chunks/execa-CAd0sJ7f.cjs +3 -0
- package/dist/chunks/extract-manifest-from-file-CEK5X5YP.cjs +1 -0
- package/dist/chunks/{extract-source-translations-BqDJ4wJe.cjs → extract-source-translations-BKXfzm51.cjs} +1 -1
- package/dist/chunks/{fetch-metadata-inspection-FViKeZE2.cjs → fetch-metadata-inspection-IuAwjjQT.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-DetIg3mY.cjs → fetch-signed-in-identity-BFxRufRI.cjs} +1 -1
- package/dist/chunks/fetch-workspace-or-throw-CgPc8IBL.cjs +1 -0
- package/dist/chunks/{format-data-value-CSmt_osQ.cjs → format-data-value-Cln0Hv7L.cjs} +1 -1
- package/dist/chunks/{format-metadata-fields-CIlW-vcz.cjs → format-metadata-fields-BltFjIsO.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-boZrxwKt.cjs → format-metadata-owner-DpOc_B3P.cjs} +1 -1
- package/dist/chunks/{generate-application-client-CApCs5PX.cjs → generate-application-client-CL8nm0q9.cjs} +1 -1
- package/dist/chunks/{get-client-generation-skip-reason-D9u3PsGX.cjs → get-client-generation-skip-reason-BJFlVAos.cjs} +1 -1
- package/dist/chunks/{get-system-view-universal-identifier.util-C6XI2VGC-Dy2DReV-.cjs → get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs} +1 -1
- package/dist/chunks/global-flags.constant-MWMrKAud.cjs +1 -0
- package/dist/chunks/{is-access-token-expiring-hGgVV9T8.cjs → is-access-token-expiring-B3WtsewG.cjs} +1 -1
- package/dist/chunks/{is-application-not-found-error-DH5B4tzI.cjs → is-application-not-found-error-BC7jyU0p.cjs} +1 -1
- package/dist/chunks/{is-exported-manifest-CoOxJ1Ku.cjs → is-exported-manifest-D8cwSas4.cjs} +1 -1
- package/dist/chunks/is-valid-package-name-Ij_K6iEL.cjs +1 -0
- package/dist/chunks/locale-catalog-format-C_5EGBEn.cjs +20 -0
- package/dist/chunks/metadata-CY9y5wYc.cjs +1 -0
- package/dist/chunks/parse-app-export-CpZxFIlO.cjs +1 -0
- package/dist/chunks/{parse-graphql-response-8IMbTRp8.cjs → parse-graphql-response-Di8aFmnF.cjs} +1 -1
- package/dist/chunks/{parse-json-input-CJEnFJw_.cjs → parse-json-input-kEwLo8mG.cjs} +1 -1
- package/dist/chunks/pull-minimum-sdk-version.constant-JDRwzl32.cjs +5 -0
- package/dist/chunks/pull-source-CpAYRk5s.cjs +1 -0
- package/dist/chunks/{read-app-identity-BbNKSUV5.cjs → read-app-identity-CJZThpUC.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-BxzrxUSf.cjs → read-application-identifier-D6YPuiA7.cjs} +1 -1
- package/dist/chunks/{read-application-identity-uq1DePso.cjs → read-application-identity-CWSIB1Jd.cjs} +1 -1
- package/dist/chunks/{read-config-BinH4NbQ.cjs → read-config-9Dv5cmvw.cjs} +1 -1
- package/dist/chunks/{read-infer-deletion-option-BFdfPWCc.cjs → read-infer-deletion-option-DtCw0TsU.cjs} +1 -1
- package/dist/chunks/read-json-object-BlyNzzdk.cjs +1 -0
- package/dist/chunks/{read-source-identity-DmwOw5xO.cjs → read-source-identity-BQ_YGISo.cjs} +1 -1
- package/dist/chunks/record-pull-base-BIlU7Fj1.cjs +1 -0
- package/dist/chunks/{record-typecheck-config-inputs-BxgLBZ_x.cjs → record-typecheck-config-inputs-BGVirGsR.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-DCmkyPd1.cjs → request-oauth-tokens-BkL-WsAM.cjs} +1 -1
- package/dist/chunks/{resolve-app-project-CMuYw_Z4.cjs → resolve-app-project-DP27LYGR.cjs} +1 -1
- package/dist/chunks/{resolve-command-target-BFHhx0DC.cjs → resolve-command-target-C4r6LuWk.cjs} +1 -1
- package/dist/chunks/{resolve-project-typescript-D66veK53.cjs → resolve-project-typescript-BOAxXiKm.cjs} +1 -1
- package/dist/chunks/{resolve-source-sdk-Cfn4KCbU.cjs → resolve-source-sdk-CyvER2l1.cjs} +1 -1
- package/dist/chunks/{run-api-graphql-command-Byg29Kwt.cjs → run-api-graphql-command-D-Pu9EdU.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-BVxjuvu0.cjs → run-api-rest-command-BuDANSQa.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-BzKv_KQW.cjs → run-app-add-command-C0b2LVQN.cjs} +3 -3
- package/dist/chunks/{run-app-apply-command-DwhPVSBM.cjs → run-app-apply-command-BnfxBO7o.cjs} +1 -1
- package/dist/chunks/{run-app-build-command-BeUcVmMK.cjs → run-app-build-command-tAj7RilT.cjs} +1 -1
- package/dist/chunks/{run-app-dev-command-BcdQ_GFC.cjs → run-app-dev-command-BnSJIUgg.cjs} +2 -2
- package/dist/chunks/{run-app-exec-command-DNbhEfkC.cjs → run-app-exec-command-BPlfFt9-.cjs} +2 -2
- package/dist/chunks/{run-app-generate-client-command-DxN3fEA1.cjs → run-app-generate-client-command-7t5Hs10P.cjs} +1 -1
- package/dist/chunks/run-app-init-command-BTUiHdOH.cjs +2 -0
- package/dist/chunks/{run-app-install-command-Btc0jUCP.cjs → run-app-install-command-DOzp9bOL.cjs} +1 -1
- package/dist/chunks/{run-app-logs-command-dfLruOJn.cjs → run-app-logs-command-CQDO_gce.cjs} +3 -3
- package/dist/chunks/{run-app-operation-Or8xoNyS.cjs → run-app-operation-BmlaxoZF.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-4BoAWJL8.cjs → run-app-plan-command-1cb1TuM6.cjs} +1 -1
- package/dist/chunks/run-app-publish-command-BPosULCY.cjs +1 -0
- package/dist/chunks/run-app-pull-command-BWbRZPTj.cjs +6 -0
- package/dist/chunks/{run-app-translations-extract-command-BtKIasjA.cjs → run-app-translations-extract-command-LUAa7jb9.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-CpaU-SSu.cjs → run-app-typecheck-command-3ZJqbU8D.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-BxFxIq7d.cjs → run-app-uninstall-command-BK-JAeo2.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-B2mdQ2u2.cjs → run-auth-login-command-CN6Xqgpx.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-ChQscyV4.cjs → run-auth-logout-command-Dw6CLfIY.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-kdN443Ay.cjs → run-auth-status-command-CXRrXjvh.cjs} +1 -1
- package/dist/chunks/{run-cli-BYGyQans.cjs → run-cli-BbuvDae1.cjs} +2 -2
- package/dist/chunks/{run-commands-command-CZnZ6zyN.cjs → run-commands-command-BrwpnI-3.cjs} +1 -1
- package/dist/chunks/{run-data-get-command--GOFyb1w.cjs → run-data-get-command-BD7i13MO.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-By_8ux8l.cjs → run-data-list-command-tcCgbeZj.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-BSwxxXiE.cjs → run-doctor-command-DmZ3dKc7.cjs} +2 -2
- package/dist/chunks/{run-metadata-field-describe-command-Dyfd4C9K.cjs → run-metadata-field-describe-command-BX5_s1m0.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-Cd7YnAki.cjs → run-metadata-field-list-command-BVFDiJv2.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-DJUVk4c3.cjs → run-metadata-object-describe-command-CWYI0V42.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-CYfHKqwb.cjs → run-metadata-object-list-command-Y3yebZrT.cjs} +1 -1
- package/dist/chunks/{run-open-command-smX2pJKi.cjs → run-open-command-BUEQSKSk.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-OotTwa0W.cjs → run-remote-list-command-BExGjyKO.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-C43pSDK9.cjs → run-remote-remove-command-D2thQnCU.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-fphQG7fM.cjs → run-remote-rename-command-DI0Adm5U.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-CpgiMu-K.cjs → run-remote-use-command-CXnu5zDY.cjs} +1 -1
- package/dist/chunks/{run-version-command-BugTbUa0.cjs → run-version-command-BxhaecEo.cjs} +1 -1
- package/dist/chunks/{select-target-CgDTzZ8p.cjs → select-target-CJ2FyoVQ.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-BmojAqdV.cjs → sign-in-to-remote-again-CwXAgGif.cjs} +1 -1
- package/dist/chunks/{sign-in-with-browser-1-CK0mOu.cjs → sign-in-with-browser-DdjoPq5d.cjs} +1 -1
- package/dist/chunks/{to-worker-output-diagnostics-BD6M8RST.cjs → to-worker-output-diagnostics-Hj6aQiK9.cjs} +2 -2
- package/dist/chunks/{typecheck-application-CQG69ztM.cjs → typecheck-application-nkgv6qiA.cjs} +1 -1
- package/dist/chunks/{update-config-BHs_Zv8h.cjs → update-config-XYMqGokt.cjs} +1 -1
- package/dist/chunks/{utils-BMycM5SC-9TsAPfH8.cjs → utils-RCpFyoX5-DF7Gq1IH.cjs} +2 -2
- package/dist/chunks/{write-config-atomically-BHOlbOl_.cjs → write-config-atomically-BxCEc8_P.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +7 -3
- package/package.json +2 -3
- package/src/app/bundles/README.md +3 -2
- package/src/app/pull/README.md +5 -2
- package/dist/chunks/compile-application-translations-Q8K18JOI.cjs +0 -1
- package/dist/chunks/create-metadata-client-C_ezBBSL.cjs +0 -6
- package/dist/chunks/create-pull-base-write-CyAWuU4_.cjs +0 -1
- package/dist/chunks/extract-manifest-from-file-CiZT_2AN.cjs +0 -1
- package/dist/chunks/fetch-workspace-id-BjsaXgwT.cjs +0 -1
- package/dist/chunks/global-flags.constant-DzvO9WzG.cjs +0 -1
- package/dist/chunks/locale-catalog-format-Dbn6JD4p.cjs +0 -20
- package/dist/chunks/metadata-BWVl-AS0.cjs +0 -1
- package/dist/chunks/parse-app-export-Ci1VgDGB.cjs +0 -1
- package/dist/chunks/pull-minimum-sdk-version.constant-B-1PY5i8.cjs +0 -5
- package/dist/chunks/pull-source-DcvqGJro.cjs +0 -1
- package/dist/chunks/read-json-object-ht56HC80.cjs +0 -1
- package/dist/chunks/record-pull-base-lUZgKmne.cjs +0 -1
- package/dist/chunks/run-app-init-command-b6UCdbdu.cjs +0 -2
- package/dist/chunks/run-app-publish-command-BSoeN498.cjs +0 -3
- package/dist/chunks/run-app-pull-command-_T-gRpRM.cjs +0 -3
- /package/dist/app-template/{AGENTS.md → example/files/AGENTS.md} +0 -0
- /package/dist/app-template/{CHANGELOG.md → example/files/CHANGELOG.md} +0 -0
- /package/dist/app-template/{README.md → example/files/README.md} +0 -0
- /package/dist/app-template/{SETUP.md → example/files/SETUP.md} +0 -0
- /package/dist/app-template/{github → example/files/github}/workflows/cd.yml +0 -0
- /package/dist/app-template/{github → example/files/github}/workflows/ci.yml +0 -0
- /package/dist/app-template/{github → example/files/github}/workflows/publish.yml +0 -0
- /package/dist/app-template/{locales → example/files/locales}/en.json +0 -0
- /package/dist/app-template/{public → example/files/public}/logo.svg +0 -0
- /package/dist/app-template/{src → example/files/src}/__tests__/application-config.test.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/__tests__/global-setup.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/__tests__/run-twenty.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/__tests__/schema.integration-test.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/application-config.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/constants/universal-identifiers.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/default-role.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/front-components/main-page.tsx +0 -0
- /package/dist/app-template/{src → example/files/src}/logic-functions/health-check.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/navigation-menu-items/main-page.navigation-menu-item.ts +0 -0
- /package/dist/app-template/{src → example/files/src}/page-layouts/main-page.page-layout.ts +0 -0
- /package/dist/app-template/{tsconfig.spec.json → example/files/tsconfig.spec.json} +0 -0
- /package/dist/app-template/{vitest.config.ts → example/files/vitest.config.ts} +0 -0
- /package/dist/app-template/{vitest.unit.config.ts → example/files/vitest.unit.config.ts} +0 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -166,7 +166,11 @@ node packages/twenty-cli/scripts/prepublish.mjs
|
|
|
166
166
|
|
|
167
167
|
## App integration tests
|
|
168
168
|
|
|
169
|
-
`app-template
|
|
169
|
+
`app-template/` contains the shared project scaffold. `app init` layers
|
|
170
|
+
`app-template/example/files/` and `example/scripts.json` onto it; `app pull`
|
|
171
|
+
uses only the shared scaffold before writing the exported definitions.
|
|
172
|
+
|
|
173
|
+
`app-template/example/files/src/__tests__` supplies the integration-test setup for CLI-created apps.
|
|
170
174
|
It deploys the app before tests and uninstalls it afterward by invoking the
|
|
171
175
|
installed CLI with `--json`. Apps invoke the executable rather than import the
|
|
172
176
|
CLI as a library or add it as a dependency. See the
|
|
@@ -13,10 +13,7 @@
|
|
|
13
13
|
"twenty": "twenty",
|
|
14
14
|
"lint": "oxlint -c .oxlintrc.json .",
|
|
15
15
|
"lint:fix": "oxlint --fix -c .oxlintrc.json .",
|
|
16
|
-
"typecheck": "tsgo --noEmit -p tsconfig.
|
|
17
|
-
"test": "vitest run",
|
|
18
|
-
"test:watch": "vitest",
|
|
19
|
-
"test:unit": "vitest run --config vitest.unit.config.ts"
|
|
16
|
+
"typecheck": "tsgo --noEmit -p tsconfig.json"
|
|
20
17
|
},
|
|
21
18
|
"dependencies": {},
|
|
22
19
|
"devDependencies": {
|
|
@@ -517,20 +517,20 @@ __metadata:
|
|
|
517
517
|
linkType: hard
|
|
518
518
|
|
|
519
519
|
"@tabler/icons-react@npm:^3.31.0":
|
|
520
|
-
version: 3.
|
|
521
|
-
resolution: "@tabler/icons-react@npm:3.
|
|
520
|
+
version: 3.50.0
|
|
521
|
+
resolution: "@tabler/icons-react@npm:3.50.0"
|
|
522
522
|
dependencies:
|
|
523
|
-
"@tabler/icons": "npm:3.
|
|
523
|
+
"@tabler/icons": "npm:3.50.0"
|
|
524
524
|
peerDependencies:
|
|
525
525
|
react: ">= 16"
|
|
526
|
-
checksum: 10c0/
|
|
526
|
+
checksum: 10c0/5c5b7293c8df91e66c2fce515b7894f00ac94b4ef230f66d42b6eaf97caa9871e31a14157bb1e681894055eaf572fe34ccf8750ba262baa48736a3fc7f39df9f
|
|
527
527
|
languageName: node
|
|
528
528
|
linkType: hard
|
|
529
529
|
|
|
530
|
-
"@tabler/icons@npm:3.
|
|
531
|
-
version: 3.
|
|
532
|
-
resolution: "@tabler/icons@npm:3.
|
|
533
|
-
checksum: 10c0/
|
|
530
|
+
"@tabler/icons@npm:3.50.0":
|
|
531
|
+
version: 3.50.0
|
|
532
|
+
resolution: "@tabler/icons@npm:3.50.0"
|
|
533
|
+
checksum: 10c0/d274fb47a5ee2ad27fa599fba7f3d4c8aa8d02b4cc7e5544862b937215fdb7716e73cc4c3e4bf2c390e9402c8ae70f8d8945cb8b62af5c2aee67007f65c79f22
|
|
534
534
|
languageName: node
|
|
535
535
|
linkType: hard
|
|
536
536
|
|
|
@@ -774,9 +774,9 @@ __metadata:
|
|
|
774
774
|
oxlint: "npm:^0.16.0"
|
|
775
775
|
react: "npm:^19.0.0"
|
|
776
776
|
react-dom: "npm:^19.0.0"
|
|
777
|
-
twenty-client-sdk: "npm:2.
|
|
778
|
-
twenty-sdk: "npm:2.
|
|
779
|
-
twenty-ui: "npm:2.
|
|
777
|
+
twenty-client-sdk: "npm:2.54.0"
|
|
778
|
+
twenty-sdk: "npm:2.54.0"
|
|
779
|
+
twenty-ui: "npm:2.54.0"
|
|
780
780
|
typescript: "npm:^5.9.3"
|
|
781
781
|
vite-tsconfig-paths: "npm:^4.2.1"
|
|
782
782
|
vitest: "npm:^4.1.12"
|
|
@@ -1366,25 +1366,25 @@ __metadata:
|
|
|
1366
1366
|
linkType: hard
|
|
1367
1367
|
|
|
1368
1368
|
"postcss@npm:^8.5.30":
|
|
1369
|
-
version: 8.5.
|
|
1370
|
-
resolution: "postcss@npm:8.5.
|
|
1369
|
+
version: 8.5.32
|
|
1370
|
+
resolution: "postcss@npm:8.5.32"
|
|
1371
1371
|
dependencies:
|
|
1372
1372
|
nanoid: "npm:^3.3.20"
|
|
1373
1373
|
picocolors: "npm:^1.1.1"
|
|
1374
1374
|
source-map-js: "npm:^1.2.2"
|
|
1375
|
-
checksum: 10c0/
|
|
1375
|
+
checksum: 10c0/5fa6cad84e277c2ced965dc7e8e7c0b8d7e5b76a6835591b57a43fde46e671d0c8428d365e9141c080abaae5441d495ed77ffd7472c5bd41d6c2154bd03c01d7
|
|
1376
1376
|
languageName: node
|
|
1377
1377
|
linkType: hard
|
|
1378
1378
|
|
|
1379
1379
|
"preact@npm:^11.0.0":
|
|
1380
|
-
version: 11.0
|
|
1381
|
-
resolution: "preact@npm:11.0
|
|
1380
|
+
version: 11.1.0
|
|
1381
|
+
resolution: "preact@npm:11.1.0"
|
|
1382
1382
|
peerDependencies:
|
|
1383
1383
|
preact-render-to-string: ">=6.7.0"
|
|
1384
1384
|
peerDependenciesMeta:
|
|
1385
1385
|
preact-render-to-string:
|
|
1386
1386
|
optional: true
|
|
1387
|
-
checksum: 10c0/
|
|
1387
|
+
checksum: 10c0/ca267ae9e7c477c9673dba115ad9a023a5ea39c38cb462dad804495dbf5d01fe2309658c41e2296384e9871ac8387414b3ac440950d46fdedf43579a0b1ffd94
|
|
1388
1388
|
languageName: node
|
|
1389
1389
|
linkType: hard
|
|
1390
1390
|
|
|
@@ -1657,37 +1657,37 @@ __metadata:
|
|
|
1657
1657
|
languageName: node
|
|
1658
1658
|
linkType: hard
|
|
1659
1659
|
|
|
1660
|
-
"twenty-client-sdk@npm:2.
|
|
1661
|
-
version: 2.
|
|
1662
|
-
resolution: "twenty-client-sdk@npm:2.
|
|
1660
|
+
"twenty-client-sdk@npm:2.54.0":
|
|
1661
|
+
version: 2.54.0
|
|
1662
|
+
resolution: "twenty-client-sdk@npm:2.54.0"
|
|
1663
1663
|
dependencies:
|
|
1664
1664
|
"@genql/runtime": "npm:^2.10.0"
|
|
1665
1665
|
esbuild: "npm:^0.28.1"
|
|
1666
1666
|
graphql: "npm:^16.8.1"
|
|
1667
1667
|
lodash: "npm:^4.17.21"
|
|
1668
1668
|
prettier: "npm:^3.8.3"
|
|
1669
|
-
checksum: 10c0/
|
|
1669
|
+
checksum: 10c0/bd7d4c8c0e9f2d1ab4d60942932a548655d8aad90c440861dbf38a04ca009d04d56e2ddba8c7d27b10068e592c92f6339c4c679ea4854078db8c843bbf254dfd
|
|
1670
1670
|
languageName: node
|
|
1671
1671
|
linkType: hard
|
|
1672
1672
|
|
|
1673
|
-
"twenty-sdk@npm:2.
|
|
1674
|
-
version: 2.
|
|
1675
|
-
resolution: "twenty-sdk@npm:2.
|
|
1673
|
+
"twenty-sdk@npm:2.54.0":
|
|
1674
|
+
version: 2.54.0
|
|
1675
|
+
resolution: "twenty-sdk@npm:2.54.0"
|
|
1676
1676
|
dependencies:
|
|
1677
1677
|
"@sniptt/guards": "npm:^0.2.0"
|
|
1678
1678
|
esbuild: "npm:^0.28.1"
|
|
1679
1679
|
preact: "npm:^11.0.0"
|
|
1680
1680
|
react: "npm:^19.2.0"
|
|
1681
1681
|
react-dom: "npm:^19.2.0"
|
|
1682
|
-
twenty-client-sdk: "npm:2.
|
|
1682
|
+
twenty-client-sdk: "npm:2.54.0"
|
|
1683
1683
|
uuid: "npm:^13.0.2"
|
|
1684
|
-
checksum: 10c0/
|
|
1684
|
+
checksum: 10c0/a18efe41846227628d8ed92840834cf61e5ceaf84866d1f0b86b5dc946458d36f09bd251b053855c48bc99c16a4cae3270389b2a04ed29f093f06776979d03a6
|
|
1685
1685
|
languageName: node
|
|
1686
1686
|
linkType: hard
|
|
1687
1687
|
|
|
1688
|
-
"twenty-ui@npm:2.
|
|
1689
|
-
version: 2.
|
|
1690
|
-
resolution: "twenty-ui@npm:2.
|
|
1688
|
+
"twenty-ui@npm:2.54.0":
|
|
1689
|
+
version: 2.54.0
|
|
1690
|
+
resolution: "twenty-ui@npm:2.54.0"
|
|
1691
1691
|
dependencies:
|
|
1692
1692
|
"@base-ui/react": "npm:^1.9.0"
|
|
1693
1693
|
"@base-ui/utils": "npm:0.5.0"
|
|
@@ -1707,7 +1707,7 @@ __metadata:
|
|
|
1707
1707
|
optional: true
|
|
1708
1708
|
monaco-editor:
|
|
1709
1709
|
optional: true
|
|
1710
|
-
checksum: 10c0/
|
|
1710
|
+
checksum: 10c0/8cf78424c9f31369b04432fd00e2aae80a52ef9c751334e490429e0d46b227857d3640b4929bacd794fcf1af13ed7cb73831eb69b672ace550a8368f0180c517
|
|
1711
1711
|
languageName: node
|
|
1712
1712
|
linkType: hard
|
|
1713
1713
|
|
package/dist/app-worker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./chunks/build--4zYt4wd.cjs"),t=require("./chunks/isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./chunks/constants-
|
|
1
|
+
const e=require("./chunks/build--4zYt4wd.cjs"),t=require("./chunks/isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./chunks/constants-Cbb71hpl-CrSqydxj.cjs");var r=e.t(),i=5e3,a=new AbortController,o,s=e=>{if(n.i(e)){if(e.type===`cancel`||e.type===`release`)return{type:e.type};if(e.type===`readSourceIdentity`||e.type===`buildManifest`||e.type===`typecheckSource`)return(0,r.isNonEmptyString)(e.appPath)?{type:e.type,appPath:e.appPath}:void 0;if(e.type===`bundleSnapshot`)return(0,r.isNonEmptyString)(e.appPath)?{type:`bundleSnapshot`,collectWatchInputs:e.collectWatchInputs===!0,appPath:e.appPath,holdSnapshot:e.holdSnapshot===!0}:void 0;if(e.type===`pull`)return!(0,r.isNonEmptyString)(e.appPath)||!n.i(e.target)||!(0,r.isNonEmptyString)(e.target.apiUrl)||!(0,r.isNonEmptyString)(e.target.workspaceId)||!n.i(e.applicationExport)||!n.i(e.applicationExport.application)||!(0,r.isNonEmptyString)(e.applicationExport.application.universalIdentifier)?void 0:{type:`pull`,appPath:e.appPath,target:{apiUrl:e.target.apiUrl,workspaceId:e.target.workspaceId},applicationExport:e.applicationExport};if(e.type===`extractTranslations`)return(0,r.isNonEmptyString)(e.appPath)&&(!t.t(e.locale)||(0,r.isString)(e.locale))?{type:`extractTranslations`,appPath:e.appPath,locale:e.locale??void 0}:void 0;if(e.type===`generateSourceClient`)return(0,r.isNonEmptyString)(e.appPath)&&(0,r.isString)(e.schema)?{type:`generateSourceClient`,appPath:e.appPath,schema:e.schema}:void 0}},c=e=>{process.connected||process.exit(1),process.send?.(e,void 0,{},()=>process.exit(0))},l=async()=>{if(!t.t(o))return null;let{snapshotApi:e,buildId:n}=o;return o=void 0,e.releaseSourceSnapshot({buildId:n})},u=()=>{l().then(()=>process.exit(1),()=>process.exit(1))},d=e=>{if(!process.connected){u();return}process.send?.(e)},f=e=>{if(!(!n.i(e)||e.success!==!0||!n.i(e.data)))return(0,r.isNonEmptyString)(e.data.buildId)?e.data.buildId:void 0},p=async({snapshotApi:e,appPath:n,holdSnapshot:r})=>{let i=a.signal,s=await e.buildSourceSnapshot({appPath:n,signal:i}),c=f(s);return t.t(c)?r?(o={snapshotApi:e,buildId:c},{type:`result`,result:s,isSnapshotHeld:!0}):{type:`result`,result:s,release:await e.releaseSourceSnapshot({buildId:c}),isSnapshotHeld:!1}:{type:`result`,result:s,isSnapshotHeld:!1}},m=e=>({type:`failure`,message:e instanceof Error?e.message:String(e),...e instanceof Error&&`code`in e&&(0,r.isString)(e.code)?{code:e.code}:{},...e instanceof Error&&`hint`in e&&(0,r.isString)(e.hint)?{hint:e.hint}:{},...e instanceof Error&&`details`in e&&n.i(e.details)?{details:e.details}:{}});process.on(`SIGINT`,()=>void 0),process.on(`disconnect`,()=>{a.abort(),setTimeout(()=>process.exit(1),i),t.t(o)&&u()}),process.on(`message`,e=>{let n=s(e);if(!t.t(n)){c({type:`failure`,message:`The app worker received a request it cannot read.`});return}if(n.type===`cancel`){a.abort();return}if(n.type===`release`){l().then(e=>c({type:`released`,release:e}),e=>c(m(e)));return}if(n.type===`pull`){Promise.resolve().then(()=>require("./chunks/pull-source-CpAYRk5s.cjs")).then(async({pullSource:e})=>{c({type:`result`,result:await e({...n,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`bundleSnapshot`){Promise.resolve().then(()=>require("./chunks/build-source-snapshot-BMjdktTk.cjs")).then(async({buildSourceSnapshot:e,releaseSourceSnapshot:t})=>{let r=()=>p({snapshotApi:{buildSourceSnapshot:e,releaseSourceSnapshot:t},appPath:n.appPath,holdSnapshot:n.holdSnapshot});if(!n.collectWatchInputs)return r();let{collectWatchInputs:i}=await Promise.resolve().then(()=>require("./chunks/collect-watch-inputs-Dn6g1cNu.cjs")).then(e=>e.t),{recordTypecheckConfigInputs:a}=await Promise.resolve().then(()=>require("./chunks/record-typecheck-config-inputs-BGVirGsR.cjs")),o=await i(async()=>(await a(n.appPath),r()));return{...o.result,watchInputs:o.watchInputs}}).then(e=>e.type===`result`&&e.isSnapshotHeld?d(e):c(e),e=>c(m(e)));return}if(n.type===`typecheckSource`){Promise.resolve().then(()=>require("./chunks/typecheck-application-nkgv6qiA.cjs")).then(e=>e.n).then(async({typecheckApplication:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`extractTranslations`){Promise.resolve().then(()=>require("./chunks/extract-source-translations-BKXfzm51.cjs")).then(async({extractSourceTranslations:e})=>{c({type:`result`,result:await e({appPath:n.appPath,locale:n.locale,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`buildManifest`){Promise.resolve().then(()=>require("./chunks/build-source-manifest-DPsTlw7Z.cjs")).then(async({buildSourceManifest:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`readSourceIdentity`){Promise.resolve().then(()=>require("./chunks/read-source-identity-BQ_YGISo.cjs")).then(async({readSourceIdentity:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`generateSourceClient`){Promise.resolve().then(()=>require("./chunks/generate-application-client-CL8nm0q9.cjs")).then(async({generateApplicationClient:e})=>{c({type:`result`,result:await e({appPath:n.appPath,schema:n.schema,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("./build--4zYt4wd.cjs"),t=require("./utils-BMycM5SC-9TsAPfH8.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Bod2d_GP-CQVvzM4m.cjs"),i=require("./get-system-view-universal-identifier.util-C6XI2VGC-Dy2DReV-.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.n(e)&&c(e.isLeaf),I=e=>r.n(e)&&e._outputSchemaType===`RECORD`&&r.n(e.fields),Re=e=>r.n(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.n(o)?He(o,a):P:P},R=(e,t)=>t.length===0||!r.n(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.n(e))for(let n of z(e))t.push(`${i}.${n}`)}else if(n.t(a)&&(t.push(i),r.n(a)))for(let e of z(a))t.push(`${i}.${e}`);return t},B=e=>{if(!r.n(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.n(e)?e._outputSchemaType===`RECORD`||Object.values(e).some(e=>r.n(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:
|
|
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
2
|
- Person: {"name": {"firstName": "John", "lastName": "Doe"}, "emails": {"primaryEmail": "john@example.com"}, "company": {"id": "{{trigger.properties.after.id}}"}}
|
|
3
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()}),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.n(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.a.default.h,columnSpan:r.a.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`},Z=({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}},Xt=e=>JSON.stringify(e,(e,t)=>r.n(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),Zt=({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},Qt=({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=>Xt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:Zt({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},$t=r.t.map(e=>r.o[e]),en=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),tn=({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`}]:[]],nn=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...$t,...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}))},rn=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=Z({role:e,objectUniversalIdentifier:n}),i=Z({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=Qt({role:t,objectUniversalIdentifier:n}),c=Qt({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!en({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),an=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=Z({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`}]:[]]}),on=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...tn({role:e,superset:t}),...nn({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...rn({role:e,superset:t}),...an({role:e,superset:t})],sn=e=>i.p(e)&&s(e)>=4,cn={universalIdentifier:r.lt(),name:r.at().min(1),nextStepIds:r.G(r.lt()),position:r.tt({x:r.et(),y:r.et()}).optional(),outputSchema:r.rt(r.at(),r.ct()).optional(),expectedOutputSchema:r.rt(r.at(),r.ct()).optional(),errorHandlingOptions:H.shape.errorHandlingOptions.optional()},Q=(e,t)=>r.it({...cn,type:r.Z(e),input:t}),ln=r.Q({fieldMetadataUniversalIdentifier:r.lt(),fieldMetadataId:r.$().optional()}),un=K.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:r.lt().optional()}).strict(),dn=ht.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:r.lt()}).strict(),$={objectUniversalIdentifier:r.lt()},fn={connectedAccountId:r.at().optional(),connectedAccountHandle:r.at().trim().min(1).optional()},pn=(e,t)=>{n.t(e.connectedAccountId)===n.t(e.connectedAccountHandle)&&t.addIssue({code:`custom`,path:[`connectedAccountHandle`],message:`Set exactly one of connectedAccountId and connectedAccountHandle`})},mn=wt.shape.input.extend(fn).superRefine(pn),hn=[r.it({...cn,type:r.Z(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:r.lt(),input:r.rt(r.at(),r.ct())}),Q(`HTTP_REQUEST`,tt.shape.input),Q(`CLASSIFY`,at.shape.input),Q(`ITERATOR`,ot.shape.input),Q(`DELAY`,st.shape.input),Q(`WAIT_FOR_EVENT`,ct.shape.input),Q(`EMPTY`,lt.shape.input),Q(`CREATE_RECORD`,ut.shape.input.omit({objectName:!0}).extend($).strict()),Q(`UPDATE_RECORD`,dt.shape.input.omit({objectName:!0}).extend($).strict()),Q(`UPSERT_RECORD`,ft.shape.input.omit({objectName:!0}).extend($).strict()),Q(`DELETE_RECORD`,pt.shape.input.omit({objectName:!0}).extend($).strict()),Q(`FIND_RECORDS`,gt.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...$,filter:r.it({recordFilterGroups:r.G(mt).optional(),recordFilters:r.G(dn).optional()}).optional(),orderBy:r.it({recordSorts:r.G(ln.extend({direction:r.H([`ASC`,`DESC`]),subFieldName:r.at().nullable().optional()})).optional()}).optional()}).strict()),Q(`PICK_RECORD`,r.it({...$,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`})})),Q(`FILTER`,yt.shape.input.extend({stepFilters:r.G(un)})),Q(`IF_ELSE`,xt.shape.input.extend({stepFilters:r.G(un)})),Q(`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`})}))),Q(`SEND_EMAIL`,mn),Q(`DRAFT_EMAIL`,mn),Q(`CREATE_CALENDAR_EVENT`,Tt.shape.input.extend(fn).superRefine(pn)),Q(`AI_AGENT`,r.it({agentUniversalIdentifier:r.lt(),prompt:r.at(),responseFormat:Qe.optional()}))],gn=hn.map(e=>e.shape.type.value),_n=r.q(`type`,hn,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${gn.join(`, `)}`:void 0}),vn=[`updated`,`upserted`],yn=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()})]),[bn,xn,Sn,Cn]=Ot.shape.settings.options,wn=r.q(`type`,[bn.omit({outputSchema:!0}).extend({schedule:bn.shape.schedule.strict()}).strict(),xn.omit({outputSchema:!0}).extend({schedule:xn.shape.schedule.strict()}).strict(),Sn.omit({outputSchema:!0}).extend({schedule:Sn.shape.schedule.strict()}).strict(),Cn.omit({outputSchema:!0}).strict()]),[Tn,En]=kt.shape.settings.options,Dn=r.q(`httpMethod`,[Tn.omit({outputSchema:!0,authentication:!0}).strict(),En.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),On=[r.it({universalIdentifier:r.lt(),type:r.Z(`MANUAL`),nextStepIds:r.G(r.lt()).min(1),settings:r.it({availability:yn.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({universalIdentifier:r.lt(),type:r.Z(`CRON`),nextStepIds:r.G(r.lt()).min(1),settings:wn}),r.it({universalIdentifier:r.lt(),type:r.Z(`DATABASE_EVENT`),nextStepIds:r.G(r.lt()).min(1),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(un.extend({operand:r.H(r.h)}))}).optional()}).superRefine((e,r)=>{if(t.n(e.fieldUniversalIdentifiers)&&!vn.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${vn.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({universalIdentifier:r.lt(),type:r.Z(`WEBHOOK`),nextStepIds:r.G(r.lt()).min(1),settings:Dn})],kn=On.map(e=>e.shape.type.value),An=r.q(`type`,On,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${kn.join(`, `)}`:void 0});r.it({universalIdentifier:r.lt(),name:r.at().min(1),isSystem:r.K().optional(),version:r.it({trigger:An,steps:r.G(_n).min(1)})}).superRefine((e,t)=>{let{steps:n,trigger:r}=e.version,i=[e.universalIdentifier,r.universalIdentifier,...n.map(e=>e.universalIdentifier)];new Set(i).size!==i.length&&t.addIssue({code:`custom`,message:`Workflow, trigger and steps must have distinct universal identifiers`});let a={trigger:{type:r.type,nextStepIds:r.nextStepIds},steps:n.map(e=>({...e,id:e.universalIdentifier,settings:{input:e.input}}))},o=Pt(a);for(let e of[...Lt({workflow:a,graph:o}),...It({workflow:a,graph:o}),...qe({workflow:a,graph:o,stepsById:new Map(a.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 Vt}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Ht}});
|
|
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}});
|
package/dist/chunks/{build-source-manifest-BIq-ByiX.cjs → build-source-manifest-DPsTlw7Z.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./get-tooling-error-context-CZKTM7Q6.cjs"),n=require("./compile-application-translations-
|
|
1
|
+
const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./get-tooling-error-context-CZKTM7Q6.cjs"),n=require("./compile-application-translations-DB-cG9Im.cjs"),r=require("./resolve-source-sdk-CyvER2l1.cjs");let i=require("esbuild");var a=async({appPath:a,signal:o})=>{let s=[],c=e=>{s.push({severity:`warning`,code:`BUILD_WARNING`,message:e})};try{o.throwIfAborted(),await r.t({appPath:a});let e=await n.r(a);if(o.throwIfAborted(),!e.success)return{success:!1,error:{code:`MANIFEST_BUILD_FAILED`,message:e.errors.join(`
|
|
2
2
|
`)},diagnostics:e.errors.map(e=>({severity:`error`,code:`MANIFEST_BUILD_FAILED`,message:e}))};e.warnings.forEach(c);let t=await n.t({appPath:a,onWarning:c});return o.throwIfAborted(),{success:!0,data:{manifest:{...e.manifest,translations:t},filePaths:e.filePaths},diagnostics:s}}catch(n){return{success:!1,error:{code:o.aborted?`CANCELLED`:n instanceof e.t?n.code:`MANIFEST_BUILD_FAILED`,message:n instanceof Error?n.message:String(n),...t.t(n)},diagnostics:s}}finally{await(0,i.stop)()}};exports.buildSourceManifest=a;
|