twenty 2.46.0 → 2.48.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 +25 -17
- package/dist/app-template/yarn.lock +24 -24
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/application-VJqniwXy.cjs +5 -0
- package/dist/chunks/build-pull-entities-BBNc4zkt.cjs +5 -0
- package/dist/chunks/{build-source-manifest-CLKH5vzc.cjs → build-source-manifest-BMjw7BvT.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-CbGsy1-v.cjs → build-source-snapshot-BbQlyo_m.cjs} +7 -7
- package/dist/chunks/{check-node-requirement-mqwNPktb.cjs → check-node-requirement-CGBKvEqH.cjs} +1 -1
- package/dist/chunks/cli-node-version-range.constant-D7fE8edk.cjs +1 -0
- package/dist/chunks/cli-version.constant-BJdY4dXs.cjs +1 -0
- package/dist/chunks/collect-translatable-strings-C3TWaO1V.cjs +1 -0
- package/dist/chunks/{collect-watch-inputs-B9jWG4W0.cjs → collect-watch-inputs-Cexr5YYZ.cjs} +1 -1
- package/dist/chunks/compile-application-translations-Dhfvrs__.cjs +1 -0
- package/dist/chunks/{constants-CL6mrTMT-B748cNNG.cjs → constants-Du9J-8Ug-CD8GTrut.cjs} +1 -1
- package/dist/chunks/{convert-to-label-BPBLtc_O.cjs → convert-to-label-D24GvvpW.cjs} +1 -1
- package/dist/chunks/create-app-not-installed-error-DY-iuPPx.cjs +1 -0
- package/dist/chunks/{create-http-status-error-D3gy3DzB.cjs → create-http-status-error-Dd3336c8.cjs} +1 -1
- package/dist/chunks/create-metadata-client-DEBMHFDo.cjs +6 -0
- package/dist/chunks/create-pull-base-write-Cl1jfQ6l.cjs +1 -0
- package/dist/chunks/{create-rest-client-eAfOFfDA.cjs → create-rest-client-r3OA3fUu.cjs} +16 -14
- package/dist/chunks/create-tooling-failure-B2FmNwR2.cjs +1 -0
- package/dist/chunks/{extract-manifest-from-file-j-Y9wNas.cjs → extract-manifest-from-file-D3w7Ampa.cjs} +1 -1
- package/dist/chunks/extract-source-translations-BLQ-XFuN.cjs +1 -0
- package/dist/chunks/{fetch-metadata-inspection-Dp034TpK.cjs → fetch-metadata-inspection-BwJjaHCB.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-BhvaL3zp.cjs → fetch-signed-in-identity-CWFlsW7e.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-id-DJStmf_V.cjs → fetch-workspace-id-DJFdCITG.cjs} +1 -1
- package/dist/chunks/format-body-CJyi3Ukr.cjs +1 -0
- package/dist/chunks/{format-data-value-B6rIbpJv.cjs → format-data-value-C5itQm1i.cjs} +1 -1
- package/dist/chunks/format-display-path-gEepVJDg.cjs +1 -0
- package/dist/chunks/{format-metadata-fields-DJnTg1R9.cjs → format-metadata-fields-BozY419E.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-yUeocnwY.cjs → format-metadata-owner-C6CksDIK.cjs} +1 -1
- package/dist/chunks/format-progress-line-C5nYDVHB.cjs +1 -0
- package/dist/chunks/generate-application-client-BApuJWQO.cjs +1 -0
- package/dist/chunks/{get-app-plan-summary-B0uwHXbO.cjs → get-app-plan-summary-F_MjZOGe.cjs} +2 -2
- package/dist/chunks/get-client-generation-skip-reason-B5f_gcok.cjs +1 -0
- package/dist/chunks/get-client-sdk-package-path-2U3kDCRq.cjs +1 -0
- package/dist/chunks/{get-function-input-schema-GNk3NRLJ-Bfph1o9z.cjs → get-function-input-schema-GNk3NRLJ-oQ5Evald.cjs} +1 -1
- package/dist/chunks/global-flags.constant-BPHQAhn7.cjs +1 -0
- package/dist/chunks/is-access-token-expiring-DIimejBr.cjs +1 -0
- package/dist/chunks/{is-application-not-found-error-mNeGbxmT.cjs → is-application-not-found-error-D0BAcKyX.cjs} +1 -1
- package/dist/chunks/is-exported-manifest-RF_O2ibz.cjs +1 -0
- package/dist/chunks/is-inside-directory-DHVCQE5C.cjs +1 -0
- package/dist/chunks/{is-interaction-allowed-ycbAFMIj.cjs → is-interaction-allowed-CF-ko1KI.cjs} +1 -1
- package/dist/chunks/is-locale-catalog-Dzj6m_Xt.cjs +1 -0
- package/dist/chunks/is-supported-locale-C9iuFQ39.cjs +1 -0
- package/dist/chunks/{is-supported-locale-BAjnKnKj.cjs → locale-catalog-format-BT6ommA1.cjs} +5 -5
- package/dist/chunks/metadata-BtOyR6x0.cjs +1 -0
- package/dist/chunks/{metadata-page.constant-BkG4ndrO.cjs → metadata-page.constant-CnR03vnh.cjs} +1 -1
- package/dist/chunks/{parse-api-url-BllxRdpE.cjs → parse-api-url-C9MmGtLY.cjs} +1 -1
- package/dist/chunks/{parse-app-export-BkfflyUY.cjs → parse-app-export-BT6nM7Ki.cjs} +1 -1
- package/dist/chunks/parse-extraction-locale-CM7sARBo.cjs +1 -0
- package/dist/chunks/{parse-graphql-response-CtP9KTS2.cjs → parse-graphql-response-DbYu3YlQ.cjs} +1 -1
- package/dist/chunks/{parse-json-input-CvMTKAWw.cjs → parse-json-input-DaXTn_6C.cjs} +1 -1
- package/dist/chunks/{print-typescript-value-DhElcFzI.cjs → print-typescript-value-BoxeFXca.cjs} +1 -1
- package/dist/chunks/pull-source-DNswr_80.cjs +1 -0
- package/dist/chunks/read-app-identity-CtO3wiSx.cjs +1 -0
- package/dist/chunks/read-application-identifier-B51ax_Q6.cjs +1 -0
- package/dist/chunks/{read-application-identity-BFg_p84F.cjs → read-application-identity-Bx8B9Bel.cjs} +1 -1
- package/dist/chunks/{read-config-DUJ27809.cjs → read-config-LKYhSPOb.cjs} +1 -1
- package/dist/chunks/read-json-object-BONMjSVo.cjs +1 -0
- package/dist/chunks/read-snapshot-file-ClIpemjz.cjs +1 -0
- package/dist/chunks/{read-source-identity-C8LG1v6U.cjs → read-source-identity-C4eKC14c.cjs} +1 -1
- package/dist/chunks/record-pull-base-CdTOndSf.cjs +1 -0
- package/dist/chunks/{record-typecheck-config-inputs-BDqkKCrj.cjs → record-typecheck-config-inputs-DcCY-_Z1.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-C4KKlTQT.cjs → request-oauth-tokens-CS79pVAp.cjs} +1 -1
- package/dist/chunks/require-approval-D0FfoHhF.cjs +1 -0
- package/dist/chunks/resolve-app-project-BQnFOdLH.cjs +1 -0
- package/dist/chunks/resolve-command-target-CKYtQQPx.cjs +1 -0
- package/dist/chunks/resolve-inside-sdk-Cc_y-RWT.cjs +1 -0
- package/dist/chunks/{resolve-metadata-object-QoDi-Aik.cjs → resolve-metadata-object-CRWbF9Ce.cjs} +1 -1
- package/dist/chunks/resolve-project-typescript-CZW_p97L.cjs +1 -0
- package/dist/chunks/{resolve-request-url-jC5kYwkn.cjs → resolve-request-url-BrqiqInn.cjs} +1 -1
- package/dist/chunks/resolve-source-sdk-CGEJC-UH.cjs +1 -0
- package/dist/chunks/{run-api-graphql-command-Biy0WqXa.cjs → run-api-graphql-command-KlIMjpOY.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-D9kdQceV.cjs → run-api-rest-command-W4gCU562.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-DcTQg7Si.cjs → run-app-add-command-C6rIt02R.cjs} +5 -5
- package/dist/chunks/run-app-apply-command-BckNNni9.cjs +2 -0
- package/dist/chunks/{run-app-build-command-BRYb0one.cjs → run-app-build-command-DW0r-w2C.cjs} +1 -1
- package/dist/chunks/run-app-dev-command-C3U-3OiV.cjs +2 -0
- package/dist/chunks/run-app-exec-command-DNeCk5qs.cjs +3 -0
- package/dist/chunks/run-app-generate-client-command-HAgBNVFU.cjs +2 -0
- package/dist/chunks/run-app-init-command-dTbY28oS.cjs +2 -0
- package/dist/chunks/run-app-install-command-BX30OsrQ.cjs +1 -0
- package/dist/chunks/run-app-logs-command-CdAXR-XY.cjs +9 -0
- package/dist/chunks/run-app-operation--X_q0SAn.cjs +1 -0
- package/dist/chunks/run-app-plan-command-Bm1eXl7V.cjs +1 -0
- package/dist/chunks/run-app-publish-command-Cdb3OlI2.cjs +3 -0
- package/dist/chunks/run-app-pull-command-DljZP4Ey.cjs +3 -0
- package/dist/chunks/run-app-translations-extract-command-Cc053lZ6.cjs +2 -0
- package/dist/chunks/{run-app-typecheck-command-C8LqpOej.cjs → run-app-typecheck-command-B7o20_BR.cjs} +1 -1
- package/dist/chunks/run-app-uninstall-command-DJsWZtoI.cjs +2 -0
- package/dist/chunks/{run-auth-login-command-_zDgRcth.cjs → run-auth-login-command-21pHzpvT.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-BO6O7GVi.cjs → run-auth-logout-command-DWOafJmL.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-Cj-vqoHg.cjs → run-auth-status-command-BBAcouvs.cjs} +1 -1
- package/dist/chunks/{run-cli-c9TOR0zj.cjs → run-cli-D1VWVXar.cjs} +8 -8
- package/dist/chunks/{run-commands-command-C6gvMpQ_.cjs → run-commands-command-6x3V48LL.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-jDEU4EG1.cjs → run-data-get-command-DrgvC-zi.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-EnCdbuzc.cjs → run-data-list-command-Cs8GAHbD.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-DnJ6io-m.cjs → run-doctor-command-BM4pkNY0.cjs} +2 -2
- package/dist/chunks/{run-metadata-field-describe-command-vJngpw2S.cjs → run-metadata-field-describe-command-CrmzNFh8.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-CR4w7fI6.cjs → run-metadata-field-list-command-B2CbERvZ.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-CHP8K-W2.cjs → run-metadata-object-describe-command-PLt5ySLJ.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-BqXMcAp6.cjs → run-metadata-object-list-command-BcnWKmgh.cjs} +1 -1
- package/dist/chunks/{run-open-command-DKl8acw0.cjs → run-open-command-CzMO5wI4.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-DeAzr5Mn.cjs → run-remote-list-command-37zf0rSp.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-D0C5sWjP.cjs → run-remote-remove-command-B-XUqYBY.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-Byq9WRHd.cjs → run-remote-rename-command-Bmg3nZfB.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-B6VVDlMG.cjs → run-remote-use-command-r2NUlgWw.cjs} +1 -1
- package/dist/chunks/{run-version-command-BmSk8PUV.cjs → run-version-command-DfDcA927.cjs} +1 -1
- package/dist/chunks/{select-target-C1VZjf-A.cjs → select-target-CEy96CC9.cjs} +1 -1
- package/dist/chunks/sign-in-to-remote-again-9cHGpXda.cjs +1 -0
- package/dist/chunks/sign-in-with-browser-StQ_Fkku.cjs +1 -0
- package/dist/chunks/to-public-target-T4zHrdLQ.cjs +1 -0
- package/dist/chunks/{to-worker-output-diagnostics-lprh9b0l.cjs → to-worker-output-diagnostics-BeJKIsDG.cjs} +1 -1
- package/dist/chunks/{typecheck-application-DGrovgX9.cjs → typecheck-application-DLdoLIDx.cjs} +2 -2
- package/dist/chunks/{update-config-BkKBEfAp.cjs → update-config-CNOHxgkF.cjs} +1 -1
- package/dist/chunks/utils-BEfQWzTA-z2Y1wZJq.cjs +35 -0
- package/dist/chunks/with-phase-details-Dof8Ao9R.cjs +1 -0
- package/dist/chunks/{write-config-atomically-DRWTukU-.cjs → write-config-atomically-gr2Ldzm8.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +93 -5
- package/package.json +6 -6
- package/src/app/source/README.md +1 -1
- package/dist/chunks/application-DuIJE2qG.cjs +0 -5
- package/dist/chunks/build-pull-entities-zwArrVMk.cjs +0 -5
- package/dist/chunks/cli-version.constant-aSp8WZDh.cjs +0 -1
- package/dist/chunks/compile-application-translations-B59jYVWc.cjs +0 -1
- package/dist/chunks/create-app-not-installed-error-Cc8YZqI7.cjs +0 -1
- package/dist/chunks/create-metadata-client-ChjDalSi.cjs +0 -6
- package/dist/chunks/create-pull-base-write-rxjcKtD-.cjs +0 -1
- package/dist/chunks/create-tooling-failure-DLI5FlQP.cjs +0 -1
- package/dist/chunks/format-body-VcKL4WXt.cjs +0 -1
- package/dist/chunks/generate-application-client-CCVLjxTj.cjs +0 -1
- package/dist/chunks/global-flags.constant-8GfW0sNU.cjs +0 -1
- package/dist/chunks/is-access-token-expiring-gICPXsbO.cjs +0 -1
- package/dist/chunks/is-exported-manifest-CriNOWvx.cjs +0 -1
- package/dist/chunks/is-inside-directory-t3ixLQDr.cjs +0 -1
- package/dist/chunks/metadata-D9sQOTRK.cjs +0 -1
- package/dist/chunks/package-CdYv4LEx.cjs +0 -1
- package/dist/chunks/pull-source-eoiJwFb9.cjs +0 -1
- package/dist/chunks/read-app-identity-SeleQ_D6.cjs +0 -1
- package/dist/chunks/record-pull-base-BbxvlnU8.cjs +0 -1
- package/dist/chunks/require-approval-fhegB1ap.cjs +0 -1
- package/dist/chunks/resolve-app-project-D5ZXIpsG.cjs +0 -1
- package/dist/chunks/resolve-inside-sdk-p-16gKb4.cjs +0 -1
- package/dist/chunks/resolve-project-typescript-CDY8BbmP.cjs +0 -1
- package/dist/chunks/resolve-source-sdk-mK-f4q55.cjs +0 -1
- package/dist/chunks/run-app-apply-command-DwLPPJ-Y.cjs +0 -2
- package/dist/chunks/run-app-dev-command-CVeh9Gab.cjs +0 -2
- package/dist/chunks/run-app-exec-command-DKLNLbL5.cjs +0 -3
- package/dist/chunks/run-app-init-command-CJj8_spC.cjs +0 -2
- package/dist/chunks/run-app-logs-command-Dusb8K-W.cjs +0 -9
- package/dist/chunks/run-app-operation-BWrY9YZK.cjs +0 -1
- package/dist/chunks/run-app-plan-command-C0_3e332.cjs +0 -1
- package/dist/chunks/run-app-pull-command-DcZqs8gR.cjs +0 -3
- package/dist/chunks/run-app-uninstall-command-ncWS_k-p.cjs +0 -2
- package/dist/chunks/sign-in-to-remote-again-CW8HPSTP.cjs +0 -1
- package/dist/chunks/sign-in-with-browser-C3kC6uP2.cjs +0 -1
- package/dist/chunks/to-public-target-CIAwoOKL.cjs +0 -1
- package/dist/chunks/utils-B8EXJeaX-DK3gCslL.cjs +0 -33
package/CONTRIBUTING.md
CHANGED
|
@@ -108,6 +108,13 @@ registry access is required for installation; the commands do not contact a
|
|
|
108
108
|
Twenty workspace. Temporary files are removed afterward, and nothing is
|
|
109
109
|
published. CI runs the same target for CLI and dependency changes.
|
|
110
110
|
|
|
111
|
+
The CLI CI job also runs `scripts/test-app-publish.mjs` after building the CLI
|
|
112
|
+
and SDK. It starts a disposable Verdaccio registry with no upstream registries,
|
|
113
|
+
publishes a fixture with real npm, downloads and inspects the tarball, and checks
|
|
114
|
+
version rejection, incomplete packages and cleanup. On Linux CI the test runs
|
|
115
|
+
inside a network namespace with only loopback enabled, so it cannot reach public
|
|
116
|
+
npm. It uses temporary npm configuration and a local test token.
|
|
117
|
+
|
|
111
118
|
## Releases
|
|
112
119
|
|
|
113
120
|
Publish the CLI when its changes warrant a release. A server release does not
|
|
@@ -131,29 +138,30 @@ to the next, unpublished SDK version right after each SDK release:
|
|
|
131
138
|
3. Run the `Publish npm packages` workflow in `twenty-infra` with that tag as
|
|
132
139
|
its `ref`. Creating the tag alone does not publish the package.
|
|
133
140
|
|
|
134
|
-
`yarn npm publish` first runs `scripts/
|
|
135
|
-
build and npm registry access. It
|
|
136
|
-
or templates are missing, when `dist` was built
|
|
137
|
-
its CLI runs fails or times out, or when
|
|
138
|
-
not on npm. An unreachable registry is
|
|
139
|
-
version. The check does not read tags: it
|
|
140
|
-
published. Selecting the matching SDK
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
`yarn npm publish` first runs `scripts/prepublish.mjs`, which needs a fresh
|
|
142
|
+
build and npm registry access. It checks the build first, and fails when the
|
|
143
|
+
executable, worker, lazy chunks or templates are missing, when `dist` was built
|
|
144
|
+
for another version, when one of its CLI runs fails or times out, or when
|
|
145
|
+
`app init` would pin versions that are not on npm. An unreachable registry is
|
|
146
|
+
reported separately from a missing version. The check does not read tags: it
|
|
147
|
+
confirms that the pinned versions are published. Selecting the matching SDK
|
|
148
|
+
release remains a release step.
|
|
149
|
+
|
|
150
|
+
Once the check passes, the script resolves the built app template's
|
|
151
|
+
dependencies, with the versions that `app init` pinned during the check, using
|
|
152
|
+
the repository's Yarn against the public registry, under a 3-day minimum
|
|
153
|
+
release age that exempts the pinned Twenty packages. It then writes
|
|
154
|
+
`dist/app-template/yarn.lock`. Apps created with `app init` then install exact,
|
|
155
|
+
integrity-checked versions, including for people who enforce a minimum release
|
|
156
|
+
age. The lockfile keeps the template's placeholder name, and the first
|
|
148
157
|
`yarn install` renames that root entry.
|
|
149
158
|
|
|
150
|
-
The tests of both
|
|
159
|
+
The tests of both steps run with `twenty-cli:test:package`. To run the script
|
|
151
160
|
before tagging:
|
|
152
161
|
|
|
153
162
|
```bash
|
|
154
163
|
yarn nx build twenty-cli
|
|
155
|
-
node packages/twenty-cli/scripts/
|
|
156
|
-
node packages/twenty-cli/scripts/generate-template-lock.mjs
|
|
164
|
+
node packages/twenty-cli/scripts/prepublish.mjs
|
|
157
165
|
```
|
|
158
166
|
|
|
159
167
|
## App integration tests
|
|
@@ -1291,9 +1291,9 @@ __metadata:
|
|
|
1291
1291
|
oxlint: "npm:^0.16.0"
|
|
1292
1292
|
react: "npm:^19.0.0"
|
|
1293
1293
|
react-dom: "npm:^19.0.0"
|
|
1294
|
-
twenty-client-sdk: "npm:2.
|
|
1295
|
-
twenty-sdk: "npm:2.
|
|
1296
|
-
twenty-ui: "npm:2.
|
|
1294
|
+
twenty-client-sdk: "npm:2.48.0"
|
|
1295
|
+
twenty-sdk: "npm:2.48.0"
|
|
1296
|
+
twenty-ui: "npm:2.48.0"
|
|
1297
1297
|
typescript: "npm:^5.9.3"
|
|
1298
1298
|
vite-tsconfig-paths: "npm:^4.2.1"
|
|
1299
1299
|
vitest: "npm:^4.0.0"
|
|
@@ -2305,7 +2305,7 @@ __metadata:
|
|
|
2305
2305
|
languageName: node
|
|
2306
2306
|
linkType: hard
|
|
2307
2307
|
|
|
2308
|
-
"nanoid@npm:^3.3.
|
|
2308
|
+
"nanoid@npm:^3.3.20":
|
|
2309
2309
|
version: 3.3.20
|
|
2310
2310
|
resolution: "nanoid@npm:3.3.20"
|
|
2311
2311
|
bin:
|
|
@@ -2440,13 +2440,13 @@ __metadata:
|
|
|
2440
2440
|
linkType: hard
|
|
2441
2441
|
|
|
2442
2442
|
"postcss@npm:^8.5.29":
|
|
2443
|
-
version: 8.5.
|
|
2444
|
-
resolution: "postcss@npm:8.5.
|
|
2443
|
+
version: 8.5.30
|
|
2444
|
+
resolution: "postcss@npm:8.5.30"
|
|
2445
2445
|
dependencies:
|
|
2446
|
-
nanoid: "npm:^3.3.
|
|
2446
|
+
nanoid: "npm:^3.3.20"
|
|
2447
2447
|
picocolors: "npm:^1.1.1"
|
|
2448
2448
|
source-map-js: "npm:^1.2.2"
|
|
2449
|
-
checksum: 10c0/
|
|
2449
|
+
checksum: 10c0/219cdc50ba3f2b6d0f8b779c4939514cb9d9f53cc9eb92dae1a06f2d6eb910b2ce339a3ee93e7c893b89e50241509fd92c04f0639af1cdf41a1e13983a476029
|
|
2450
2450
|
languageName: node
|
|
2451
2451
|
linkType: hard
|
|
2452
2452
|
|
|
@@ -2938,22 +2938,22 @@ __metadata:
|
|
|
2938
2938
|
languageName: node
|
|
2939
2939
|
linkType: hard
|
|
2940
2940
|
|
|
2941
|
-
"twenty-client-sdk@npm:2.
|
|
2942
|
-
version: 2.
|
|
2943
|
-
resolution: "twenty-client-sdk@npm:2.
|
|
2941
|
+
"twenty-client-sdk@npm:2.48.0":
|
|
2942
|
+
version: 2.48.0
|
|
2943
|
+
resolution: "twenty-client-sdk@npm:2.48.0"
|
|
2944
2944
|
dependencies:
|
|
2945
2945
|
"@genql/runtime": "npm:^2.10.0"
|
|
2946
2946
|
esbuild: "npm:^0.28.1"
|
|
2947
2947
|
graphql: "npm:^16.8.1"
|
|
2948
2948
|
lodash: "npm:^4.17.21"
|
|
2949
2949
|
prettier: "npm:^3.8.3"
|
|
2950
|
-
checksum: 10c0/
|
|
2950
|
+
checksum: 10c0/608279377997a1ac5e8562ab42277175664137ef0a79de7846038f5dbbfa4f3c8c3bd48d490133cfd3d69abfd76b57372ed7704b166d733af842874c8aef8586
|
|
2951
2951
|
languageName: node
|
|
2952
2952
|
linkType: hard
|
|
2953
2953
|
|
|
2954
|
-
"twenty-sdk@npm:2.
|
|
2955
|
-
version: 2.
|
|
2956
|
-
resolution: "twenty-sdk@npm:2.
|
|
2954
|
+
"twenty-sdk@npm:2.48.0":
|
|
2955
|
+
version: 2.48.0
|
|
2956
|
+
resolution: "twenty-sdk@npm:2.48.0"
|
|
2957
2957
|
dependencies:
|
|
2958
2958
|
"@sniptt/guards": "npm:^0.2.0"
|
|
2959
2959
|
axios: "npm:^1.16.0"
|
|
@@ -2972,18 +2972,18 @@ __metadata:
|
|
|
2972
2972
|
semver: "npm:7.6.3"
|
|
2973
2973
|
sharp: "npm:^0.35.3"
|
|
2974
2974
|
tinyglobby: "npm:^0.2.15"
|
|
2975
|
-
twenty-client-sdk: "npm:2.
|
|
2975
|
+
twenty-client-sdk: "npm:2.48.0"
|
|
2976
2976
|
typescript: "npm:^5.9.3"
|
|
2977
2977
|
uuid: "npm:^13.0.2"
|
|
2978
2978
|
bin:
|
|
2979
2979
|
twenty: dist/cli.cjs
|
|
2980
|
-
checksum: 10c0/
|
|
2980
|
+
checksum: 10c0/711405128e8a70cfc0d3b4ab7e741a7a22aee1a4d038358a271fcac76f238f6f69bff5657319126c9a8966cbd78eb7e6141cdb72666505366d77d8afdb638498
|
|
2981
2981
|
languageName: node
|
|
2982
2982
|
linkType: hard
|
|
2983
2983
|
|
|
2984
|
-
"twenty-ui@npm:2.
|
|
2985
|
-
version: 2.
|
|
2986
|
-
resolution: "twenty-ui@npm:2.
|
|
2984
|
+
"twenty-ui@npm:2.48.0":
|
|
2985
|
+
version: 2.48.0
|
|
2986
|
+
resolution: "twenty-ui@npm:2.48.0"
|
|
2987
2987
|
dependencies:
|
|
2988
2988
|
"@base-ui/react": "npm:^1.8.0"
|
|
2989
2989
|
"@base-ui/utils": "npm:0.4.0"
|
|
@@ -3002,7 +3002,7 @@ __metadata:
|
|
|
3002
3002
|
optional: true
|
|
3003
3003
|
monaco-editor:
|
|
3004
3004
|
optional: true
|
|
3005
|
-
checksum: 10c0/
|
|
3005
|
+
checksum: 10c0/64dd7acd34e3701d2d20a1939524de213defddd86e2d08457866ec2450848af9950e9ddc886f15144c2095d12215a9176ab3d893e8b1cb6711c8cb03ab52d944
|
|
3006
3006
|
languageName: node
|
|
3007
3007
|
linkType: hard
|
|
3008
3008
|
|
|
@@ -3367,8 +3367,8 @@ __metadata:
|
|
|
3367
3367
|
linkType: hard
|
|
3368
3368
|
|
|
3369
3369
|
"zod@npm:^4.1.11":
|
|
3370
|
-
version: 4.6.
|
|
3371
|
-
resolution: "zod@npm:4.6.
|
|
3372
|
-
checksum: 10c0/
|
|
3370
|
+
version: 4.6.7
|
|
3371
|
+
resolution: "zod@npm:4.6.7"
|
|
3372
|
+
checksum: 10c0/4ce2eb14034317b7254e347ca37b5ad591cf8333147030cf05b9b5d31692d45073f7f2747aa50cf8c6b29012194d2b22978cecc89969cf34a0d18e89d0ee7d7b
|
|
3373
3373
|
languageName: node
|
|
3374
3374
|
linkType: hard
|
package/dist/app-worker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./chunks/build-CX6FBrbu.cjs"),t=require("./chunks/constants-
|
|
1
|
+
const e=require("./chunks/build-CX6FBrbu.cjs"),t=require("./chunks/constants-Du9J-8Ug-CD8GTrut.cjs");var n=e.t(),r=5e3,i=new AbortController,a,o=e=>{if(t.p(e)){if(e.type===`cancel`||e.type===`release`)return{type:e.type};if(e.type===`readSourceIdentity`||e.type===`buildManifest`||e.type===`typecheckSource`)return(0,n.isNonEmptyString)(e.appPath)?{type:e.type,appPath:e.appPath}:void 0;if(e.type===`bundleSnapshot`)return(0,n.isNonEmptyString)(e.appPath)?{type:`bundleSnapshot`,collectWatchInputs:e.collectWatchInputs===!0,appPath:e.appPath,holdSnapshot:e.holdSnapshot===!0}:void 0;if(e.type===`pull`)return!(0,n.isNonEmptyString)(e.appPath)||!t.p(e.target)||!(0,n.isNonEmptyString)(e.target.apiUrl)||!(0,n.isNonEmptyString)(e.target.workspaceId)||!t.p(e.applicationExport)||!t.p(e.applicationExport.application)||!(0,n.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,n.isNonEmptyString)(e.appPath)&&(!t.Vt(e.locale)||(0,n.isString)(e.locale))?{type:`extractTranslations`,appPath:e.appPath,locale:e.locale??void 0}:void 0;if(e.type===`generateSourceClient`)return(0,n.isNonEmptyString)(e.appPath)&&(0,n.isString)(e.schema)?{type:`generateSourceClient`,appPath:e.appPath,schema:e.schema}:void 0}},s=e=>{process.connected||process.exit(1),process.send?.(e,void 0,{},()=>process.exit(0))},c=async()=>{if(!t.Vt(a))return null;let{snapshotApi:e,buildId:n}=a;return a=void 0,e.releaseSourceSnapshot({buildId:n})},l=()=>{c().then(()=>process.exit(1),()=>process.exit(1))},u=e=>{if(!process.connected){l();return}process.send?.(e)},d=e=>{if(!(!t.p(e)||e.success!==!0||!t.p(e.data)))return(0,n.isNonEmptyString)(e.data.buildId)?e.data.buildId:void 0},f=async({snapshotApi:e,appPath:n,holdSnapshot:r})=>{let o=i.signal,s=await e.buildSourceSnapshot({appPath:n,signal:o}),c=d(s);return t.Vt(c)?r?(a={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}},p=e=>({type:`failure`,message:e instanceof Error?e.message:String(e),...e instanceof Error&&`code`in e&&(0,n.isString)(e.code)?{code:e.code}:{},...e instanceof Error&&`hint`in e&&(0,n.isString)(e.hint)?{hint:e.hint}:{},...e instanceof Error&&`details`in e&&t.p(e.details)?{details:e.details}:{}});process.on(`SIGINT`,()=>void 0),process.on(`disconnect`,()=>{i.abort(),setTimeout(()=>process.exit(1),r),t.Vt(a)&&l()}),process.on(`message`,e=>{let n=o(e);if(!t.Vt(n)){s({type:`failure`,message:`The app worker received a request it cannot read.`});return}if(n.type===`cancel`){i.abort();return}if(n.type===`release`){c().then(e=>s({type:`released`,release:e}),e=>s(p(e)));return}if(n.type===`pull`){Promise.resolve().then(()=>require("./chunks/pull-source-DNswr_80.cjs")).then(async({pullSource:e})=>{s({type:`result`,result:await e({...n,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}if(n.type===`bundleSnapshot`){Promise.resolve().then(()=>require("./chunks/build-source-snapshot-BbQlyo_m.cjs")).then(async({buildSourceSnapshot:e,releaseSourceSnapshot:t})=>{let r=()=>f({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-Cexr5YYZ.cjs")).then(e=>e.t),{recordTypecheckConfigInputs:a}=await Promise.resolve().then(()=>require("./chunks/record-typecheck-config-inputs-DcCY-_Z1.cjs")),o=await i(async()=>(await a(n.appPath),r()));return{...o.result,watchInputs:o.watchInputs}}).then(e=>e.type===`result`&&e.isSnapshotHeld?u(e):s(e),e=>s(p(e)));return}if(n.type===`typecheckSource`){Promise.resolve().then(()=>require("./chunks/typecheck-application-DLdoLIDx.cjs")).then(e=>e.n).then(async({typecheckApplication:e})=>{s({type:`result`,result:await e({appPath:n.appPath,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}if(n.type===`extractTranslations`){Promise.resolve().then(()=>require("./chunks/extract-source-translations-BLQ-XFuN.cjs")).then(async({extractSourceTranslations:e})=>{s({type:`result`,result:await e({appPath:n.appPath,locale:n.locale,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}if(n.type===`buildManifest`){Promise.resolve().then(()=>require("./chunks/build-source-manifest-BMjw7BvT.cjs")).then(async({buildSourceManifest:e})=>{s({type:`result`,result:await e({appPath:n.appPath,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}if(n.type===`readSourceIdentity`){Promise.resolve().then(()=>require("./chunks/read-source-identity-C4eKC14c.cjs")).then(async({readSourceIdentity:e})=>{s({type:`result`,result:await e({appPath:n.appPath,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}if(n.type===`generateSourceClient`){Promise.resolve().then(()=>require("./chunks/generate-application-client-BApuJWQO.cjs")).then(async({generateApplicationClient:e})=>{s({type:`result`,result:await e({appPath:n.appPath,schema:n.schema,signal:i.signal}),isSnapshotHeld:!1})}).catch(e=>s(p(e)));return}});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-BEfQWzTA-z2Y1wZJq.cjs"),n=require("./constants-Du9J-8Ug-CD8GTrut.cjs");function r(e){if(!n.mt(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}function i(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var a=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,o=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function s(e,t,a,o,s,c){let l=typeof a==`string`?i(a):a,u=typeof o==`string`?r(o):o;if(typeof o==`string`&&(o=r(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=t(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return n.pt(d)}function c(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function l(e,t){return e<<t|e>>>32-t}function u(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=l(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],u=n[3],d=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=l(i,5)+c(n,a,s,u)+d+t[n]+r[e]>>>0;d=u,u=s,s=l(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+d>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function d(e,t,n,r){return s(80,u,e,t,n,r)}d.DNS=a,d.URL=o;function f(e){if(!n.mt(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}function p(e){return e instanceof Boolean||typeof e==`boolean`}function m(e){return e instanceof String||typeof e==`string`}function h(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&!Array.isArray(e)}var ee=[`choice`,`score`,`boolean`],te=/^[a-zA-Z0-9_.-]{1,64}$/,ne=e=>te.test(e),g=e.t(),_=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}({}),v=`trigger`,re=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},ie=/{{([^{}]+)}}/g;function*y(e){if((0,g.isString)(e)){for(let[,t]of e.matchAll(ie))n.Vt(t)&&(yield t);return}if((0,g.isObject)(e))for(let t of Object.values(e))yield*y(t)}var ae=e=>[...y(e)],oe=(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]},se=e=>{if(!n.Vt(e)||!h(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length===0?!1:t.every(e=>n.Vt(e)&&h(e)&&p(e.isLeaf))},b=(e,t=[])=>{let n=[];if(!(0,g.isObject)(e))return n;for(let[r,i]of Object.entries(e)){if(!(0,g.isObject)(i))continue;let e=[...t,r];n.push(e.join(`.`)),!i.isLeaf&&(0,g.isObject)(i.value)&&n.push(...b(i.value,e))}return n},ce=({schema:e,propertyPath:t})=>{let r=e;for(let e=0;e<t.length;e++){let i=t[e];if(!n.Vt(i))return;if(!(0,g.isObject)(r))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:[]};let a=r[i];if(!n.Vt(a))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:Object.keys(r)};if(a.isLeaf){let r=t[e+1];return n.Vt(r)?{validPrefix:t.slice(0,e+1),failedSegment:r,availableKeys:[]}:void 0}r=a.value}},x={found:!1},S=e=>n.p(e)&&p(e.isLeaf),C=e=>n.p(e)&&e._outputSchemaType===`RECORD`&&n.p(e.fields),w=e=>n.p(e)&&!(`_outputSchemaType`in e)&&S(e.first)&&e.first.isLeaf===!1&&C(e.first.value)&&S(e.totalCount),T=e=>({found:!0,type:m(e.type)?e.type:void 0,label:m(e.label)?e.label:void 0}),E=(e,t)=>t.length===0?T(e):O(e.value,t),le=(e,t)=>{for(let n=1;n<=t.length;n++){let r=e[t.slice(0,n).join(`.`)];if(S(r))return E(r,t.slice(n))}return x},ue=(e,t)=>{let[n,...r]=t;if(n===`first`)return r.length===0?T(e.first):O(e.first.value,r);if(n===`all`||n===`totalCount`){let t=e[n];return r.length===0&&S(t)?T(t):x}return x},D=(e,t)=>{let[r,...i]=t;if(!n.Vt(r))return x;let a=e[r];return S(a)?E(a,i):n.Vt(a)?i.length===0?{found:!0}:n.p(a)?D(a,i):x:x},O=(e,t)=>t.length===0||!n.p(e)?x:C(e)?le(e.fields,t):w(e)?ue(e,t):D(e,t),de=({schema:e,propertyPath:t})=>O(e,t),k=e=>{let t=[];for(let[r,i]of Object.entries(e))if(S(i)){if(t.push(r),i.isLeaf)continue;let e=i.value;if(C(e))for(let n of k(e.fields))t.push(`${r}.${n}`);else if(n.p(e))for(let n of k(e))t.push(`${r}.${n}`)}else if(n.Vt(i)&&(t.push(r),n.p(i)))for(let e of k(i))t.push(`${r}.${e}`);return t},A=e=>{if(!n.p(e))return[];if(C(e))return k(e.fields);if(w(e)){let t=[];if(S(e.first)){t.push(`first`);for(let n of A(e.first.value))t.push(`first.${n}`)}return n.Vt(e.all)&&t.push(`all`),t.push(`totalCount`),t}return k(e)},fe=3,j=e=>n.p(e)?e._outputSchemaType===`RECORD`?!0:Object.values(e).some(e=>n.p(e)&&j(e.value)):!1,M=(e,t)=>t.map(t=>({candidate:t,distance:oe(e,t)})).filter(({candidate:e,distance:t})=>t<=Math.ceil(e.length/2)).sort((e,t)=>e.distance-t.distance).slice(0,fe).map(({candidate:e})=>e),pe=({schema:e,propertyPath:t,referencedStepId:r})=>{if(!se(e)||j(e)){let n=A(e);return M(t.join(`.`),n).map(e=>[r,e].join(`.`))}let i=ce({schema:e,propertyPath:t});if(!n.Vt(i))return[];let a=M(i.failedSegment,i.availableKeys).map(e=>[r,...i.validPrefix,e].join(`.`));if((0,g.isNonEmptyArray)(a))return a;let o=b(e);return M(t.join(`.`),o).map(e=>[r,e].join(`.`))},me=({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=ae(o.settings?.input),c=t.ancestorsByStepId.get(o.id)??new Set;for(let t of s){let s=re(t),l=s[0];if(!n.Vt(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===v;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(...he({step:o,variable:t,pathSegments:s,referencedStepId:l,isTriggerReference:u,trigger:e.trigger,stepsById:r}))}}return i},he=({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.Vt(l)&&(0,g.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.Vt(l)||u)return[];if(!de({schema:l,propertyPath:c}).found){let r=pe({schema:l,propertyPath:c,referencedStepId:i}),a=_e(l,i),o=(0,g.isNonEmptyArray)(r)?`Did you mean "{{${r[0]}}}"?${r.length>1?` Other options: ${r.slice(1).map(e=>`{{${e}}}`).join(`, `)}.`:``}`:(0,g.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.Vt(o)?{hint:o}:{},...(0,g.isNonEmptyArray)(r)?{suggestions:r}:{},...(0,g.isNonEmptyArray)(a)?{availablePaths:a}:{}}]}return[]},ge=20,_e=(e,t)=>A(e).slice(0,ge).map(e=>`${t}.${e}`),ve=n.jt({type:n.Dt(`object`),properties:n.Nt(n.Ft(),n.jt({type:n.vt([`string`,`number`,`boolean`]),description:n.Ft().optional()})).refine(e=>Object.keys(e).every(ne),{message:`Output field names can only contain letters, numbers, underscores, dots or hyphens (max 64 characters)`}),required:n.xt(n.Ft()).optional(),additionalProperties:n.Dt(!1).optional()}),ye=n.Ct(`type`,[n.jt({type:n.Dt(`text`)}),n.jt({type:n.Dt(`json`),schema:ve})]),N=[1e3,5e3,15e3],P=n.jt({input:n.Ot({}).describe(`Input data for the workflow action. Structure depends on the action type.`),outputSchema:n.Ot({}).describe(`Schema defining the output data structure. This data can be referenced in subsequent steps using {{stepId.fieldName}}.`),errorHandlingOptions:n.jt({retryOnFailure:n.jt({value:n.Mt(e=>typeof e==`boolean`?Number(e):e,n.At().int().min(0).max(N.length).describe(`How many times to retry the action if it fails, between 0 and ${N.length}. 0 disables retries.`))}),continueOnFailure:n.jt({value:n.St().describe(`Whether to continue to the next step if this action fails.`)})})}),be={expectedOutputSchema:n.Ot({}).optional().describe(`A sample output value declared by the user for steps whose output structure is only known at runtime.`)},xe=P.extend({input:n.jt({url:n.Ft(),method:n.vt([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`]),headers:n.Nt(n.Ft(),n.Ft()).optional(),body:n.Nt(n.Ft(),n.It([n.Ft(),n.At(),n.St(),n.yt(),n.xt(n.It([n.Ft(),n.At(),n.St(),n.yt()]))])).or(n.Ft()).optional()}),...be}),Se=/^[a-zA-Z0-9_-]{1,64}$/,Ce=n.jt({id:n.Rt().describe(`Stable identifier for this criterion row.`),name:n.Ft().describe(`Option name for a choice question, or the label of one score level.`),description:n.Ft().optional().describe(`What the model should understand this option to mean.`)}),we=n.jt({id:n.Rt().describe(`Stable identifier for this question row.`),name:n.Ft().regex(Se,`Answer name must be empty or contain 1 to 64 characters using only letters, digits, underscores and dashes`).or(n.Dt(``)).describe(`Answer key for this question, made of letters, digits, underscores and dashes. Downstream steps read {{stepId.answers.<name>}}.`),type:n.vt(ee).describe(`choice picks one option, score grades an ordered rubric, boolean estimates the probability that a statement holds.`),instructions:n.Ft().describe(`What the model should decide about the shared state.`),criteria:n.xt(Ce).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),Te=P.extend({input:n.jt({state:n.Ft().describe(`The shared state every question is asked about. Supports variables.`),questions:n.xt(we)})}),Ee=P.extend({input:n.jt({items:n.It([n.xt(n.It([n.Ft(),n.At(),n.St(),n.yt(),n.Nt(n.Ft(),n.bt()),n.bt()])),n.Ft()]).optional(),initialLoopStepIds:n.xt(n.Ft()).optional(),shouldContinueOnIterationFailure:n.St().optional()})}),De=P.extend({input:n.jt({delayType:n.vt([`SCHEDULED_DATE`,`DURATION`]),scheduledDateTime:n.Ft().nullable().optional(),duration:n.jt({days:n.It([n.At().min(0),n.Ft()]).optional(),hours:n.It([n.At().min(0),n.Ft()]).optional(),minutes:n.It([n.At().min(0),n.Ft()]).optional(),seconds:n.It([n.At().min(0),n.Ft()]).optional()}).optional()})}),Oe=P.extend({input:n.jt({eventName:n.Ft().describe(`Event to wait for, in format objectName.action (e.g., "company.updated", "task.created", "person.deleted").`),recordId:n.Ft().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:n.xt(n.Ft()).nullable().optional().describe(`For update events, only resume when one of these fields changed.`),timeout:n.jt({days:n.It([n.At().min(0),n.Ft()]).optional(),hours:n.It([n.At().min(0),n.Ft()]).optional(),minutes:n.It([n.At().min(0),n.Ft()]).optional()}).nullable().optional().describe(`Stop waiting after this duration. The step then succeeds with hasTimedOut set to true.`)})}),ke=P.extend({input:n.jt({})}),F=n.Nt(n.Ft(),n.bt()).describe(`Record data object. Use nested objects for relationships (e.g., "company": {"id": "{{reference}}"}). Common patterns:
|
|
2
|
+
- Person: {"name": {"firstName": "John", "lastName": "Doe"}, "emails": {"primaryEmail": "john@example.com"}, "company": {"id": "{{trigger.properties.after.id}}"}}
|
|
3
|
+
- Company: {"name": "Acme Corp", "domainName": {"primaryLinkUrl": "https://acme.com"}}
|
|
4
|
+
- Task: {"title": "Follow up", "status": "TODO", "assignee": {"id": "{{user.id}}"}}`),Ae=P.extend({input:n.jt({objectName:n.Ft().describe(`The name of the object to create a record in. Must be lowercase (e.g., "person", "company", "task").`),objectRecord:F.describe(`The record data to create.`)})}),je=P.extend({input:n.jt({objectName:n.Ft(),objectRecord:F,objectRecordId:n.Ft(),fieldsToUpdate:n.xt(n.Ft())})}),Me=P.extend({input:n.jt({objectName:n.Ft(),objectRecord:F})}),Ne=P.extend({input:n.jt({objectName:n.Ft(),objectRecordId:n.Ft()})}),I=n.Ft().regex(/^{{[^{}]+}}$/,`Expected a workflow variable reference like {{stepId.path}}`),Pe=P.extend({input:n.jt({objectName:n.Ft(),limit:n.It([n.At(),I]).optional(),offset:n.It([n.At().int().nonnegative(),I]).optional(),filter:n.jt({recordFilterGroups:n.xt(n.bt()).optional(),recordFilters:n.xt(n.bt()).optional()}).optional(),orderBy:n.jt({recordSorts:n.xt(n.bt()).optional(),gqlOperationOrderBy:n.xt(n.Nt(n.Ft(),n.bt())).optional()}).optional()})}),Fe=n.jt({id:n.Ft(),name:n.Ft(),label:n.Ft(),type:n.It([n.Dt(n.ot.TEXT),n.Dt(n.ot.NUMBER),n.Dt(n.ot.DATE),n.Dt(n.ot.SELECT),n.Dt(n.ot.MULTI_SELECT),n.Dt(`RECORD`)]),placeholder:n.Ft().optional(),settings:n.Nt(n.Ft(),n.bt()).optional(),value:n.bt().optional()}),Ie=P.extend({input:n.xt(Fe),instructions:n.Ft().optional()}),L=n.jt({id:n.Ft(),logicalOperator:n.vt(n.P),parentStepFilterGroupId:n.Ft().optional(),positionInStepFilterGroup:n.At().optional()}),R=n.jt({id:n.Ft(),type:n.Ft(),stepOutputKey:n.Ft(),operand:n.vt(n.W).or(n.vt(n.L)),value:n.Ft(),stepFilterGroupId:n.Ft(),positionInStepFilterGroup:n.At().optional(),fieldMetadataId:n.Ft().optional(),compositeFieldSubFieldName:n.Ft().optional()}),Le=P.extend({input:n.jt({stepFilterGroups:n.xt(L),stepFilters:n.xt(R)})}),Re=n.jt({id:n.Ft(),nextStepIds:n.xt(n.Ft()),filterGroupId:n.Ft().optional()}),ze=P.extend({input:n.jt({stepFilterGroups:n.xt(L),stepFilters:n.xt(R),branches:n.xt(Re)})}),Be=n.vt([`RANDOM`,`ROUND_ROBIN`,`LOAD_BALANCED`]);P.extend({input:n.jt({objectName:n.Ft(),strategy:Be,recordIds:n.xt(n.Ft()),loadBalance:n.jt({objectNameSingular:n.Ft(),fieldName:n.Ft()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Vt(e.loadBalance)&&t.addIssue({code:n._t.custom,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})});var z=n.jt({name:n.Ft().optional().describe(`Human-readable name for the trigger. Optional but recommended for clarity.`),type:n.vt([`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:n.jt({x:n.At(),y:n.At()}).optional().nullable().describe(`Position coordinates for the trigger in the workflow diagram. Use (0, 0) for the trigger step.`),nextStepIds:n.xt(n.Ft()).optional().nullable().describe(`Array of step IDs that the trigger connects to. These are the first steps in the workflow.`)}),Ve=z.extend({type:n.Dt(`CRON`),settings:n.Ct(`type`,[n.jt({type:n.Dt(`DAYS`),schedule:n.jt({day:n.At().min(1),hour:n.At().min(0).max(23),minute:n.At().min(0).max(59)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`HOURS`),schedule:n.jt({hour:n.At().min(1),minute:n.At().min(0).max(59)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`MINUTES`),schedule:n.jt({minute:n.At().min(1).max(60)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`CUSTOM`),pattern:n.Ft(),outputSchema:n.Ot({})})])}),He=z.extend({type:n.Dt(`WEBHOOK`),settings:n.Ct(`httpMethod`,[n.jt({outputSchema:n.Ot({}),httpMethod:n.Dt(`GET`),authentication:n.Dt(`API_KEY`).nullable()}),n.jt({outputSchema:n.Ot({}),expectedOutputSchema:n.Ot({}).optional(),httpMethod:n.Dt(`POST`),expectedBody:n.Ot({}),authentication:n.Dt(`API_KEY`).nullable()})])}),Ue=e=>{let t=e.settings?.input;return e.type===_.IF_ELSE&&(0,g.isObject)(t)&&`branches`in t&&Array.isArray(t.branches)},B=e=>{let t=e.settings?.input;return e.type===_.ITERATOR&&(0,g.isObject)(t)&&`initialLoopStepIds`in t&&(0,g.isNonEmptyArray)(t.initialLoopStepIds)},We=e=>{let t=e.settings?.input;if(n.Vt(t)&&(0,g.isObject)(t))return t},Ge=e=>{let t=new Set(e.nextStepIds??[]);if(Ue(e))for(let n of e.settings.input.branches??[])for(let e of n?.nextStepIds??[])t.add(e);if(B(e))for(let n of e.settings.input.initialLoopStepIds??[])t.add(n);return[...t]},Ke=({trigger:e,steps:t})=>{let r=new Map,i=n.Vt(e?.nextStepIds)?e.nextStepIds.filter(n.Vt):[];r.set(v,i);for(let e of t??[])r.set(e.id,Ge(e));let a=new Set,o=[v];for(;o.length>0;){let e=o.shift();if(!(!n.Vt(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:qe(r)}},qe=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},Je=({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.Vt(d)||a.has(f))return;i.add(e),B(d)&&(d.settings.input.initialLoopStepIds??[]).forEach(t=>s(t,[...c,e],e));let p=d.type===_.ITERATOR?d.nextStepIds??[]:t.childrenByStepId.get(e)??[];n.Vt(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},Ye=({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.Vt);t.r(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(...Xe(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},Xe=e=>{let t=[],r=We(e);if(e.type===_.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.Vt).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.Vt(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===_.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},Ze=`20202020-64aa-4b6f-b003-9c74b97cee20`,V=({entityNamespace:e,value:t,applicationUniversalIdentifier:n})=>d(`${e}:${t}`,n),Qe=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n})=>V({entityNamespace:`fieldMetadata`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),H=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n})=>V({entityNamespace:`pageLayout`,value:t?`${t}:${n}`:n,applicationUniversalIdentifier:e}),$e=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutTab`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),et=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutTabUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutWidget`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),tt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_PAGE}),nt=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,relationTargetObjectUniversalIdentifier:n})=>V({entityNamespace:`fieldMetadata`,value:`${t}:systemRelation:${n}`,applicationUniversalIdentifier:e}),rt=({objectMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,name:n})=>V({entityNamespace:`viewFieldGroup`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),it=({fieldMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,fieldMetadataUniversalIdentifier:n})=>V({entityNamespace:`viewField`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),at={INDEX:`INDEX`,FIELDS_WIDGET:`FIELDS_WIDGET`},ot=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t,viewKey:n})=>V({entityNamespace:`view`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),U=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(U).filter(e=>e!==U.OK&&e!==U.UNKNOWN),n.ot.TEXT,n.ot.ARRAY,n.ot.BOOLEAN,n.ot.DATE,n.ot.DATE_TIME,n.ot.NUMBER,n.ot.NUMERIC,n.ot.RAW_JSON,n.ot.RICH_TEXT,n.ot.SELECT,n.ot.MULTI_SELECT,_.SEND_EMAIL,_.DRAFT_EMAIL,_.CREATE_CALENDAR_EVENT;var st=`public`,ct=`front-component-shared-dependencies.mjs`,lt=`twenty:front-component-shared-dependencies`;n.X.RECORD_PAGE,n.X.DASHBOARD;var ut={js:`import { createRequire as __createRequire } from 'module';
|
|
5
|
+
const require = __createRequire(import.meta.url);`},dt=`.twenty/output`,ft=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,fieldUniversalIdentifier:n})=>V({entityNamespace:`fieldPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),pt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,objectUniversalIdentifier:n})=>V({entityNamespace:`objectPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),mt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_FORM}),ht=({pageLayoutTabManifest:e,pageLayoutType:r})=>{let i=e.layoutMode??(r===n.X.STANDALONE_PAGE?n.J.VERTICAL_LIST:n.J.GRID),a=e.widgets??[],o=[];if(!Object.values(n.J).some(e=>e===i))return{status:`fail`,errors:[`Page layout tab "${e.title}" defines unsupported layoutMode "${i}". Expected GRID, VERTICAL_LIST or CANVAS.`]};for(let t of a){let r=[t.heightBehavior,n.p(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.Vt);r.length>0&&i!==n.J.VERTICAL_LIST&&o.push(`Page layout widget "${t.title}" defines heightBehavior, but its parent tab "${e.title}" uses ${i}. heightBehavior is only supported for VERTICAL_LIST tabs.`);for(let e of r)Object.values(n.ct).some(t=>t===e)||o.push(`Page layout widget "${t.title}" defines unsupported heightBehavior "${e}". Expected FIT_CONTENT or TAB_VIEWPORT.`)}if(o.length>0)return{status:`fail`,errors:o};let s={...e,layoutMode:i,widgets:a.map(({heightBehavior:e,position:r,gridPosition:a,...o},s)=>{if(n.Vt(r))return{...o,position:r.layoutMode===n.J.VERTICAL_LIST&&n.Vt(e)?{...r,heightBehavior:e}:r};if(n.Vt(a))return{...o,position:{layoutMode:n.J.GRID,...a}};switch(i){case n.J.GRID:return{...o,position:{layoutMode:i,row:0,column:0,rowSpan:n.k.default.h,columnSpan:n.k.default.w}};case n.J.VERTICAL_LIST:return{...o,position:{layoutMode:i,index:s,...n.Vt(e)?{heightBehavior:e}:{}}};case n.J.CANVAS:return{...o,position:{layoutMode:i}};default:return t.o(i)}})};for(let e of s.widgets)e.position.layoutMode!==i&&o.push(`Page layout widget "${e.title}" uses a ${e.position.layoutMode} position, but its parent tab "${s.title}" uses ${i}.`);if(i===n.J.VERTICAL_LIST){let e=s.widgets.filter(({type:e,position:r})=>r.layoutMode===n.J.VERTICAL_LIST&&t.t({widgetType:e,heightBehavior:r.heightBehavior})===n.ct.TAB_VIEWPORT);e.length>1&&o.push(`Page layout tab "${s.title}" can contain only one TAB_VIEWPORT widget.`);let r=e.length===1?e[0]:void 0;n.Vt(r)&&s.widgets.some(e=>e!==r&&e.position.layoutMode===n.J.VERTICAL_LIST&&r.position.layoutMode===n.J.VERTICAL_LIST&&e.position.index>=r.position.index)&&o.push(`Page layout tab "${s.title}" must place its TAB_VIEWPORT widget last.`)}return o.length>0?{status:`fail`,errors:o}:{status:`success`,pageLayoutTab:s}},W=[`canReadObjectRecords`,`canUpdateObjectRecords`,`canSoftDeleteObjectRecords`,`canDestroyObjectRecords`],G={canReadObjectRecords:`canReadAllObjectRecords`,canUpdateObjectRecords:`canUpdateAllObjectRecords`,canSoftDeleteObjectRecords:`canSoftDeleteAllObjectRecords`,canDestroyObjectRecords:`canDestroyAllObjectRecords`},K=({role:e,objectUniversalIdentifier:t})=>{let n=e.objectPermissions?.find(e=>e.objectUniversalIdentifier===t);return{canReadObjectRecords:n?.canReadObjectRecords??e[G.canReadObjectRecords]??!1,canUpdateObjectRecords:n?.canUpdateObjectRecords??e[G.canUpdateObjectRecords]??!1,canSoftDeleteObjectRecords:n?.canSoftDeleteObjectRecords??e[G.canSoftDeleteObjectRecords]??!1,canDestroyObjectRecords:n?.canDestroyObjectRecords??e[G.canDestroyObjectRecords]??!1}},gt=e=>JSON.stringify(e,(e,t)=>n.p(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),_t=({groupsByUniversalIdentifier:e,predicateGroupUniversalIdentifier:t})=>{let r=[],i=new Set,a=t;for(;n.Vt(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.Vt(t))break;r.push(t.logicalOperator),a=t.parentPredicateGroupUniversalIdentifier}return r},q=({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=>gt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:_t({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},vt=n.x.map(e=>n.S[e]),yt=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),bt=({role:e,superset:t})=>[...W.filter(n=>{let r=G[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`}]:[]],xt=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...vt,...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}))},St=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=K({role:e,objectUniversalIdentifier:n}),i=K({role:t,objectUniversalIdentifier:n}),a=W.filter(e=>r[e]&&!i[e]).map(e=>({type:`OBJECT_RECORDS`,objectUniversalIdentifier:n,action:e})),o=W.some(e=>r[e]),s=q({role:t,objectUniversalIdentifier:n}),c=q({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!yt({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),Ct=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=K({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`}]:[]]}),wt=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...bt({role:e,superset:t}),...xt({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...St({role:e,superset:t}),...Ct({role:e,superset:t})],Tt=e=>n.mt(e)&&f(e)>=4,J={universalIdentifier:n.Rt(),name:n.Ft().min(1),nextStepIds:n.xt(n.Rt()),position:n.jt({x:n.At(),y:n.At()}).optional(),outputSchema:n.Nt(n.Ft(),n.Lt()).optional(),expectedOutputSchema:n.Nt(n.Ft(),n.Lt()).optional(),errorHandlingOptions:P.shape.errorHandlingOptions.optional()},Y=(e,t)=>n.Pt({...J,type:n.Dt(e),input:t}),X=n.Ot({fieldMetadataUniversalIdentifier:n.Rt(),fieldMetadataId:n.kt().optional()}),Z=R.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt().optional()}).strict(),Q={objectUniversalIdentifier:n.Rt()},Et=n.Ct(`type`,[n.Pt({...J,type:n.Dt(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:n.Rt(),input:n.Nt(n.Ft(),n.Lt())}),Y(`HTTP_REQUEST`,xe.shape.input),Y(`CLASSIFY`,Te.shape.input),Y(`ITERATOR`,Ee.shape.input),Y(`DELAY`,De.shape.input),Y(`WAIT_FOR_EVENT`,Oe.shape.input),Y(`EMPTY`,ke.shape.input),Y(`CREATE_RECORD`,Ae.shape.input.omit({objectName:!0}).extend(Q).strict()),Y(`UPDATE_RECORD`,je.shape.input.omit({objectName:!0}).extend(Q).strict()),Y(`UPSERT_RECORD`,Me.shape.input.omit({objectName:!0}).extend(Q).strict()),Y(`DELETE_RECORD`,Ne.shape.input.omit({objectName:!0}).extend(Q).strict()),Y(`FIND_RECORDS`,Pe.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...Q,filter:n.Pt({recordFilterGroups:n.xt(n.Nt(n.Ft(),n.Lt())).optional(),recordFilters:n.xt(X).optional()}).optional(),orderBy:n.Pt({recordSorts:n.xt(X.extend({direction:n.vt([`ASC`,`DESC`]),subFieldName:n.Ft().nullable().optional()})).optional()}).optional()}).strict()),Y(`PICK_RECORD`,n.Pt({...Q,strategy:Be,recordIds:n.xt(n.Ft()),loadBalance:n.Pt({objectUniversalIdentifier:n.Rt(),fieldUniversalIdentifier:n.Rt()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Vt(e.loadBalance)&&t.addIssue({code:`custom`,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})),Y(`FILTER`,Le.shape.input.extend({stepFilters:n.xt(Z)})),Y(`IF_ELSE`,ze.shape.input.extend({stepFilters:n.xt(Z)})),Y(`FORM`,n.xt(Ie.shape.input.element.extend({settings:n.Nt(n.Ft(),n.Lt()).optional()}).superRefine((e,t)=>{e.type===`RECORD`&&!n.Rt().safeParse(e.settings?.objectUniversalIdentifier).success&&t.addIssue({code:`custom`,path:[`settings`,`objectUniversalIdentifier`],message:`Record picker fields require an object universal identifier`})}))),Y(`AI_AGENT`,n.Pt({agentUniversalIdentifier:n.Rt(),prompt:n.Ft(),responseFormat:ye.optional()}))]),$=[`updated`,`upserted`],Dt=n.Ct(`type`,[n.Pt({type:n.Dt(`GLOBAL`)}),n.Pt({type:n.Dt(`SINGLE_RECORD`),objectUniversalIdentifier:n.Rt()}),n.Pt({type:n.Dt(`BULK_RECORDS`),objectUniversalIdentifier:n.Rt()})]),[Ot,kt,At,jt]=Ve.shape.settings.options,Mt=n.Ct(`type`,[Ot.omit({outputSchema:!0}).extend({schedule:Ot.shape.schedule.strict()}).strict(),kt.omit({outputSchema:!0}).extend({schedule:kt.shape.schedule.strict()}).strict(),At.omit({outputSchema:!0}).extend({schedule:At.shape.schedule.strict()}).strict(),jt.omit({outputSchema:!0}).strict()]),[Nt,Pt]=He.shape.settings.options,Ft=n.Ct(`httpMethod`,[Nt.omit({outputSchema:!0,authentication:!0}).strict(),Pt.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),It=[n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`MANUAL`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({availability:Dt.optional(),icon:n.Ft().optional(),isPinned:n.St().optional()}).superRefine((e,t)=>{!n.Vt(e.availability)&&(n.Vt(e.icon)||n.Vt(e.isPinned))&&t.addIssue({code:`custom`,path:[`availability`],message:`Set an availability for the icon and pin to show in the command menu`})}).optional()}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`CRON`),nextStepIds:n.xt(n.Rt()).min(1),settings:Mt}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`DATABASE_EVENT`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({objectUniversalIdentifier:n.Rt(),action:n.vt([`created`,`updated`,`deleted`,`upserted`]),fieldUniversalIdentifiers:n.xt(n.Rt()).optional(),filter:n.Pt({stepFilterGroups:n.xt(L),stepFilters:n.xt(Z.extend({operand:n.vt(n.W)}))}).optional()}).superRefine((e,r)=>{if(t.r(e.fieldUniversalIdentifiers)&&!$.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${$.join(` and `)} events`}),!n.Vt(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.Vt(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.Vt(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`})})})}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`WEBHOOK`),nextStepIds:n.xt(n.Rt()).min(1),settings:Ft})],Lt=It.map(e=>e.shape.type.value),Rt=n.Ct(`type`,It,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${Lt.join(`, `)}`:void 0});n.Pt({universalIdentifier:n.Rt(),name:n.Ft().min(1),version:n.Pt({trigger:Rt,steps:n.xt(Et).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=Ke(a);for(let e of[...Ye({workflow:a,graph:o}),...Je({workflow:a,graph:o}),...me({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,"_",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ot}});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./application-VJqniwXy.cjs"),r=require("./metadata-BtOyR6x0.cjs"),i=require("./print-typescript-value-BoxeFXca.cjs"),a=require("./kebab-case-D0usAzG-.cjs");var o=80,s=e=>[{path:[...e,`type`],symbol:`FieldType`,members:t.ot},{path:[...e,`writability`],symbol:`MetadataWritability`,members:t.Z},{path:[...e,`universalSettings`,`relationType`],symbol:`RelationType`,members:t.B},{path:[...e,`universalSettings`,`onDelete`],symbol:`OnDeleteAction`,members:t.N},{path:[...e,`universalSettings`,`dataType`],symbol:`NumberDataType`,members:t.V},{path:[...e,`universalSettings`,`displayFormat`],symbol:`DateDisplayFormat`,members:t.ut}],c=s([]),l=[{path:[`writability`],symbol:`MetadataWritability`,members:t.Z},{path:[`openRecordIn`],symbol:`ObjectOpenRecordIn`,members:t.rt},...s([`fields`,`[]`])],u=[{path:[`indexType`],symbol:`IndexType`,members:t.R}],d=[{path:[`rowLevelPermissionPredicateGroups`,`[]`,`logicalOperator`],symbol:`RowLevelPermissionPredicateGroupLogicalOperator`,members:t.tt},{path:[`rowLevelPermissionPredicates`,`[]`,`operand`],symbol:`RowLevelPermissionPredicateOperand`,members:t.A},{path:[`permissionFlagUniversalIdentifiers`,`[]`],symbol:`SystemPermissionFlag`,members:t.S}],f=e=>({path:e,symbol:`AggregateOperations`,members:t.q}),p=[f([`aggregateOperation`])],m=[{path:[`type`],symbol:`ViewType`,members:t.z},{path:[`visibility`],symbol:`ViewVisibility`,members:t.at},{path:[`openRecordIn`],symbol:`ViewOpenRecordIn`,members:t.K},f([`kanbanAggregateOperation`]),{path:[`calendarLayout`],symbol:`ViewCalendarLayout`,members:t.dt},f([`fields`,`[]`,`aggregateOperation`]),{path:[`filters`,`[]`,`operand`],symbol:`ViewFilterOperand`,members:t.W},{path:[`filterGroups`,`[]`,`logicalOperator`],symbol:`ViewFilterGroupLogicalOperator`,members:t.j},{path:[`sorts`,`[]`,`direction`],symbol:`ViewSortDirection`,members:t.F}],h=e=>[{path:[...e,`type`],symbol:`WidgetType`,members:t.H},{path:[...e,`position`,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.J},f([...e,`configuration`,`aggregateOperation`]),...[`dateGranularity`,`primaryAxisDateGranularity`,`secondaryAxisGroupByDateGranularity`].map(n=>({path:[...e,`configuration`,n],symbol:`ObjectRecordGroupByDateGranularity`,members:t.Q}))],g=e=>[{path:[...e,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.J},...h([...e,`widgets`,`[]`])],_=h([]),v=g([]),y=[{path:[`type`],symbol:`NavigationMenuItemType`,members:t.it}],b=[{path:[`type`],symbol:`PageLayoutType`,members:t.X},...g([`tabs`,`[]`])],x=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),S=({definer:e,config:n,enumBindings:r=[]})=>{let a=new Set,s=i.t({value:n,resolveEnumSymbol:({path:e,value:n})=>{let i=r.find(t=>x(t.path,e));if(!t.Vt(i))return;let o=Object.keys(i.members).find(e=>i.members[e]===n);if(t.Vt(o))return a.add(i.symbol),`${i.symbol}.${o}`}}),c=[e,...[...a].sort()],l=`import { ${c.join(`, `)} } from 'twenty-sdk/define';`;return{content:`${l.length<=o?l:`import {\n${c.map(e=>` ${e},`).join(`
|
|
2
|
+
`)}\n} from 'twenty-sdk/define';`}
|
|
3
|
+
|
|
4
|
+
export default ${e}(${s});
|
|
5
|
+
`,requiredSdkExports:c}},C=e.t(),w=80,T=new Map(Object.entries(r.i).flatMap(([e,t])=>Object.entries(t).map(([t,{universalIdentifier:n}])=>[n,{objectName:e,fieldName:t}]))),E=e=>(0,C.isNonEmptyString)(e)&&(0,C.isNonEmptyString)(a.t(e).replace(/-+/g,``)),D=e=>e.slice(0,w).replace(/-+$/g,``),O=({segments:e,universalIdentifier:n})=>{let r=D(e.filter(t.Vt).map(a.t).join(`-`).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``));return(0,C.isNonEmptyString)(r)?r:n.slice(0,8)},k=({indexManifest:e,objectName:t,fieldLocationByUniversalIdentifier:n})=>O({segments:[t,...e.fields.map(({fieldUniversalIdentifier:e})=>n.get(e)?.fieldName??null)],universalIdentifier:e.universalIdentifier}),A=({viewFieldManifest:e,fieldLocationByUniversalIdentifier:n})=>{let r=n.get(e.fieldMetadataUniversalIdentifier)??T.get(e.fieldMetadataUniversalIdentifier);return O({segments:t.Vt(r)?[r.objectName,r.fieldName]:[],universalIdentifier:e.universalIdentifier})},j=`__typename`,M=e=>Array.isArray(e)?e.map(M):typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==j).map(([e,t])=>[e,M(t)])),N=new Set([`packageJsonChecksum`,`yarnLockChecksum`,`requiredServerVersionRange`,`aboutDescription`,`postInstallLogicFunction`,`preInstallLogicFunction`,`uninstallLogicFunction`,`healthCheckLogicFunction`,`settingsFrontComponent`,`settingsCustomTabFrontComponentUniversalIdentifier`,`frontComponentSharedDependencies`,`logoUrl`,`screenshots`]),P=`public/cover.generated.png`,F=e=>(e.roles??[]).some(({universalIdentifier:t})=>t===e.application.defaultRoleUniversalIdentifier),I=e=>{let t=Object.fromEntries(Object.entries(e.application).filter(([t])=>!N.has(t)&&!(t===`defaultRoleUniversalIdentifier`&&F(e)))),{galleryImages:n}=t;if(!Array.isArray(n)||n.length===0||n.every(e=>e===P)){let{galleryImages:e,...n}=t;return n}return t},L=({permissions:e,getDerivedUniversalIdentifier:t})=>e.map(({universalIdentifier:e,...n})=>e===t(n)?n:{universalIdentifier:e,...n}),R=({roleManifest:e,applicationUniversalIdentifier:r})=>{let{universalIdentifier:i,objectPermissions:a,fieldPermissions:o}=e;return{...e,...t.Vt(a)?{objectPermissions:L({permissions:a,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>n.t({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.Vt(o)?{fieldPermissions:L({permissions:o,getDerivedUniversalIdentifier:({fieldUniversalIdentifier:e})=>n.l({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,fieldUniversalIdentifier:e})})}:{}}},z=({objectName:e,fieldName:t,fieldUniversalIdentifier:n})=>O({segments:[e,t],universalIdentifier:n}),B=new Map(Object.entries(r.t).map(([e,t])=>[t,e])),V=({objectUniversalIdentifier:e,manifest:t})=>(t.objects??[]).find(t=>t.universalIdentifier===e)?.nameSingular??B.get(e)??null,H=new Map(Object.entries(r.r).map(([e,{universalIdentifier:t}])=>[t,e])),U=({pageLayoutUniversalIdentifier:e,manifest:r})=>{let i=r.pageLayouts?.find(t=>t.universalIdentifier===e);if(t.Vt(i))return i.name;let a=H.get(e);if(t.Vt(a))return a;let o=r.application.universalIdentifier;for(let t of r.objects??[]){let r={objectMetadataApplicationUniversalIdentifier:o,objectUniversalIdentifier:t.universalIdentifier};if(n.f(r)===e)return`${t.nameSingular}RecordPage`;if(n.n(r)===e)return`${t.nameSingular}RecordForm`}return null},W=({viewUniversalIdentifier:e,manifest:r})=>{let i=r.views?.find(t=>t.universalIdentifier===e);if(t.Vt(i))return i.name;let a=r.application.universalIdentifier;for(let t of r.objects??[])if(n.y({objectMetadataApplicationUniversalIdentifier:a,objectUniversalIdentifier:t.universalIdentifier,viewKey:n.m.INDEX})===e)return`${t.nameSingular}IndexView`;return null},G=({navigationMenuItemManifest:e,manifest:n})=>{let{type:r,name:i,targetObjectUniversalIdentifier:a,viewUniversalIdentifier:o,pageLayoutUniversalIdentifier:s}=e;return E(i)?i:r===t.it.OBJECT&&t.Vt(a)?V({objectUniversalIdentifier:a,manifest:n}):r===t.it.VIEW&&t.Vt(o)?W({viewUniversalIdentifier:o,manifest:n}):r===t.it.PAGE_LAYOUT&&t.Vt(s)?U({pageLayoutUniversalIdentifier:s,manifest:n}):null},K=({navigationMenuItemManifest:e,manifest:t})=>O({segments:[G({navigationMenuItemManifest:e,manifest:t})],universalIdentifier:e.universalIdentifier}),q=({folderUniversalIdentifier:e,manifest:t})=>{let n=t.navigationMenuItems?.find(t=>t.universalIdentifier===e)?.name;return E(n)?n:null},J=[`application`,`object`,`field`,`index`,`permissionFlag`,`role`,`view`,`viewField`,`pageLayout`,`pageLayoutTab`,`navigationMenuItem`,`pageLayoutWidget`],Y=(e,n=new Map)=>{let r=e.application.universalIdentifier,i=[],o=[];i.push({kind:`application`,universalIdentifier:r,definer:`defineApplication`,config:I(e),enumBindings:[],defaultFolder:`src`,fileSuffix:`.config.ts`,fileBaseName:`application`,parentName:null});let s=new Set,f=new Map,h=[...e.fields??[]];for(let t of e.objects??[]){let e=[];for(let r of t.fields??[])f.set(r.universalIdentifier,{objectName:t.nameSingular,fieldName:r.name}),n.get(r.universalIdentifier.toLowerCase())?.entityKey===`fields`?h.push({...r,objectUniversalIdentifier:t.universalIdentifier}):e.push(r);s.add(t.universalIdentifier),i.push({kind:`object`,universalIdentifier:t.universalIdentifier,definer:`defineObject`,config:{...t,fields:e},enumBindings:l,defaultFolder:`src/objects`,fileSuffix:`.object.ts`,fileBaseName:a.t(t.nameSingular),parentName:null})}for(let t of h){let n=V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});f.set(t.universalIdentifier,{objectName:n,fieldName:t.name}),i.push({kind:`field`,universalIdentifier:t.universalIdentifier,definer:`defineField`,config:t,enumBindings:c,defaultFolder:`src/fields`,fileSuffix:`.field.ts`,fileBaseName:z({objectName:n,fieldName:t.name,fieldUniversalIdentifier:t.universalIdentifier}),parentName:n})}for(let t of e.indexes??[]){if(!s.has(t.objectUniversalIdentifier)){o.push({kind:`index`,universalIdentifier:t.universalIdentifier,reason:`its object is not part of the written source`});continue}let n=V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});i.push({kind:`index`,universalIdentifier:t.universalIdentifier,definer:`defineIndex`,config:t,enumBindings:u,defaultFolder:`src/indexes`,fileSuffix:`.index.ts`,fileBaseName:k({indexManifest:t,objectName:n,fieldLocationByUniversalIdentifier:f}),parentName:n})}for(let t of e.permissionFlags??[])i.push({kind:`permissionFlag`,universalIdentifier:t.universalIdentifier,definer:`definePermissionFlag`,config:t,enumBindings:[],defaultFolder:`src/permission-flags`,fileSuffix:`.permission-flag.ts`,fileBaseName:O({segments:[t.key],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.roles??[])i.push({kind:`role`,universalIdentifier:t.universalIdentifier,definer:t.universalIdentifier===e.application.defaultRoleUniversalIdentifier?`defineApplicationRole`:`defineRole`,config:R({roleManifest:t,applicationUniversalIdentifier:r}),enumBindings:d,defaultFolder:`src/roles`,fileSuffix:`.role.ts`,fileBaseName:O({segments:[t.label],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.views??[])i.push({kind:`view`,universalIdentifier:t.universalIdentifier,definer:`defineView`,config:t,enumBindings:m,defaultFolder:`src/views`,fileSuffix:`.view.ts`,fileBaseName:O({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e})});for(let t of e.viewFields??[])i.push({kind:`viewField`,universalIdentifier:t.universalIdentifier,definer:`defineViewField`,config:t,enumBindings:p,defaultFolder:`src/view-fields`,fileSuffix:`.view-field.ts`,fileBaseName:A({viewFieldManifest:t,fieldLocationByUniversalIdentifier:f}),parentName:null});for(let n of e.pageLayouts??[])i.push({kind:`pageLayout`,universalIdentifier:n.universalIdentifier,definer:`definePageLayout`,config:M(n),enumBindings:b,defaultFolder:`src/page-layouts`,fileSuffix:`.page-layout.ts`,fileBaseName:O({segments:[n.name],universalIdentifier:n.universalIdentifier}),parentName:t.Vt(n.objectUniversalIdentifier)?V({objectUniversalIdentifier:n.objectUniversalIdentifier,manifest:e}):null});for(let n of e.pageLayoutTabs??[]){let{pageLayoutUniversalIdentifier:r}=n;if(!t.Vt(r)){o.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,reason:`it does not name the page layout it belongs to`});continue}i.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutTab`,config:M(n),enumBindings:v,defaultFolder:`src/page-layout-tabs`,fileSuffix:`.page-layout-tab.ts`,fileBaseName:O({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:U({pageLayoutUniversalIdentifier:r,manifest:e})})}for(let n of e.navigationMenuItems??[]){let{folderUniversalIdentifier:r}=n;i.push({kind:`navigationMenuItem`,universalIdentifier:n.universalIdentifier,definer:`defineNavigationMenuItem`,config:n,enumBindings:y,defaultFolder:`src/navigation-menu-items`,fileSuffix:`.navigation-menu-item.ts`,fileBaseName:K({navigationMenuItemManifest:n,manifest:e}),parentName:t.Vt(r)?q({folderUniversalIdentifier:r,manifest:e}):null})}for(let n of e.pageLayoutWidgets??[]){let{objectUniversalIdentifier:r}=n;i.push({kind:`pageLayoutWidget`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutWidget`,config:M(n),enumBindings:_,defaultFolder:`src/page-layout-widgets`,fileSuffix:`.page-layout-widget.ts`,fileBaseName:O({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:t.Vt(r)?V({objectUniversalIdentifier:r,manifest:e}):null})}return{entities:i,skipped:o}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return J}});
|
package/dist/chunks/{build-source-manifest-CLKH5vzc.cjs → build-source-manifest-BMjw7BvT.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./cli-error-CSsayo0u.cjs"),t=require("./get-tooling-error-context-C69TBSej.cjs"),n=require("./compile-application-translations-
|
|
1
|
+
const e=require("./cli-error-CSsayo0u.cjs"),t=require("./get-tooling-error-context-C69TBSej.cjs"),n=require("./compile-application-translations-Dhfvrs__.cjs"),r=require("./resolve-source-sdk-CGEJC-UH.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;
|