twenty 2.50.0 → 2.51.3

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.
Files changed (125) hide show
  1. package/dist/app-template/package.json +1 -1
  2. package/dist/app-template/yarn.lock +220 -173
  3. package/dist/app-worker.cjs +1 -1
  4. package/dist/chunks/application-DOWikeQt.cjs +5 -0
  5. package/dist/chunks/{build-pull-entities-DUmEo3aj.cjs → build-pull-entities-ShVsLh_s.cjs} +2 -2
  6. package/dist/chunks/{build-source-manifest-BeFnnS85.cjs → build-source-manifest-Gw2TI8Xe.cjs} +1 -1
  7. package/dist/chunks/{build-source-snapshot-Cqb4LMAC.cjs → build-source-snapshot-lbc2Pb7D.cjs} +19 -19
  8. package/dist/chunks/{check-node-requirement-CGBKvEqH.cjs → check-node-requirement-B_hf2E32.cjs} +1 -1
  9. package/dist/chunks/cli-version.constant-B92ETb2e.cjs +1 -0
  10. package/dist/chunks/{collect-translatable-strings-D9iJWM3B.cjs → collect-translatable-strings-DWRZN9zQ.cjs} +1 -1
  11. package/dist/chunks/{collect-watch-inputs-CSE6DsGE.cjs → collect-watch-inputs-CS4oNP1F.cjs} +1 -1
  12. package/dist/chunks/{compile-application-translations-eYLVYoTD.cjs → compile-application-translations-DS6jGOV4.cjs} +1 -1
  13. package/dist/chunks/{constants-BAi8jZf9-C7iTUxcn.cjs → constants-D-caeNc5-9rDzSg5B.cjs} +1 -1
  14. package/dist/chunks/{convert-to-label-DB0PYecG.cjs → convert-to-label-hx-g0Lvj.cjs} +1 -1
  15. package/dist/chunks/{create-http-status-error-CCASIoUs.cjs → create-http-status-error-E0DUDIUP.cjs} +1 -1
  16. package/dist/chunks/create-metadata-client-9IF8ArjT.cjs +6 -0
  17. package/dist/chunks/{create-pull-base-write-Lh9yrY5q.cjs → create-pull-base-write-JW3ZTnaC.cjs} +1 -1
  18. package/dist/chunks/{create-rest-client-C-uI61ur.cjs → create-rest-client-PU2Uyfnb.cjs} +1 -1
  19. package/dist/chunks/{extract-manifest-from-file-yeNBn6po.cjs → extract-manifest-from-file-nrU-X7g7.cjs} +1 -1
  20. package/dist/chunks/{extract-source-translations-CZW5S9vg.cjs → extract-source-translations-EiwJs83j.cjs} +1 -1
  21. package/dist/chunks/{fetch-metadata-inspection-CHOmOnq5.cjs → fetch-metadata-inspection-CeqzcB_x.cjs} +1 -1
  22. package/dist/chunks/{fetch-signed-in-identity-BSx-tgUO.cjs → fetch-signed-in-identity-B49Tf79K.cjs} +1 -1
  23. package/dist/chunks/{fetch-workspace-id-Bg2V_cma.cjs → fetch-workspace-id-CsvJDu8b.cjs} +1 -1
  24. package/dist/chunks/format-body-CyNgSGIx.cjs +1 -0
  25. package/dist/chunks/{format-data-value-Dcn0aNoJ.cjs → format-data-value-kug8Yjt2.cjs} +1 -1
  26. package/dist/chunks/{format-metadata-fields-BpiTZFjv.cjs → format-metadata-fields-BTukrGn9.cjs} +1 -1
  27. package/dist/chunks/{format-metadata-owner-c6wBFmq7.cjs → format-metadata-owner-CsQXOj_P.cjs} +1 -1
  28. package/dist/chunks/format-progress-line-DhMnjGkz.cjs +1 -0
  29. package/dist/chunks/{generate-application-client-9tS8r18c.cjs → generate-application-client-B3Fen9_7.cjs} +1 -1
  30. package/dist/chunks/{get-app-plan-summary-DOhqg3eL.cjs → get-app-plan-summary-C-CQdNrh.cjs} +2 -2
  31. package/dist/chunks/{get-client-generation-skip-reason-D3_AAZQP.cjs → get-client-generation-skip-reason-BVkBgZWQ.cjs} +1 -1
  32. package/dist/chunks/{get-function-input-schema-GNk3NRLJ-BvvX155j.cjs → get-function-input-schema-GNk3NRLJ-DTFC8CbW.cjs} +1 -1
  33. package/dist/chunks/{global-flags.constant-DaR1vQnA.cjs → global-flags.constant-Bd-dYByR.cjs} +1 -1
  34. package/dist/chunks/is-access-token-expiring-DT6D8bMy.cjs +1 -0
  35. package/dist/chunks/{is-application-not-found-error-DxO-ftTG.cjs → is-application-not-found-error-Cja7iQrL.cjs} +1 -1
  36. package/dist/chunks/{is-exported-manifest-Cq0Sjj23.cjs → is-exported-manifest-DnQNK9XY.cjs} +1 -1
  37. package/dist/chunks/is-locale-catalog-CUFLOiRx.cjs +1 -0
  38. package/dist/chunks/is-supported-locale-xFJcoWeE.cjs +1 -0
  39. package/dist/chunks/{locale-catalog-format-DwZh0gOt.cjs → locale-catalog-format-CgKjHqcW.cjs} +2 -2
  40. package/dist/chunks/metadata-DkXpEhJh.cjs +1 -0
  41. package/dist/chunks/{metadata-page.constant-CX7U7xM8.cjs → metadata-page.constant-CxWuBtP5.cjs} +1 -1
  42. package/dist/chunks/{parse-api-url-BeUTFxSv.cjs → parse-api-url-CFCz3xUA.cjs} +1 -1
  43. package/dist/chunks/{parse-app-export-CaLKxant.cjs → parse-app-export-DFV_KqHM.cjs} +1 -1
  44. package/dist/chunks/parse-extraction-locale-C7Gdd3Oa.cjs +1 -0
  45. package/dist/chunks/{parse-graphql-response-DSSJWiGu.cjs → parse-graphql-response-BcKxw_s9.cjs} +1 -1
  46. package/dist/chunks/{parse-json-input-BOUh0Y2U.cjs → parse-json-input-CO-KP4XZ.cjs} +1 -1
  47. package/dist/chunks/{print-typescript-value-BU2EWXuF.cjs → print-typescript-value-D5kLR9wo.cjs} +1 -1
  48. package/dist/chunks/{pull-source-DqAHeLk7.cjs → pull-source-BKm8k5WI.cjs} +1 -1
  49. package/dist/chunks/{read-app-identity-CdFKlGlw.cjs → read-app-identity-Da5yI23t.cjs} +1 -1
  50. package/dist/chunks/{read-application-identifier-Cckd5Pm1.cjs → read-application-identifier-C3qn6MSa.cjs} +1 -1
  51. package/dist/chunks/{read-application-identity-B8iACpb4.cjs → read-application-identity-DgEOK9zh.cjs} +1 -1
  52. package/dist/chunks/{read-config-DYzGn3dk.cjs → read-config-Qwl4pAO8.cjs} +1 -1
  53. package/dist/chunks/read-json-object-BXZs97qz.cjs +1 -0
  54. package/dist/chunks/{read-snapshot-file-CQ_tHUot.cjs → read-snapshot-file-CxPJh0Bk.cjs} +1 -1
  55. package/dist/chunks/{read-source-identity-SwqTRFjJ.cjs → read-source-identity-BM-MsOjA.cjs} +1 -1
  56. package/dist/chunks/{record-pull-base-CH-q0A8T.cjs → record-pull-base-DwoMDnXm.cjs} +1 -1
  57. package/dist/chunks/{record-typecheck-config-inputs-DWzR6mUU.cjs → record-typecheck-config-inputs-CmF0bbqm.cjs} +1 -1
  58. package/dist/chunks/{request-oauth-tokens-XMt_yPua.cjs → request-oauth-tokens-QdDt7j8i.cjs} +1 -1
  59. package/dist/chunks/{resolve-app-project-Dc5KpCDh.cjs → resolve-app-project-B0KRR-xp.cjs} +1 -1
  60. package/dist/chunks/{resolve-command-target-Dv9k9ic2.cjs → resolve-command-target-BWCnYRCn.cjs} +1 -1
  61. package/dist/chunks/{resolve-inside-sdk-BK6jFT6V.cjs → resolve-inside-sdk-DiEOTO12.cjs} +1 -1
  62. package/dist/chunks/{resolve-metadata-object-Dlprkb-X.cjs → resolve-metadata-object-BSDYVuzQ.cjs} +1 -1
  63. package/dist/chunks/{resolve-project-typescript-BWyUXLJM.cjs → resolve-project-typescript-vMtmufcP.cjs} +1 -1
  64. package/dist/chunks/{resolve-request-url-B6KNhoFa.cjs → resolve-request-url-BvOe0vYd.cjs} +1 -1
  65. package/dist/chunks/{resolve-source-sdk-C0_F9oUQ.cjs → resolve-source-sdk-BNnltA8w.cjs} +1 -1
  66. package/dist/chunks/{run-api-graphql-command-CVdIic7q.cjs → run-api-graphql-command-Df2FAGpA.cjs} +1 -1
  67. package/dist/chunks/{run-api-rest-command-DgF7Vh0j.cjs → run-api-rest-command-2YvvMh8h.cjs} +1 -1
  68. package/dist/chunks/{run-app-add-command-4wAkXDW2.cjs → run-app-add-command-C0ojf2K6.cjs} +5 -5
  69. package/dist/chunks/{run-app-apply-command-DOPPX88t.cjs → run-app-apply-command-DM_46_Gl.cjs} +2 -2
  70. package/dist/chunks/{run-app-build-command-VoObCeD2.cjs → run-app-build-command-DA7o-ebo.cjs} +1 -1
  71. package/dist/chunks/{run-app-dev-command-DqY3qjVy.cjs → run-app-dev-command-DkerkLC8.cjs} +2 -2
  72. package/dist/chunks/{run-app-exec-command-CasOptA2.cjs → run-app-exec-command-CpNraBBq.cjs} +2 -2
  73. package/dist/chunks/{run-app-generate-client-command-BdOjFITA.cjs → run-app-generate-client-command-a5IQE60M.cjs} +1 -1
  74. package/dist/chunks/run-app-init-command-ktxmLunJ.cjs +2 -0
  75. package/dist/chunks/{run-app-install-command-DDkBjstj.cjs → run-app-install-command-AG25zpGx.cjs} +1 -1
  76. package/dist/chunks/{run-app-logs-command-DPOtBKPs.cjs → run-app-logs-command-Dd-OBwhF.cjs} +3 -3
  77. package/dist/chunks/{run-app-operation-Dt8_tKmi.cjs → run-app-operation-BLlHL5Nk.cjs} +1 -1
  78. package/dist/chunks/{run-app-plan-command-CusqLQ3f.cjs → run-app-plan-command-7Bi90BQp.cjs} +1 -1
  79. package/dist/chunks/{run-app-publish-command-COhfOFpj.cjs → run-app-publish-command-9zd_f_a3.cjs} +2 -2
  80. package/dist/chunks/{run-app-pull-command-C9GHMbgF.cjs → run-app-pull-command-CdArJFPT.cjs} +2 -2
  81. package/dist/chunks/{run-app-translations-extract-command-DWEinGqX.cjs → run-app-translations-extract-command-DrUZkCUW.cjs} +1 -1
  82. package/dist/chunks/{run-app-typecheck-command-CGrsPEx6.cjs → run-app-typecheck-command-CQe2CTGd.cjs} +1 -1
  83. package/dist/chunks/{run-app-uninstall-command-i7a4Jem9.cjs → run-app-uninstall-command--RFHGXiH.cjs} +1 -1
  84. package/dist/chunks/{run-auth-login-command-DaXPK5wd.cjs → run-auth-login-command-Cb3bITQj.cjs} +1 -1
  85. package/dist/chunks/{run-auth-logout-command-W7tRzWph.cjs → run-auth-logout-command-iC22soKN.cjs} +1 -1
  86. package/dist/chunks/{run-auth-status-command-B0dAwETL.cjs → run-auth-status-command-C0rdb747.cjs} +1 -1
  87. package/dist/chunks/{run-cli-CAoDm_W8.cjs → run-cli-CwAoqiMW.cjs} +7 -7
  88. package/dist/chunks/{run-commands-command-ZjKeKGKY.cjs → run-commands-command-Dp-Xzn5x.cjs} +1 -1
  89. package/dist/chunks/{run-data-get-command-B77up-s7.cjs → run-data-get-command-D7czgisf.cjs} +1 -1
  90. package/dist/chunks/{run-data-list-command-RwomiIPV.cjs → run-data-list-command-CUp_FN_I.cjs} +1 -1
  91. package/dist/chunks/{run-doctor-command-vxHdUzhC.cjs → run-doctor-command-C-gOPvp9.cjs} +2 -2
  92. package/dist/chunks/{run-metadata-field-describe-command-B_NgZ7Ms.cjs → run-metadata-field-describe-command-7xrRVRwr.cjs} +1 -1
  93. package/dist/chunks/{run-metadata-field-list-command-BGYdnELQ.cjs → run-metadata-field-list-command-CpIUXOmy.cjs} +1 -1
  94. package/dist/chunks/{run-metadata-object-describe-command-J85iBAkc.cjs → run-metadata-object-describe-command--cIPFkWW.cjs} +1 -1
  95. package/dist/chunks/{run-metadata-object-list-command-Bql6RG8g.cjs → run-metadata-object-list-command-CQ1jcSJc.cjs} +1 -1
  96. package/dist/chunks/{run-open-command-BNX-l7r7.cjs → run-open-command-DLe3PYqB.cjs} +1 -1
  97. package/dist/chunks/{run-remote-list-command-D6aUDed3.cjs → run-remote-list-command-DV-Ruk98.cjs} +1 -1
  98. package/dist/chunks/{run-remote-remove-command-D0Mb9tkZ.cjs → run-remote-remove-command-C1JeH5mK.cjs} +1 -1
  99. package/dist/chunks/{run-remote-rename-command-BgjOFYNE.cjs → run-remote-rename-command-CCVu4hEw.cjs} +1 -1
  100. package/dist/chunks/{run-remote-use-command-zGfFYq-A.cjs → run-remote-use-command-BvqWgEsP.cjs} +1 -1
  101. package/dist/chunks/{run-version-command-DwZTxHuu.cjs → run-version-command-D4R17bRL.cjs} +1 -1
  102. package/dist/chunks/{select-target-CKoOXLSW.cjs → select-target-DZlm8j62.cjs} +1 -1
  103. package/dist/chunks/{sign-in-to-remote-again-BhpxdF8v.cjs → sign-in-to-remote-again-WEIeFaAT.cjs} +1 -1
  104. package/dist/chunks/{sign-in-with-browser-BrB5btVu.cjs → sign-in-with-browser-BUvT_awm.cjs} +1 -1
  105. package/dist/chunks/to-public-target-bNT50le0.cjs +1 -0
  106. package/dist/chunks/{to-worker-output-diagnostics-eE_POlPf.cjs → to-worker-output-diagnostics-BzdY4Z2V.cjs} +1 -1
  107. package/dist/chunks/{typecheck-application-P6akOoSs.cjs → typecheck-application-dVtzoMDg.cjs} +2 -2
  108. package/dist/chunks/{update-config-BNB8Mkee.cjs → update-config-CnB7lDVC.cjs} +1 -1
  109. package/dist/chunks/{utils-D6KY4-gU-rSlFwrTC.cjs → utils-CvvLHbc4-CKDJ1YgX.cjs} +20 -17
  110. package/dist/chunks/{write-config-atomically-eVpizD-t.cjs → write-config-atomically-DkRUfbw0.cjs} +1 -1
  111. package/dist/cli.cjs +1 -1
  112. package/package.json +2 -2
  113. package/dist/chunks/application-C02vC9wC.cjs +0 -5
  114. package/dist/chunks/cli-version.constant-jQjsWsAO.cjs +0 -1
  115. package/dist/chunks/create-metadata-client-DsTAacZG.cjs +0 -6
  116. package/dist/chunks/format-body-DqhC3QLB.cjs +0 -1
  117. package/dist/chunks/format-progress-line-CeE356w0.cjs +0 -1
  118. package/dist/chunks/is-access-token-expiring-jLfrOp26.cjs +0 -1
  119. package/dist/chunks/is-locale-catalog-DjsopIs-.cjs +0 -1
  120. package/dist/chunks/is-supported-locale-CdAUON0G.cjs +0 -1
  121. package/dist/chunks/metadata-Dojezbdo.cjs +0 -1
  122. package/dist/chunks/parse-extraction-locale-DMjUY8zC.cjs +0 -1
  123. package/dist/chunks/read-json-object-VckLNpsj.cjs +0 -1
  124. package/dist/chunks/run-app-init-command-DFNSImQ4.cjs +0 -2
  125. package/dist/chunks/to-public-target-DYS-Zlyh.cjs +0 -1
