twenty 2.49.0 → 2.50.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/dist/app-template/AGENTS.md +16 -1
- package/dist/app-template/src/front-components/main-page.tsx +1 -1
- package/dist/app-template/yarn.lock +16 -16
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{application-BE-X21OV.cjs → application-C02vC9wC.cjs} +2 -2
- package/dist/chunks/{build-pull-entities-caP3XupC.cjs → build-pull-entities-DUmEo3aj.cjs} +2 -2
- package/dist/chunks/{build-source-manifest-DWRbCMVq.cjs → build-source-manifest-BeFnnS85.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-CtgBQfSx.cjs → build-source-snapshot-Cqb4LMAC.cjs} +4 -4
- package/dist/chunks/cli-version.constant-jQjsWsAO.cjs +1 -0
- package/dist/chunks/{collect-translatable-strings-GBVXMoaX.cjs → collect-translatable-strings-D9iJWM3B.cjs} +1 -1
- package/dist/chunks/{collect-watch-inputs-CJVgCTo5.cjs → collect-watch-inputs-CSE6DsGE.cjs} +1 -1
- package/dist/chunks/{compile-application-translations-B4jILjGc.cjs → compile-application-translations-eYLVYoTD.cjs} +1 -1
- package/dist/chunks/{constants-CemcuPi_-D7dbw2cv.cjs → constants-BAi8jZf9-C7iTUxcn.cjs} +1 -1
- package/dist/chunks/{convert-to-label-DH4ArWop.cjs → convert-to-label-DB0PYecG.cjs} +1 -1
- package/dist/chunks/{create-http-status-error-C6gJS0JS.cjs → create-http-status-error-CCASIoUs.cjs} +1 -1
- package/dist/chunks/create-metadata-client-DsTAacZG.cjs +6 -0
- package/dist/chunks/{create-pull-base-write-CX9yftCd.cjs → create-pull-base-write-Lh9yrY5q.cjs} +1 -1
- package/dist/chunks/create-rest-client-C-uI61ur.cjs +1 -0
- package/dist/chunks/{extract-manifest-from-file-mvb6OhWm.cjs → extract-manifest-from-file-yeNBn6po.cjs} +1 -1
- package/dist/chunks/{extract-source-translations-Bd_030qL.cjs → extract-source-translations-CZW5S9vg.cjs} +1 -1
- package/dist/chunks/{fetch-metadata-inspection-CAmEp-xl.cjs → fetch-metadata-inspection-CHOmOnq5.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-b_LbRuL-.cjs → fetch-signed-in-identity-BSx-tgUO.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-id-C9kY0s84.cjs → fetch-workspace-id-Bg2V_cma.cjs} +1 -1
- package/dist/chunks/format-body-DqhC3QLB.cjs +1 -0
- package/dist/chunks/{format-data-value-C7Njc7Sb.cjs → format-data-value-Dcn0aNoJ.cjs} +1 -1
- package/dist/chunks/{format-metadata-fields-BOG2kj2h.cjs → format-metadata-fields-BpiTZFjv.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-CyEMvoQr.cjs → format-metadata-owner-c6wBFmq7.cjs} +1 -1
- package/dist/chunks/format-progress-line-CeE356w0.cjs +1 -0
- package/dist/chunks/{generate-application-client-BOLnv8nr.cjs → generate-application-client-9tS8r18c.cjs} +1 -1
- package/dist/chunks/{get-app-plan-summary-D1Dsd34P.cjs → get-app-plan-summary-DOhqg3eL.cjs} +1 -1
- package/dist/chunks/{get-client-generation-skip-reason-CUn0Y2Vu.cjs → get-client-generation-skip-reason-D3_AAZQP.cjs} +1 -1
- package/dist/chunks/{get-function-input-schema-GNk3NRLJ-CWNFoyKh.cjs → get-function-input-schema-GNk3NRLJ-BvvX155j.cjs} +1 -1
- package/dist/chunks/{global-flags.constant-0k222fHC.cjs → global-flags.constant-DaR1vQnA.cjs} +1 -1
- package/dist/chunks/{is-access-token-expiring-D-YfufId.cjs → is-access-token-expiring-jLfrOp26.cjs} +1 -1
- package/dist/chunks/{is-application-not-found-error-4vnGlYbm.cjs → is-application-not-found-error-DxO-ftTG.cjs} +1 -1
- package/dist/chunks/{is-exported-manifest-dsiWCcjx.cjs → is-exported-manifest-Cq0Sjj23.cjs} +1 -1
- package/dist/chunks/{is-locale-catalog-CRn-mKHj.cjs → is-locale-catalog-DjsopIs-.cjs} +1 -1
- package/dist/chunks/is-supported-locale-CdAUON0G.cjs +1 -0
- package/dist/chunks/{locale-catalog-format-rg5FMb7l.cjs → locale-catalog-format-DwZh0gOt.cjs} +1 -1
- package/dist/chunks/{metadata-Vepr2xeA.cjs → metadata-Dojezbdo.cjs} +1 -1
- package/dist/chunks/{metadata-page.constant-thBSPIZT.cjs → metadata-page.constant-CX7U7xM8.cjs} +1 -1
- package/dist/chunks/{parse-api-url-CEfjRyid.cjs → parse-api-url-BeUTFxSv.cjs} +1 -1
- package/dist/chunks/{parse-app-export-DUZ2dQJ8.cjs → parse-app-export-CaLKxant.cjs} +1 -1
- package/dist/chunks/{parse-extraction-locale-fg7K8vps.cjs → parse-extraction-locale-DMjUY8zC.cjs} +1 -1
- package/dist/chunks/{parse-graphql-response-DvoRiFPV.cjs → parse-graphql-response-DSSJWiGu.cjs} +1 -1
- package/dist/chunks/{parse-json-input-DE451WQG.cjs → parse-json-input-BOUh0Y2U.cjs} +1 -1
- package/dist/chunks/{print-typescript-value-DaEFmMda.cjs → print-typescript-value-BU2EWXuF.cjs} +1 -1
- package/dist/chunks/{pull-source-D9QUEAsK.cjs → pull-source-DqAHeLk7.cjs} +1 -1
- package/dist/chunks/{read-app-identity-DtEnxiEF.cjs → read-app-identity-CdFKlGlw.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-DyZcsUV4.cjs → read-application-identifier-Cckd5Pm1.cjs} +1 -1
- package/dist/chunks/{read-application-identity-CMJ-W5D8.cjs → read-application-identity-B8iACpb4.cjs} +1 -1
- package/dist/chunks/{read-config-DdtXhdPp.cjs → read-config-DYzGn3dk.cjs} +1 -1
- package/dist/chunks/read-json-object-VckLNpsj.cjs +1 -0
- package/dist/chunks/{read-snapshot-file-dvWjVexO.cjs → read-snapshot-file-CQ_tHUot.cjs} +1 -1
- package/dist/chunks/{read-source-identity-Ca7QkuwC.cjs → read-source-identity-SwqTRFjJ.cjs} +1 -1
- package/dist/chunks/{record-pull-base-Dfqth7Uy.cjs → record-pull-base-CH-q0A8T.cjs} +1 -1
- package/dist/chunks/{record-typecheck-config-inputs-DZy2PhMY.cjs → record-typecheck-config-inputs-DWzR6mUU.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-BY5ew3aM.cjs → request-oauth-tokens-XMt_yPua.cjs} +1 -1
- package/dist/chunks/{resolve-app-project-dftvbB2P.cjs → resolve-app-project-Dc5KpCDh.cjs} +1 -1
- package/dist/chunks/{resolve-command-target-0k6iitOZ.cjs → resolve-command-target-Dv9k9ic2.cjs} +1 -1
- package/dist/chunks/{resolve-inside-sdk-6M8jy9bi.cjs → resolve-inside-sdk-BK6jFT6V.cjs} +1 -1
- package/dist/chunks/{resolve-metadata-object-DzDTQF_T.cjs → resolve-metadata-object-Dlprkb-X.cjs} +1 -1
- package/dist/chunks/{resolve-project-typescript-Cw2kvn6E.cjs → resolve-project-typescript-BWyUXLJM.cjs} +1 -1
- package/dist/chunks/{resolve-request-url-Cnuxu_nj.cjs → resolve-request-url-B6KNhoFa.cjs} +1 -1
- package/dist/chunks/{resolve-source-sdk-B1Fxlsmt.cjs → resolve-source-sdk-C0_F9oUQ.cjs} +1 -1
- package/dist/chunks/{run-api-graphql-command-CzQ4IH4l.cjs → run-api-graphql-command-CVdIic7q.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-BtXv11uz.cjs → run-api-rest-command-DgF7Vh0j.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-DsgrCsEl.cjs → run-app-add-command-4wAkXDW2.cjs} +2 -2
- package/dist/chunks/{run-app-apply-command-X_XGAwRN.cjs → run-app-apply-command-DOPPX88t.cjs} +1 -1
- package/dist/chunks/{run-app-build-command--t8qRNsn.cjs → run-app-build-command-VoObCeD2.cjs} +1 -1
- package/dist/chunks/{run-app-dev-command-Cc-nhH2t.cjs → run-app-dev-command-DqY3qjVy.cjs} +1 -1
- package/dist/chunks/{run-app-exec-command-mdXCYmUn.cjs → run-app-exec-command-CasOptA2.cjs} +2 -2
- package/dist/chunks/{run-app-generate-client-command-3DMg-WyX.cjs → run-app-generate-client-command-BdOjFITA.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-BfS8IFmY.cjs → run-app-init-command-DFNSImQ4.cjs} +1 -1
- package/dist/chunks/{run-app-install-command-DMbwFvtE.cjs → run-app-install-command-DDkBjstj.cjs} +1 -1
- package/dist/chunks/{run-app-logs-command-B7_iDOj1.cjs → run-app-logs-command-DPOtBKPs.cjs} +3 -3
- package/dist/chunks/{run-app-operation-DFCj0sG_.cjs → run-app-operation-Dt8_tKmi.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-Dh_DFA7H.cjs → run-app-plan-command-CusqLQ3f.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-eJcYGb8S.cjs → run-app-publish-command-COhfOFpj.cjs} +2 -2
- package/dist/chunks/{run-app-pull-command-BV2cMuLU.cjs → run-app-pull-command-C9GHMbgF.cjs} +2 -2
- package/dist/chunks/{run-app-translations-extract-command-CBBbk_vJ.cjs → run-app-translations-extract-command-DWEinGqX.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-pAHhuBGo.cjs → run-app-typecheck-command-CGrsPEx6.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-C5um6udQ.cjs → run-app-uninstall-command-i7a4Jem9.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-C4VI44Xu.cjs → run-auth-login-command-DaXPK5wd.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-5Tvqclki.cjs → run-auth-logout-command-W7tRzWph.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-CLH1bylR.cjs → run-auth-status-command-B0dAwETL.cjs} +1 -1
- package/dist/chunks/{run-cli-BA0FsxzB.cjs → run-cli-CAoDm_W8.cjs} +1 -1
- package/dist/chunks/{run-commands-command-CjzkTcrO.cjs → run-commands-command-ZjKeKGKY.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-DoZIpf8O.cjs → run-data-get-command-B77up-s7.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-DAoplyqj.cjs → run-data-list-command-RwomiIPV.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-D8cpt7FI.cjs → run-doctor-command-vxHdUzhC.cjs} +2 -2
- package/dist/chunks/{run-metadata-field-describe-command-BrZYIhjH.cjs → run-metadata-field-describe-command-B_NgZ7Ms.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-C9-pHXbx.cjs → run-metadata-field-list-command-BGYdnELQ.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-WFdGu1Iq.cjs → run-metadata-object-describe-command-J85iBAkc.cjs} +1 -1
- package/dist/chunks/run-metadata-object-list-command-Bql6RG8g.cjs +2 -0
- package/dist/chunks/{run-open-command-B1pdHp36.cjs → run-open-command-BNX-l7r7.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-BRPcCOKx.cjs → run-remote-list-command-D6aUDed3.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-CS6za2Pm.cjs → run-remote-remove-command-D0Mb9tkZ.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-BOqWQUR4.cjs → run-remote-rename-command-BgjOFYNE.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-BANiokD-.cjs → run-remote-use-command-zGfFYq-A.cjs} +1 -1
- package/dist/chunks/{run-version-command-C0xgcPP6.cjs → run-version-command-DwZTxHuu.cjs} +1 -1
- package/dist/chunks/{select-target-CfuNLCQL.cjs → select-target-CKoOXLSW.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-DYCWIDa9.cjs → sign-in-to-remote-again-BhpxdF8v.cjs} +1 -1
- package/dist/chunks/{sign-in-with-browser-Ck4tOxtA.cjs → sign-in-with-browser-BrB5btVu.cjs} +1 -1
- package/dist/chunks/{to-public-target-C0POrVoG.cjs → to-public-target-DYS-Zlyh.cjs} +1 -1
- package/dist/chunks/{to-worker-output-diagnostics-Bt_acI26.cjs → to-worker-output-diagnostics-eE_POlPf.cjs} +1 -1
- package/dist/chunks/{typecheck-application-DEO1SVdO.cjs → typecheck-application-P6akOoSs.cjs} +1 -1
- package/dist/chunks/{update-config-FzOzO3wZ.cjs → update-config-BNB8Mkee.cjs} +1 -1
- package/dist/chunks/{utils-ZOESAfF8-ub6jPiZ-.cjs → utils-D6KY4-gU-rSlFwrTC.cjs} +3 -3
- package/dist/chunks/{write-config-atomically-C-YMKq3P.cjs → write-config-atomically-eVpizD-t.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/package.json +2 -2
- package/dist/chunks/cli-version.constant-BBeYll5N.cjs +0 -1
- package/dist/chunks/create-metadata-client-BRD2ys8z.cjs +0 -6
- package/dist/chunks/create-rest-client-Cc5Cmakp.cjs +0 -60
- package/dist/chunks/format-body-BIv-9Sd5.cjs +0 -1
- package/dist/chunks/format-progress-line-DgxG_7p2.cjs +0 -1
- package/dist/chunks/is-supported-locale-BOZxTj7r.cjs +0 -1
- package/dist/chunks/read-json-object-CgaXuNS0.cjs +0 -1
- package/dist/chunks/run-metadata-object-list-command-8UKU3cMW.cjs +0 -2
|
@@ -37,6 +37,21 @@
|
|
|
37
37
|
- https://docs.twenty.com/developers/extend/apps/operations/publishing.md
|
|
38
38
|
- Rich app example: https://github.com/twentyhq/twenty/tree/main/packages/twenty-apps/examples/postcard
|
|
39
39
|
|
|
40
|
+
## Front components
|
|
41
|
+
|
|
42
|
+
For front component work, follow the official `develop-app` skill when installed. Install the official skills with `npx skills add https://github.com/twentyhq/twenty/tree/agent-skills --skill '*'`. Apply these essentials even when no skills are installed:
|
|
43
|
+
|
|
44
|
+
- For every visible front component, use `twenty-ui` components by default. Reuse an equivalent Twenty UI control before writing a custom control or adding another UI library. Plain HTML is appropriate for layout containers and content without a Twenty UI equivalent.
|
|
45
|
+
- Import from public family subpaths: `twenty-ui/components/input` for `MainButton` and `LightButton`, `twenty-ui/primitives/input` for foundational controls, `twenty-ui/primitives/typography` for text, and the matching family for other components. Import individual icons from `twenty-ui/icon`, never `IconsProvider` or `useIcons`. Keep `twenty-ui`, `twenty-sdk` and `twenty-client-sdk` pinned to the same version in `devDependencies`.
|
|
46
|
+
- The renderer supplies styles and the workspace theme. Use `useTheme()` from `twenty-ui/theme` inside the component for spacing, colors, typography and radii. Do not add a root `ThemeProvider`, force a color scheme, or copy standalone stylesheet setup into a front component. Never dereference theme tokens at module top level, since entity files also run during manifest extraction.
|
|
47
|
+
- Use component props before custom styles. Keep layouts compact and responsive to widget width, give inputs visible labels and icon-only actions accessible names, and handle loading, empty, error, disabled and saving states. Verify light and dark themes, narrow widths and long values.
|
|
48
|
+
- Use `openCommandConfirmationModal` or `CommandModal` from `twenty-sdk/front-component` for confirmation dialogs and `enqueueSnackbar` for notifications. Do not render `Dialog`, `AlertDialog`, native `dialog` elements or native browser popovers directly. Use Twenty UI `Dropdown` for menus and pickers.
|
|
49
|
+
- Components run in a Web Worker with a sandboxed, partial `window` and `document`. Prefer CSS for layout and width-based queries. `canvas` and `scrollIntoView` are unsupported; consult the current runtime limitations before using other browser APIs.
|
|
50
|
+
- Keep the `.tsx` entity's direct `export default defineFrontComponent({ ... })` call. The SDK mounts the component, so do not call `react-dom/client` or use browser globals at module top level.
|
|
51
|
+
- Read workspace data with `CoreApiClient` from `twenty-client-sdk/core` and selection with `useSelectedRecordIds()` from `twenty-sdk/front-component`. Call third-party APIs from logic functions; secret application variables never reach a front component.
|
|
52
|
+
|
|
53
|
+
Read the [front component guide](https://docs.twenty.com/developers/extend/apps/layout/front-components.md) before implementation for the renderer setup and runtime limitations. Use [Twenty UI getting started](https://docs.twenty.com/ui/getting-started.md), [components](https://docs.twenty.com/ui/components/overview.md), [primitives](https://docs.twenty.com/ui/primitives/overview.md) and [theming](https://docs.twenty.com/ui/theming.md) to find the relevant component page and check its current props and composition.
|
|
54
|
+
|
|
40
55
|
## UUID requirement
|
|
41
56
|
|
|
42
57
|
- All generated UUIDs must be valid UUID v4.
|
|
@@ -44,7 +59,7 @@
|
|
|
44
59
|
## Common Pitfalls
|
|
45
60
|
|
|
46
61
|
- Creating a view without a navigationMenuItem associated. This will make the view available on the left sidebar.
|
|
47
|
-
- Creating a front
|
|
62
|
+
- Creating a front component that overflows its widget. Fit the available width and let content determine height, unless the component is the tab's single `heightBehavior: 'TAB_VIEWPORT'` widget and owns internal scrolling.
|
|
48
63
|
|
|
49
64
|
## Best practice
|
|
50
65
|
|
|
@@ -204,7 +204,7 @@ const MainPage = () => {
|
|
|
204
204
|
padding: '40px',
|
|
205
205
|
}}
|
|
206
206
|
>
|
|
207
|
-
<Avatar name={APP_DISPLAY_NAME} colorSeed={APP_DISPLAY_NAME} size="
|
|
207
|
+
<Avatar name={APP_DISPLAY_NAME} colorSeed={APP_DISPLAY_NAME} size="xxl" />
|
|
208
208
|
<span
|
|
209
209
|
style={{
|
|
210
210
|
fontSize: '24px',
|
|
@@ -1265,9 +1265,9 @@ __metadata:
|
|
|
1265
1265
|
oxlint: "npm:^0.16.0"
|
|
1266
1266
|
react: "npm:^19.0.0"
|
|
1267
1267
|
react-dom: "npm:^19.0.0"
|
|
1268
|
-
twenty-client-sdk: "npm:2.
|
|
1269
|
-
twenty-sdk: "npm:2.
|
|
1270
|
-
twenty-ui: "npm:2.
|
|
1268
|
+
twenty-client-sdk: "npm:2.50.0"
|
|
1269
|
+
twenty-sdk: "npm:2.50.0"
|
|
1270
|
+
twenty-ui: "npm:2.50.0"
|
|
1271
1271
|
typescript: "npm:^5.9.3"
|
|
1272
1272
|
vite-tsconfig-paths: "npm:^4.2.1"
|
|
1273
1273
|
vitest: "npm:^4.0.0"
|
|
@@ -2912,22 +2912,22 @@ __metadata:
|
|
|
2912
2912
|
languageName: node
|
|
2913
2913
|
linkType: hard
|
|
2914
2914
|
|
|
2915
|
-
"twenty-client-sdk@npm:2.
|
|
2916
|
-
version: 2.
|
|
2917
|
-
resolution: "twenty-client-sdk@npm:2.
|
|
2915
|
+
"twenty-client-sdk@npm:2.50.0":
|
|
2916
|
+
version: 2.50.0
|
|
2917
|
+
resolution: "twenty-client-sdk@npm:2.50.0"
|
|
2918
2918
|
dependencies:
|
|
2919
2919
|
"@genql/runtime": "npm:^2.10.0"
|
|
2920
2920
|
esbuild: "npm:^0.28.1"
|
|
2921
2921
|
graphql: "npm:^16.8.1"
|
|
2922
2922
|
lodash: "npm:^4.17.21"
|
|
2923
2923
|
prettier: "npm:^3.8.3"
|
|
2924
|
-
checksum: 10c0/
|
|
2924
|
+
checksum: 10c0/d1a545e9f986747dcf30efbb37dbf8a6a0da773a2c91ef83cc04cf7c4a90767d7bfbb223dacc293e7f5f8fdcfe431c67690d838ff9553eb24dec0c897d75dd66
|
|
2925
2925
|
languageName: node
|
|
2926
2926
|
linkType: hard
|
|
2927
2927
|
|
|
2928
|
-
"twenty-sdk@npm:2.
|
|
2929
|
-
version: 2.
|
|
2930
|
-
resolution: "twenty-sdk@npm:2.
|
|
2928
|
+
"twenty-sdk@npm:2.50.0":
|
|
2929
|
+
version: 2.50.0
|
|
2930
|
+
resolution: "twenty-sdk@npm:2.50.0"
|
|
2931
2931
|
dependencies:
|
|
2932
2932
|
"@sniptt/guards": "npm:^0.2.0"
|
|
2933
2933
|
axios: "npm:^1.16.0"
|
|
@@ -2946,18 +2946,18 @@ __metadata:
|
|
|
2946
2946
|
semver: "npm:7.6.3"
|
|
2947
2947
|
sharp: "npm:^0.35.5"
|
|
2948
2948
|
tinyglobby: "npm:^0.2.15"
|
|
2949
|
-
twenty-client-sdk: "npm:2.
|
|
2949
|
+
twenty-client-sdk: "npm:2.50.0"
|
|
2950
2950
|
typescript: "npm:^5.9.3"
|
|
2951
2951
|
uuid: "npm:^13.0.2"
|
|
2952
2952
|
bin:
|
|
2953
2953
|
twenty: dist/cli.cjs
|
|
2954
|
-
checksum: 10c0/
|
|
2954
|
+
checksum: 10c0/82238005a797f009f615bce730e0fb7066c76e673e3153332a0d3b6cf5a4fb5794c8e2140e698c4b8004e683483082371d74dea8d21a7f8b8959823d90376152
|
|
2955
2955
|
languageName: node
|
|
2956
2956
|
linkType: hard
|
|
2957
2957
|
|
|
2958
|
-
"twenty-ui@npm:2.
|
|
2959
|
-
version: 2.
|
|
2960
|
-
resolution: "twenty-ui@npm:2.
|
|
2958
|
+
"twenty-ui@npm:2.50.0":
|
|
2959
|
+
version: 2.50.0
|
|
2960
|
+
resolution: "twenty-ui@npm:2.50.0"
|
|
2961
2961
|
dependencies:
|
|
2962
2962
|
"@base-ui/react": "npm:^1.9.0"
|
|
2963
2963
|
"@base-ui/utils": "npm:0.5.0"
|
|
@@ -2976,7 +2976,7 @@ __metadata:
|
|
|
2976
2976
|
optional: true
|
|
2977
2977
|
monaco-editor:
|
|
2978
2978
|
optional: true
|
|
2979
|
-
checksum: 10c0/
|
|
2979
|
+
checksum: 10c0/00d89bc173cab13eeee4666ce2608dd8590d94428453d9fcfb2df5f9c3057adbe306df4a50a2b9fa2f76de3353384503d1679cbf3492a32afac5ddca2a49cc73
|
|
2980
2980
|
languageName: node
|
|
2981
2981
|
linkType: hard
|
|
2982
2982
|
|
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-BAi8jZf9-C7iTUxcn.cjs");var n=e.t(),r=5e3,i=new AbortController,a,o=e=>{if(t.v(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.v(e.target)||!(0,n.isNonEmptyString)(e.target.apiUrl)||!(0,n.isNonEmptyString)(e.target.workspaceId)||!t.v(e.applicationExport)||!t.v(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.v(e)||e.success!==!0||!t.v(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.v(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-DqAHeLk7.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-Cqb4LMAC.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-CSE6DsGE.cjs")).then(e=>e.t),{recordTypecheckConfigInputs:a}=await Promise.resolve().then(()=>require("./chunks/record-typecheck-config-inputs-DWzR6mUU.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-P6akOoSs.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-CZW5S9vg.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-BeFnnS85.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-SwqTRFjJ.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-9tS8r18c.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}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-ZOESAfF8-ub6jPiZ-.cjs"),n=require("./constants-CemcuPi_-D7dbw2cv.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 ee(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&!Array.isArray(e)}var te=[`choice`,`score`,`boolean`],ne=/^[a-zA-Z0-9_.-]{1,64}$/,re=e=>ne.test(e),h=e.t(),g=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}({}),_=`trigger`,ie=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},ae=/{{([^{}]+)}}/g;function*v(e){if((0,h.isString)(e)){for(let[,t]of e.matchAll(ae))n.Vt(t)&&(yield t);return}if((0,h.isObject)(e))for(let t of Object.values(e))yield*v(t)}var oe=e=>[...v(e)],se=(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]},ce=e=>{if(!n.Vt(e)||!ee(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length===0?!1:t.every(e=>n.Vt(e)&&ee(e)&&p(e.isLeaf))},y=(e,t=[])=>{let n=[];if(!(0,h.isObject)(e))return n;for(let[r,i]of Object.entries(e)){if(!(0,h.isObject)(i))continue;let e=[...t,r];n.push(e.join(`.`)),!i.isLeaf&&(0,h.isObject)(i.value)&&n.push(...y(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.Vt(i))return;if(!(0,h.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}},b={found:!1},x=e=>n.p(e)&&p(e.isLeaf),S=e=>n.p(e)&&e._outputSchemaType===`RECORD`&&n.p(e.fields),C=e=>n.p(e)&&!(`_outputSchemaType`in e)&&x(e.first)&&e.first.isLeaf===!1&&S(e.first.value)&&x(e.totalCount),w=e=>({found:!0,type:m(e.type)?e.type:void 0,label:m(e.label)?e.label:void 0}),ue=(e,t)=>t.length===0?w(e):T(e.value,t),de=(e,t)=>{for(let n=1;n<=t.length;n++){let r=e[t.slice(0,n).join(`.`)];if(x(r))return ue(r,t.slice(n))}return b},fe=(e,t)=>{let[n,...r]=t;if(n===`first`)return r.length===0?w(e.first):T(e.first.value,r);if(n===`all`||n===`totalCount`){let t=e[n];return r.length===0&&x(t)?w(t):b}return b},pe=(e,t)=>{let[r,...i]=t;if(!n.Vt(r))return b;let a=e[r];return x(a)?ue(a,i):n.Vt(a)?i.length===0?{found:!0}:n.p(a)?pe(a,i):b:b},T=(e,t)=>t.length===0||!n.p(e)?b:S(e)?de(e.fields,t):C(e)?fe(e,t):pe(e,t),me=({schema:e,propertyPath:t})=>T(e,t),E=e=>{let t=[];for(let[r,i]of Object.entries(e))if(x(i)){if(t.push(r),i.isLeaf)continue;let e=i.value;if(S(e))for(let n of E(e.fields))t.push(`${r}.${n}`);else if(n.p(e))for(let n of E(e))t.push(`${r}.${n}`)}else if(n.Vt(i)&&(t.push(r),n.p(i)))for(let e of E(i))t.push(`${r}.${e}`);return t},D=e=>{if(!n.p(e))return[];if(S(e))return E(e.fields);if(C(e)){let t=[];if(x(e.first)){t.push(`first`);for(let n of D(e.first.value))t.push(`first.${n}`)}return n.Vt(e.all)&&t.push(`all`),t.push(`totalCount`),t}return E(e)},he=3,O=e=>n.p(e)?e._outputSchemaType===`RECORD`?!0:Object.values(e).some(e=>n.p(e)&&O(e.value)):!1,k=(e,t)=>t.map(t=>({candidate:t,distance:se(e,t)})).filter(({candidate:e,distance:t})=>t<=Math.ceil(e.length/2)).sort((e,t)=>e.distance-t.distance).slice(0,he).map(({candidate:e})=>e),ge=({schema:e,propertyPath:t,referencedStepId:r})=>{if(!ce(e)||O(e)){let n=D(e);return k(t.join(`.`),n).map(e=>[r,e].join(`.`))}let i=le({schema:e,propertyPath:t});if(!n.Vt(i))return[];let a=k(i.failedSegment,i.availableKeys).map(e=>[r,...i.validPrefix,e].join(`.`));if((0,h.isNonEmptyArray)(a))return a;let o=y(e);return k(t.join(`.`),o).map(e=>[r,e].join(`.`))},_e=({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=oe(o.settings?.input),c=t.ancestorsByStepId.get(o.id)??new Set;for(let t of s){let s=ie(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===_;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(...ve({step:o,variable:t,pathSegments:s,referencedStepId:l,isTriggerReference:u,trigger:e.trigger,stepsById:r}))}}return i},ve=({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,h.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.Vt(l)||u)return[];if(!me({schema:l,propertyPath:c}).found){let r=ge({schema:l,propertyPath:c,referencedStepId:i}),a=be(l,i),o=(0,h.isNonEmptyArray)(r)?`Did you mean "{{${r[0]}}}"?${r.length>1?` Other options: ${r.slice(1).map(e=>`{{${e}}}`).join(`, `)}.`:``}`:(0,h.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,h.isNonEmptyArray)(r)?{suggestions:r}:{},...(0,h.isNonEmptyArray)(a)?{availablePaths:a}:{}}]}return[]},ye=20,be=(e,t)=>D(e).slice(0,ye).map(e=>`${t}.${e}`),xe=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(re),{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()}),Se=n.Ct(`type`,[n.jt({type:n.Dt(`text`)}),n.jt({type:n.Dt(`json`),schema:xe})]),A=[1e3,5e3,15e3],j=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(A.length).describe(`How many times to retry the action if it fails, between 0 and ${A.length}. 0 disables retries.`))}),continueOnFailure:n.jt({value:n.St().describe(`Whether to continue to the next step if this action fails.`)})})}),Ce={expectedOutputSchema:n.Ot({}).optional().describe(`A sample output value declared by the user for steps whose output structure is only known at runtime.`)},we=j.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()}),...Ce}),Te=/^[a-zA-Z0-9_-]{1,64}$/,Ee=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.`)}),De=n.jt({id:n.Rt().describe(`Stable identifier for this question row.`),name:n.Ft().regex(Te,`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(te).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(Ee).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),Oe=j.extend({input:n.jt({state:n.Ft().describe(`The shared state every question is asked about. Supports variables.`),questions:n.xt(De)})}),ke=j.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()})}),Ae=j.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()})}),je=j.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.`)})}),Me=j.extend({input:n.jt({})}),M=n.Nt(n.Ft(),n.bt()).describe(`Record data object. Use nested objects for relationships (e.g., "company": {"id": "{{reference}}"}). Common patterns:
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-D6KY4-gU-rSlFwrTC.cjs"),n=require("./constants-BAi8jZf9-C7iTUxcn.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 ee(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&!Array.isArray(e)}var te=[`choice`,`score`,`boolean`],ne=/^[a-zA-Z0-9_.-]{1,64}$/,re=e=>ne.test(e),h=e.t(),g=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}({}),_=`trigger`,ie=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},ae=/{{([^{}]+)}}/g;function*v(e){if((0,h.isString)(e)){for(let[,t]of e.matchAll(ae))n.Vt(t)&&(yield t);return}if((0,h.isObject)(e))for(let t of Object.values(e))yield*v(t)}var oe=e=>[...v(e)],se=(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]},ce=e=>{if(!n.Vt(e)||!ee(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length===0?!1:t.every(e=>n.Vt(e)&&ee(e)&&p(e.isLeaf))},y=(e,t=[])=>{let n=[];if(!(0,h.isObject)(e))return n;for(let[r,i]of Object.entries(e)){if(!(0,h.isObject)(i))continue;let e=[...t,r];n.push(e.join(`.`)),!i.isLeaf&&(0,h.isObject)(i.value)&&n.push(...y(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.Vt(i))return;if(!(0,h.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}},b={found:!1},x=e=>n.v(e)&&p(e.isLeaf),S=e=>n.v(e)&&e._outputSchemaType===`RECORD`&&n.v(e.fields),C=e=>n.v(e)&&!(`_outputSchemaType`in e)&&x(e.first)&&e.first.isLeaf===!1&&S(e.first.value)&&x(e.totalCount),w=e=>({found:!0,type:m(e.type)?e.type:void 0,label:m(e.label)?e.label:void 0}),ue=(e,t)=>t.length===0?w(e):T(e.value,t),de=(e,t)=>{for(let n=1;n<=t.length;n++){let r=e[t.slice(0,n).join(`.`)];if(x(r))return ue(r,t.slice(n))}return b},fe=(e,t)=>{let[n,...r]=t;if(n===`first`)return r.length===0?w(e.first):T(e.first.value,r);if(n===`all`||n===`totalCount`){let t=e[n];return r.length===0&&x(t)?w(t):b}return b},pe=(e,t)=>{let[r,...i]=t;if(!n.Vt(r))return b;let a=e[r];return x(a)?ue(a,i):n.Vt(a)?i.length===0?{found:!0}:n.v(a)?pe(a,i):b:b},T=(e,t)=>t.length===0||!n.v(e)?b:S(e)?de(e.fields,t):C(e)?fe(e,t):pe(e,t),me=({schema:e,propertyPath:t})=>T(e,t),E=e=>{let t=[];for(let[r,i]of Object.entries(e))if(x(i)){if(t.push(r),i.isLeaf)continue;let e=i.value;if(S(e))for(let n of E(e.fields))t.push(`${r}.${n}`);else if(n.v(e))for(let n of E(e))t.push(`${r}.${n}`)}else if(n.Vt(i)&&(t.push(r),n.v(i)))for(let e of E(i))t.push(`${r}.${e}`);return t},D=e=>{if(!n.v(e))return[];if(S(e))return E(e.fields);if(C(e)){let t=[];if(x(e.first)){t.push(`first`);for(let n of D(e.first.value))t.push(`first.${n}`)}return n.Vt(e.all)&&t.push(`all`),t.push(`totalCount`),t}return E(e)},he=3,O=e=>n.v(e)?e._outputSchemaType===`RECORD`?!0:Object.values(e).some(e=>n.v(e)&&O(e.value)):!1,k=(e,t)=>t.map(t=>({candidate:t,distance:se(e,t)})).filter(({candidate:e,distance:t})=>t<=Math.ceil(e.length/2)).sort((e,t)=>e.distance-t.distance).slice(0,he).map(({candidate:e})=>e),ge=({schema:e,propertyPath:t,referencedStepId:r})=>{if(!ce(e)||O(e)){let n=D(e);return k(t.join(`.`),n).map(e=>[r,e].join(`.`))}let i=le({schema:e,propertyPath:t});if(!n.Vt(i))return[];let a=k(i.failedSegment,i.availableKeys).map(e=>[r,...i.validPrefix,e].join(`.`));if((0,h.isNonEmptyArray)(a))return a;let o=y(e);return k(t.join(`.`),o).map(e=>[r,e].join(`.`))},_e=({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=oe(o.settings?.input),c=t.ancestorsByStepId.get(o.id)??new Set;for(let t of s){let s=ie(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===_;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(...ve({step:o,variable:t,pathSegments:s,referencedStepId:l,isTriggerReference:u,trigger:e.trigger,stepsById:r}))}}return i},ve=({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,h.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.Vt(l)||u)return[];if(!me({schema:l,propertyPath:c}).found){let r=ge({schema:l,propertyPath:c,referencedStepId:i}),a=be(l,i),o=(0,h.isNonEmptyArray)(r)?`Did you mean "{{${r[0]}}}"?${r.length>1?` Other options: ${r.slice(1).map(e=>`{{${e}}}`).join(`, `)}.`:``}`:(0,h.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,h.isNonEmptyArray)(r)?{suggestions:r}:{},...(0,h.isNonEmptyArray)(a)?{availablePaths:a}:{}}]}return[]},ye=20,be=(e,t)=>D(e).slice(0,ye).map(e=>`${t}.${e}`),xe=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(re),{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()}),Se=n.Ct(`type`,[n.jt({type:n.Dt(`text`)}),n.jt({type:n.Dt(`json`),schema:xe})]),A=[1e3,5e3,15e3],j=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(A.length).describe(`How many times to retry the action if it fails, between 0 and ${A.length}. 0 disables retries.`))}),continueOnFailure:n.jt({value:n.St().describe(`Whether to continue to the next step if this action fails.`)})})}),Ce={expectedOutputSchema:n.Ot({}).optional().describe(`A sample output value declared by the user for steps whose output structure is only known at runtime.`)},we=j.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()}),...Ce}),Te=/^[a-zA-Z0-9_-]{1,64}$/,Ee=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.`)}),De=n.jt({id:n.Rt().describe(`Stable identifier for this question row.`),name:n.Ft().regex(Te,`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(te).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(Ee).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),Oe=j.extend({input:n.jt({state:n.Ft().describe(`The shared state every question is asked about. Supports variables.`),questions:n.xt(De)})}),ke=j.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()})}),Ae=j.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()})}),je=j.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.`)})}),Me=j.extend({input:n.jt({})}),M=n.Nt(n.Ft(),n.bt()).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
4
|
- Task: {"title": "Follow up", "status": "TODO", "assignee": {"id": "{{user.id}}"}}`),Ne=j.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:M.describe(`The record data to create.`)})}),Pe=j.extend({input:n.jt({objectName:n.Ft(),objectRecord:M,objectRecordId:n.Ft(),fieldsToUpdate:n.xt(n.Ft())})}),Fe=j.extend({input:n.jt({objectName:n.Ft(),objectRecord:M})}),Ie=j.extend({input:n.jt({objectName:n.Ft(),objectRecordId:n.Ft()})}),N=n.jt({id:n.Ft(),logicalOperator:n.vt(n.M),parentRecordFilterGroupId:n.Ft().nullable().optional(),positionInRecordFilterGroup:n.At().nullable().optional()}),P=n.jt({id:n.Ft().optional(),fieldMetadataId:n.Ft(),operand:n.vt(n.W),value:n.Ft().nullable().optional(),recordFilterGroupId:n.Ft().nullable().optional(),positionInRecordFilterGroup:n.At().nullable().optional(),subFieldName:n.Ft().nullable().optional(),relationTargetFieldMetadataId:n.Ft().nullable().optional()}),F=n.Ft().regex(/^{{[^{}]+}}$/,`Expected a workflow variable reference like {{stepId.path}}`),Le=j.extend({input:n.jt({objectName:n.Ft(),limit:n.It([n.At(),F]).optional(),offset:n.It([n.At().int().nonnegative(),F]).optional(),filter:n.jt({recordFilterGroups:n.xt(N).optional(),recordFilters:n.xt(P).optional()}).optional(),orderBy:n.jt({recordSorts:n.xt(n.bt()).optional(),gqlOperationOrderBy:n.xt(n.Nt(n.Ft(),n.bt())).optional()}).optional()})}),Re=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()}),ze=j.extend({input:n.xt(Re),instructions:n.Ft().optional()}),I=n.jt({id:n.Ft(),logicalOperator:n.vt(n.P),parentStepFilterGroupId:n.Ft().optional(),positionInStepFilterGroup:n.At().optional()}),L=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()}),Be=j.extend({input:n.jt({stepFilterGroups:n.xt(I),stepFilters:n.xt(L)})}),Ve=n.jt({id:n.Ft(),nextStepIds:n.xt(n.Ft()),filterGroupId:n.Ft().optional()}),He=j.extend({input:n.jt({stepFilterGroups:n.xt(I),stepFilters:n.xt(L),branches:n.xt(Ve)})}),R=n.vt([`RANDOM`,`ROUND_ROBIN`,`LOAD_BALANCED`]);j.extend({input:n.jt({objectName:n.Ft(),strategy:R,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.`)}),Ue=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({})})])}),We=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()})])}),Ge=e=>{let t=e.settings?.input;return e.type===g.IF_ELSE&&(0,h.isObject)(t)&&`branches`in t&&Array.isArray(t.branches)},B=e=>{let t=e.settings?.input;return e.type===g.ITERATOR&&(0,h.isObject)(t)&&`initialLoopStepIds`in t&&(0,h.isNonEmptyArray)(t.initialLoopStepIds)},Ke=e=>{let t=e.settings?.input;if(n.Vt(t)&&(0,h.isObject)(t))return t},qe=e=>{let t=new Set(e.nextStepIds??[]);if(Ge(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]},Je=({trigger:e,steps:t})=>{let r=new Map,i=n.Vt(e?.nextStepIds)?e.nextStepIds.filter(n.Vt):[];r.set(_,i);for(let e of t??[])r.set(e.id,qe(e));let a=new Set,o=[_];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:Ye(r)}},Ye=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},Xe=({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===g.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},Ze=({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(...Qe(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},Qe=e=>{let t=[],r=Ke(e);if(e.type===g.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===g.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},$e=`20202020-64aa-4b6f-b003-9c74b97cee20`,V=({entityNamespace:e,value:t,applicationUniversalIdentifier:n})=>d(`${e}:${t}`,n),et=({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}),tt=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutTab`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),nt=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutTabUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutWidget`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),rt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_PAGE}),it=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,relationTargetObjectUniversalIdentifier:n})=>V({entityNamespace:`fieldMetadata`,value:`${t}:systemRelation:${n}`,applicationUniversalIdentifier:e}),at=({objectMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,name:n})=>V({entityNamespace:`viewFieldGroup`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),ot=({fieldMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,fieldMetadataUniversalIdentifier:n})=>V({entityNamespace:`viewField`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),st={INDEX:`INDEX`,FIELDS_WIDGET:`FIELDS_WIDGET`},ct=({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,g.SEND_EMAIL,g.DRAFT_EMAIL,g.CREATE_CALENDAR_EVENT;var lt=`public`,ut=`front-component-shared-dependencies.mjs`,dt=`twenty:front-component-shared-dependencies`;n.X.RECORD_PAGE,n.X.DASHBOARD;var ft={js:`import { createRequire as __createRequire } from 'module';
|
|
5
|
-
const require = __createRequire(import.meta.url);`},pt=`.twenty/output`,mt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,fieldUniversalIdentifier:n})=>V({entityNamespace:`fieldPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),ht=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,objectUniversalIdentifier:n})=>V({entityNamespace:`objectPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),gt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_FORM}),_t=({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}},vt=e=>JSON.stringify(e,(e,t)=>n.p(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),yt=({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=>vt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:yt({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},bt=n.x.map(e=>n.S[e]),xt=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),St=({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`}]:[]],Ct=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...bt,...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}))},wt=({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&&!xt({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),Tt=({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`}]:[]]}),Et=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...St({role:e,superset:t}),...Ct({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...wt({role:e,superset:t}),...Tt({role:e,superset:t})],Dt=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:j.shape.errorHandlingOptions.optional()},Y=(e,t)=>n.Pt({...J,type:n.Dt(e),input:t}),Ot=n.Ot({fieldMetadataUniversalIdentifier:n.Rt(),fieldMetadataId:n.kt().optional()}),X=L.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt().optional()}).strict(),kt=P.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt()}).strict(),Z={objectUniversalIdentifier:n.Rt()},At=[n.Pt({...J,type:n.Dt(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:n.Rt(),input:n.Nt(n.Ft(),n.Lt())}),Y(`HTTP_REQUEST`,we.shape.input),Y(`CLASSIFY`,Oe.shape.input),Y(`ITERATOR`,ke.shape.input),Y(`DELAY`,Ae.shape.input),Y(`WAIT_FOR_EVENT`,je.shape.input),Y(`EMPTY`,Me.shape.input),Y(`CREATE_RECORD`,Ne.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPDATE_RECORD`,Pe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPSERT_RECORD`,Fe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`DELETE_RECORD`,Ie.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`FIND_RECORDS`,Le.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...Z,filter:n.Pt({recordFilterGroups:n.xt(N).optional(),recordFilters:n.xt(kt).optional()}).optional(),orderBy:n.Pt({recordSorts:n.xt(Ot.extend({direction:n.vt([`ASC`,`DESC`]),subFieldName:n.Ft().nullable().optional()})).optional()}).optional()}).strict()),Y(`PICK_RECORD`,n.Pt({...Z,strategy:R,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`,Be.shape.input.extend({stepFilters:n.xt(X)})),Y(`IF_ELSE`,He.shape.input.extend({stepFilters:n.xt(X)})),Y(`FORM`,n.xt(ze.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:Se.optional()}))],jt=At.map(e=>e.shape.type.value),Mt=n.Ct(`type`,At,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${jt.join(`, `)}`:void 0}),Nt=[`updated`,`upserted`],Pt=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()})]),[Q,Ft,It,Lt]=Ue.shape.settings.options,Rt=n.Ct(`type`,[Q.omit({outputSchema:!0}).extend({schedule:Q.shape.schedule.strict()}).strict(),Ft.omit({outputSchema:!0}).extend({schedule:Ft.shape.schedule.strict()}).strict(),It.omit({outputSchema:!0}).extend({schedule:It.shape.schedule.strict()}).strict(),Lt.omit({outputSchema:!0}).strict()]),[zt,Bt]=We.shape.settings.options,Vt=n.Ct(`httpMethod`,[zt.omit({outputSchema:!0,authentication:!0}).strict(),Bt.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),$=[n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`MANUAL`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({availability:Pt.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:Rt}),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(I),stepFilters:n.xt(X.extend({operand:n.vt(n.W)}))}).optional()}).superRefine((e,r)=>{if(t.r(e.fieldUniversalIdentifiers)&&!Nt.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${Nt.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:Vt})],Ht=$.map(e=>e.shape.type.value),Ut=n.Ct(`type`,$,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${Ht.join(`, `)}`:void 0});n.Pt({universalIdentifier:n.Rt(),name:n.Ft().min(1),version:n.Pt({trigger:Ut,steps:n.xt(Mt).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=Je(a);for(let e of[...Ze({workflow:a,graph:o}),...Xe({workflow:a,graph:o}),..._e({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 $e}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ct}});
|
|
5
|
+
const require = __createRequire(import.meta.url);`},pt=`.twenty/output`,mt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,fieldUniversalIdentifier:n})=>V({entityNamespace:`fieldPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),ht=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,objectUniversalIdentifier:n})=>V({entityNamespace:`objectPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),gt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_FORM}),_t=({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.v(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.O.default.h,columnSpan:n.O.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}},vt=e=>JSON.stringify(e,(e,t)=>n.v(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),yt=({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=>vt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:yt({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},bt=n.d.map(e=>n.r[e]),xt=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),St=({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`}]:[]],Ct=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...bt,...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}))},wt=({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&&!xt({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),Tt=({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`}]:[]]}),Et=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...St({role:e,superset:t}),...Ct({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...wt({role:e,superset:t}),...Tt({role:e,superset:t})],Dt=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:j.shape.errorHandlingOptions.optional()},Y=(e,t)=>n.Pt({...J,type:n.Dt(e),input:t}),Ot=n.Ot({fieldMetadataUniversalIdentifier:n.Rt(),fieldMetadataId:n.kt().optional()}),X=L.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt().optional()}).strict(),kt=P.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt()}).strict(),Z={objectUniversalIdentifier:n.Rt()},At=[n.Pt({...J,type:n.Dt(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:n.Rt(),input:n.Nt(n.Ft(),n.Lt())}),Y(`HTTP_REQUEST`,we.shape.input),Y(`CLASSIFY`,Oe.shape.input),Y(`ITERATOR`,ke.shape.input),Y(`DELAY`,Ae.shape.input),Y(`WAIT_FOR_EVENT`,je.shape.input),Y(`EMPTY`,Me.shape.input),Y(`CREATE_RECORD`,Ne.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPDATE_RECORD`,Pe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPSERT_RECORD`,Fe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`DELETE_RECORD`,Ie.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`FIND_RECORDS`,Le.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...Z,filter:n.Pt({recordFilterGroups:n.xt(N).optional(),recordFilters:n.xt(kt).optional()}).optional(),orderBy:n.Pt({recordSorts:n.xt(Ot.extend({direction:n.vt([`ASC`,`DESC`]),subFieldName:n.Ft().nullable().optional()})).optional()}).optional()}).strict()),Y(`PICK_RECORD`,n.Pt({...Z,strategy:R,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`,Be.shape.input.extend({stepFilters:n.xt(X)})),Y(`IF_ELSE`,He.shape.input.extend({stepFilters:n.xt(X)})),Y(`FORM`,n.xt(ze.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:Se.optional()}))],jt=At.map(e=>e.shape.type.value),Mt=n.Ct(`type`,At,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${jt.join(`, `)}`:void 0}),Nt=[`updated`,`upserted`],Pt=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()})]),[Q,Ft,It,Lt]=Ue.shape.settings.options,Rt=n.Ct(`type`,[Q.omit({outputSchema:!0}).extend({schedule:Q.shape.schedule.strict()}).strict(),Ft.omit({outputSchema:!0}).extend({schedule:Ft.shape.schedule.strict()}).strict(),It.omit({outputSchema:!0}).extend({schedule:It.shape.schedule.strict()}).strict(),Lt.omit({outputSchema:!0}).strict()]),[zt,Bt]=We.shape.settings.options,Vt=n.Ct(`httpMethod`,[zt.omit({outputSchema:!0,authentication:!0}).strict(),Bt.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),$=[n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`MANUAL`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({availability:Pt.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:Rt}),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(I),stepFilters:n.xt(X.extend({operand:n.vt(n.W)}))}).optional()}).superRefine((e,r)=>{if(t.r(e.fieldUniversalIdentifiers)&&!Nt.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${Nt.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:Vt})],Ht=$.map(e=>e.shape.type.value),Ut=n.Ct(`type`,$,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${Ht.join(`, `)}`:void 0});n.Pt({universalIdentifier:n.Rt(),name:n.Ft().min(1),version:n.Pt({trigger:Ut,steps:n.xt(Mt).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=Je(a);for(let e of[...Ze({workflow:a,graph:o}),...Xe({workflow:a,graph:o}),..._e({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 $e}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ct}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-BAi8jZf9-C7iTUxcn.cjs"),n=require("./application-C02vC9wC.cjs"),r=require("./metadata-Dojezbdo.cjs"),i=require("./print-typescript-value-BU2EWXuF.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.r}],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
2
|
`)}\n} from 'twenty-sdk/define';`}
|
|
3
3
|
|
|
4
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.
|
|
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.d({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.Vt(o)?{fieldPermissions:L({permissions:o,getDerivedUniversalIdentifier:({fieldUniversalIdentifier:e})=>n.o({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.t(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-DWRbCMVq.cjs → build-source-manifest-BeFnnS85.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-eYLVYoTD.cjs"),r=require("./resolve-source-sdk-C0_F9oUQ.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;
|