twenty 2.51.3 → 2.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/CONTRIBUTING.md +5 -1
  2. package/README.md +4 -5
  3. package/dist/app-template/{AGENTS.md → example/files/AGENTS.md} +8 -18
  4. package/dist/app-template/{README.md → example/files/README.md} +1 -1
  5. package/dist/app-template/example/files/SETUP.md +27 -0
  6. package/dist/app-template/{github → example/files/github}/workflows/cd.yml +2 -0
  7. package/dist/app-template/{github → example/files/github}/workflows/publish.yml +4 -1
  8. package/dist/app-template/{src → example/files/src}/__tests__/global-setup.ts +11 -14
  9. package/dist/app-template/{src → example/files/src}/__tests__/run-twenty.ts +12 -8
  10. package/dist/app-template/{src → example/files/src}/default-role.ts +2 -0
  11. package/dist/app-template/example/scripts.json +6 -0
  12. package/dist/app-template/package.json +3 -6
  13. package/dist/app-template/yarn.lock +46 -1413
  14. package/dist/app-worker.cjs +1 -1
  15. package/dist/chunks/AppLocales-CcZVcJIa-BjjIbbsZ.cjs +1 -0
  16. package/dist/chunks/api-url-protocols.constant-EEmR3Pmg.cjs +1 -0
  17. package/dist/chunks/application-pYRHxplP.cjs +5 -0
  18. package/dist/chunks/assert-pull-paths-TFGZvzZO.cjs +1 -0
  19. package/dist/chunks/build--4zYt4wd.cjs +1 -0
  20. package/dist/chunks/{build-source-manifest-Gw2TI8Xe.cjs → build-source-manifest-DPsTlw7Z.cjs} +1 -1
  21. package/dist/chunks/build-source-snapshot-BMjdktTk.cjs +865 -0
  22. package/dist/chunks/capitalize-DFPVt1IM-CF4z3TZK.cjs +1 -0
  23. package/dist/chunks/check-node-requirement-CnwHKQBp.cjs +1 -0
  24. package/dist/chunks/cli-error-CrUD8uMp.cjs +1 -0
  25. package/dist/chunks/cli-node-version-range.constant-D3XrqV07.cjs +1 -0
  26. package/dist/chunks/cli-version.constant-M53Gu1CK.cjs +1 -0
  27. package/dist/chunks/collect-translatable-strings-BWzloBoB.cjs +1 -0
  28. package/dist/chunks/collect-watch-inputs-Dn6g1cNu.cjs +1 -0
  29. package/dist/chunks/compile-application-translations-DB-cG9Im.cjs +1 -0
  30. package/dist/chunks/{confirm-in-terminal-BxEM5lxE.cjs → confirm-in-terminal-D2e1lKUY.cjs} +1 -1
  31. package/dist/chunks/constants-Cbb71hpl-CrSqydxj.cjs +55 -0
  32. package/dist/chunks/convert-to-label-CbLHl7Lv.cjs +1 -0
  33. package/dist/chunks/{create-app-not-installed-error-DY-iuPPx.cjs → create-app-not-installed-error-sN4TzjlV.cjs} +1 -1
  34. package/dist/chunks/{create-cancelled-error-DgrNfOv2.cjs → create-cancelled-error-BBhAY8fS.cjs} +1 -1
  35. package/dist/chunks/create-http-status-error-CSxveq4d.cjs +1 -0
  36. package/dist/chunks/create-metadata-client-CJRFQ20Z.cjs +6 -0
  37. package/dist/chunks/create-pull-base-write-BAapBdLz.cjs +1 -0
  38. package/dist/chunks/{create-rest-client-PU2Uyfnb.cjs → create-rest-client-eb80-tts.cjs} +1 -1
  39. package/dist/chunks/{create-tooling-failure-B2FmNwR2.cjs → create-tooling-failure-0Foyei1R.cjs} +1 -1
  40. package/dist/chunks/execa-CAd0sJ7f.cjs +3 -0
  41. package/dist/chunks/extract-manifest-from-file-CEK5X5YP.cjs +1 -0
  42. package/dist/chunks/extract-source-translations-BKXfzm51.cjs +1 -0
  43. package/dist/chunks/{fetch-metadata-inspection-CeqzcB_x.cjs → fetch-metadata-inspection-IuAwjjQT.cjs} +1 -1
  44. package/dist/chunks/fetch-signed-in-identity-BFxRufRI.cjs +1 -0
  45. package/dist/chunks/fetch-workspace-or-throw-CgPc8IBL.cjs +1 -0
  46. package/dist/chunks/{find-remote-D48r20g0.cjs → find-remote-TcvVyJpy.cjs} +1 -1
  47. package/dist/chunks/format-body-C7fmVDAZ.cjs +1 -0
  48. package/dist/chunks/format-data-value-Cln0Hv7L.cjs +1 -0
  49. package/dist/chunks/{format-display-path-gEepVJDg.cjs → format-display-path-CZLIKwPT.cjs} +1 -1
  50. package/dist/chunks/format-metadata-fields-BltFjIsO.cjs +2 -0
  51. package/dist/chunks/format-metadata-owner-DpOc_B3P.cjs +1 -0
  52. package/dist/chunks/format-progress-line-Cj65-DU5.cjs +1 -0
  53. package/dist/chunks/fs-utils-DoSmCBu8.cjs +2 -0
  54. package/dist/chunks/generate-application-client-CL8nm0q9.cjs +1 -0
  55. package/dist/chunks/get-client-generation-skip-reason-BJFlVAos.cjs +1 -0
  56. package/dist/chunks/{get-credential-kind-JI9heHe2.cjs → get-credential-kind-qxy7oLdW.cjs} +1 -1
  57. package/dist/chunks/get-function-input-schema-GNk3NRLJ-DscBUsKy.cjs +1 -0
  58. package/dist/chunks/get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs +1 -0
  59. package/dist/chunks/get-tooling-error-context-CZKTM7Q6.cjs +1 -0
  60. package/dist/chunks/global-flags.constant-MWMrKAud.cjs +1 -0
  61. package/dist/chunks/has-error-code-DsJeqbZq.cjs +1 -0
  62. package/dist/chunks/is-access-token-expiring-B3WtsewG.cjs +1 -0
  63. package/dist/chunks/{is-application-not-found-error-Cja7iQrL.cjs → is-application-not-found-error-BC7jyU0p.cjs} +1 -1
  64. package/dist/chunks/is-exported-manifest-D8cwSas4.cjs +1 -0
  65. package/dist/chunks/{is-inside-directory-DHVCQE5C.cjs → is-inside-directory-CymDrDJC.cjs} +1 -1
  66. package/dist/chunks/{is-interaction-allowed-CF-ko1KI.cjs → is-interaction-allowed-BQLOG8RG.cjs} +1 -1
  67. package/dist/chunks/is-locale-catalog-D0wFrW8f.cjs +1 -0
  68. package/dist/chunks/{is-same-universal-identifier-BCBib3RP.cjs → is-same-universal-identifier-Bm_wb6Ez.cjs} +1 -1
  69. package/dist/chunks/is-supported-locale-C33Of85N.cjs +1 -0
  70. package/dist/chunks/is-valid-package-name-Ij_K6iEL.cjs +1 -0
  71. package/dist/chunks/isDefined-Dtu5EYqP-CJctgvfE.cjs +1 -0
  72. package/dist/chunks/locale-catalog-format-C_5EGBEn.cjs +20 -0
  73. package/dist/chunks/metadata-CY9y5wYc.cjs +1 -0
  74. package/dist/chunks/{metadata-page.constant-CxWuBtP5.cjs → metadata-page.constant-7kxmFenL.cjs} +1 -1
  75. package/dist/chunks/parse-api-url-jHzjLWX1.cjs +1 -0
  76. package/dist/chunks/parse-app-export-CpZxFIlO.cjs +1 -0
  77. package/dist/chunks/parse-extraction-locale-h0bmy8hf.cjs +1 -0
  78. package/dist/chunks/parse-graphql-response-Di8aFmnF.cjs +1 -0
  79. package/dist/chunks/{parse-json-input-CO-KP4XZ.cjs → parse-json-input-kEwLo8mG.cjs} +1 -1
  80. package/dist/chunks/{print-typescript-value-D5kLR9wo.cjs → print-typescript-value-ChOUZ7Mm.cjs} +1 -1
  81. package/dist/chunks/pull-minimum-sdk-version.constant-JDRwzl32.cjs +5 -0
  82. package/dist/chunks/pull-source-CpAYRk5s.cjs +1 -0
  83. package/dist/chunks/{read-app-identity-Da5yI23t.cjs → read-app-identity-CJZThpUC.cjs} +1 -1
  84. package/dist/chunks/read-application-identifier-D6YPuiA7.cjs +1 -0
  85. package/dist/chunks/read-application-identity-CWSIB1Jd.cjs +1 -0
  86. package/dist/chunks/{read-command-values-uSJqBG_E.cjs → read-command-values-rGaU2qHz.cjs} +1 -1
  87. package/dist/chunks/read-config-9Dv5cmvw.cjs +1 -0
  88. package/dist/chunks/read-infer-deletion-option-DtCw0TsU.cjs +8 -0
  89. package/dist/chunks/{read-input-value-Cxgh_r2g.cjs → read-input-value-CzJsE62r.cjs} +1 -1
  90. package/dist/chunks/read-json-object-BlyNzzdk.cjs +1 -0
  91. package/dist/chunks/read-snapshot-file-Dgc3WCDM.cjs +1 -0
  92. package/dist/chunks/{read-source-identity-BM-MsOjA.cjs → read-source-identity-BQ_YGISo.cjs} +1 -1
  93. package/dist/chunks/record-pull-base-BIlU7Fj1.cjs +1 -0
  94. package/dist/chunks/{record-typecheck-config-inputs-CmF0bbqm.cjs → record-typecheck-config-inputs-BGVirGsR.cjs} +1 -1
  95. package/dist/chunks/request-oauth-tokens-BkL-WsAM.cjs +1 -0
  96. package/dist/chunks/request-timeout-milliseconds.constant-BkZTOtpY.cjs +1 -0
  97. package/dist/chunks/{require-approval-D0FfoHhF.cjs → require-approval-BIgPOy_r.cjs} +1 -1
  98. package/dist/chunks/resolve-app-project-DP27LYGR.cjs +1 -0
  99. package/dist/chunks/resolve-command-target-C4r6LuWk.cjs +1 -0
  100. package/dist/chunks/resolve-inside-sdk-Ca2uRzQW.cjs +1 -0
  101. package/dist/chunks/{resolve-metadata-object-BSDYVuzQ.cjs → resolve-metadata-object-C3sDavWu.cjs} +1 -1
  102. package/dist/chunks/{resolve-project-typescript-vMtmufcP.cjs → resolve-project-typescript-BOAxXiKm.cjs} +1 -1
  103. package/dist/chunks/resolve-request-url-BwELN2oQ.cjs +1 -0
  104. package/dist/chunks/resolve-source-sdk-CyvER2l1.cjs +1 -0
  105. package/dist/chunks/result-item-limit.constant-QX3teiuy.cjs +1 -0
  106. package/dist/chunks/rolldown-runtime-mLOUI7ql.cjs +1 -0
  107. package/dist/chunks/run-api-graphql-command-D-Pu9EdU.cjs +1 -0
  108. package/dist/chunks/run-api-rest-command-BuDANSQa.cjs +1 -0
  109. package/dist/chunks/run-app-add-command-C0b2LVQN.cjs +163 -0
  110. package/dist/chunks/run-app-apply-command-BnfxBO7o.cjs +2 -0
  111. package/dist/chunks/{run-app-build-command-DA7o-ebo.cjs → run-app-build-command-tAj7RilT.cjs} +1 -1
  112. package/dist/chunks/run-app-dev-command-BnSJIUgg.cjs +2 -0
  113. package/dist/chunks/run-app-exec-command-BPlfFt9-.cjs +3 -0
  114. package/dist/chunks/run-app-generate-client-command-7t5Hs10P.cjs +2 -0
  115. package/dist/chunks/run-app-init-command-BTUiHdOH.cjs +2 -0
  116. package/dist/chunks/run-app-install-command-DOzp9bOL.cjs +1 -0
  117. package/dist/chunks/run-app-logs-command-CQDO_gce.cjs +9 -0
  118. package/dist/chunks/run-app-operation-BmlaxoZF.cjs +1 -0
  119. package/dist/chunks/run-app-plan-command-1cb1TuM6.cjs +1 -0
  120. package/dist/chunks/run-app-publish-command-BPosULCY.cjs +1 -0
  121. package/dist/chunks/run-app-pull-command-BWbRZPTj.cjs +6 -0
  122. package/dist/chunks/{run-app-translations-extract-command-DrUZkCUW.cjs → run-app-translations-extract-command-LUAa7jb9.cjs} +1 -1
  123. package/dist/chunks/{run-app-typecheck-command-CQe2CTGd.cjs → run-app-typecheck-command-3ZJqbU8D.cjs} +1 -1
  124. package/dist/chunks/{run-app-uninstall-command--RFHGXiH.cjs → run-app-uninstall-command-BK-JAeo2.cjs} +1 -1
  125. package/dist/chunks/run-auth-login-command-CN6Xqgpx.cjs +1 -0
  126. package/dist/chunks/{run-auth-logout-command-iC22soKN.cjs → run-auth-logout-command-Dw6CLfIY.cjs} +1 -1
  127. package/dist/chunks/run-auth-status-command-CXRrXjvh.cjs +1 -0
  128. package/dist/chunks/run-cli-BbuvDae1.cjs +24 -0
  129. package/dist/chunks/run-commands-command-BrwpnI-3.cjs +2 -0
  130. package/dist/chunks/{run-data-get-command-D7czgisf.cjs → run-data-get-command-BD7i13MO.cjs} +1 -1
  131. package/dist/chunks/run-data-list-command-tcCgbeZj.cjs +1 -0
  132. package/dist/chunks/run-doctor-command-DmZ3dKc7.cjs +2 -0
  133. package/dist/chunks/run-metadata-field-describe-command-BX5_s1m0.cjs +3 -0
  134. package/dist/chunks/{run-metadata-field-list-command-CpIUXOmy.cjs → run-metadata-field-list-command-BVFDiJv2.cjs} +1 -1
  135. package/dist/chunks/{run-metadata-object-describe-command--cIPFkWW.cjs → run-metadata-object-describe-command-CWYI0V42.cjs} +1 -1
  136. package/dist/chunks/{run-metadata-object-list-command-CQ1jcSJc.cjs → run-metadata-object-list-command-Y3yebZrT.cjs} +1 -1
  137. package/dist/chunks/run-open-command-BUEQSKSk.cjs +1 -0
  138. package/dist/chunks/{run-remote-list-command-DV-Ruk98.cjs → run-remote-list-command-BExGjyKO.cjs} +1 -1
  139. package/dist/chunks/{run-remote-remove-command-C1JeH5mK.cjs → run-remote-remove-command-D2thQnCU.cjs} +1 -1
  140. package/dist/chunks/{run-remote-rename-command-CCVu4hEw.cjs → run-remote-rename-command-DI0Adm5U.cjs} +1 -1
  141. package/dist/chunks/{run-remote-use-command-BvqWgEsP.cjs → run-remote-use-command-CXnu5zDY.cjs} +1 -1
  142. package/dist/chunks/{run-version-command-D4R17bRL.cjs → run-version-command-BxhaecEo.cjs} +1 -1
  143. package/dist/chunks/select-target-CJ2FyoVQ.cjs +1 -0
  144. package/dist/chunks/sign-in-to-remote-again-CwXAgGif.cjs +1 -0
  145. package/dist/chunks/sign-in-with-browser-DdjoPq5d.cjs +124 -0
  146. package/dist/chunks/to-cli-error-4pSpVaW9.cjs +1 -0
  147. package/dist/chunks/to-public-target-D00so1uO.cjs +1 -0
  148. package/dist/chunks/to-worker-output-diagnostics-Hj6aQiK9.cjs +2 -0
  149. package/dist/chunks/typecheck-application-nkgv6qiA.cjs +2 -0
  150. package/dist/chunks/undici-BfHt0Tny.cjs +95 -0
  151. package/dist/chunks/{update-config-CnB7lDVC.cjs → update-config-XYMqGokt.cjs} +1 -1
  152. package/dist/chunks/utils-RCpFyoX5-DF7Gq1IH.cjs +11 -0
  153. package/dist/chunks/valid-DnUN-PQ0.cjs +1 -0
  154. package/dist/chunks/{validate-remote-name-w-qnr43w.cjs → validate-remote-name-ZWOgVe80.cjs} +1 -1
  155. package/dist/chunks/{with-phase-details-Dof8Ao9R.cjs → with-phase-details-CRqY0f3c.cjs} +1 -1
  156. package/dist/chunks/write-config-atomically-BxCEc8_P.cjs +1 -0
  157. package/dist/cli.cjs +1 -1
  158. package/docs/commands.md +19 -12
  159. package/package.json +5 -5
  160. package/src/app/bundles/README.md +3 -2
  161. package/src/app/manifest/README.md +10 -12
  162. package/src/app/pull/README.md +9 -2
  163. package/dist/app-template/SETUP.md +0 -47
  164. package/dist/chunks/application-DOWikeQt.cjs +0 -5
  165. package/dist/chunks/assert-pull-paths-BuQ1ZRvQ.cjs +0 -1
  166. package/dist/chunks/build-CX6FBrbu.cjs +0 -1
  167. package/dist/chunks/build-pull-entities-ShVsLh_s.cjs +0 -5
  168. package/dist/chunks/build-source-snapshot-lbc2Pb7D.cjs +0 -865
  169. package/dist/chunks/check-node-requirement-B_hf2E32.cjs +0 -1
  170. package/dist/chunks/cli-error-CSsayo0u.cjs +0 -1
  171. package/dist/chunks/cli-node-version-range.constant-D7fE8edk.cjs +0 -1
  172. package/dist/chunks/cli-version.constant-B92ETb2e.cjs +0 -1
  173. package/dist/chunks/collect-translatable-strings-DWRZN9zQ.cjs +0 -1
  174. package/dist/chunks/collect-watch-inputs-CS4oNP1F.cjs +0 -1
  175. package/dist/chunks/compile-application-translations-DS6jGOV4.cjs +0 -1
  176. package/dist/chunks/constants-D-caeNc5-9rDzSg5B.cjs +0 -23
  177. package/dist/chunks/convert-to-label-hx-g0Lvj.cjs +0 -1
  178. package/dist/chunks/create-http-status-error-E0DUDIUP.cjs +0 -1
  179. package/dist/chunks/create-metadata-client-9IF8ArjT.cjs +0 -6
  180. package/dist/chunks/create-pull-base-write-JW3ZTnaC.cjs +0 -1
  181. package/dist/chunks/extract-manifest-from-file-nrU-X7g7.cjs +0 -1
  182. package/dist/chunks/extract-source-translations-EiwJs83j.cjs +0 -1
  183. package/dist/chunks/fetch-signed-in-identity-B49Tf79K.cjs +0 -1
  184. package/dist/chunks/fetch-workspace-id-CsvJDu8b.cjs +0 -1
  185. package/dist/chunks/format-body-CyNgSGIx.cjs +0 -1
  186. package/dist/chunks/format-data-value-kug8Yjt2.cjs +0 -1
  187. package/dist/chunks/format-metadata-fields-BTukrGn9.cjs +0 -2
  188. package/dist/chunks/format-metadata-owner-CsQXOj_P.cjs +0 -1
  189. package/dist/chunks/format-progress-line-DhMnjGkz.cjs +0 -1
  190. package/dist/chunks/fs-utils-Bl1fQcaJ.cjs +0 -2
  191. package/dist/chunks/generate-application-client-B3Fen9_7.cjs +0 -1
  192. package/dist/chunks/get-app-plan-summary-C-CQdNrh.cjs +0 -8
  193. package/dist/chunks/get-client-generation-skip-reason-BVkBgZWQ.cjs +0 -1
  194. package/dist/chunks/get-function-input-schema-GNk3NRLJ-DTFC8CbW.cjs +0 -1
  195. package/dist/chunks/get-tooling-error-context-C69TBSej.cjs +0 -1
  196. package/dist/chunks/global-flags.constant-Bd-dYByR.cjs +0 -1
  197. package/dist/chunks/is-access-token-expiring-DT6D8bMy.cjs +0 -1
  198. package/dist/chunks/is-exported-manifest-DnQNK9XY.cjs +0 -1
  199. package/dist/chunks/is-locale-catalog-CUFLOiRx.cjs +0 -1
  200. package/dist/chunks/is-supported-locale-xFJcoWeE.cjs +0 -1
  201. package/dist/chunks/locale-catalog-format-CgKjHqcW.cjs +0 -20
  202. package/dist/chunks/metadata-DkXpEhJh.cjs +0 -1
  203. package/dist/chunks/parse-api-url-CFCz3xUA.cjs +0 -1
  204. package/dist/chunks/parse-app-export-DFV_KqHM.cjs +0 -1
  205. package/dist/chunks/parse-extraction-locale-C7Gdd3Oa.cjs +0 -1
  206. package/dist/chunks/parse-graphql-response-BcKxw_s9.cjs +0 -1
  207. package/dist/chunks/pull-source-BKm8k5WI.cjs +0 -1
  208. package/dist/chunks/read-application-identifier-C3qn6MSa.cjs +0 -1
  209. package/dist/chunks/read-application-identity-DgEOK9zh.cjs +0 -1
  210. package/dist/chunks/read-config-Qwl4pAO8.cjs +0 -1
  211. package/dist/chunks/read-json-object-BXZs97qz.cjs +0 -1
  212. package/dist/chunks/read-snapshot-file-CxPJh0Bk.cjs +0 -1
  213. package/dist/chunks/record-pull-base-DwoMDnXm.cjs +0 -1
  214. package/dist/chunks/request-oauth-tokens-QdDt7j8i.cjs +0 -1
  215. package/dist/chunks/request-timeout-milliseconds.constant-DtyQHrll.cjs +0 -1
  216. package/dist/chunks/resolve-app-project-B0KRR-xp.cjs +0 -1
  217. package/dist/chunks/resolve-command-target-BWCnYRCn.cjs +0 -1
  218. package/dist/chunks/resolve-inside-sdk-DiEOTO12.cjs +0 -1
  219. package/dist/chunks/resolve-request-url-BvOe0vYd.cjs +0 -1
  220. package/dist/chunks/resolve-source-sdk-BNnltA8w.cjs +0 -1
  221. package/dist/chunks/result-item-limit.constant-CDrOhiWD.cjs +0 -1
  222. package/dist/chunks/run-api-graphql-command-Df2FAGpA.cjs +0 -1
  223. package/dist/chunks/run-api-rest-command-2YvvMh8h.cjs +0 -1
  224. package/dist/chunks/run-app-add-command-C0ojf2K6.cjs +0 -163
  225. package/dist/chunks/run-app-apply-command-DM_46_Gl.cjs +0 -2
  226. package/dist/chunks/run-app-dev-command-DkerkLC8.cjs +0 -2
  227. package/dist/chunks/run-app-exec-command-CpNraBBq.cjs +0 -3
  228. package/dist/chunks/run-app-generate-client-command-a5IQE60M.cjs +0 -2
  229. package/dist/chunks/run-app-init-command-ktxmLunJ.cjs +0 -2
  230. package/dist/chunks/run-app-install-command-AG25zpGx.cjs +0 -1
  231. package/dist/chunks/run-app-logs-command-Dd-OBwhF.cjs +0 -9
  232. package/dist/chunks/run-app-operation-BLlHL5Nk.cjs +0 -1
  233. package/dist/chunks/run-app-plan-command-7Bi90BQp.cjs +0 -1
  234. package/dist/chunks/run-app-publish-command-9zd_f_a3.cjs +0 -3
  235. package/dist/chunks/run-app-pull-command-CdArJFPT.cjs +0 -3
  236. package/dist/chunks/run-auth-login-command-Cb3bITQj.cjs +0 -1
  237. package/dist/chunks/run-auth-status-command-C0rdb747.cjs +0 -1
  238. package/dist/chunks/run-cli-CwAoqiMW.cjs +0 -23
  239. package/dist/chunks/run-commands-command-Dp-Xzn5x.cjs +0 -2
  240. package/dist/chunks/run-data-list-command-CUp_FN_I.cjs +0 -1
  241. package/dist/chunks/run-doctor-command-C-gOPvp9.cjs +0 -2
  242. package/dist/chunks/run-metadata-field-describe-command-7xrRVRwr.cjs +0 -3
  243. package/dist/chunks/run-open-command-DLe3PYqB.cjs +0 -1
  244. package/dist/chunks/select-target-DZlm8j62.cjs +0 -1
  245. package/dist/chunks/sign-in-to-remote-again-WEIeFaAT.cjs +0 -1
  246. package/dist/chunks/sign-in-with-browser-BUvT_awm.cjs +0 -1
  247. package/dist/chunks/to-cli-error-BBYf_wqo.cjs +0 -1
  248. package/dist/chunks/to-public-target-bNT50le0.cjs +0 -1
  249. package/dist/chunks/to-worker-output-diagnostics-BzdY4Z2V.cjs +0 -2
  250. package/dist/chunks/typecheck-application-dVtzoMDg.cjs +0 -2
  251. package/dist/chunks/undici-D3mKdfwl.cjs +0 -95
  252. package/dist/chunks/utils-CvvLHbc4-CKDJ1YgX.cjs +0 -38
  253. package/dist/chunks/write-config-atomically-DkRUfbw0.cjs +0 -1
  254. /package/dist/app-template/{CHANGELOG.md → example/files/CHANGELOG.md} +0 -0
  255. /package/dist/app-template/{github → example/files/github}/workflows/ci.yml +0 -0
  256. /package/dist/app-template/{locales → example/files/locales}/en.json +0 -0
  257. /package/dist/app-template/{public → example/files/public}/logo.svg +0 -0
  258. /package/dist/app-template/{src → example/files/src}/__tests__/application-config.test.ts +0 -0
  259. /package/dist/app-template/{src → example/files/src}/__tests__/schema.integration-test.ts +0 -0
  260. /package/dist/app-template/{src → example/files/src}/application-config.ts +0 -0
  261. /package/dist/app-template/{src → example/files/src}/constants/universal-identifiers.ts +0 -0
  262. /package/dist/app-template/{src → example/files/src}/front-components/main-page.tsx +0 -0
  263. /package/dist/app-template/{src → example/files/src}/logic-functions/health-check.ts +0 -0
  264. /package/dist/app-template/{src → example/files/src}/navigation-menu-items/main-page.navigation-menu-item.ts +0 -0
  265. /package/dist/app-template/{src → example/files/src}/page-layouts/main-page.page-layout.ts +0 -0
  266. /package/dist/app-template/{tsconfig.spec.json → example/files/tsconfig.spec.json} +0 -0
  267. /package/dist/app-template/{vitest.config.ts → example/files/vitest.config.ts} +0 -0
  268. /package/dist/app-template/{vitest.unit.config.ts → example/files/vitest.unit.config.ts} +0 -0
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs");var t=e.t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),n=e.t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),r=e.t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=e.t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=e.t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};var c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.t={},f=0,p=`[a-zA-Z0-9-]`,m=[[`\\s`,1],[`\\d`,o],[p,a]],h=e=>{for(let[t,n]of m)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},g=(e,t,n)=>{let r=h(t),i=f++;s(e,i,t),d[e]=i,u[i]=t,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};g(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),g(`NUMERICIDENTIFIERLOOSE`,`\\d+`),g(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${p}*`),g(`MAINVERSION`,`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),g(`MAINVERSIONLOOSE`,`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),g(`PRERELEASEIDENTIFIER`,`(?:${u[d.NUMERICIDENTIFIER]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[d.NUMERICIDENTIFIERLOOSE]}|${u[d.NONNUMERICIDENTIFIER]})`),g(`PRERELEASE`,`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),g(`PRERELEASELOOSE`,`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g(`BUILDIDENTIFIER`,`${p}+`),g(`BUILD`,`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),g(`FULLPLAIN`,`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),g(`FULL`,`^${u[d.FULLPLAIN]}$`),g(`LOOSEPLAIN`,`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),g(`LOOSE`,`^${u[d.LOOSEPLAIN]}$`),g(`GTLT`,`((?:<|>)?=?)`),g(`XRANGEIDENTIFIERLOOSE`,`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g(`XRANGEIDENTIFIER`,`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),g(`XRANGEPLAIN`,`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),g(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),g(`XRANGE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),g(`XRANGELOOSE`,`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),g(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g(`COERCE`,`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),g(`COERCEFULL`,u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`),g(`COERCERTL`,u[d.COERCE],!0),g(`COERCERTLFULL`,u[d.COERCEFULL],!0),g(`LONETILDE`,`(?:~>?)`),g(`TILDETRIM`,`(\\s*)${u[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,g(`TILDE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),g(`TILDELOOSE`,`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),g(`LONECARET`,`(?:\\^)`),g(`CARETTRIM`,`(\\s*)${u[d.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,g(`CARET`,`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),g(`CARETLOOSE`,`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),g(`COMPARATORLOOSE`,`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),g(`COMPARATOR`,`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),g(`COMPARATORTRIM`,`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,g(`HYPHENRANGE`,`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),g(`HYPHENRANGELOOSE`,`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),g(`STAR`,`(<|>)?=?\\s*\\*`),g(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),g(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=e.t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),s=e.t(((e,t)=>{var s=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=n(),{compareIdentifiers:p}=o();t.exports=class e{constructor(t,n){if(n=f(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);s(`SemVer`,t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?u[d.LOOSE]:u[d.FULL]);if(!r)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);r[4]?this.prerelease=r[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(s(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),p(this.major,t.major)||p(this.minor,t.minor)||p(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(s(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let e=this.build[n],r=t.build[n];if(s(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}inc(e,t,n){switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),p(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),c=e.t(((e,t)=>{var n=s();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),l=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)===0})),u=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)!==0})),d=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>0})),f=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>=0})),p=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<0})),m=e.t(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<=0})),h=e.t(((e,t)=>{var n=l(),r=u(),i=d(),a=f(),o=p(),s=m();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),g=e.t(((e,t)=>{var r=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return r}constructor(t,n){if(n=o(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===r?this.value=``:this.value=this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new f(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===r||e===r)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=o(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var o=n(),{safeRe:c,t:l}=a(),u=h(),d=i(),f=s(),p=_()})),_=e.t(((e,o)=>{var c=/\s+/g;o.exports=class e{constructor(t,n){if(n=u(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof d)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(c,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!S(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&C(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&b)|(this.options.loose&&x))+`:`+e,n=l.get(t);if(n)return n;let r=this.options.loose,i=r?m[h.HYPHENRANGELOOSE]:m[h.HYPHENRANGE];e=e.replace(i,F(this.options.includePrerelease)),f(`hyphen replace`,e),e=e.replace(m[h.COMPARATORTRIM],_),f(`comparator trim`,e),e=e.replace(m[h.TILDETRIM],v),f(`tilde trim`,e),e=e.replace(m[h.CARETTRIM],y),f(`caret trim`,e);let a=e.split(` `).map(e=>T(e,this.options)).join(` `).split(/\s+/).map(e=>P(e,this.options));r&&(a=a.filter(e=>(f(`loose invalid filter`,e,this.options),!!e.match(m[h.COMPARATORLOOSE])))),f(`range list`,a);let o=new Map,s=a.map(e=>new d(e,this.options));for(let e of s){if(S(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return l.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>w(e,n)&&t.set.some(t=>w(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new p(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}};var l=new(t()),u=n(),d=g(),f=i(),p=s(),{safeRe:m,t:h,comparatorTrimReplace:_,tildeTrimReplace:v,caretTrimReplace:y}=a(),{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:x}=r(),S=e=>e.value===`<0.0.0-0`,C=e=>e.value===``,w=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},T=(e,t)=>(f(`comp`,e,t),e=k(e,t),f(`caret`,e),e=D(e,t),f(`tildes`,e),e=j(e,t),f(`xrange`,e),e=N(e,t),f(`stars`,e),e),E=e=>!e||e.toLowerCase()===`x`||e===`*`,D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(` `),O=(e,t)=>{let n=t.loose?m[h.TILDELOOSE]:m[h.TILDE];return e.replace(n,(t,n,r,i,a)=>{f(`tilde`,e,t,n,r,i,a);let o;return E(n)?o=``:E(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:E(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(f(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,f(`tilde return`,o),o})},k=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(` `),A=(e,t)=>{f(`caret`,e,t);let n=t.loose?m[h.CARETLOOSE]:m[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{f(`caret`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(f(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(f(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),f(`caret return`,s),s})},j=(e,t)=>(f(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>M(e,t)).join(` `)),M=(e,t)=>{e=e.trim();let n=t.loose?m[h.XRANGELOOSE]:m[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{f(`xRange`,e,n,r,i,a,o,s);let c=E(i),l=c||E(a),u=l||E(o),d=u;return r===`=`&&d&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&d?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),f(`xRange return`,n),n})},N=(e,t)=>(f(`replaceStars`,e,t),e.trim().replace(m[h.STAR],``)),P=(e,t)=>(f(`replaceGTE0`,e,t),e.trim().replace(m[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),F=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=E(r)?``:E(i)?`>=${r}.0.0${e?`-0`:``}`:E(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=E(l)?``:E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),I=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(f(e[n].semver),e[n].semver!==d.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),v=e.t(((e,t)=>{var n=_();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),y=e.t(((e,t)=>{var n=s(),r=g(),{ANY:i}=r,a=_(),o=v(),c=d(),l=p(),u=m(),h=f();t.exports=(e,t,s,d)=>{e=new n(e,d),t=new a(t,d);let f,p,m,g,_;switch(s){case`>`:f=c,p=u,m=l,g=`>`,_=`>=`;break;case`<`:f=l,p=h,m=c,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,f(e.semver,o.semver,d)?o=e:m(e.semver,s.semver,d)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&p(e,s.semver)||s.operator===_&&m(e,s.semver))return!1}return!0}})),b=e.t(((e,t)=>{var n=y();t.exports=(e,t,r)=>n(e,t,`<`,r)})),x=e.t(((e,t)=>{var n=_();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}}));Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return r}});
@@ -1 +1 @@
1
- const e=require("./cli-error-CSsayo0u.cjs");var t=/^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$/,n=n=>{if(!t.test(n))throw new e.t({code:`INVALID_REMOTE_NAME`,exitCode:e.n.USAGE,message:`${n} is not a valid remote name.`,hint:`Use letters, digits, dots, dashes and underscores, starting with a letter or digit.`});return n};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
1
+ const e=require("./cli-error-CrUD8uMp.cjs");var t=/^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$/,n=n=>{if(!t.test(n))throw new e.t({code:`INVALID_REMOTE_NAME`,exitCode:e.n.USAGE,message:`${n} is not a valid remote name.`,hint:`Use letters, digits, dots, dashes and underscores, starting with a letter or digit.`});return n};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -1 +1 @@
1
- const e=require("./cli-error-CSsayo0u.cjs");var t=({error:t,phase:n,outcome:r,completedPhases:i,hint:a})=>new e.t({cause:t,code:t.code,exitCode:t.exitCode,message:t.message,hint:t.hint??a,details:{...t.details,phase:n,outcome:r,completedPhases:[...i]}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
1
+ const e=require("./cli-error-CrUD8uMp.cjs");var t=({error:t,phase:n,outcome:r,completedPhases:i,hint:a})=>new e.t({cause:t,code:t.code,exitCode:t.exitCode,message:t.message,hint:t.hint??a,details:{...t.details,phase:n,outcome:r,completedPhases:[...i]}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Cbb71hpl-CrSqydxj.cjs"),r=require("./has-error-code-DsJeqbZq.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./request-timeout-milliseconds.constant-BkZTOtpY.cjs"),o=require("./config-file-mode.constant-DLBzKKUl.cjs");let s=require("node:crypto"),c=require("node:fs/promises"),l=require("node:path"),u=require("node:timers/promises");var d=e.t(),f={TIMEOUT_MILLISECONDS:2*a.t+5e3,RETRY_MILLISECONDS:50},p=async e=>{try{let t=JSON.parse(await(0,c.readFile)(e,`utf8`));return n.i(t)&&(0,d.isNumber)(t.pid)&&(0,d.isString)(t.token)?{pid:t.pid,token:t.token}:void 0}catch{return}},m=e=>{try{return process.kill(e,0),!0}catch(e){return r.t(e,`EPERM`)}},h=async e=>{let n=await p(e),r=t.t(n)&&!m(n.pid),a=t.t(n)?` (pid ${n.pid})`:``;return new i.t({code:`CONFIG_LOCKED`,message:r?`A twenty command (pid ${n.pid}) stopped without releasing ${e}.`:`Another twenty command${a} is changing ${(0,l.dirname)(e)}.`,hint:r?`Delete ${e} and try again.`:`Try again when it finishes. If no twenty command is running, delete ${e}.`,details:{lockPath:e,ownerPid:n?.pid??null}})},g=async(e,t)=>{try{let n=await(0,c.open)(e,`wx`,o.t.PRIVATE_FILE);return await n.writeFile(JSON.stringify({pid:process.pid,token:t})),await n.close(),!0}catch(e){if(r.t(e,`EEXIST`))return!1;throw e}},_=async({lockPath:e,token:n,signal:r})=>{let i=Date.now()+f.TIMEOUT_MILLISECONDS,a=await g(e,n);for(;!a;){r.throwIfAborted();let o=await p(e);if(t.t(o)&&!m(o.pid)||Date.now()>i)throw await h(e);await(0,u.setTimeout)(f.RETRY_MILLISECONDS,void 0,{signal:r}),a=await g(e,n)}},v=async(e,t)=>{(await p(e))?.token===t&&await(0,c.rm)(e,{force:!0})},y=async({configPath:e,signal:t,operation:n})=>{let r=`${e}.lock`,i=(0,s.randomUUID)();await(0,c.mkdir)((0,l.dirname)(e),{recursive:!0,mode:o.t.PRIVATE_DIRECTORY}),await _({lockPath:r,token:i,signal:t});try{return await n()}finally{await v(r,i)}},b=async(e,t)=>{let n=`${e}.${process.pid}.${(0,s.randomUUID)()}.tmp`,r=await(0,c.open)(n,`wx`,o.t.PRIVATE_FILE);try{await r.writeFile(`${JSON.stringify(t,null,2)}\n`),await r.sync(),await r.close(),await(0,c.rename)(n,e)}catch(e){throw await r.close().catch(()=>void 0),await(0,c.rm)(n,{force:!0}),e}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require("./chunks/check-node-requirement-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"))});
2
+ const e=require("./chunks/check-node-requirement-CnwHKQBp.cjs"),t=require("./chunks/cli-node-version-range.constant-D3XrqV07.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-BbuvDae1.cjs"))});
package/docs/commands.md CHANGED
@@ -310,27 +310,29 @@ and inspect the changes before applying an app with a different tooling version.
310
310
 
311
311
  ```bash
312
312
  twenty app plan --remote dev
313
- twenty app plan --path ./apps/billing --no-delete --json
313
+ twenty app plan --path ./apps/billing --no-prune --json
314
+ twenty app plan --prune
314
315
  ```
315
316
 
316
317
  `app plan` builds once with the CLI pipeline, releases the temporary snapshot, then requests the server's metadata preview with `dryRun: true`. It uses the usual connection selection and requires the server's `APPLICATIONS` permission. The server enforces authorization, ownership and manifest/version compatibility. No registration, installation, upload or metadata synchronization is performed, and planning never advances a pull base. The local build can generate app artifacts, just as `app build` does.
317
318
 
318
319
  JSON marks plans with `plan: true`. A plan is not a saved approval: remote changes can alter what a later apply does. A missing owned application registration returns `PLAN_UNAVAILABLE` (exit 1). Register the app with `twenty app apply --create`, then plan again.
319
320
 
320
- Entities missing from source are included as deletions by default. `--no-delete` passes `inferDeletionFromMissingEntities: false` to the preview. Human output lists every action, identifies object/field deletions that would remove stored data, and shows the opt-out hint. JSON includes action details and counts. Application-variable values, including previous values in updates, are redacted from all plan actions regardless of their `isSecret` setting. A plan exceeding 10,000 actions or the transport's 16 MiB response limit fails instead of displaying an incomplete plan.
321
+ Entities missing from source are included as deletions by default, except for the workspace custom application, which keeps them unless you pass `--prune`. `--no-prune` passes `inferDeletionFromMissingEntities: false` to the preview and `--prune` passes `true`; without either the argument is omitted and the server decides. Servers released before `--prune` existed treat an omitted argument as `true`, so pass `--no-prune` to keep entities against them. The deprecated `--no-delete` still works as `--no-prune` with a `DEPRECATED_OPTION` warning; an explicit `--prune` or `--no-prune` takes precedence over it. Human output lists every action, identifies object/field deletions that would remove stored data, and shows the opt-out hint. JSON includes action details and counts. Application-variable values, including previous values in updates, are redacted from all plan actions regardless of their `isSecret` setting. A plan exceeding 10,000 actions or the transport's 16 MiB response limit fails instead of displaying an incomplete plan.
321
322
 
322
323
  ## Apply an app
323
324
 
324
325
  ```bash
325
326
  twenty app apply --remote dev
326
327
  twenty app apply --create --json
327
- twenty app apply --no-delete
328
+ twenty app apply --no-prune
329
+ twenty app apply --prune
328
330
  ```
329
331
 
330
332
  `app apply` builds the app once with the CLI pipeline and keeps that build's snapshot until it finishes, so the files it uploads are the ones it built. It then asks the workspace for a fresh plan, shows it, and applies it: it installs the development app if needed, uploads the snapshot files, synchronizes the manifest, and regenerates the app's typed API client. It needs the server's `APPLICATIONS` and `UPLOAD_FILE` permissions.
331
333
 
332
334
  - **New apps.** An app without a registration needs `--create`, or a yes at the prompt in an interactive terminal. The CLI then registers the app (the server also requires `API_KEYS_AND_WEBHOOKS` for this), installs it, and plans its changes before uploading anything. Without approval it stops with `CREATE_REQUIRED` (exit 2). The registration's client secret is never requested.
333
- - **Deletions.** Entities missing from source are deleted by default, as in `app plan`; `--no-delete` keeps them and is sent to both the plan and the sync. Object and field deletions permanently delete stored data, so they need `--yes` or a yes at the prompt. Otherwise the command stops with `CONFIRMATION_REQUIRED` (exit 2) before changing anything. `--yes` never changes which entities are deleted.
335
+ - **Deletions.** Entities missing from source are deleted by default (except in the workspace custom application), as in `app plan`; `--no-prune` keeps them, `--prune` deletes them in every app, and the choice is sent to both the plan and the sync. JSON reports `inferDeletionFromMissingEntities: null` when neither flag is passed. Object and field deletions permanently delete stored data, so they need `--yes` or a yes at the prompt. Otherwise the command stops with `CONFIRMATION_REQUIRED` (exit 2) before changing anything. `--yes` never changes which entities are deleted.
334
336
  - **Uploads.** File bytes go straight to the upload URLs the server returns, without the CLI's credentials. Each file is checked against the build's size and SHA-256 before anything is uploaded.
335
337
  - **Pull baseline.** After an acknowledged sync, the CLI fetches the workspace ID and fresh application export, then atomically records `.twenty/cli/pull-base.json`. This baseline lets `app pull` distinguish workspace changes from local edits. It is bound to the normalized API URL, workspace UUID and app UUID. JSON reports `pullBase: "recorded"`, `"failed"` or `"unsupported"`; only a recorded base adds `pullBase` to `completedPhases`. Invalid exports or file-write errors preserve the prior base, warn with `PULL_BASE_NOT_RECORDED`, and allow client generation to continue. A server without the export API reports `"unsupported"` without a warning on every apply. The export is recorded as the server sent it; collections it lacks are read as empty by pull. Cancellation before the base is committed exits 130 with `outcome: "applied"` and `phase: "pullBase"`.
336
338
  - **Typed client.** After the sync, the CLI fetches the app's GraphQL schema from the workspace and calls the app's own `twenty-client-sdk/generate` to regenerate the client in the app's own `node_modules/twenty-client-sdk` (`clientGeneration: "generated"`). It is skipped with a `CLIENT_NOT_GENERATED` warning when the app has no `node_modules/twenty-client-sdk` of its own, as in a hoisted workspace. A symlinked client package is followed and its target rewritten, so don't apply two apps that share one client package at the same time.
@@ -342,8 +344,8 @@ Remote changes made between the plan and the sync can change what the sync does.
342
344
 
343
345
  ```bash
344
346
  twenty app dev --remote dev
345
- twenty app dev --create --no-delete
346
- twenty app dev --path ./apps/billing --format ndjson --no-delete
347
+ twenty app dev --create --no-prune
348
+ twenty app dev --path ./apps/billing --format ndjson --no-prune
347
349
  ```
348
350
 
349
351
  `app dev` builds and syncs once, then watches for edits. Each attempt uses the
@@ -368,7 +370,8 @@ snapshot was acknowledged by the workspace. This is eventual convergence after
368
370
  edits settle, not an atomic checkout of files being edited concurrently.
369
371
 
370
372
  Registration uses `--create` or a terminal confirmation. Deletion inference is
371
- on by default, with `--no-delete` to keep missing entities. Object and field
373
+ on by default except for the workspace custom application, with `--no-prune`
374
+ to keep missing entities and `--prune` to delete them in every app. Object and field
372
375
  deletions require a terminal confirmation or `--yes`. Every revision requests a
373
376
  fresh plan. An edit cancels a pending confirmation; approval for the
374
377
  old revision cannot authorize the new one. A remote failure is reported with the
@@ -413,12 +416,16 @@ The app must already be installed in the workspace; otherwise the command fails
413
416
  ```bash
414
417
  twenty app pull --remote dev
415
418
  twenty app pull --path ./apps/billing --json
416
- twenty app pull --universal-identifier <uuid> --verbose
419
+ twenty app pull --path ./workspace-app --yes --no-input
417
420
  ```
418
421
 
419
- `app pull` reads the app's definition and exports its workspace metadata into the existing project. It uses the selected connection and the server's `APPLICATIONS` permission; the server decides which apps this workspace can export. It does not register an app or change the workspace. When a project has no application definition, provide `--universal-identifier`. A project declaring a different app is refused before writing.
422
+ Inside an app, `app pull` reads the identifier from the local application definition and pulls that application. Outside an app, it asks where to create a project for the selected workspace's custom application, then asks to create it, install its dependencies with Yarn, and pull. `--path` chooses an existing app or a new or empty destination; noninteractive creation requires both `--path` and `--yes`. It never overwrites an unrelated nonempty directory.
420
423
 
421
- The project must have `twenty-sdk` installed, version `>=1.23.0`, with its public `twenty-sdk/define` and `twenty-sdk/front-component` exports. Pull also checks that the SDK provides the authoring APIs required by the generated files. Missing APIs fail with `SDK_SOURCE_UNSUPPORTED`; install a compatible version (2.40.0 or later). Pull does not require a project TypeScript compiler. Run `twenty app typecheck` afterwards to check the generated definitions against your installed SDK.
424
+ New projects reuse the bundled initializer's package and configuration files without demo entities. Pull writes the custom application's definition. An existing SDK project without an application definition also pulls the custom application. A missing custom application is an error. There is no `--universal-identifier` option.
425
+
426
+ Pull uses the selected connection and the server's `APPLICATIONS` permission. Creating a project here creates local files only; it does not register an application or change the workspace. Existing projects do not install dependencies automatically. If a new project's installation fails, the scaffold is kept so you can run `yarn install` there and retry pull.
427
+
428
+ The project must have `twenty-sdk` installed, version `>=1.23.0`, with its public `twenty-sdk/define` and `twenty-sdk/front-component` exports. Pull also checks that the SDK provides the authoring APIs required by the generated files. Missing APIs fail with `SDK_SOURCE_UNSUPPORTED`; install a compatible version (2.50.0 or later). Pull does not require a project TypeScript compiler. Run `twenty app typecheck` afterwards to check the generated definitions against your installed SDK.
422
429
 
423
430
  Pull compares workspace metadata and local definitions using a baseline saved
424
431
  by apply or a previous pull in `.twenty/cli/pull-base.json`. The baseline belongs
@@ -432,7 +439,7 @@ failures restore the previous files and baseline.
432
439
 
433
440
  Failures in reconciliation report `error.details.outcome`: `unchanged` after an acknowledged refusal, cancellation before writing or successful rollback; `unknown` if a worker stops without acknowledging completion or rollback fails; `pulled` if writes and baseline completed but temporary-file cleanup failed. An interrupted worker can leave files partially written; inspect the changes and retained `.twenty/cli/pull-backup-*` files before retrying. A failed rollback also reports `backupDirectory`. Ctrl+C exits 130 unless the worker acknowledges a completed commit, in which case pull returns its result.
434
441
 
435
- The current export contains metadata and translations, not application source assets or dependency files. Logic-function/front-component code and unsupported metadata are not regenerated. An export with nonempty `files` is refused before writing. Package files, dependency pins and the installed generated client are left alone; pull never installs dependencies. Each export response is limited to 16 MiB. See the [pull implementation](../src/app/pull/README.md) for reconciliation and compatibility details.
442
+ The current export contains metadata, translations and stored dependency files. Public assets and application source files are not exported yet. Workflows are written as `defineWorkflow` files in `src/workflows`; a workflow changed in the workflow builder, or one using steps or references an application cannot declare, is reported as a coverage gap and its local file is kept. The workspace Custom application is published from the builder too, so its workflows are written from their active version, and apply publishes a changed definition as a new version. Skills and agents are written as `defineSkill` and `defineAgent` files in `src/skills` and `src/agents`; one the server cannot reproduce from a definition, such as an agent on more than one role, is reported as a coverage gap and its local file is kept. Logic-function/front-component code and unsupported metadata are not regenerated. Pull restores `package.json` and `yarn.lock` from the application’s `dependencies` folder. If the exported package omits `twenty-sdk`, as the workspace Custom application does, pull keeps your local SDK dependency. Other exported files are refused before writing. Dependency files unchanged on the workspace keep local edits; changed remote files replace them. Missing remote files leave local files untouched. The installed generated client is left alone; pull never installs dependencies. Run `yarn install` after pulling dependency changes. Each export response is limited to 16 MiB. See the [pull implementation](../src/app/pull/README.md) for reconciliation and compatibility details.
436
443
 
437
444
  ## Install a registered app
438
445
 
@@ -603,7 +610,7 @@ Builds and typechecks the app, packs that exact build, then publishes the packag
603
610
 
604
611
  Install npm and authenticate with the intended registry first. npm runs from the app directory, so its project/user configuration and environment credentials apply. `--tag` sets the npm dist-tag. GitHub Actions jobs with OIDC request provenance automatically; set `TWENTY_APP_PUBLISH_DISABLE_PROVENANCE=true` to opt out, for example when publishing from a private source repository.
605
612
 
606
- Packing and publishing skip npm lifecycle scripts because the CLI already built the app. npm's package-file selection still applies. If `package.json` has a `files` field, it must include `manifest.json` and the generated app files; the command rejects an incomplete package before publication. npm excludes the root `yarn.lock` from packages. Temporary packages and build snapshots are removed after completion or failure.
613
+ Packing and publishing skip npm lifecycle scripts because the CLI already built the app. npm's package-file selection still applies. If `package.json` has a `files` field, it must include `manifest.json` and the generated app files; the command rejects an incomplete package before publication. npm excludes the root `yarn.lock` from packages, so the CLI also packs it as `dependencies/yarn.lock`, where Twenty reads it at install. Temporary packages and build snapshots are removed after completion or failure.
607
614
 
608
615
  Human mode displays npm output and supports interactive authentication when a terminal is available. JSON mode returns one CLI envelope and does not prompt; configure an automation token or npm’s `npm_config_otp` environment option before running it. Failed npm commands return `PUBLISH_FAILED` with the subprocess exit code and captured output. If publication is interrupted after sending the package, check the registry before retrying, since the version may already have been published.
609
616
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twenty",
3
- "version": "2.51.3",
3
+ "version": "2.54.0",
4
4
  "description": "The Twenty command line.",
5
5
  "homepage": "https://twenty.com",
6
6
  "repository": {
@@ -28,19 +28,19 @@
28
28
  "@types/lodash.startcase": "^4",
29
29
  "@types/node": "^24.0.0",
30
30
  "@types/semver": "^7.5.8",
31
- "cjs-module-lexer": "^2.2.0",
32
31
  "commander": "^14.0.3",
33
32
  "execa": "^5.1.1",
34
33
  "lodash.startcase": "^4.4.0",
35
34
  "npm-pick-manifest": "^11.0.1",
36
35
  "semver": "7.6.3",
37
36
  "string-width": "^8.2.0",
38
- "twenty-client-sdk": "2.51.3",
37
+ "twenty-client-sdk": "2.54.0",
39
38
  "twenty-shared": "0.0.0",
40
- "undici": "^7.29.0",
39
+ "undici": "^7.30.1",
41
40
  "uuid": "^13.0.2",
42
41
  "vite": "^8.0.0",
43
- "vitest": "^4.1.0"
42
+ "vite-tsconfig-paths": "^4.2.1",
43
+ "vitest": "^4.1.12"
44
44
  },
45
45
  "dependencies": {
46
46
  "chokidar": "^3.6.0",
@@ -36,8 +36,9 @@ removes snapshots owned by the current build.
36
36
  shared with the other CLI app operations. The [dev session](../dev/README.md)
37
37
  observes the build's inputs and retains immutable copies for remote apply.
38
38
  - The define stub reads `twenty-sdk/define` from the app's installed SDK. Factories
39
- become no-op validators, plain-data exports retain their values, and other
40
- exports use proxy stubs. Runtime constants match the SDK the app uses.
39
+ become no-op validators, plain-data exports retain their values, including
40
+ non-enumerable properties, and other exports use proxy stubs. Runtime
41
+ constants match the SDK the app uses.
41
42
  - `sharp` is optional and resolved from the app. It is not a CLI dependency.
42
43
  When unavailable, cover generation warns and the build continues. Vite embeds
43
44
  the backdrop PNG as a data URI so it works in the standalone package.
@@ -57,18 +57,16 @@ From `packages/twenty-cli`, after building the repository SDK, shared and UI
57
57
  packages:
58
58
 
59
59
  ```bash
60
- node ../../node_modules/vitest/vitest.mjs run --config vitest.config.ts --maxWorkers=1 src/app/manifest/__tests__/manifest-parity.spec.ts
60
+ node ../../node_modules/vitest/vitest.mjs run --config vitest.config.ts --maxWorkers=1 src/app/manifest/__tests__/manifest-fixtures.spec.ts
61
61
  ```
62
62
 
63
- The suite bundles the SDK implementation as a test-only reference. It
64
- compares manifests, entity file paths, errors and warnings for every repository
65
- fixture and a freshly initialized app. It also exercises the production CLI
66
- worker using a copy of the real SDK's authoring entry points without `./build`,
67
- `./cli` or their implementation files.
63
+ The suite compares manifests, entity file paths, errors and warnings against
64
+ checked-in expectations for every repository fixture and a freshly initialized
65
+ app. It exercises the production CLI worker using a copy of the real SDK's
66
+ authoring entry points without `./build`, `./cli` or their implementation files.
68
67
 
69
- The SDK reference's discovery is sorted to match the CLI's deterministic input
70
- order. Comparisons remove only JSON-omitted `undefined` properties, matching the
71
- worker IPC boundary; arrays and diagnostics are not reordered. The invalid-app
72
- fixture throws `Invalid UUID` in both implementations. Additional cases cover
73
- duplicate identifiers, empty lockfiles, translations, source output and credential filtering.
74
- Unit tests cover individual validation and translation rules.
68
+ Comparisons remove only JSON-omitted `undefined` properties, matching the worker
69
+ IPC boundary; arrays and diagnostics are not reordered. Additional cases cover
70
+ invalid and duplicate identifiers, empty lockfiles, translations, source output
71
+ and credential filtering. Unit tests cover individual validation and translation
72
+ rules.
@@ -10,6 +10,9 @@ See the [app tooling overview](../README.md) for package boundaries.
10
10
 
11
11
  ## Contract
12
12
 
13
+ - An existing application's local identifier selects the target. With no local definition, the command fetches `currentWorkspace.workspaceCustomApplication.universalIdentifier`. Apply baseline recording still queries only the workspace ID.
14
+ - Outside an app, pull offers to create a local project and install its dependencies before reconciliation. Noninteractive creation requires `--path` and `--yes`. The initializer omits demo entities, and unrelated nonempty directories are refused.
15
+ - Missing custom applications fail before project creation. The worker still checks that the local identity matches the export before writing.
13
16
  - Source scanning stays inside the disposable CLI worker so configs containing functions are never serialized through IPC. Only the server export and report cross that boundary. Selected credentials are removed from the worker environment. App source is trusted developer code, not sandboxed code.
14
17
  - The wire/export and baseline boundary check identity and envelope fields, not every metadata collection. `toPullManifest` is the single explicit assertion into the typed writers, preserving their trust in the server schema. Missing/null object and field collections are consumed with `?? []`, like the other collections. Malformed entity contents can still make reconciliation fail before writing. We do not duplicate the server's schema.
15
18
  - The baseline file is an envelope whose `manifest` member is an `ExportedManifest`. Reconciliation walks arrays generically without maintaining a second collection list. Unrecognized collections and non-array metadata survive; protected or unreconciled definitions retain their prior baseline entries.
@@ -17,12 +20,16 @@ See the [app tooling overview](../README.md) for package boundaries.
17
20
  - Fields already declared with `defineField` stay in their existing files, even when the server exports them inside an object. Object generation excludes those fields; baseline comparisons use the same source layout. Pull also removes duplicate inline copies left in object files, while retaining the standalone definitions.
18
21
  - Before destination writes, `assertPullSdkExports` checks the actual imports emitted by the writer against the app's SDK. It checks export presence, not every config shape; run typecheck to validate the generated definitions against the installed SDK.
19
22
  - Temporary files and the baseline live under `.twenty/cli`. Apply and pull share `createPullBaseWrite` as the serializer. The baseline is bound to the API URL, workspace UUID and application UUID. Pull stages it with mode 0600 and writes it after the source files.
20
- - The baseline can carry `sourceFingerprints`, a SHA-256 per app-relative source and locale file. Apply captures them before building. Pull reports an overwritten local change when a file it rewrites or deletes no longer matches its fingerprint. Without a fingerprint it compares the file with the writer's rendering of the baseline, which is reliable only for source produced by that writer. Pull carries fingerprints forward, updating the files it writes and dropping the ones it deletes.
23
+ - The baseline can carry `sourceFingerprints`, a SHA-256 per app-relative source, locale and dependency file. Apply captures them before building. Pull reports an overwritten local change when a file it rewrites or deletes no longer matches its fingerprint. Without a fingerprint it compares the file with the writer's rendering of the baseline, which is reliable only for source produced by that writer. Pull carries fingerprints forward, updating the files it writes and dropping the ones it deletes.
21
24
  - Ordinary I/O failures restore originals. Cancellation is checked before committing the staged plan, not halfway through it. An acknowledged successful commit wins over cancellation. The parent can forcibly kill an unresponsive worker after its grace period, so an unacknowledged result has outcome `unknown`, never a claim that rollback succeeded. Failed rollback retains backups and reports their directory; failure to clean up after a completed commit has outcome `pulled`.
22
25
  - Human reporting uses CLI terminal escaping, machine reporting contains the full coverage and path lists, and gaps warn without stopping successful writes. Unknown coverage status strings remain visible. Pull does not prompt for approval or require a clean Git checkout; remote changes overwrite conflicting local edits and are included in the report.
23
26
 
24
27
  Translation string extraction uses the CLI's TypeScript parser. Traversal, static-string rules, whitespace normalization and deduplication are checked against the SDK reference by parity tests. It does not depend on ts-morph or load parser tooling for help and command discovery.
25
28
 
26
- Pull accepts metadata exports with `files: []` and refuses nonempty source/dependency-file exports. It does not restore package files, generate the typed client or write logic-function/front-component source. Export responses have a 16 MiB cap. Pull does not modify the workspace.
29
+ Workflows arrive in `manifest.workflows` and are written as `defineWorkflow` files. Their filter operands and form field types use SDK enums; filter group logical operators stay string literals, which every SDK with `defineWorkflow` accepts. A workflow the server cannot express as a definition is reported as `UNSUPPORTED` coverage, so its local file is kept.
30
+
31
+ Skills and agents arrive in `manifest.skills` and `manifest.agents` and are written as `defineSkill` and `defineAgent` files, with no enum bindings. The server exports one only when its definition reproduces the stored entity; otherwise it is reported as `UNSUPPORTED` coverage, so its local file is kept.
32
+
33
+ Pull requests `exportApplication(shouldIncludeDependencies: true)`. Export defaults to metadata-only files (`files: []`) for existing clients and apply baselines. Pull restores `dependencies/package.json` and `dependencies/yarn.lock` to the project root, in the same transaction as metadata and the baseline. Exact folder and filename checks reject all other exported files, including record attachments, public assets and source. If the remote package omits `twenty-sdk`, pull retains the local SDK dependency so the workspace custom app remains usable with the CLI. The baseline stores remote `dependencyFingerprints` separately from written `sourceFingerprints` for this case. Other exported dependency contents are copied exactly. Dependency files unchanged on the server preserve local edits; remote changes replace local contents and use the usual overwrite report. Missing remote files leave local files untouched. Pull does not install dependencies, generate the typed client or write logic-function/front-component source. Export responses have a 16 MiB cap. Pull does not modify the workspace. Because pull is partial, `app apply` of the workspace custom application only deletes entities missing from source with `--prune`.
27
34
 
28
35
  Tests cover writers, planning and reconciliation. Command tests build the actual Vite worker, exercise an authoring-only SDK, local mock HTTP, credentials/output isolation, SDK export refusal and forced termination after the first destination write. The repository SDK tests cover canonical generated definitions, nested coverage, translation preservation, target mismatch, overwrite reporting and rollback.
@@ -1,47 +0,0 @@
1
- # Setup
2
-
3
- Follow these steps to get your app running locally.
4
-
5
- ## Prerequisites
6
-
7
- - Node.js (version specified in `.nvmrc`)
8
- - Yarn 4
9
- - Docker (to run the local Twenty server)
10
-
11
- ## Steps
12
-
13
- 1. Install dependencies:
14
-
15
- ```bash
16
- yarn install
17
- ```
18
-
19
- The committed `yarn.lock` pins exact, integrity-checked versions, so this
20
- resolves nothing from the registry.
21
-
22
- 2. Start the local Twenty server:
23
-
24
- ```bash
25
- yarn twenty docker:start
26
- ```
27
-
28
- Check the server status at any time with `yarn twenty docker:status`.
29
-
30
- 3. Start the development server and sync your app:
31
-
32
- ```bash
33
- yarn twenty dev
34
- ```
35
-
36
- 4. Open [http://localhost:2020](http://localhost:2020) and log in with the default development credentials: `tim@apple.dev` / `tim@apple.dev`.
37
-
38
- ## Verifying your setup
39
-
40
- - `yarn lint` - Lint the project with oxlint
41
- - `yarn typecheck` - Type-check the project
42
- - `yarn test:unit` - Run unit tests
43
- - `yarn test` - Run integration tests
44
-
45
- ## Troubleshooting
46
-
47
- See the [troubleshooting guide](https://docs.twenty.com/developers/extend/apps/getting-started/troubleshooting) or ask on [Discord](https://discord.gg/cx5n4Jzs57).
@@ -1,5 +0,0 @@
1
- const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-CvvLHbc4-CKDJ1YgX.cjs"),n=require("./constants-D-caeNc5-9rDzSg5B.cjs");function r(e){if(!n.gt(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.ht(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.gt(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.Ut(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.Ut(e)||!ee(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length===0?!1:t.every(e=>n.Ut(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.Ut(i))return;if(!(0,h.isObject)(r))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:[]};let a=r[i];if(!n.Ut(a))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:Object.keys(r)};if(a.isLeaf){let r=t[e+1];return n.Ut(r)?{validPrefix:t.slice(0,e+1),failedSegment:r,availableKeys:[]}:void 0}r=a.value}},b={found:!1},x=e=>n.u(e)&&p(e.isLeaf),S=e=>n.u(e)&&e._outputSchemaType===`RECORD`&&n.u(e.fields),C=e=>n.u(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.Ut(r))return b;let a=e[r];return x(a)?ue(a,i):n.Ut(a)?i.length===0?{found:!0}:n.u(a)?pe(a,i):b:b},T=(e,t)=>t.length===0||!n.u(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.u(e))for(let n of E(e))t.push(`${r}.${n}`)}else if(n.Ut(i)&&(t.push(r),n.u(i)))for(let e of E(i))t.push(`${r}.${e}`);return t},D=e=>{if(!n.u(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.Ut(e.all)&&t.push(`all`),t.push(`totalCount`),t}return E(e)},he=3,O=e=>n.u(e)?e._outputSchemaType===`RECORD`?!0:Object.values(e).some(e=>n.u(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.Ut(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.Ut(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.Ut(l)&&(0,h.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.Ut(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.Ut(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.Nt({type:n.kt(`object`),properties:n.Ft(n.Lt(),n.Nt({type:n.bt([`string`,`number`,`boolean`]),description:n.Lt().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.Ct(n.Lt()).optional(),additionalProperties:n.kt(!1).optional()}),Se=n.Tt(`type`,[n.Nt({type:n.kt(`text`)}),n.Nt({type:n.kt(`json`),schema:xe})]),A=[1e3,5e3,15e3],j=n.Nt({input:n.At({}).describe(`Input data for the workflow action. Structure depends on the action type.`),outputSchema:n.At({}).describe(`Schema defining the output data structure. This data can be referenced in subsequent steps using {{stepId.fieldName}}.`),errorHandlingOptions:n.Nt({retryOnFailure:n.Nt({value:n.Pt(e=>typeof e==`boolean`?Number(e):e,n.Mt().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.Nt({value:n.wt().describe(`Whether to continue to the next step if this action fails.`)})})}),Ce={expectedOutputSchema:n.At({}).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.Nt({url:n.Lt(),method:n.bt([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`]),headers:n.Ft(n.Lt(),n.Lt()).optional(),body:n.Ft(n.Lt(),n.Rt([n.Lt(),n.Mt(),n.wt(),n.xt(),n.Ct(n.Rt([n.Lt(),n.Mt(),n.wt(),n.xt()]))])).or(n.Lt()).optional()}),...Ce}),Te=/^[a-zA-Z0-9_-]{1,64}$/,Ee=n.Nt({id:n.Bt().describe(`Stable identifier for this criterion row.`),name:n.Lt().describe(`Option name for a choice question, or the label of one score level.`),description:n.Lt().optional().describe(`What the model should understand this option to mean.`)}),De=n.Nt({id:n.Bt().describe(`Stable identifier for this question row.`),name:n.Lt().regex(Te,`Answer name must be empty or contain 1 to 64 characters using only letters, digits, underscores and dashes`).or(n.kt(``)).describe(`Answer key for this question, made of letters, digits, underscores and dashes. Downstream steps read {{stepId.answers.<name>}}.`),type:n.bt(te).describe(`choice picks one option, score grades an ordered rubric, boolean estimates the probability that a statement holds.`),instructions:n.Lt().describe(`What the model should decide about the shared state.`),criteria:n.Ct(Ee).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),Oe=j.extend({input:n.Nt({state:n.Lt().describe(`The shared state every question is asked about. Supports variables.`),questions:n.Ct(De)})}),ke=j.extend({input:n.Nt({items:n.Rt([n.Ct(n.Rt([n.Lt(),n.Mt(),n.wt(),n.xt(),n.Ft(n.Lt(),n.St()),n.St()])),n.Lt()]).optional(),initialLoopStepIds:n.Ct(n.Lt()).optional(),shouldContinueOnIterationFailure:n.wt().optional()})}),Ae=j.extend({input:n.Nt({delayType:n.bt([`SCHEDULED_DATE`,`DURATION`]),scheduledDateTime:n.Lt().nullable().optional(),duration:n.Nt({days:n.Rt([n.Mt().min(0),n.Lt()]).optional(),hours:n.Rt([n.Mt().min(0),n.Lt()]).optional(),minutes:n.Rt([n.Mt().min(0),n.Lt()]).optional(),seconds:n.Rt([n.Mt().min(0),n.Lt()]).optional()}).optional()})}),je=j.extend({input:n.Nt({eventName:n.Lt().describe(`Event to wait for, in format objectName.action (e.g., "company.updated", "task.created", "person.deleted").`),recordId:n.Lt().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.Ct(n.Lt()).nullable().optional().describe(`For update events, only resume when one of these fields changed.`),timeout:n.Nt({days:n.Rt([n.Mt().min(0),n.Lt()]).optional(),hours:n.Rt([n.Mt().min(0),n.Lt()]).optional(),minutes:n.Rt([n.Mt().min(0),n.Lt()]).optional()}).nullable().optional().describe(`Stop waiting after this duration. The step then succeeds with hasTimedOut set to true.`)})}),Me=j.extend({input:n.Nt({})}),M=n.Ft(n.Lt(),n.St()).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.Nt({objectName:n.Lt().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.Nt({objectName:n.Lt(),objectRecord:M,objectRecordId:n.Lt(),fieldsToUpdate:n.Ct(n.Lt())})}),Fe=j.extend({input:n.Nt({objectName:n.Lt(),objectRecord:M})}),Ie=j.extend({input:n.Nt({objectName:n.Lt(),objectRecordId:n.Lt()})}),N=n.Nt({id:n.Lt(),logicalOperator:n.bt(n.dt),parentRecordFilterGroupId:n.Lt().nullable().optional(),positionInRecordFilterGroup:n.Mt().nullable().optional()}),P=n.Nt({id:n.Lt().optional(),fieldMetadataId:n.Lt(),operand:n.bt(n.B),value:n.Lt().nullable().optional(),recordFilterGroupId:n.Lt().nullable().optional(),positionInRecordFilterGroup:n.Mt().nullable().optional(),subFieldName:n.Lt().nullable().optional(),relationTargetFieldMetadataId:n.Lt().nullable().optional()}),F=n.Lt().regex(/^{{[^{}]+}}$/,`Expected a workflow variable reference like {{stepId.path}}`),Le=j.extend({input:n.Nt({objectName:n.Lt(),limit:n.Rt([n.Mt(),F]).optional(),offset:n.Rt([n.Mt().int().nonnegative(),F]).optional(),filter:n.Nt({recordFilterGroups:n.Ct(N).optional(),recordFilters:n.Ct(P).optional()}).optional(),orderBy:n.Nt({recordSorts:n.Ct(n.St()).optional(),gqlOperationOrderBy:n.Ct(n.Ft(n.Lt(),n.St())).optional()}).optional()})}),Re=n.Nt({id:n.Lt(),name:n.Lt(),label:n.Lt(),type:n.Rt([n.kt(n.ct.TEXT),n.kt(n.ct.NUMBER),n.kt(n.ct.DATE),n.kt(n.ct.SELECT),n.kt(n.ct.MULTI_SELECT),n.kt(`RECORD`)]),placeholder:n.Lt().optional(),settings:n.Ft(n.Lt(),n.St()).optional(),value:n.St().optional()}),ze=j.extend({input:n.Ct(Re),instructions:n.Lt().optional()}),I=n.Nt({id:n.Lt(),logicalOperator:n.bt(n.V),parentStepFilterGroupId:n.Lt().optional(),positionInStepFilterGroup:n.Mt().optional()}),L=n.Nt({id:n.Lt(),type:n.Lt(),stepOutputKey:n.Lt(),operand:n.bt(n.B).or(n.bt(n.J)),value:n.Lt(),stepFilterGroupId:n.Lt(),positionInStepFilterGroup:n.Mt().optional(),fieldMetadataId:n.Lt().optional(),compositeFieldSubFieldName:n.Lt().optional()}),Be=j.extend({input:n.Nt({stepFilterGroups:n.Ct(I),stepFilters:n.Ct(L)})}),Ve=n.Nt({id:n.Lt(),nextStepIds:n.Ct(n.Lt()),filterGroupId:n.Lt().optional()}),He=j.extend({input:n.Nt({stepFilterGroups:n.Ct(I),stepFilters:n.Ct(L),branches:n.Ct(Ve)})}),R=n.bt([`RANDOM`,`ROUND_ROBIN`,`LOAD_BALANCED`]);j.extend({input:n.Nt({objectName:n.Lt(),strategy:R,recordIds:n.Ct(n.Lt()),loadBalance:n.Nt({objectNameSingular:n.Lt(),fieldName:n.Lt()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Ut(e.loadBalance)&&t.addIssue({code:n.yt.custom,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})});var z=n.Nt({name:n.Lt().optional().describe(`Human-readable name for the trigger. Optional but recommended for clarity.`),type:n.bt([`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.Nt({x:n.Mt(),y:n.Mt()}).optional().nullable().describe(`Position coordinates for the trigger in the workflow diagram. Use (0, 0) for the trigger step.`),nextStepIds:n.Ct(n.Lt()).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.kt(`CRON`),settings:n.Tt(`type`,[n.Nt({type:n.kt(`DAYS`),schedule:n.Nt({day:n.Mt().min(1),hour:n.Mt().min(0).max(23),minute:n.Mt().min(0).max(59)}),outputSchema:n.At({})}),n.Nt({type:n.kt(`HOURS`),schedule:n.Nt({hour:n.Mt().min(1),minute:n.Mt().min(0).max(59)}),outputSchema:n.At({})}),n.Nt({type:n.kt(`MINUTES`),schedule:n.Nt({minute:n.Mt().min(1).max(60)}),outputSchema:n.At({})}),n.Nt({type:n.kt(`CUSTOM`),pattern:n.Lt(),outputSchema:n.At({})})])}),We=z.extend({type:n.kt(`WEBHOOK`),settings:n.Tt(`httpMethod`,[n.Nt({outputSchema:n.At({}),httpMethod:n.kt(`GET`),authentication:n.kt(`API_KEY`).nullable()}),n.Nt({outputSchema:n.At({}),expectedOutputSchema:n.At({}).optional(),httpMethod:n.kt(`POST`),expectedBody:n.At({}),authentication:n.kt(`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.Ut(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.Ut(e?.nextStepIds)?e.nextStepIds.filter(n.Ut):[];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.Ut(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.Ut(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.Ut(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.Ut);t.n(a)&&c.length===0&&i.push({severity:`error`,code:`TRIGGER_HAS_NO_NEXT_STEP`,message:`The trigger is not connected to any step. The trigger must have a "nextStepIds" array pointing to the first step (e.g. nextStepIds: ["${a[0].id}"]). If you used edges, also set trigger.nextStepIds.`});for(let e of c)o.has(e)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`The trigger references a non-existent step "${e}".`});for(let e of a){for(let t of r.childrenByStepId.get(e.id)??[])o.has(t)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`Step "${e.name??e.id}" references a non-existent step "${t}".`,stepId:e.id});i.push(...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.Ut).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.Ut(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.Q.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.ct.TEXT,n.ct.ARRAY,n.ct.BOOLEAN,n.ct.DATE,n.ct.DATE_TIME,n.ct.NUMBER,n.ct.NUMERIC,n.ct.RAW_JSON,n.ct.RICH_TEXT,n.ct.SELECT,n.ct.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.Q.RECORD_PAGE,n.Q.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.Q.RECORD_FORM}),_t=({pageLayoutTabManifest:e,pageLayoutType:r})=>{let i=e.layoutMode??(r===n.Q.STANDALONE_PAGE?n.ft.VERTICAL_LIST:n.ft.GRID),a=e.widgets??[],o=[];if(!Object.values(n.ft).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.u(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.Ut);r.length>0&&i!==n.ft.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.G).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.Ut(r))return{...o,position:r.layoutMode===n.ft.VERTICAL_LIST&&n.Ut(e)?{...r,heightBehavior:e}:r};if(n.Ut(a))return{...o,position:{layoutMode:n.ft.GRID,...a}};switch(i){case n.ft.GRID:return{...o,position:{layoutMode:i,row:0,column:0,rowSpan:n.v.default.h,columnSpan:n.v.default.w}};case n.ft.VERTICAL_LIST:return{...o,position:{layoutMode:i,index:s,...n.Ut(e)?{heightBehavior:e}:{}}};case n.ft.CANVAS:return{...o,position:{layoutMode:i}};default:return t.t(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.ft.VERTICAL_LIST){let e=s.widgets.filter(({type:e,position:r})=>r.layoutMode===n.ft.VERTICAL_LIST&&t.a({widgetType:e,heightBehavior:r.heightBehavior})===n.G.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.Ut(r)&&s.widgets.some(e=>e!==r&&e.position.layoutMode===n.ft.VERTICAL_LIST&&r.position.layoutMode===n.ft.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.u(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.Ut(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.Ut(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.l.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.gt(e)&&f(e)>=4,J={universalIdentifier:n.Bt(),name:n.Lt().min(1),nextStepIds:n.Ct(n.Bt()),position:n.Nt({x:n.Mt(),y:n.Mt()}).optional(),outputSchema:n.Ft(n.Lt(),n.zt()).optional(),expectedOutputSchema:n.Ft(n.Lt(),n.zt()).optional(),errorHandlingOptions:j.shape.errorHandlingOptions.optional()},Y=(e,t)=>n.It({...J,type:n.kt(e),input:t}),Ot=n.At({fieldMetadataUniversalIdentifier:n.Bt(),fieldMetadataId:n.jt().optional()}),X=L.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Bt().optional()}).strict(),kt=P.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Bt()}).strict(),Z={objectUniversalIdentifier:n.Bt()},At=[n.It({...J,type:n.kt(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:n.Bt(),input:n.Ft(n.Lt(),n.zt())}),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.It({recordFilterGroups:n.Ct(N).optional(),recordFilters:n.Ct(kt).optional()}).optional(),orderBy:n.It({recordSorts:n.Ct(Ot.extend({direction:n.bt([`ASC`,`DESC`]),subFieldName:n.Lt().nullable().optional()})).optional()}).optional()}).strict()),Y(`PICK_RECORD`,n.It({...Z,strategy:R,recordIds:n.Ct(n.Lt()),loadBalance:n.It({objectUniversalIdentifier:n.Bt(),fieldUniversalIdentifier:n.Bt()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Ut(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.Ct(X)})),Y(`IF_ELSE`,He.shape.input.extend({stepFilters:n.Ct(X)})),Y(`FORM`,n.Ct(ze.shape.input.element.extend({settings:n.Ft(n.Lt(),n.zt()).optional()}).superRefine((e,t)=>{e.type===`RECORD`&&!n.Bt().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.It({agentUniversalIdentifier:n.Bt(),prompt:n.Lt(),responseFormat:Se.optional()}))],jt=At.map(e=>e.shape.type.value),Mt=n.Tt(`type`,At,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${jt.join(`, `)}`:void 0}),Nt=[`updated`,`upserted`],Pt=n.Tt(`type`,[n.It({type:n.kt(`GLOBAL`)}),n.It({type:n.kt(`SINGLE_RECORD`),objectUniversalIdentifier:n.Bt()}),n.It({type:n.kt(`BULK_RECORDS`),objectUniversalIdentifier:n.Bt()})]),[Q,Ft,It,Lt]=Ue.shape.settings.options,Rt=n.Tt(`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.Tt(`httpMethod`,[zt.omit({outputSchema:!0,authentication:!0}).strict(),Bt.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),$=[n.It({universalIdentifier:n.Bt(),type:n.kt(`MANUAL`),nextStepIds:n.Ct(n.Bt()).min(1),settings:n.It({availability:Pt.optional(),icon:n.Lt().optional(),isPinned:n.wt().optional()}).superRefine((e,t)=>{!n.Ut(e.availability)&&(n.Ut(e.icon)||n.Ut(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.It({universalIdentifier:n.Bt(),type:n.kt(`CRON`),nextStepIds:n.Ct(n.Bt()).min(1),settings:Rt}),n.It({universalIdentifier:n.Bt(),type:n.kt(`DATABASE_EVENT`),nextStepIds:n.Ct(n.Bt()).min(1),settings:n.It({objectUniversalIdentifier:n.Bt(),action:n.bt([`created`,`updated`,`deleted`,`upserted`]),fieldUniversalIdentifiers:n.Ct(n.Bt()).optional(),filter:n.It({stepFilterGroups:n.Ct(I),stepFilters:n.Ct(X.extend({operand:n.bt(n.B)}))}).optional()}).superRefine((e,r)=>{if(t.n(e.fieldUniversalIdentifiers)&&!Nt.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${Nt.join(` and `)} events`}),!n.Ut(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.Ut(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.Ut(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.It({universalIdentifier:n.Bt(),type:n.kt(`WEBHOOK`),nextStepIds:n.Ct(n.Bt()).min(1),settings:Vt})],Ht=$.map(e=>e.shape.type.value),Ut=n.Tt(`type`,$,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${Ht.join(`, `)}`:void 0});n.It({universalIdentifier:n.Bt(),name:n.Lt().min(1),version:n.It({trigger:Ut,steps:n.Ct(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
- const e=require("./cli-error-CSsayo0u.cjs");let t=require("node:fs/promises"),n=require("node:path");var r=class extends Error{},i=async({appPath:i,relativePaths:a})=>{for(let o of a){let a=(0,n.relative)(i,(0,n.resolve)(i,o));if(a.length===0||a===`..`||a.startsWith(`..${n.sep}`)||(0,n.isAbsolute)(a))throw new r(`Path leaves the application directory: ${o}`);let s=i;for(let i of a.split(n.sep)){s=(0,n.resolve)(s,i);try{if((await(0,t.lstat)(s)).isSymbolicLink())throw new r(`Cannot follow symbolic links: ${o}`)}catch(t){if(e.r(t,`ENOENT`))break;throw t}}}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSymbol=e.isBigInt=e.isString=e.isNumber=e.isBoolean=e.isUndefined=void 0,e.isUndefined=e=>e===void 0,e.isBoolean=e=>typeof e==`boolean`,e.isNumber=e=>typeof e==`number`&&!Number.isNaN(e),e.isString=e=>typeof e==`string`,e.isBigInt=e=>typeof e==`bigint`,e.isSymbol=e=>typeof e==`symbol`})),d=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=e.isWeakSet=e.isWeakMap=e.isSet=e.isMap=e.isArray=e.isObject=e.isFunction=e.isNull=void 0,e.isNull=e=>e===null,e.isFunction=e=>typeof e==`function`,e.isObject=t=>!e.isNull(t)&&typeof t==`object`,e.isArray=e=>Array.isArray(e),e.isMap=e=>e instanceof Map,e.isSet=e=>e instanceof Set,e.isWeakMap=e=>e instanceof WeakMap,e.isWeakSet=e=>e instanceof WeakSet,e.isDate=e=>e instanceof Date})),f=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNegativeInteger=e.isNonNegativeInteger=e.isPositiveInteger=e.isInteger=e.isNumberOrNaN=e.isNonEmptyString=e.isNonEmptyArray=e.isObjectOrNull=void 0;var t=u(),n=d();e.isObjectOrNull=e=>typeof e==`object`,e.isNonEmptyArray=e=>n.isArray(e)&&e.length>0,e.isNonEmptyString=e=>t.isString(e)&&e.length>0,e.isNumberOrNaN=e=>typeof e==`number`,e.isInteger=e=>t.isNumber(e)&&Number.isInteger(e),e.isPositiveInteger=t=>e.isInteger(t)&&t>0,e.isNonNegativeInteger=t=>e.isInteger(t)&&t>=0,e.isNegativeInteger=t=>e.isInteger(t)&&t<0})),p=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.structural=e.primitives=e.convenience=void 0,e.convenience=r(f()),i(f(),e),e.primitives=r(u()),i(u(),e),e.structural=r(d()),i(d(),e)}));Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -1,5 +0,0 @@
1
- const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-D-caeNc5-9rDzSg5B.cjs"),n=require("./application-DOWikeQt.cjs"),r=require("./metadata-DkXpEhJh.cjs"),i=require("./print-typescript-value-D5kLR9wo.cjs"),a=require("./kebab-case-D0usAzG-.cjs");var o=80,s=e=>[{path:[...e,`type`],symbol:`FieldType`,members:t.ct},{path:[...e,`writability`],symbol:`MetadataWritability`,members:t.at},{path:[...e,`universalSettings`,`relationType`],symbol:`RelationType`,members:t.nt},{path:[...e,`universalSettings`,`onDelete`],symbol:`OnDeleteAction`,members:t.W},{path:[...e,`universalSettings`,`dataType`],symbol:`NumberDataType`,members:t.pt},{path:[...e,`universalSettings`,`displayFormat`],symbol:`DateDisplayFormat`,members:t.P}],c=s([]),l=[{path:[`writability`],symbol:`MetadataWritability`,members:t.at},{path:[`openRecordIn`],symbol:`ObjectOpenRecordIn`,members:t.$},...s([`fields`,`[]`])],u=[{path:[`indexType`],symbol:`IndexType`,members:t.ot}],d=[{path:[`rowLevelPermissionPredicateGroups`,`[]`,`logicalOperator`],symbol:`RowLevelPermissionPredicateGroupLogicalOperator`,members:t.N},{path:[`rowLevelPermissionPredicates`,`[]`,`operand`],symbol:`RowLevelPermissionPredicateOperand`,members:t.tt},{path:[`permissionFlagUniversalIdentifiers`,`[]`],symbol:`SystemPermissionFlag`,members:t.S}],f=e=>({path:e,symbol:`AggregateOperations`,members:t.et}),p=[f([`aggregateOperation`])],m=[{path:[`type`],symbol:`ViewType`,members:t.st},{path:[`visibility`],symbol:`ViewVisibility`,members:t.H},{path:[`openRecordIn`],symbol:`ViewOpenRecordIn`,members:t.z},f([`kanbanAggregateOperation`]),{path:[`calendarLayout`],symbol:`ViewCalendarLayout`,members:t.F},f([`fields`,`[]`,`aggregateOperation`]),{path:[`filters`,`[]`,`operand`],symbol:`ViewFilterOperand`,members:t.B},{path:[`filterGroups`,`[]`,`logicalOperator`],symbol:`ViewFilterGroupLogicalOperator`,members:t.Y},{path:[`sorts`,`[]`,`direction`],symbol:`ViewSortDirection`,members:t.U}],h=e=>[{path:[...e,`type`],symbol:`WidgetType`,members:t.I},{path:[...e,`position`,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.ft},f([...e,`configuration`,`aggregateOperation`]),...[`dateGranularity`,`primaryAxisDateGranularity`,`secondaryAxisGroupByDateGranularity`].map(n=>({path:[...e,`configuration`,n],symbol:`ObjectRecordGroupByDateGranularity`,members:t.X}))],g=e=>[{path:[...e,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.ft},...h([...e,`widgets`,`[]`])],_=h([]),v=g([]),y=[{path:[`type`],symbol:`NavigationMenuItemType`,members:t.it}],b=[{path:[`type`],symbol:`PageLayoutType`,members:t.Q},...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.Ut(i))return;let o=Object.keys(i.members).find(e=>i.members[e]===n);if(t.Ut(o))return a.add(i.symbol),`${i.symbol}.${o}`}}),c=[e,...[...a].sort()],l=`import { ${c.join(`, `)} } from 'twenty-sdk/define';`;return{content:`${l.length<=o?l:`import {\n${c.map(e=>` ${e},`).join(`
2
- `)}\n} from 'twenty-sdk/define';`}
3
-
4
- export default ${e}(${s});
5
- `,requiredSdkExports:c}},C=e.t(),w=80,T=new Map(Object.entries(r.i).flatMap(([e,t])=>Object.entries(t).map(([t,{universalIdentifier:n}])=>[n,{objectName:e,fieldName:t}]))),E=e=>(0,C.isNonEmptyString)(e)&&(0,C.isNonEmptyString)(a.t(e).replace(/-+/g,``)),D=e=>e.slice(0,w).replace(/-+$/g,``),O=({segments:e,universalIdentifier:n})=>{let r=D(e.filter(t.Ut).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.Ut(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.Ut(a)?{objectPermissions:L({permissions:a,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>n.d({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.Ut(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.Ut(i))return i.name;let a=H.get(e);if(t.Ut(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.Ut(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.Ut(a)?V({objectUniversalIdentifier:a,manifest:n}):r===t.it.VIEW&&t.Ut(o)?W({viewUniversalIdentifier:o,manifest:n}):r===t.it.PAGE_LAYOUT&&t.Ut(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.Ut(n.objectUniversalIdentifier)?V({objectUniversalIdentifier:n.objectUniversalIdentifier,manifest:e}):null});for(let n of e.pageLayoutTabs??[]){let{pageLayoutUniversalIdentifier:r}=n;if(!t.Ut(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.Ut(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.Ut(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}});