@@ -1 +1 @@
1
- const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-BAi8jZf9-C7iTUxcn.cjs"),n=require("./cli-error-CSsayo0u.cjs"),r=require("./request-timeout-milliseconds.constant-DtyQHrll.cjs"),i=require("./config-file-mode.constant-DLBzKKUl.cjs");let a=require("node:crypto"),o=require("node:fs/promises"),s=require("node:path"),c=require("node:timers/promises");var l=e.t(),u={TIMEOUT_MILLISECONDS:2*r.t+5e3,RETRY_MILLISECONDS:50},d=async e=>{try{let n=JSON.parse(await(0,o.readFile)(e,`utf8`));return t.v(n)&&(0,l.isNumber)(n.pid)&&(0,l.isString)(n.token)?{pid:n.pid,token:n.token}:void 0}catch{return}},f=e=>{try{return process.kill(e,0),!0}catch(e){return n.r(e,`EPERM`)}},p=async e=>{let r=await d(e),i=t.Vt(r)&&!f(r.pid),a=t.Vt(r)?` (pid ${r.pid})`:``;return new n.t({code:`CONFIG_LOCKED`,message:i?`A twenty command (pid ${r.pid}) stopped without releasing ${e}.`:`Another twenty command${a} is changing ${(0,s.dirname)(e)}.`,hint:i?`Delete ${e} and try again.`:`Try again when it finishes. If no twenty command is running, delete ${e}.`,details:{lockPath:e,ownerPid:r?.pid??null}})},m=async(e,t)=>{try{let n=await(0,o.open)(e,`wx`,i.t.PRIVATE_FILE);return await n.writeFile(JSON.stringify({pid:process.pid,token:t})),await n.close(),!0}catch(e){if(n.r(e,`EEXIST`))return!1;throw e}},h=async({lockPath:e,token:n,signal:r})=>{let i=Date.now()+u.TIMEOUT_MILLISECONDS,a=await m(e,n);for(;!a;){r.throwIfAborted();let o=await d(e);if(t.Vt(o)&&!f(o.pid)||Date.now()>i)throw await p(e);await(0,c.setTimeout)(u.RETRY_MILLISECONDS,void 0,{signal:r}),a=await m(e,n)}},g=async(e,t)=>{(await d(e))?.token===t&&await(0,o.rm)(e,{force:!0})},_=async({configPath:e,signal:t,operation:n})=>{let r=`${e}.lock`,c=(0,a.randomUUID)();await(0,o.mkdir)((0,s.dirname)(e),{recursive:!0,mode:i.t.PRIVATE_DIRECTORY}),await h({lockPath:r,token:c,signal:t});try{return await n()}finally{await g(r,c)}},v=async(e,t)=>{let n=`${e}.${process.pid}.${(0,a.randomUUID)()}.tmp`,r=await(0,o.open)(n,`wx`,i.t.PRIVATE_FILE);try{await r.writeFile(`${JSON.stringify(t,null,2)}\n`),await r.sync(),await r.close(),await(0,o.rename)(n,e)}catch(e){throw await r.close().catch(()=>void 0),await(0,o.rm)(n,{force:!0}),e}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
1
+ const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-D-caeNc5-9rDzSg5B.cjs"),n=require("./cli-error-CSsayo0u.cjs"),r=require("./request-timeout-milliseconds.constant-DtyQHrll.cjs"),i=require("./config-file-mode.constant-DLBzKKUl.cjs");let a=require("node:crypto"),o=require("node:fs/promises"),s=require("node:path"),c=require("node:timers/promises");var l=e.t(),u={TIMEOUT_MILLISECONDS:2*r.t+5e3,RETRY_MILLISECONDS:50},d=async e=>{try{let n=JSON.parse(await(0,o.readFile)(e,`utf8`));return t.u(n)&&(0,l.isNumber)(n.pid)&&(0,l.isString)(n.token)?{pid:n.pid,token:n.token}:void 0}catch{return}},f=e=>{try{return process.kill(e,0),!0}catch(e){return n.r(e,`EPERM`)}},p=async e=>{let r=await d(e),i=t.Ut(r)&&!f(r.pid),a=t.Ut(r)?` (pid ${r.pid})`:``;return new n.t({code:`CONFIG_LOCKED`,message:i?`A twenty command (pid ${r.pid}) stopped without releasing ${e}.`:`Another twenty command${a} is changing ${(0,s.dirname)(e)}.`,hint:i?`Delete ${e} and try again.`:`Try again when it finishes. If no twenty command is running, delete ${e}.`,details:{lockPath:e,ownerPid:r?.pid??null}})},m=async(e,t)=>{try{let n=await(0,o.open)(e,`wx`,i.t.PRIVATE_FILE);return await n.writeFile(JSON.stringify({pid:process.pid,token:t})),await n.close(),!0}catch(e){if(n.r(e,`EEXIST`))return!1;throw e}},h=async({lockPath:e,token:n,signal:r})=>{let i=Date.now()+u.TIMEOUT_MILLISECONDS,a=await m(e,n);for(;!a;){r.throwIfAborted();let o=await d(e);if(t.Ut(o)&&!f(o.pid)||Date.now()>i)throw await p(e);await(0,c.setTimeout)(u.RETRY_MILLISECONDS,void 0,{signal:r}),a=await m(e,n)}},g=async(e,t)=>{(await d(e))?.token===t&&await(0,o.rm)(e,{force:!0})},_=async({configPath:e,signal:t,operation:n})=>{let r=`${e}.lock`,c=(0,a.randomUUID)();await(0,o.mkdir)((0,s.dirname)(e),{recursive:!0,mode:i.t.PRIVATE_DIRECTORY}),await h({lockPath:r,token:c,signal:t});try{return await n()}finally{await g(r,c)}},v=async(e,t)=>{let n=`${e}.${process.pid}.${(0,a.randomUUID)()}.tmp`,r=await(0,o.open)(n,`wx`,i.t.PRIVATE_FILE);try{await r.writeFile(`${JSON.stringify(t,null,2)}\n`),await r.sync(),await r.close(),await(0,o.rename)(n,e)}catch(e){throw await r.close().catch(()=>void 0),await(0,o.rm)(n,{force:!0}),e}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require("./chunks/check-node-requirement-CGBKvEqH.cjs"),t=require("./chunks/cli-node-version-range.constant-D7fE8edk.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-CAoDm_W8.cjs"))});
2
+ const e=require("./chunks/check-node-requirement-B_hf2E32.cjs"),t=require("./chunks/cli-node-version-range.constant-D7fE8edk.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-CwAoqiMW.cjs"))});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twenty",
3
- "version": "2.50.0",
3
+ "version": "2.51.3",
4
4
  "description": "The Twenty command line.",
5
5
  "homepage": "https://twenty.com",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "npm-pick-manifest": "^11.0.1",
36
36
  "semver": "7.6.3",
37
37
  "string-width": "^8.2.0",
38
- "twenty-client-sdk": "2.50.0",
38
+ "twenty-client-sdk": "2.51.3",
39
39
  "twenty-shared": "0.0.0",
40
40
  "undici": "^7.29.0",
41
41
  "uuid": "^13.0.2",
@@ -1,5 +0,0 @@
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
- - Person: {"name": {"firstName": "John", "lastName": "Doe"}, "emails": {"primaryEmail": "john@example.com"}, "company": {"id": "{{trigger.properties.after.id}}"}}
3
- - Company: {"name": "Acme Corp", "domainName": {"primaryLinkUrl": "https://acme.com"}}
4
- - Task: {"title": "Follow up", "status": "TODO", "assignee": {"id": "{{user.id}}"}}`),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.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 +0,0 @@
1
- var e=`2.50.0`;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});