twenty 2.57.0 → 2.59.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 (249) hide show
  1. package/CONTRIBUTING.md +82 -54
  2. package/README.md +35 -22
  3. package/dist/app-template/.nvmrc +1 -1
  4. package/dist/app-template/example/files/README.md +20 -4
  5. package/dist/app-template/example/files/github/workflows/publish.yml +1 -1
  6. package/dist/app-template/example/files/src/default-role.ts +6 -4
  7. package/dist/app-template/yarn.lock +177 -114
  8. package/dist/app-worker.cjs +1 -1
  9. package/dist/chunks/{cli-version.constant-1uwk-lMz.cjs → AssetDirectory-c_JEwMr2.cjs} +1 -1
  10. package/dist/chunks/FileFolder-BmCXp_bX.cjs +1 -0
  11. package/dist/chunks/TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs +1 -0
  12. package/dist/chunks/build-source-manifest-Ddwa8ath.cjs +2 -0
  13. package/dist/chunks/build-source-snapshot-CUsEVNsQ.cjs +898 -0
  14. package/dist/chunks/cli-version.constant-y_3mZ4gx.cjs +1 -0
  15. package/dist/chunks/code-step-file-suffix.constant-B6vqrfcU.cjs +1 -0
  16. package/dist/chunks/collect-translatable-strings-AWv41yIv.cjs +1 -0
  17. package/dist/chunks/collect-watch-inputs-DfWAkX1r.cjs +1 -0
  18. package/dist/chunks/compile-application-translations-C9UZQCAb.cjs +58 -0
  19. package/dist/chunks/convert-to-label-CI8cZyg_.cjs +1 -0
  20. package/dist/chunks/create-http-status-error-1VM7PoVZ.cjs +1 -0
  21. package/dist/chunks/create-metadata-client-FopHnDj0.cjs +6 -0
  22. package/dist/chunks/create-pull-base-write-CX8xZhMz.cjs +1 -0
  23. package/dist/chunks/create-rest-client-HbzXSfhZ.cjs +1 -0
  24. package/dist/chunks/extract-manifest-from-file-DPDIhnyg.cjs +1 -0
  25. package/dist/chunks/extract-source-translations-B-XmoSt7.cjs +1 -0
  26. package/dist/chunks/{fetch-metadata-inspection-Dqn8jToW.cjs → fetch-metadata-inspection-ooyNi2DN.cjs} +1 -1
  27. package/dist/chunks/{fetch-signed-in-identity-DCqCwASL.cjs → fetch-signed-in-identity-nCzWXunB.cjs} +1 -1
  28. package/dist/chunks/fetch-workspace-or-throw-DHoa_BYF.cjs +1 -0
  29. package/dist/chunks/format-body-DlJyFFVS.cjs +1 -0
  30. package/dist/chunks/format-data-value-D_1TNU-r.cjs +1 -0
  31. package/dist/chunks/format-metadata-fields-DmRandPR.cjs +2 -0
  32. package/dist/chunks/format-metadata-owner-ByoX2plp.cjs +1 -0
  33. package/dist/chunks/format-progress-line-BoU0vHbc.cjs +1 -0
  34. package/dist/chunks/formatBytes-CUW21d2t.cjs +1 -0
  35. package/dist/chunks/generate-application-client-Dlp_O7qk.cjs +1 -0
  36. package/dist/chunks/{get-client-generation-skip-reason-DZmeP0IC.cjs → get-client-generation-skip-reason-BZiAtHwa.cjs} +1 -1
  37. package/dist/chunks/get-field-universal-identifier.util-d1401qKf.cjs +1 -0
  38. package/dist/chunks/get-function-input-schema-ClPQURr8.cjs +1 -0
  39. package/dist/chunks/get-local-status-BbRv0a22.cjs +1 -0
  40. package/dist/chunks/global-flags.constant-DMHyA_PD.cjs +1 -0
  41. package/dist/chunks/is-access-token-expiring-BvJhEqtV.cjs +1 -0
  42. package/dist/chunks/is-application-not-found-error-CQ7k4hGU.cjs +1 -0
  43. package/dist/chunks/is-exported-manifest-C4lO285q.cjs +1 -0
  44. package/dist/chunks/is-locale-catalog-T4W5NhnW.cjs +1 -0
  45. package/dist/chunks/{AppLocales-CcZVcJIa-BjjIbbsZ.cjs → is-supported-locale-DUMI9QQ2.cjs} +1 -1
  46. package/dist/chunks/is-valid-package-name-Ds0DY5qP.cjs +1 -0
  47. package/dist/chunks/isNonEmptyArray-v52xg4Xj.cjs +1 -0
  48. package/dist/chunks/isPlainObject-fJEJm71P.cjs +1 -0
  49. package/dist/chunks/isValidUniversalIdentifier-DymFerYs.cjs +1 -0
  50. package/dist/chunks/isValidUuid-D3NV1xmO.cjs +1 -0
  51. package/dist/chunks/kebab-case-B3kq7ANN.cjs +1 -0
  52. package/dist/chunks/list-application-source-files-DcyU-HrX.cjs +1 -0
  53. package/dist/chunks/locale-catalog-format-BD4XDEnl.cjs +1 -0
  54. package/dist/chunks/{metadata-page.constant-qMNOJLjJ.cjs → metadata-page.constant-D4-pGQWp.cjs} +1 -1
  55. package/dist/chunks/parse-api-url-B5c0Gh_n.cjs +1 -0
  56. package/dist/chunks/parse-app-export-BC81wdmc.cjs +1 -0
  57. package/dist/chunks/parse-extraction-locale-B0apfizg.cjs +1 -0
  58. package/dist/chunks/parse-graphql-response-Cl8_fBgo.cjs +1 -0
  59. package/dist/chunks/parse-json-input-DxGKbeED.cjs +1 -0
  60. package/dist/chunks/print-typescript-value-BjYn0ZFT.cjs +3 -0
  61. package/dist/chunks/proxy-header-environment-variable.constant-CJyhJMve.cjs +1 -0
  62. package/dist/chunks/pull-minimum-sdk-version.constant-DUMi_IUD.cjs +6 -0
  63. package/dist/chunks/pull-source-CXQQf8Lw.cjs +1 -0
  64. package/dist/chunks/read-app-identity-Cny6sAGs.cjs +1 -0
  65. package/dist/chunks/read-application-identifier-C4U2JsfD.cjs +1 -0
  66. package/dist/chunks/read-application-identity-5sO-Mqb1.cjs +1 -0
  67. package/dist/chunks/read-bounded-body-BekYzK8S.cjs +1 -0
  68. package/dist/chunks/read-command-values-l5T9Lba4.cjs +1 -0
  69. package/dist/chunks/read-config-6GnzcpJm.cjs +1 -0
  70. package/dist/chunks/read-infer-deletion-option-Hv5V-A47.cjs +8 -0
  71. package/dist/chunks/read-json-object-BMftwGZ5.cjs +1 -0
  72. package/dist/chunks/read-local-container-Cs3cWspd.cjs +1 -0
  73. package/dist/chunks/read-snapshot-file-Dxla2ete.cjs +1 -0
  74. package/dist/chunks/{read-source-identity-CaErC5Qk.cjs → read-source-identity-CG9W0pSt.cjs} +1 -1
  75. package/dist/chunks/record-pull-base-8bIoAoiB.cjs +1 -0
  76. package/dist/chunks/{record-typecheck-config-inputs-BAruvIZV.cjs → record-typecheck-config-inputs-U2RUjjp9.cjs} +1 -1
  77. package/dist/chunks/request-oauth-tokens-_Xwy2q9c.cjs +1 -0
  78. package/dist/chunks/resolve-app-project-B4IjfcM-.cjs +1 -0
  79. package/dist/chunks/resolve-command-target-CLqjjxCT.cjs +1 -0
  80. package/dist/chunks/resolve-inside-sdk-DA7EQpf0.cjs +1 -0
  81. package/dist/chunks/resolve-metadata-object-7DhvIcEm.cjs +1 -0
  82. package/dist/chunks/resolve-project-typescript-DO4LrLr-.cjs +1 -0
  83. package/dist/chunks/resolve-proxy-headers-DipR9jft.cjs +1 -0
  84. package/dist/chunks/resolve-request-url-CfvGDGkw.cjs +1 -0
  85. package/dist/chunks/resolve-source-sdk-C4Hu045V.cjs +1 -0
  86. package/dist/chunks/run-api-graphql-command-ELrIPdM5.cjs +1 -0
  87. package/dist/chunks/run-api-rest-command-COVnszcN.cjs +1 -0
  88. package/dist/chunks/{run-app-add-command-qkKHuv9-.cjs → run-app-add-command-b9sm20rn.cjs} +20 -18
  89. package/dist/chunks/{run-app-apply-command-XNJHctjU.cjs → run-app-apply-command-CD7NOdiR.cjs} +2 -2
  90. package/dist/chunks/run-app-build-command-C8ubC2GH.cjs +2 -0
  91. package/dist/chunks/{run-app-dev-command-D6zVdTId.cjs → run-app-dev-command-D1JOfJv6.cjs} +2 -2
  92. package/dist/chunks/run-app-exec-command-cw4vPVHE.cjs +3 -0
  93. package/dist/chunks/run-app-generate-client-command-BVRFtPni.cjs +2 -0
  94. package/dist/chunks/{run-app-init-command-DcS8RfBK.cjs → run-app-init-command-DuxE1JhM.cjs} +2 -2
  95. package/dist/chunks/run-app-install-command-DlcUupwk.cjs +1 -0
  96. package/dist/chunks/run-app-logs-command-CaLIVesh.cjs +8 -0
  97. package/dist/chunks/run-app-operation-DKPh4r7b.cjs +1 -0
  98. package/dist/chunks/{run-app-plan-command-DcjgbzTy.cjs → run-app-plan-command-BGQ7vJZT.cjs} +1 -1
  99. package/dist/chunks/run-app-publish-command-BGNJVIBl.cjs +1 -0
  100. package/dist/chunks/run-app-pull-command-NbZ8fjhE.cjs +6 -0
  101. package/dist/chunks/run-app-translations-extract-command-CGIFvpC1.cjs +2 -0
  102. package/dist/chunks/{run-app-typecheck-command-D2Po43IB.cjs → run-app-typecheck-command-D0KV3hFS.cjs} +1 -1
  103. package/dist/chunks/{run-app-uninstall-command-DXyjeBwO.cjs → run-app-uninstall-command-CepQk4_4.cjs} +1 -1
  104. package/dist/chunks/run-auth-login-command-DpS1bUdL.cjs +1 -0
  105. package/dist/chunks/{run-auth-logout-command-ChrdwI-r.cjs → run-auth-logout-command-hvi_HvpQ.cjs} +1 -1
  106. package/dist/chunks/run-auth-status-command-Dr4YQuLn.cjs +1 -0
  107. package/dist/chunks/{run-cli-BoGzN25b.cjs → run-cli-oUabLHNz.cjs} +6 -6
  108. package/dist/chunks/run-commands-command-DYm9TuAx.cjs +2 -0
  109. package/dist/chunks/run-data-export-command-C4_7rc0v.cjs +3 -0
  110. package/dist/chunks/run-data-get-command-CcEYQ4xO.cjs +1 -0
  111. package/dist/chunks/run-data-list-command-D0K7HFD-.cjs +1 -0
  112. package/dist/chunks/run-doctor-command-fHf5vCGl.cjs +2 -0
  113. package/dist/chunks/run-local-logs-command-COsSRk3f.cjs +1 -0
  114. package/dist/chunks/run-local-reset-command-m0x-EiA6.cjs +2 -0
  115. package/dist/chunks/run-local-start-command-DsFS9_ew.cjs +1 -0
  116. package/dist/chunks/{run-local-status-command-ClvEgxcU.cjs → run-local-status-command-BYxy0R9I.cjs} +1 -1
  117. package/dist/chunks/run-local-stop-command-D66F73fW.cjs +1 -0
  118. package/dist/chunks/run-local-upgrade-command-6P71bQw6.cjs +1 -0
  119. package/dist/chunks/run-metadata-field-describe-command-nfKhj-m_.cjs +3 -0
  120. package/dist/chunks/{run-metadata-field-list-command-YCsoqOo1.cjs → run-metadata-field-list-command-CW2I6hmh.cjs} +1 -1
  121. package/dist/chunks/{run-metadata-object-describe-command-DpTobKR3.cjs → run-metadata-object-describe-command-WLxcOe4T.cjs} +1 -1
  122. package/dist/chunks/{run-metadata-object-list-command-BnSIIMDP.cjs → run-metadata-object-list-command-Q4pwAEwO.cjs} +1 -1
  123. package/dist/chunks/run-open-command-DPrz3N1e.cjs +1 -0
  124. package/dist/chunks/{run-remote-list-command-0f2QIf8C.cjs → run-remote-list-command-C2tZHRAT.cjs} +1 -1
  125. package/dist/chunks/{run-remote-remove-command-ClFB0Ub7.cjs → run-remote-remove-command-DgSQvjeN.cjs} +1 -1
  126. package/dist/chunks/{run-remote-rename-command-BVUcpZxq.cjs → run-remote-rename-command--37-GTRY.cjs} +1 -1
  127. package/dist/chunks/{run-remote-use-command-ByRTqnq5.cjs → run-remote-use-command-B6obKSPB.cjs} +1 -1
  128. package/dist/chunks/{run-version-command-_9OGraNf.cjs → run-version-command-BWTSv9_Y.cjs} +1 -1
  129. package/dist/chunks/select-target-Ck9mdMLQ.cjs +1 -0
  130. package/dist/chunks/sign-in-to-remote-again-DFQr-xvw.cjs +1 -0
  131. package/dist/chunks/sign-in-with-browser-TQANmPyb.cjs +124 -0
  132. package/dist/chunks/standard-object-fields.constant-C4AVX0t2.cjs +1 -0
  133. package/dist/chunks/subscribe-graphql-w-Ar4hCj.cjs +2 -0
  134. package/dist/chunks/to-public-target-BltDNpJN.cjs +1 -0
  135. package/dist/chunks/to-worker-output-diagnostics-w1hZPfn0.cjs +2 -0
  136. package/dist/chunks/{typecheck-application-BYPGp8lW.cjs → typecheck-application-8A504oUF.cjs} +1 -1
  137. package/dist/chunks/{update-config-ClCVH3C5.cjs → update-config-Bk0qgzgZ.cjs} +1 -1
  138. package/dist/chunks/wait-for-local-environment-zNEJcWA1.cjs +1 -0
  139. package/dist/chunks/write-config-atomically-B6XQJ6XK.cjs +1 -0
  140. package/dist/cli.cjs +1 -1
  141. package/docs/commands.md +875 -233
  142. package/package.json +3 -2
  143. package/src/app/README.md +15 -10
  144. package/src/app/add/README.md +75 -51
  145. package/src/app/bundles/README.md +56 -33
  146. package/src/app/client/README.md +23 -21
  147. package/src/app/dev/README.md +30 -16
  148. package/src/app/exec/README.md +61 -41
  149. package/src/app/function-logs/README.md +49 -32
  150. package/src/app/manifest/README.md +31 -25
  151. package/src/app/pull/README.md +191 -21
  152. package/src/app/source/README.md +67 -14
  153. package/src/app/typecheck/README.md +29 -24
  154. package/dist/chunks/application-T4xvzjbB.cjs +0 -5
  155. package/dist/chunks/build-source-manifest-tGYOCdor.cjs +0 -2
  156. package/dist/chunks/build-source-snapshot-CzwiB8HK.cjs +0 -26
  157. package/dist/chunks/collect-translatable-strings-BB6KpZT2.cjs +0 -1
  158. package/dist/chunks/collect-watch-inputs-Dn6g1cNu.cjs +0 -1
  159. package/dist/chunks/compile-application-translations-S-xuODkF.cjs +0 -870
  160. package/dist/chunks/constants-Bw_pUpSi-BsJPlw-e.cjs +0 -55
  161. package/dist/chunks/convert-to-label-CbLHl7Lv.cjs +0 -1
  162. package/dist/chunks/create-http-status-error-DBUhBnxP.cjs +0 -1
  163. package/dist/chunks/create-metadata-client-wHecaKNL.cjs +0 -6
  164. package/dist/chunks/create-pull-base-write-BZnZwrLk.cjs +0 -1
  165. package/dist/chunks/create-rest-client-B-kdRm7C.cjs +0 -1
  166. package/dist/chunks/extract-manifest-from-file-CNGCZF6o.cjs +0 -1
  167. package/dist/chunks/extract-source-translations-BHWNS2e9.cjs +0 -1
  168. package/dist/chunks/fetch-workspace-or-throw-CBKYiJI0.cjs +0 -1
  169. package/dist/chunks/format-body-C7fmVDAZ.cjs +0 -1
  170. package/dist/chunks/format-data-value-DuQjxLye.cjs +0 -1
  171. package/dist/chunks/format-metadata-fields-DPClLlzD.cjs +0 -2
  172. package/dist/chunks/format-metadata-owner-ffrpq9D6.cjs +0 -1
  173. package/dist/chunks/format-progress-line-Cj65-DU5.cjs +0 -1
  174. package/dist/chunks/generate-application-client-DjE_Tp0M.cjs +0 -1
  175. package/dist/chunks/get-function-input-schema-GNk3NRLJ-DscBUsKy.cjs +0 -1
  176. package/dist/chunks/get-local-status-D52rgA2e.cjs +0 -1
  177. package/dist/chunks/get-system-view-universal-identifier.util-DgYnPEO1-CKEQWit5.cjs +0 -1
  178. package/dist/chunks/global-flags.constant-C8Yu1rWc.cjs +0 -1
  179. package/dist/chunks/is-access-token-expiring-Cin0OQ-E.cjs +0 -1
  180. package/dist/chunks/is-application-not-found-error-BAsQDAoQ.cjs +0 -1
  181. package/dist/chunks/is-exported-manifest-COVWXnDs.cjs +0 -1
  182. package/dist/chunks/is-locale-catalog-D0wFrW8f.cjs +0 -1
  183. package/dist/chunks/is-supported-locale-C33Of85N.cjs +0 -1
  184. package/dist/chunks/is-valid-package-name-CfHS8_Lr.cjs +0 -1
  185. package/dist/chunks/kebab-case-D0usAzG-.cjs +0 -1
  186. package/dist/chunks/list-application-source-files-jEau5Rie.cjs +0 -1
  187. package/dist/chunks/locale-catalog-format-Cg9YplKA.cjs +0 -20
  188. package/dist/chunks/metadata-Db5EuDpT.cjs +0 -1
  189. package/dist/chunks/parse-api-url-jHzjLWX1.cjs +0 -1
  190. package/dist/chunks/parse-app-export-Dnu8mFrS.cjs +0 -1
  191. package/dist/chunks/parse-extraction-locale-h0bmy8hf.cjs +0 -1
  192. package/dist/chunks/parse-graphql-response-BSRJqolm.cjs +0 -1
  193. package/dist/chunks/parse-json-input-CN9Wyj73.cjs +0 -1
  194. package/dist/chunks/print-typescript-value-BsjFUceV.cjs +0 -3
  195. package/dist/chunks/pull-minimum-sdk-version.constant-BxmmUfee.cjs +0 -6
  196. package/dist/chunks/pull-source-BPng2lln.cjs +0 -1
  197. package/dist/chunks/read-app-identity-yX9-Ylxj.cjs +0 -1
  198. package/dist/chunks/read-application-identifier-DuI_jnU7.cjs +0 -1
  199. package/dist/chunks/read-application-identity-BFQ0oOna.cjs +0 -1
  200. package/dist/chunks/read-bounded-body-BHRu5J2Y.cjs +0 -1
  201. package/dist/chunks/read-command-values-rGaU2qHz.cjs +0 -1
  202. package/dist/chunks/read-config-DdGLulo-.cjs +0 -1
  203. package/dist/chunks/read-infer-deletion-option-uFunybak.cjs +0 -8
  204. package/dist/chunks/read-json-object-DcNHNB8I.cjs +0 -1
  205. package/dist/chunks/read-local-container-CPiVE1-D.cjs +0 -1
  206. package/dist/chunks/read-snapshot-file-BPLzlSH_.cjs +0 -1
  207. package/dist/chunks/record-pull-base-RQ2mlIWr.cjs +0 -1
  208. package/dist/chunks/request-oauth-tokens-Bp2eRh4F.cjs +0 -1
  209. package/dist/chunks/resolve-app-project-aqOLK3Gb.cjs +0 -1
  210. package/dist/chunks/resolve-command-target-D4gMeXgA.cjs +0 -1
  211. package/dist/chunks/resolve-inside-sdk-Ca2uRzQW.cjs +0 -1
  212. package/dist/chunks/resolve-metadata-object-xK90Ursp.cjs +0 -1
  213. package/dist/chunks/resolve-project-typescript-DkwXiCmt.cjs +0 -1
  214. package/dist/chunks/resolve-request-url-I1EOOumy.cjs +0 -1
  215. package/dist/chunks/resolve-source-sdk-CggXRBVx.cjs +0 -1
  216. package/dist/chunks/run-api-graphql-command-C3sJMP8H.cjs +0 -1
  217. package/dist/chunks/run-api-rest-command-DQOP-cn8.cjs +0 -1
  218. package/dist/chunks/run-app-build-command-CaInzuD2.cjs +0 -2
  219. package/dist/chunks/run-app-exec-command-DMHS9gpq.cjs +0 -3
  220. package/dist/chunks/run-app-generate-client-command-Ddq9lT40.cjs +0 -2
  221. package/dist/chunks/run-app-install-command-DUB3JTon.cjs +0 -1
  222. package/dist/chunks/run-app-logs-command-CQHxh_Dt.cjs +0 -9
  223. package/dist/chunks/run-app-operation-KdXiXPb6.cjs +0 -1
  224. package/dist/chunks/run-app-publish-command-DEV9zgL1.cjs +0 -1
  225. package/dist/chunks/run-app-pull-command-B-hxnqvY.cjs +0 -6
  226. package/dist/chunks/run-app-translations-extract-command-C0OfqFii.cjs +0 -2
  227. package/dist/chunks/run-auth-login-command-CVLvoJ7G.cjs +0 -1
  228. package/dist/chunks/run-auth-status-command-X0m6rzI-.cjs +0 -1
  229. package/dist/chunks/run-commands-command-hMdnwU8-.cjs +0 -2
  230. package/dist/chunks/run-data-get-command-DFE4NM2R.cjs +0 -1
  231. package/dist/chunks/run-data-list-command-BMEzitv6.cjs +0 -1
  232. package/dist/chunks/run-doctor-command-Bj2UR9ai.cjs +0 -2
  233. package/dist/chunks/run-local-logs-command-mUwB2XdV.cjs +0 -1
  234. package/dist/chunks/run-local-reset-command-WooW50PQ.cjs +0 -2
  235. package/dist/chunks/run-local-start-command-CiXP155w.cjs +0 -1
  236. package/dist/chunks/run-local-stop-command-BuV_YdJ7.cjs +0 -1
  237. package/dist/chunks/run-local-upgrade-command--O_EiVZc.cjs +0 -1
  238. package/dist/chunks/run-metadata-field-describe-command-iEw4KqIg.cjs +0 -3
  239. package/dist/chunks/run-open-command-DWLQ7z_P.cjs +0 -1
  240. package/dist/chunks/select-target-BHGEOc55.cjs +0 -1
  241. package/dist/chunks/sign-in-to-remote-again-DF27JFsz.cjs +0 -1
  242. package/dist/chunks/sign-in-with-browser-BNG4oa7e.cjs +0 -124
  243. package/dist/chunks/to-public-target-D00so1uO.cjs +0 -1
  244. package/dist/chunks/to-worker-output-diagnostics-WZlUWvcj.cjs +0 -2
  245. package/dist/chunks/utils-Ds_lD5Ag-DfSfzJJP.cjs +0 -11
  246. package/dist/chunks/wait-for-local-environment-CjCRJnhK.cjs +0 -1
  247. package/dist/chunks/write-config-atomically-CQdFdvWo.cjs +0 -1
  248. /package/dist/chunks/{capitalize-DFPVt1IM-CF4z3TZK.cjs → capitalize-CF4z3TZK.cjs} +0 -0
  249. /package/dist/chunks/{isDefined-Dtu5EYqP-CJctgvfE.cjs → isDefined-CJctgvfE.cjs} +0 -0
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./fs-utils-DoSmCBu8.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./get-tooling-error-context-CZKTM7Q6.cjs"),o=require("./locale-catalog-format-BD4XDEnl.cjs"),s=require("./collect-translatable-strings-AWv41yIv.cjs"),c=require("./constants-Cf5-CwMu.cjs"),l=require("./build-source-manifest-Ddwa8ath.cjs"),u=require("./assert-pull-paths-TFGZvzZO.cjs"),d=require("./is-locale-catalog-T4W5NhnW.cjs"),f=require("./parse-extraction-locale-B0apfizg.cjs");let p=require("node:fs/promises"),m=require("node:path");var h=e.t(),g=e=>n.t(e)&&Object.values(e).every(e=>(0,h.isString)(e)||d.t(e)),_=async e=>{try{let t=await r.o(e);if(g(t))return t}catch(t){throw new i.t({code:`INVALID_INPUT`,message:`Cannot read translation catalog ${e}. No catalogs were updated.`,cause:t})}throw new i.t({code:`INVALID_INPUT`,message:`Invalid translation catalog ${e}. Expected messages or context groups with string translations. No catalogs were updated.`})},v=async({appPath:e,manifest:n,frontComponentSourcePaths:i=[],scaffoldLocale:a,signal:l})=>{l.throwIfAborted();let d=[...new Map([...s.t(n),...await s.n(i)].map(e=>[s.r(e.message,e.context),e])).values()],f=(0,m.join)(e,c.n);await u.t({appPath:e,relativePaths:[c.n]});let h=new Set((await r.i(f)?await(0,p.readdir)(f):[]).filter(e=>e.endsWith(`.json`)&&e!==`en.json`));t.t(a)&&h.add(`${a}.json`);let g=new Map([[`en.json`,o.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:e})))]]);await u.t({appPath:e,relativePaths:[...g.keys(),...h].map(e=>(0,m.join)(c.n,e))});for(let e of[...h].sort()){let t=(0,m.join)(f,e),n=await r.i(t)?await _(t):{},i=new Map(o.n(n).map(e=>[s.r(e.message,e.context),e.translation]));g.set(e,o.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:i.get(s.r(e,t))??``}))))}l.throwIfAborted();let v=(0,m.join)(`.twenty`,`cli`);await u.t({appPath:e,relativePaths:[v]}),await r.r(f),await r.r((0,m.join)(e,v));let y=await(0,p.mkdtemp)((0,m.join)(e,v,`extract-`));try{for(let[e,t]of g)l.throwIfAborted(),await r.c((0,m.join)(y,e),t);for(let e of g.keys())l.throwIfAborted(),await(0,p.rename)((0,m.join)(y,e),(0,m.join)(f,e))}finally{await(0,p.rm)(y,{recursive:!0,force:!0})}return{sourceCount:d.length,updatedLocaleFiles:[...g.keys()].map(e=>(0,m.join)(c.n,e))}},y=async({appPath:e,locale:t,signal:n})=>{let r=f.t(t),o=await l.buildSourceManifest({appPath:e,signal:n});if(!o.success)return o;try{return{success:!0,data:await v({appPath:e,manifest:o.data.manifest,frontComponentSourcePaths:o.data.filePaths.frontComponents.map(t=>(0,m.join)(e,t)),scaffoldLocale:r,signal:n}),diagnostics:o.diagnostics}}catch(e){if(!(e instanceof i.t)&&!(e instanceof u.n))throw e;return{success:!1,error:{code:e instanceof i.t?e.code:`APP_PATH_UNAVAILABLE`,message:e.message,...a.t(e)},diagnostics:o.diagnostics}}};exports.extractSourceTranslations=y;
@@ -1 +1 @@
1
- const e=require("./create-metadata-client-wHecaKNL.cjs"),t=require("./metadata-page.constant-qMNOJLjJ.cjs"),n=require("./resolve-metadata-object-xK90Ursp.cjs"),r=require("./format-metadata-owner-ffrpq9D6.cjs");var i={type:!0,sourceObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},targetObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},sourceFieldMetadata:{id:!0,name:!0},targetFieldMetadata:{id:!0,name:!0}},a=async({objectName:a,target:o,signal:s,output:c})=>{let l=e.t({target:o,signal:s}),u=await n.t({client:l,name:a}),[d,{currentWorkspace:f},{applications:p,areOwnersNamed:m}]=await Promise.all([t.n(async e=>{let{fields:n}=await l.query({fields:{__args:{paging:{first:t.t,after:e},filter:{objectMetadataId:{eq:u.id}}},pageInfo:{hasNextPage:!0,endCursor:!0},edges:{node:{id:!0,universalIdentifier:!0,objectMetadataId:!0,name:!0,label:!0,description:!0,type:!0,isActive:!0,isSystem:!0,isNullable:!0,isUnique:!0,defaultValue:!0,options:!0,settings:!0,applicationId:!0,relation:i,morphRelations:i}}}});return n}),l.query({currentWorkspace:{workspaceCustomApplicationId:!0}}),r.r(l)]);m||c.warn({code:`OWNERS_UNAVAILABLE`,message:`Owners other than Custom show as unknown: listing apps needs the Workspace Apps permission.`});let h=r.n({applications:p,workspaceCustomApplicationId:f.workspaceCustomApplicationId}),{applicationId:g,..._}=u;return{object:{..._,owner:h(g)},fields:d.map(({applicationId:e,...t})=>({...t,owner:h(e)})).sort((e,t)=>e.name.localeCompare(t.name))}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
1
+ const e=require("./create-metadata-client-FopHnDj0.cjs"),t=require("./metadata-page.constant-D4-pGQWp.cjs"),n=require("./resolve-metadata-object-7DhvIcEm.cjs"),r=require("./format-metadata-owner-ByoX2plp.cjs");var i={type:!0,sourceObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},targetObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},sourceFieldMetadata:{id:!0,name:!0},targetFieldMetadata:{id:!0,name:!0}},a=async({objectName:a,target:o,signal:s,output:c})=>{let l=e.t({target:o,signal:s}),u=await n.t({client:l,name:a}),[d,{currentWorkspace:f},{applications:p,areOwnersNamed:m}]=await Promise.all([t.n(async e=>{let{fields:n}=await l.query({fields:{__args:{paging:{first:t.t,after:e},filter:{objectMetadataId:{eq:u.id}}},pageInfo:{hasNextPage:!0,endCursor:!0},edges:{node:{id:!0,universalIdentifier:!0,objectMetadataId:!0,name:!0,label:!0,description:!0,type:!0,isActive:!0,isSystem:!0,isNullable:!0,isUnique:!0,defaultValue:!0,options:!0,settings:!0,applicationId:!0,relation:i,morphRelations:i}}}});return n}),l.query({currentWorkspace:{workspaceCustomApplicationId:!0}}),r.r(l)]);m||c.warn({code:`OWNERS_UNAVAILABLE`,message:`Owners other than Custom show as unknown: listing apps needs the Workspace Apps permission.`});let h=r.n({applications:p,workspaceCustomApplicationId:f.workspaceCustomApplicationId}),{applicationId:g,..._}=u;return{object:{..._,owner:h(g)},fields:d.map(({applicationId:e,...t})=>({...t,owner:h(e)})).sort((e,t)=>e.name.localeCompare(t.name))}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./create-metadata-client-wHecaKNL.cjs");var n=e.n({fetchSignedInIdentity:()=>r}),r=async({target:e,signal:n})=>{let r=t.t({target:e,signal:n});if(e.credentialKind===`apiKey`){let{currentWorkspace:e}=await r.query({currentWorkspace:{displayName:!0}});return{workspaceName:e.displayName??null,email:null}}let{currentWorkspace:i,currentUser:a}=await r.query({currentWorkspace:{displayName:!0},currentUser:{email:!0}});return{workspaceName:i.displayName??null,email:a.email}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./create-metadata-client-FopHnDj0.cjs");var n=e.n({fetchSignedInIdentity:()=>r}),r=async({target:e,signal:n})=>{let r=t.t({target:e,signal:n});if(e.credentialKind===`apiKey`){let{currentWorkspace:e}=await r.query({currentWorkspace:{displayName:!0}});return{workspaceName:e.displayName??null,email:null}}let{currentWorkspace:i,currentUser:a}=await r.query({currentWorkspace:{displayName:!0},currentUser:{email:!0}});return{workspaceName:i.displayName??null,email:a.email}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./isNonEmptyArray-v52xg4Xj.cjs"),i=require("./isValidUuid-D3NV1xmO.cjs"),a=require("./isValidUniversalIdentifier-DymFerYs.cjs"),o=require("./cli-error-CrUD8uMp.cjs"),s=require("./parse-app-export-BC81wdmc.cjs"),c=require("./is-application-not-found-error-CQ7k4hGU.cjs"),l=require("./create-metadata-client-FopHnDj0.cjs"),u=require("./create-app-not-installed-error-sN4TzjlV.cjs");var d=e=>Object.entries(e),f=e.t(),p=new Set([`APPLICATION_NOT_EXPORTABLE`,`STANDARD_APPLICATION_NOT_EXPORTABLE`]),m=({entry:e,status:t})=>(e.code===`GRAPHQL_VALIDATION_FAILED`||(0,f.isNull)(e.code)&&t===400)&&(0,f.isNull)(e.path),h=({error:e,messagePrefix:t})=>{if(!(e instanceof o.t)||e.code!==`GRAPHQL_ERROR`)return!1;let r=e.details?.errors;if(!(0,f.isArray)(r)||r.length!==1)return!1;let i=r[0];return n.t(i)&&m({entry:i,status:e.details?.status})&&(0,f.isString)(i.message)&&i.message.startsWith(t)},g=e=>{if(!(e instanceof o.t)||e.code!==`GRAPHQL_ERROR`)return!1;let t=e.details?.errors;if(!(0,f.isArray)(t)||t.length!==1)return!1;let r=t[0];return n.t(r)&&(0,f.isString)(r.subCode)&&p.has(r.subCode)},_=async({universalIdentifier:e,target:t,signal:i,shouldIncludeDependencies:a=!1,shouldIncludeSourceFiles:p=!1,shouldIncludePublicAssets:_=!1})=>{let v=l.t({target:t,signal:i}),y={shouldIncludeSourceFiles:p,shouldIncludePublicAssets:_},b=d(y).map(([e])=>e),x=()=>v.query({__name:`ExportApplication`,exportApplication:{__args:{universalIdentifier:e,...Object.fromEntries(Object.entries(y).filter(([,e])=>e)),...a?{shouldIncludeDependencies:!0}:{}},application:{universalIdentifier:!0,displayName:!0,sourceType:!0},manifest:!0,coverage:{metadataName:!0,universalIdentifier:!0,status:!0,reason:!0},files:{folder:!0,path:!0,content:!0}}});try{let t=async()=>{try{return await x()}catch(e){if(!(e instanceof o.t)||e.code!==`GRAPHQL_ERROR`)throw e;let i=e.details?.errors,a=new Set;if(!(0,f.isArray)(i)||!r.t(i)||!i.every(t=>{if(!n.t(t)||!m({entry:t,status:e.details?.status}))return!1;let r=t.message,i=b.find(e=>y[e]&&(0,f.isString)(r)&&r.startsWith(`Unknown argument "${e}" on field "Query.exportApplication".`));return i?(a.add(i),!0):!1}))throw e;for(let e of a)y[e]=!1;return t()}};return s.t({value:(await t())?.exportApplication,universalIdentifier:e})}catch(n){throw c.t({error:n,field:`exportApplication`})?u.t({universalIdentifier:e,apiUrl:t.apiUrl}):h({error:n,messagePrefix:`Cannot query field "exportApplication" on type "Query".`})?new o.t({code:`APP_EXPORT_UNSUPPORTED`,message:`This server does not support application export.`}):g(n)?new o.t({code:`APP_NOT_EXPORTABLE`,message:n.message,hint:`Only apps developed locally can be pulled: not the standard app, and not apps installed from a package.`,details:{universalIdentifier:e}}):n}},v=async({target:e,signal:r,shouldIncludeCustomApplication:s=!1})=>{let c=(await l.t({target:e,signal:r}).query({currentWorkspace:{id:!0,...s?{workspaceCustomApplication:{universalIdentifier:!0}}:{}}}))?.currentWorkspace;if(!n.t(c)||!(0,f.isNonEmptyString)(c.id)||!i.t(c.id))throw new o.t({code:`INVALID_RESPONSE`,message:`${e.apiUrl} did not say which workspace these credentials belong to.`});if(s&&t.t(c.workspaceCustomApplication)&&(!n.t(c.workspaceCustomApplication)||!(0,f.isNonEmptyString)(c.workspaceCustomApplication.universalIdentifier)||!a.t(c.workspaceCustomApplication.universalIdentifier)))throw new o.t({code:`INVALID_RESPONSE`,message:`${e.apiUrl} returned an invalid workspace custom application identifier.`});return c};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs");var n=e.t(),r=e=>t.t(e)?(0,n.isString)(e)?e:JSON.stringify(e,null,2):``;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs");var r=e.t(),i=[`name`,`title`,`subject`],a=3,o=e=>n.t(e)&&(0,r.isNonEmptyString)(e.id),s=e=>i.map(t=>e[t]).find(t.t),c=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,l=e=>{if(e.length===0)return`-`;if(e.every(o)){let t=e.slice(0,a).map(e=>u(s(e)??e.id)),n=e.length>a?`, …`:``;return`${e.length} ${e.length===1?`record`:`records`} returned · ${t.join(`, `)}${n}`}return e.some(e=>n.t(e)||(0,r.isArray)(e))?JSON.stringify(e):e.map(u).join(`, `)},u=e=>{if(!t.t(e))return`-`;if((0,r.isString)(e))return/[\x00-\x1f\x7f-\x9f]/.test(e)?JSON.stringify(e).replace(/[\x7f-\x9f]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`):e;if((0,r.isArray)(e))return l(e);if(n.t(e)){if((0,r.isNonEmptyString)(e.firstName)||(0,r.isNonEmptyString)(e.lastName))return u([e.firstName,e.lastName].filter(r.isNonEmptyString).join(` `));if((0,r.isNonEmptyString)(e.primaryEmail))return u(e.primaryEmail);if((0,r.isNonEmptyString)(e.primaryLinkUrl))return u(e.primaryLinkUrl);let n=o(e)?s(e):void 0;if(t.t(n))return`${u(n)} (${u(e.id)})`}return JSON.stringify(e)},d=e=>c(u(e),60),f=e=>c(u(e),120);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
@@ -0,0 +1,2 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./style-BR52fK4V.cjs"),i=require("./format-table-4drtI5sP.cjs"),a=require("./format-metadata-owner-ByoX2plp.cjs");var o=e.t(),s=e=>{let t=e.options;return(0,o.isArray)(t)?t.filter(n.t):[]},c=e=>(t.t(e.relation)?[e.relation]:(e.morphRelations??[]).filter(t=>t.sourceFieldMetadata.id===e.id)).map(e=>`${e.type.toLowerCase().replaceAll(`_`,`-`)} · ${e.targetObjectMetadata.namePlural}.${e.targetFieldMetadata.name}`).join(` · `),l=e=>[e.isActive===!1?`inactive`:``,e.isNullable===!1?`required`:``,e.isUnique===!0?`unique`:``,c(e),...s(e).map(e=>String(e.label??e.value??``))].filter(o.isNonEmptyString).join(` · `),u=({fields:e,hiddenSystemFieldCount:t,labelIdentifierFieldMetadataId:n})=>[i.t({rows:e,columns:[{header:`FIELD`,value:e=>e.name},{header:`LABEL`,value:e=>e.label},{header:`TYPE`,value:e=>e.type},{header:`OWNER`,value:e=>a.t(e.owner)},{header:`DETAILS`,value:e=>[e.id===n?`label field`:``,l(e)].filter(o.isNonEmptyString).join(` · `)}]}),r.i(t>0?`${e.length} fields · ${t} system fields hidden, show them with --all`:`${e.length} fields`)].join(`
2
+ `);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs"),t=require("./cli-error-CrUD8uMp.cjs");require("./TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs");const n=require("./style-BR52fK4V.cjs");var r=async e=>{try{let{findManyApplications:t}=await e.query({findManyApplications:{id:!0,name:!0,universalIdentifier:!0}});return{applications:t,areOwnersNamed:!0}}catch(e){if(!(e instanceof t.t)||e.code!==`PERMISSION_DENIED`)throw e;return{applications:[],areOwnersNamed:!1}}},i=({applications:t,workspaceCustomApplicationId:n})=>{let r=new Map(t.map(e=>[e.id,e]));return t=>{let i=r.get(t);return t===n?{kind:`custom`,applicationId:t,name:null}:e.t(i)?i.universalIdentifier===`20202020-64aa-4b6f-b003-9c74b97cee20`?{kind:`standard`,applicationId:t,name:null}:{kind:`application`,applicationId:t,name:i.name}:{kind:`unknown`,applicationId:t,name:null}}},a=e=>{switch(e.kind){case`standard`:return`Standard`;case`custom`:return n.n(`cyan`,`Custom`);case`application`:return n.n(`magenta`,e.name??`Unknown app`);case`unknown`:return n.n(`yellow`,`Unknown`)}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs");var t=({message:t,percentage:n})=>e.t(n)?`${t} ${n}%`:t;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1 @@
1
+ var e=[`B`,`KB`,`MB`,`GB`,`TB`],t=({bytes:e,unitIndex:t})=>Number((e/1024**t).toFixed(t===0?0:1)),n=n=>{let r=Math.min(e.length-1,n>0?Math.floor(Math.log(n)/Math.log(1024)):0),i=r<e.length-1&&t({bytes:n,unitIndex:r})>=1024?r+1:r;return`${t({bytes:n,unitIndex:i})} ${e[i]}`};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./get-client-sdk-package-path-2U3kDCRq.cjs"),i=require("./read-json-object-BMftwGZ5.cjs"),a=require("./resolve-inside-sdk-DA7EQpf0.cjs"),o=require("./validate-app-path-Dau-PC0a.cjs");let s=require("node:fs/promises"),c=require("node:path"),l=require("node:module");var u=e.t(),d=async({appPath:e,schema:d,signal:f})=>{let p=await o.t(e);if(!p.success)return p;try{if(f?.throwIfAborted(),!(0,u.isNonEmptyString)(d))throw Error(`schema must be a non-empty GraphQL schema string.`);let o=r.t({appPath:e});if((await i.t((0,c.join)(o,`package.json`)))?.name!==`twenty-client-sdk`)throw Error(`Expected twenty-client-sdk in the app node_modules directory.`);let p=(0,l.createRequire)((0,c.join)(o,`package.json`)),m=a.t({resolveFromApp:p.resolve,specifier:`twenty-client-sdk/generate`,sdkPath:await(0,s.realpath)(o)});if(!t.t(m))throw Error(`The app's twenty-client-sdk does not provide its own generate entry point. Install a compatible twenty-client-sdk version in this app.`);f?.throwIfAborted();let h=p(m);if(!n.t(h)||!(0,u.isFunction)(h.replaceCoreClient))throw Error(`The app's twenty-client-sdk/generate must export replaceCoreClient.`);return f?.throwIfAborted(),await h.replaceCoreClient({packageRoot:o,schema:d}),f?.throwIfAborted(),{success:!0,data:null,diagnostics:[]}}catch(e){return{success:!1,error:{code:f?.aborted&&Object.is(e,f.reason)?`CANCELLED`:`CLIENT_GENERATION_FAILED`,message:e instanceof Error?e.message:String(e)},diagnostics:[]}}};exports.generateApplicationClient=d;
@@ -1 +1 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./get-client-sdk-package-path-2U3kDCRq.cjs"),n=require("./has-error-code-DsJeqbZq.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./to-worker-output-diagnostics-WZlUWvcj.cjs"),a=require("./create-metadata-client-wHecaKNL.cjs"),o=require("./create-tooling-failure-0Foyei1R.cjs");let s=require("node:fs/promises");var c=e.t(),l=async({applicationUniversalIdentifier:e,context:{target:t,signal:n,output:i}})=>{i.progress({message:`Fetching the application schema…`});let o=(await a.t({target:t,signal:n}).query({__name:`ApplicationCoreGraphqlSchema`,applicationCoreGraphqlSchema:{__args:{applicationUniversalIdentifier:e}}}))?.applicationCoreGraphqlSchema;if(!(0,c.isNonEmptyString)(o)||o.trim().length===0)throw new r.t({code:`INVALID_RESPONSE`,message:`The server did not return an application GraphQL schema.`});return o},u=async({appPath:e,schema:t,sdk:n,context:{signal:r,output:a,outputMode:s}})=>{a.progress({message:`Generating the typed API client…`});let c=await i.n({request:{type:`generateSourceClient`,appPath:e,schema:t},signal:r}),l=i.s({value:c.result,parseData:i.o}),u=[...l.diagnostics,...i.t(c.output)];if(s===`human`)for(let e of u)a.progress({message:i.c(e)});if(!l.success)throw o.t({error:l.error,diagnostics:u,sdkVersion:n.version,operation:`generateClient`});return r.throwIfAborted(),u},d=async e=>u({...e,schema:await l(e)}),f=async({appPath:e})=>{if(await(0,s.lstat)(t.t({appPath:e})).then(()=>!1,e=>n.t(e,`ENOENT`)))return`twenty-client-sdk is not installed in the app's own node_modules.`};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./get-client-sdk-package-path-2U3kDCRq.cjs"),n=require("./has-error-code-DsJeqbZq.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./to-worker-output-diagnostics-w1hZPfn0.cjs"),a=require("./create-metadata-client-FopHnDj0.cjs"),o=require("./create-tooling-failure-0Foyei1R.cjs");let s=require("node:fs/promises");var c=e.t(),l=async({applicationUniversalIdentifier:e,context:{target:t,signal:n,output:i}})=>{i.progress({message:`Fetching the application schema…`});let o=(await a.t({target:t,signal:n}).query({__name:`ApplicationCoreGraphqlSchema`,applicationCoreGraphqlSchema:{__args:{applicationUniversalIdentifier:e}}}))?.applicationCoreGraphqlSchema;if(!(0,c.isNonEmptyString)(o)||o.trim().length===0)throw new r.t({code:`INVALID_RESPONSE`,message:`The server did not return an application GraphQL schema.`});return o},u=async({appPath:e,schema:t,sdk:n,context:{signal:r,output:a,outputMode:s}})=>{a.progress({message:`Generating the typed API client…`});let c=await i.n({request:{type:`generateSourceClient`,appPath:e,schema:t},signal:r}),l=i.s({value:c.result,parseData:i.o}),u=[...l.diagnostics,...i.t(c.output)];if(s===`human`)for(let e of u)a.progress({message:i.c(e)});if(!l.success)throw o.t({error:l.error,diagnostics:u,sdkVersion:n.version,operation:`generateClient`});return r.throwIfAborted(),u},d=async e=>u({...e,schema:await l(e)}),f=async({appPath:e})=>{if(await(0,s.lstat)(t.t({appPath:e})).then(()=>!1,e=>n.t(e,`ENOENT`)))return`twenty-client-sdk is not installed in the app's own node_modules.`};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -0,0 +1 @@
1
+ const e=require("./isValidUniversalIdentifier-DymFerYs.cjs");var t=function(e){return e.ACTOR=`ACTOR`,e.ADDRESS=`ADDRESS`,e.ARRAY=`ARRAY`,e.BOOLEAN=`BOOLEAN`,e.CURRENCY=`CURRENCY`,e.DATE=`DATE`,e.DATE_TIME=`DATE_TIME`,e.EMAILS=`EMAILS`,e.FILES=`FILES`,e.FULL_NAME=`FULL_NAME`,e.LINKS=`LINKS`,e.MORPH_RELATION=`MORPH_RELATION`,e.MULTI_SELECT=`MULTI_SELECT`,e.NUMBER=`NUMBER`,e.NUMERIC=`NUMERIC`,e.PHONES=`PHONES`,e.POSITION=`POSITION`,e.RATING=`RATING`,e.RAW_JSON=`RAW_JSON`,e.RELATION=`RELATION`,e.RICH_TEXT=`RICH_TEXT`,e.SELECT=`SELECT`,e.TEXT=`TEXT`,e.TS_VECTOR=`TS_VECTOR`,e.UUID=`UUID`,e}({}),n=function(e){return e.MANY_TO_ONE=`MANY_TO_ONE`,e.ONE_TO_MANY=`ONE_TO_MANY`,e}({});function r(t){if(!e.n(t))throw TypeError(`Invalid UUID`);let n;return Uint8Array.of((n=parseInt(t.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(t.slice(9,13),16))>>>8,n&255,(n=parseInt(t.slice(14,18),16))>>>8,n&255,(n=parseInt(t.slice(19,23),16))>>>8,n&255,(n=parseInt(t.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}var i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));function a(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+`-`+i[e[t+4]]+i[e[t+5]]+`-`+i[e[t+6]]+i[e[t+7]]+`-`+i[e[t+8]]+i[e[t+9]]+`-`+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}function o(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 s=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,c=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function l(e,t,n,i,s,c){let l=typeof n==`string`?o(n):n,u=typeof i==`string`?r(i):i;if(typeof i==`string`&&(i=r(i)),i?.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 a(d)}function u(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 d(e,t){return e<<t|e>>>32-t}function f(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]=d(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],c=n[3],l=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=d(i,5)+u(n,a,s,c)+l+t[n]+r[e]>>>0;l=c,c=s,s=d(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]+c>>>0,n[4]=n[4]+l>>>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 p(e,t,n,r){return l(80,f,e,t,n,r)}p.DNS=s,p.URL=c;var m=({entityNamespace:e,value:t,applicationUniversalIdentifier:n})=>p(`${e}:${t}`,n),h=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n})=>m({entityNamespace:`fieldMetadata`,value:`${t}:${n}`,applicationUniversalIdentifier:e});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs");let t=require("typescript");var n=`TwentyRecord`,r=n=>{let r=n.typeArguments?.[0];if(e.t(r)&&r.kind===t.SyntaxKind.LiteralType&&r.literal.kind===t.SyntaxKind.StringLiteral)return r.literal.text},i=e=>e.type===`record`?{type:`records`,objectUniversalIdentifier:e.objectUniversalIdentifier}:{type:`array`,items:e},a=o=>{switch(o.kind){case t.SyntaxKind.NumberKeyword:return{type:`number`};case t.SyntaxKind.StringKeyword:return{type:`string`};case t.SyntaxKind.BooleanKeyword:return{type:`boolean`};case t.SyntaxKind.ArrayType:return i(a(o.elementType));case t.SyntaxKind.TypeReference:{let s=o,c=s.typeName.kind===t.SyntaxKind.Identifier?s.typeName.text:void 0;if(c===`Array`||c===`ReadonlyArray`){let t=s.typeArguments?.[0];return i(e.t(t)?a(t):{})}if(c===n){let t=r(s);if(e.t(t))return{type:`record`,objectUniversalIdentifier:t}}return{}}case t.SyntaxKind.ObjectKeyword:return{type:`object`};case t.SyntaxKind.TypeLiteral:{let t={};return o.members.forEach(n=>{if(e.t(n.name)&&e.t(n.type)){let e=n.name.text;t[e]=a(n.type)}}),{type:`object`,properties:t}}case t.SyntaxKind.UnionType:{let e=o,n=[],r=!0;return e.types.forEach(e=>{if(e.kind===t.SyntaxKind.LiteralType){let i=e.literal;i.kind===t.SyntaxKind.StringLiteral?n.push(i.text):r=!1}else r=!1}),r?{type:`string`,enum:n}:{}}default:return{}}},o=(t,n)=>t.parameters.reduce((t,n)=>{let r=n.type;return e.t(r)?[...t,a(r)]:[...t,{}]},n),s=n=>n.kind===t.SyntaxKind.FunctionDeclaration?[n]:n.kind===t.SyntaxKind.VariableStatement?n.declarationList.declarations.filter(n=>e.t(n.initializer)&&n.initializer.kind===t.SyntaxKind.ArrowFunction).map(e=>e.initializer):[],c=e=>{let n=(0,t.createSourceFile)(`temp.ts`,e,t.ScriptTarget.ESNext,!0),r=[];return n.forEachChild(e=>{(e.kind===t.SyntaxKind.FunctionDeclaration||e.kind===t.SyntaxKind.VariableStatement)&&s(e).forEach(e=>{r=o(e,r)})}),r};exports.getFunctionInputSchema=c;
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs");var t=async({port:e,signal:t})=>{try{let n=await fetch(`http://127.0.0.1:${e}/healthz`,{signal:AbortSignal.any([t,AbortSignal.timeout(3e3)]),redirect:`error`});return await n.body?.cancel(),n.ok}catch{return t.throwIfAborted(),!1}},n=async({environment:n,container:r,signal:i})=>{let a={name:n.name,url:`http://localhost:${r?.port??n.port}`,image:r?.image??null};if(!e.t(r))return{...a,status:`not-created`};if(!r.isRunning)return{...a,status:`stopped`};let o=await t({port:r.port,signal:i});return{...a,status:o?`healthy`:`starting`}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -0,0 +1 @@
1
+ var e={path:[`data`,`export`],description:`Export records to a CSV file with server-side permissions`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--output <file>`,description:`Destination CSV file (required)`},{flags:`--fields <names>`,description:`Comma-separated field API names, in CSV order (default: active non-system fields)`},{flags:`--filter <expression>`,description:`REST filter expression, as in data list`},{flags:`--order-by <expression>`,description:`REST order_by expression, as in data list`},{flags:`--force`,description:`Replace an existing output file after a successful download`}],examples:[`twenty data export companies --output companies.csv`,`twenty data export companies --fields name,domainName,employees --filter 'employees[gte]:5000' --output large-companies.csv`,`twenty data export people --output people.csv --format ndjson`],outputModes:[`human`,`json`,`ndjson`],writes:!0,needsProject:!1,needsTarget:!0,requiredPermissions:[`EXPORT_CSV`],load:async()=>(await Promise.resolve().then(()=>require("./run-data-export-command-C4_7rc0v.cjs"))).runDataExportCommand},t={path:[`local`,`start`],description:`Start the local Twenty development environment`,options:[{flags:`-p, --port <port>`,description:`HTTP port for a new instance (default: 2020, or 2021 with --test)`},{flags:`--test`,description:`Use the separate local test instance`}],arguments:[{name:`version`,description:`Twenty version or image tag (new instances: engines.twenty, then latest)`,required:!1}],examples:[`twenty local start`,`twenty local start 2.53.1 --test`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-start-command-DsFS9_ew.cjs"))).runLocalStartCommand},n={path:[`local`,`stop`],description:`Stop the local environment, preserving its data`,options:[{flags:`--test`,description:`Use the separate local test instance`}],examples:[`twenty local stop`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-stop-command-D66F73fW.cjs"))).runLocalStopCommand},r={path:[`local`,`status`],description:`Show local environment status, URL and image`,options:[{flags:`--test`,description:`Use the separate local test instance`}],examples:[`twenty local status --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-status-command-BYxy0R9I.cjs"))).runLocalStatusCommand},i={path:[`local`,`logs`],description:`Stream local environment logs`,options:[{flags:`-n, --lines <lines>`,description:`Number of recent log lines (default: 50, maximum: 10000)`},{flags:`--no-follow`,description:`Print recent logs and exit`},{flags:`--test`,description:`Use the separate local test instance`}],examples:[`twenty local logs`,`twenty local logs --test --no-follow`],outputModes:[`human`,`ndjson`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-logs-command-COsSRk3f.cjs"))).runLocalLogsCommand},a={path:[`local`,`reset`],description:`Delete the local environment and all its data`,options:[{flags:`--yes`,description:`Delete the local environment and its data without asking`},{flags:`--test`,description:`Use the separate local test instance`}],examples:[`twenty local reset`,`twenty local reset --test --yes`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-reset-command-m0x-EiA6.cjs"))).runLocalResetCommand},o={path:[`local`,`upgrade`],description:`Upgrade the local environment, preserving its data volumes`,options:[{flags:`--test`,description:`Use the separate local test instance`}],arguments:[{name:`version`,description:`Twenty version or image tag (default: engines.twenty, then latest)`,required:!1}],examples:[`twenty local upgrade`,`twenty local upgrade 2.53.1 --test`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-local-upgrade-command-6P71bQw6.cjs"))).runLocalUpgradeCommand},s={path:[`app`,`install`],description:`Install a registered app package in the target workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Registered app universal identifier, works without a local project`}],examples:[`twenty app install --remote dev`,`twenty app install --path ./apps/billing --json`,`twenty app install --universal-identifier <id> --remote staging --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-install-command-DlcUupwk.cjs"))).runAppInstallCommand},c={path:[`app`,`publish`],description:`Build and publish the app to npm or a private Twenty registry`,options:[{flags:`--private`,description:`Publish to a Twenty server registry using --remote or the active target`},{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--tag <tag>`,description:`npm dist-tag, for example beta or next`}],examples:[`twenty app publish`,`twenty app publish --private --remote dev`,`twenty app publish --path ./apps/billing --tag beta --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-publish-command-BGNJVIBl.cjs"))).runAppPublishCommand},l={path:[`app`,`dev`],description:`Watch app source, build complete snapshots and sync changes to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Allow registering and installing an app with no registration`},{flags:`--yes`,description:`Allow object and field deletions without asking`}],examples:[`twenty app dev --remote dev`,`twenty app dev --create --no-prune`,`twenty app dev --format ndjson --no-prune`],outputModes:[`human`,`ndjson`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-dev-command-D1JOfJv6.cjs"))).runAppDevCommand},u={path:[`app`,`add`],description:`Add an object, field, logic function, front component or validation rule to an app`,arguments:[{name:`entity`,description:`object, field, logic-function, front-component or validation-rule (prompted when omitted)`,required:!1}],options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Definition name; also determines the generated filename`},{flags:`--create-view`,description:`Create a table view for the new object`},{flags:`--create-navigation-menu-item`,description:`Create a navigation menu item for the new object`},{flags:`--create-page-layout`,description:`Create a record page layout and its fields view for the new object`},{flags:`--name-plural <name>`,description:`Plural API name (object)`},{flags:`--label <label>`,description:`Display label (object or field; default: derived from name)`},{flags:`--label-plural <label>`,description:`Plural display label (object; default: derived from plural name)`},{flags:`--type <type>`,description:`Field type, for example TEXT, NUMBER or RELATION (default: TEXT)`},{flags:`--object <uuid>`,description:`Parent object universal identifier (field or validation rule)`},{flags:`--description <text>`,description:`Field description`},{flags:`--target-object <uuid>`,description:`Target object universal identifier (relation field)`},{flags:`--target-field <uuid>`,description:`Target field universal identifier (relation field)`},{flags:`--relation-type <type>`,description:`ONE_TO_MANY or MANY_TO_ONE (relation field; default: ONE_TO_MANY)`},{flags:`--on-delete <action>`,description:`CASCADE, RESTRICT, SET_NULL, NO_ACTION or None (relation field; default: CASCADE)`}],examples:[`twenty app add`,`twenty app add object --name invoice --name-plural invoices --no-input`,`twenty app add object --name invoice --name-plural invoices --create-view --create-navigation-menu-item --create-page-layout --no-input`,`twenty app add field --name amount --type NUMBER --object <object-universal-identifier> --json`,`twenty app add logic-function --name send-invoice --no-input`,`twenty app add front-component --name invoice-panel --no-input`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-add-command-b9sm20rn.cjs"))).runAppAddCommand},d={path:[`app`,`exec`],description:`Execute a deployed app logic function as the signed-in user`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Exact deployed function name`},{flags:`--universal-identifier <id>`,description:`Function universal identifier`},{flags:`--post-install`,description:`Execute the post-install hook without installing the app`},{flags:`--pre-install`,description:`Execute the pre-install hook without installing the app`},{flags:`--uninstall-hook`,description:`Execute the uninstall hook without uninstalling the app`},{flags:`--payload <json>`,description:`JSON object, @file or - for stdin (default: {})`}],examples:[`twenty app exec --name add-numbers --remote dev`,`twenty app exec --name add-numbers --payload @payload.json --json`,`twenty app exec --post-install --payload '{}'`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-exec-command-cw4vPVHE.cjs"))).runAppExecCommand},f={path:[`app`,`generate-client`],description:`Regenerate the app's typed API client from the workspace schema, without building or syncing`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app generate-client --remote dev`,`twenty app generate-client --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-app-generate-client-command-BVRFtPni.cjs"))).runAppGenerateClientCommand},p={path:[`app`,`logs`],description:`Watch new logic-function logs from this app`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Filter all functions with this exact name within the app`},{flags:`--universal-identifier <id>`,description:`Filter one function by universal identifier`}],examples:[`twenty app logs --remote dev`,`twenty app logs --name add-numbers --remote dev`,`twenty app logs --format ndjson`],outputModes:[`human`,`ndjson`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-logs-command-CaLIVesh.cjs"))).runAppLogsCommand},m={path:[`app`,`apply`],description:`Build the app, preview the changes, then upload and sync it to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Register the app and install it in the workspace if it has no registration yet`},{flags:`--yes`,description:`Apply object and field deletions without asking; does not change which entities are deleted`}],examples:[`twenty app apply --remote dev`,`twenty app apply --create --json`,`twenty app apply --no-prune`,`twenty app apply --prune`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-apply-command-CD7NOdiR.cjs"))).runAppApplyCommand},h={path:[`app`,`build`],description:`Build the app with the CLI and report the artifacts`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app build`,`twenty app build --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-build-command-C8ubC2GH.cjs"))).runAppBuildCommand},g={path:[`app`,`init`],description:`Create an app from the template bundled with this CLI, without installing anything`,arguments:[{name:`name`,description:`Package name of the app, for example my-app`,required:!0}],options:[{flags:`--path <directory>`,description:`Directory to create (default: ./<name>)`},{flags:`--display-name <name>`,description:`Name shown in Twenty (default: derived from the package name)`},{flags:`--description <text>`,description:`Description shown in Twenty`}],examples:[`twenty app init my-app`,`twenty app init billing --path ./apps/billing --display-name Billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-init-command-DuxE1JhM.cjs"))).runAppInitCommand},_={path:[`app`,`pull`],description:`Pull an app, or create a local project for the workspace custom app`,options:[{flags:`--path <directory>`,description:`App directory, or a new or empty directory for the workspace custom app`},{flags:`--yes`,description:`Create a missing project and install its dependencies without prompting`},{flags:`--verbose`,description:`List coverage details`}],examples:[`twenty app pull --remote dev`,`twenty app pull --path ./apps/billing`,`twenty app pull --path ./workspace-app --yes --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-pull-command-NbZ8fjhE.cjs"))).runAppPullCommand},v={path:[`app`,`plan`],description:`Build the app and preview metadata changes without applying them`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0}],examples:[`twenty app plan --remote dev`,`twenty app plan --path ./apps/billing --no-prune --json`,`twenty app plan --prune`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-plan-command-BGQ7vJZT.cjs"))).runAppPlanCommand},y={path:[`app`,`translations`,`extract`],description:`Extract app strings and update translation catalogs`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--locale <locale>`,description:`Create a target locale catalog if missing, for example fr-FR`}],examples:[`twenty app translations extract`,`twenty app translations extract --locale fr-FR`,`twenty app translations extract --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-translations-extract-command-CGIFvpC1.cjs"))).runAppTranslationsExtractCommand},b={path:[`app`,`typecheck`],description:`Typecheck the app with its project TypeScript, without building`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app typecheck`,`twenty app typecheck --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-typecheck-command-D0KV3hFS.cjs"))).runAppTypecheckCommand},x={path:[`app`,`uninstall`],description:`Uninstall the app from the workspace, deleting its objects, fields and their data`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Uninstall the app with this universal identifier, works without a local project`},{flags:`--yes`,description:`Uninstall without asking`}],examples:[`twenty app uninstall --remote dev`,`twenty app uninstall --yes --json`,`twenty app uninstall --universal-identifier <id> --yes`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-uninstall-command-CepQk4_4.cjs"))).runAppUninstallCommand},S={path:[`auth`,`login`],description:`Sign in with your browser or an API key, and save the remote`,options:[{flags:`--with-token`,description:`Read an API key from standard input`},{flags:`--url <url>`,description:`Twenty server URL, for example https://acme.twenty.com`},{flags:`--name <name>`,description:`Name of the remote to save (defaults to "default")`},{flags:`--use`,description:`Make this remote the default`},{flags:`--replace`,description:`Point an existing remote at a different URL`},{flags:`--proxy-header <header...>`,description:`Header for an authenticating proxy in front of the server, as "Name: value". Repeatable; saved on the remote`},{flags:`--proxy-header-command <command>`,description:`Shell command that prints proxy headers as "Name: value" lines, run when a request needs them; saved on the remote`}],examples:[`twenty auth login --url https://acme.twenty.com`,`twenty auth login --url https://acme.twenty.com --name prod --use`,`printf '%s' "$TWENTY_API_KEY" | twenty auth login --with-token --url https://acme.twenty.com --name prod --use`,`twenty auth login --with-token --remote prod < api-key.txt`,`twenty auth login --url https://twenty.example.com --proxy-header-command 'echo "cf-access-token: $(cloudflared access token -app=https://twenty.example.com)"'`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-login-command-DpS1bUdL.cjs"))).runAuthLoginCommand},C={path:[`auth`,`logout`],description:`Forget the credentials of a saved remote, keeping the remote`,examples:[`twenty auth logout --remote staging`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-logout-command-hvi_HvpQ.cjs"))).runAuthLogoutCommand},w={path:[`auth`,`status`],description:`Show which workspace commands use and check its credentials`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-status-command-Dr4YQuLn.cjs"))).runAuthStatusCommand},T={path:[`auth`,`token`],description:`Print the credential commands send, for scripts`,examples:[`curl -H "Authorization: Bearer $(twenty auth token)" https://acme.twenty.com/rest/companies`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-token-command-D4geJ-rx.cjs"))).runAuthTokenCommand},E={path:[`api`,`graphql`],description:`Send a GraphQL query or mutation`,options:[{flags:`--query <query>`,description:`GraphQL document: inline, @file.graphql, or - for standard input`,required:!0},{flags:`--variables <json>`,description:`Variables as a JSON object: inline, @file.json, or - for standard input`},{flags:`--metadata`,description:`Send to the metadata API instead of the core API`}],examples:[`twenty api graphql --query '{ companies(first: 2) { edges { node { name } } } }'`,`twenty api graphql --metadata --query '{ currentWorkspace { displayName } }'`,`twenty api graphql --query @create-company.graphql --variables @variables.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-graphql-command-ELrIPdM5.cjs"))).runApiGraphqlCommand},D={path:[`api`,`rest`],description:`Send a request to the REST API`,arguments:[{name:`path`,description:`Path under the API URL, for example /rest/companies`,required:!0}],options:[{flags:`-X, --method <method>`,description:`HTTP method, defaults to GET; required with --body`,choices:[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`]},{flags:`--body <json>`,description:`Request body: JSON, @file.json, or - for standard input`}],examples:[`twenty api rest '/rest/companies?limit=5'`,`twenty api rest /rest/companies --method POST --body '{"name":"Linear"}'`,`twenty api rest /rest/companies/<id> --method PATCH --body @changes.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-rest-command-COVnszcN.cjs"))).runApiRestCommand},O={WORKSPACE:`Workspace:`,APP:`App development:`,TOOLS:`Tools:`},k={path:[`commands`],description:`List the available commands`,helpGroup:O.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-commands-command-DYm9TuAx.cjs"))).runCommandsCommand},A={path:[`data`,`get`],description:`Inspect a record by id`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0},{name:`id`,description:`Record id`,required:!0}],examples:[`twenty data get companies <id>`,`twenty data get people <id> --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-get-command-CcEYQ4xO.cjs"))).runDataGetCommand},j={path:[`data`,`list`],description:`List records with REST filters and pagination`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--filter <expression>`,description:`REST filter expression, passed through unchanged`},{flags:`--order-by <expression>`,description:`REST order_by expression, passed through unchanged`},{flags:`--fields <names>`,description:`Comma-separated human table columns; JSON and NDJSON retain full records`},{flags:`--limit <count>`,description:`Records per page, 1–200 (default: 50)`},{flags:`--cursor <cursor>`,description:`Start after this opaque REST cursor`},{flags:`--all`,description:`Read every remaining page, bounded unless --format ndjson is used`}],examples:[`twenty data list companies --limit 20`,`twenty data list companies --filter 'employees[gte]:5000' --order-by 'employees[DescNullsLast]'`,`twenty data list people --all --format ndjson`],outputModes:[`human`,`json`,`ndjson`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-list-command-D0K7HFD-.cjs"))).runDataListCommand},M={path:[`doctor`],description:`Diagnose CLI, app SDK and workspace connection problems`,helpGroup:O.TOOLS,options:[{flags:`--path <directory>`,description:`App directory to inspect`},{flags:`--offline`,description:`Skip network checks`}],examples:[`twenty doctor`,`twenty doctor --remote staging --path ./my-app --json`,`twenty doctor --offline`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-doctor-command-fHf5vCGl.cjs"))).runDoctorCommand},N={path:[`metadata`,`object`,`describe`],description:`Describe an object`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],examples:[`twenty metadata object describe companies`,`twenty metadata object describe person --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-describe-command-WLxcOe4T.cjs"))).runMetadataObjectDescribeCommand},P={path:[`metadata`,`field`,`list`],description:`List fields and who owns each one`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--all`,description:`Include system fields`}],examples:[`twenty metadata field list companies`,`twenty metadata field list companies --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-list-command-CW2I6hmh.cjs"))).runMetadataFieldListCommand},F={path:[`metadata`,`field`,`describe`],description:`Describe a field, its constraints, options and relations`,arguments:[{name:`object`,description:`Exact singular or plural object API name`,required:!0},{name:`field`,description:`Exact field API name, including system fields`,required:!0}],examples:[`twenty metadata field describe companies tier`,`twenty metadata field describe people company --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-describe-command-nfKhj-m_.cjs"))).runMetadataFieldDescribeCommand},I={path:[`metadata`,`object`,`list`],description:`List objects and who owns each one`,options:[{flags:`--all`,description:`Include system objects`}],examples:[`twenty metadata object list`,`twenty metadata object list --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-list-command-Q4pwAEwO.cjs"))).runMetadataObjectListCommand},L={path:[`open`],description:`Open the workspace in your browser`,helpGroup:O.WORKSPACE,arguments:[{name:`page`,description:`Page to open, for example settings/applications`,required:!1}],options:[{flags:`--url-only`,description:`Print the address instead of opening a browser`}],examples:[`twenty open`,`twenty open settings/applications`,`twenty open --remote staging --url-only --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-open-command-DPrz3N1e.cjs"))).runOpenCommand},R={path:[`remote`,`list`],description:`List saved remotes`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-list-command-C2tZHRAT.cjs"))).runRemoteListCommand},z={path:[`remote`,`remove`],description:`Remove a saved remote and its credentials`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-remove-command-DgSQvjeN.cjs"))).runRemoteRemoveCommand},B={path:[`remote`,`rename`],description:`Rename a saved remote`,arguments:[{name:`current`,description:`Current name`,required:!0},{name:`new`,description:`New name`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-rename-command--37-GTRY.cjs"))).runRemoteRenameCommand},V={path:[`remote`,`use`],description:`Make a saved remote the default`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-use-command-B6obKSPB.cjs"))).runRemoteUseCommand},H={path:[`version`],description:`Print version information`,helpGroup:O.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-version-command-BWTSv9_Y.cjs"))).runVersionCommand},U=[t,n,r,i,a,o,u,m,l,d,p,h,f,g,v,_,c,y,b,s,x,S,C,w,T,R,V,B,z,E,D,k,j,e,A,M,I,N,P,F,L,H],W=e=>e.path.join(` `),G={JSON:`--json`,FORMAT:`--format <format>`,REMOTE:`-r, --remote <name>`,NO_INPUT:`--no-input`,HELP:`-h, --help`,VERSION:`-v, --version`};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return G}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./oauth-timing.constant-BClMQcKn.cjs");var i=e.t(),a=e=>{try{let t=JSON.parse(Buffer.from(e.split(`.`)[1]??``,`base64url`).toString());return n.t(t)&&(0,i.isNumber)(t.exp)?t.exp*1e3:void 0}catch{return}},o=e=>{let n=a(e);return t.t(n)&&n-r.t.REFRESH_MARGIN_MILLISECONDS<Date.now()};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isPlainObject-fJEJm71P.cjs"),n=require("./cli-error-CrUD8uMp.cjs");var r=e.t(),i=({error:e,field:i})=>{if(!(e instanceof n.t)||e.code!==`GRAPHQL_ERROR`)return!1;let a=e.details?.errors;if(!(0,r.isArray)(a)||a.length!==1)return!1;let o=a[0];return t.t(o)&&o.code===`NOT_FOUND`&&o.subCode===`APPLICATION_NOT_FOUND`&&((0,r.isNull)(o.path)||(0,r.isArray)(o.path)&&o.path[0]===i)};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./is-locale-catalog-T4W5NhnW.cjs");var i=e.t(),a={application:`application`,frontComponent:`frontComponents`,object:`objects`,field:`fields`,index:`indexes`,permissionFlag:`permissionFlags`,role:`roles`,view:`views`,viewField:`viewFields`,pageLayout:`pageLayouts`,pageLayoutTab:`pageLayoutTabs`,navigationMenuItem:`navigationMenuItems`,pageLayoutWidget:`pageLayoutWidgets`,workflow:`workflows`,skill:`skills`,agent:`agents`,validationRule:`validationRules`,relatedRecordPath:`relatedRecordPaths`},o=(e,r=[])=>!t.t(e)||(0,i.isArray)(e)&&e.every(e=>n.t(e)&&(0,i.isString)(e.universalIdentifier)&&r.every(t=>o(e[t],t===`tabs`?[`widgets`]:[]))),s=e=>n.t(e)&&n.t(e.application)&&(0,i.isString)(e.application.universalIdentifier)&&(!t.t(e.publicAssets)||(0,i.isArray)(e.publicAssets)&&e.publicAssets.every(e=>n.t(e)&&(0,i.isString)(e.filePath)))&&(!t.t(e.translations)||n.t(e.translations)&&Object.values(e.translations).every(r.t))&&Object.values(a).filter(e=>e!==`application`).every(t=>o(e[t],t===`objects`||t===`views`?[`fields`]:t===`pageLayouts`?[`tabs`]:t===`pageLayoutTabs`?[`widgets`]:[]))&&(!(0,i.isArray)(e.objects)||e.objects.every(e=>n.t(e)&&(0,i.isString)(e.nameSingular)));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs");var t=t=>e.t(t)&&typeof t==`object`&&!Array.isArray(t)&&Object.values(t).every(e=>typeof e==`string`);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -1 +1 @@
1
- var e={en:`en`,"pseudo-en":`pseudo-en`,"af-ZA":`af-ZA`,"ar-SA":`ar-SA`,"ca-ES":`ca-ES`,"cs-CZ":`cs-CZ`,"da-DK":`da-DK`,"de-DE":`de-DE`,"el-GR":`el-GR`,"es-ES":`es-ES`,"fa-IR":`fa-IR`,"fi-FI":`fi-FI`,"fr-FR":`fr-FR`,"he-IL":`he-IL`,"hu-HU":`hu-HU`,"hy-AM":`hy-AM`,"it-IT":`it-IT`,"ja-JP":`ja-JP`,"ko-KR":`ko-KR`,"nl-NL":`nl-NL`,"no-NO":`no-NO`,"pl-PL":`pl-PL`,"pt-BR":`pt-BR`,"pt-PT":`pt-PT`,"ro-RO":`ro-RO`,"ru-RU":`ru-RU`,"sr-Cyrl":`sr-Cyrl`,"sr-Latn":`sr-Latn`,"sv-SE":`sv-SE`,"tr-TR":`tr-TR`,"uk-UA":`uk-UA`,"uz-UZ":`uz-UZ`,"vi-VN":`vi-VN`,"zh-CN":`zh-CN`,"zh-TW":`zh-TW`};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
1
+ var e={en:`en`,"pseudo-en":`pseudo-en`,"af-ZA":`af-ZA`,"ar-SA":`ar-SA`,"ca-ES":`ca-ES`,"cs-CZ":`cs-CZ`,"da-DK":`da-DK`,"de-DE":`de-DE`,"el-GR":`el-GR`,"es-ES":`es-ES`,"fa-IR":`fa-IR`,"fi-FI":`fi-FI`,"fr-FR":`fr-FR`,"he-IL":`he-IL`,"hu-HU":`hu-HU`,"hy-AM":`hy-AM`,"it-IT":`it-IT`,"ja-JP":`ja-JP`,"ko-KR":`ko-KR`,"nl-NL":`nl-NL`,"no-NO":`no-NO`,"pl-PL":`pl-PL`,"pt-BR":`pt-BR`,"pt-PT":`pt-PT`,"ro-RO":`ro-RO`,"ru-RU":`ru-RU`,"sr-Cyrl":`sr-Cyrl`,"sr-Latn":`sr-Latn`,"sv-SE":`sv-SE`,"tr-TR":`tr-TR`,"uk-UA":`uk-UA`,"uz-UZ":`uz-UZ`,"vi-VN":`vi-VN`,"zh-CN":`zh-CN`,"zh-TW":`zh-TW`},t=t=>Object.prototype.hasOwnProperty.call(e,t);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./valid-BPaM0XRk.cjs"),n=require("./satisfies-Jm-ashRt.cjs"),r=require("./ltr-BS5BTFWS.cjs"),i=require("./isDefined-CJctgvfE.cjs"),a=require("./isNonEmptyArray-v52xg4Xj.cjs"),o=require("./has-error-code-DsJeqbZq.cjs"),s=require("./cli-error-CrUD8uMp.cjs"),c=require("./print-typescript-value-BjYn0ZFT.cjs"),l=require("./cli-version.constant-y_3mZ4gx.cjs"),u=require("./max-satisfying-BNYDQrne.cjs");let d=require("node:crypto"),f=require("node:fs/promises"),p=require("node:path"),m=require("node:fs");var h=`2.59.0`,g=[`twenty-client-sdk`,`twenty-sdk`,`twenty-ui`],_=e.t(((e,t)=>{var n=u.r();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),v=e.t(((e,n)=>{var r=t.f();n.exports=(e,t,n,i,a)=>{typeof n==`string`&&(a=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,a).version}catch{return null}}})),y=e.t(((e,t)=>{var n=u.r();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l)return!c.patch&&!c.minor?`major`:s.patch?`patch`:s.minor?`minor`:`major`;let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),b=e.t(((e,n)=>{var r=t.f();n.exports=(e,t)=>new r(e,t).major})),x=e.t(((e,n)=>{var r=t.f();n.exports=(e,t)=>new r(e,t).minor})),S=e.t(((e,n)=>{var r=t.f();n.exports=(e,t)=>new r(e,t).patch})),C=e.t(((e,t)=>{var n=u.r();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),w=e.t(((e,n)=>{var r=t.d();n.exports=(e,t,n)=>r(t,e,n)})),T=e.t(((e,n)=>{var r=t.d();n.exports=(e,t)=>r(e,t,!0)})),E=e.t(((e,n)=>{var r=t.f();n.exports=(e,t,n)=>{let i=new r(e,n),a=new r(t,n);return i.compare(a)||i.compareBuild(a)}})),D=e.t(((e,t)=>{var n=E();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),O=e.t(((e,t)=>{var n=E();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),k=e.t(((e,n)=>{var r=t.f(),i=u.r(),{safeRe:a,t:o}=t.m();n.exports=(e,t)=>{if(e instanceof r)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?a[o.COERCEFULL]:a[o.COERCE]);else{let r=t.includePrerelease?a[o.COERCERTLFULL]:a[o.COERCERTL],i;for(;(i=r.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||i.index+i[0].length!==n.index+n[0].length)&&(n=i),r.lastIndex=i.index+i[1].length+i[2].length;r.lastIndex=-1}if(n===null)return null;let s=n[2];return i(`${s}.${n[3]||`0`}.${n[4]||`0`}${t.includePrerelease&&n[5]?`-${n[5]}`:``}${t.includePrerelease&&n[6]?`+${n[6]}`:``}`,t)}})),A=e.t(((e,n)=>{var r=t.n();n.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),j=e.t(((e,n)=>{var r=t.f(),i=t.n();n.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new r(a,n))}),a}})),M=e.t(((e,n)=>{var r=t.f(),i=t.n(),a=t.c();n.exports=(e,t)=>{e=new i(e,t);let n=new r(`0.0.0`);if(e.test(n)||(n=new r(`0.0.0-0`),e.test(n)))return n;n=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],o=null;i.forEach(e=>{let t=new r(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||a(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!n||a(n,o))&&(n=o)}return n&&e.test(n)?n:null}})),N=e.t(((e,t)=>{var n=r.n();t.exports=(e,t,r)=>n(e,t,`>`,r)})),P=e.t(((e,n)=>{var r=t.n();n.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))})),F=e.t(((e,r)=>{var i=n.t(),a=t.d();r.exports=(e,t,n)=>{let r=[],o=null,s=null,c=e.sort((e,t)=>a(e,t,n));for(let e of c)i(e,t,n)?(s=e,o||=e):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let l=[];for(let[e,t]of r)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),I=e.t(((e,r)=>{var i=t.n(),a=t.r(),{ANY:o}=a,s=n.t(),c=t.d(),l=(e,t,n={})=>{if(e===t)return!0;e=new i(e,n),t=new i(t,n);let r=!1;OUTER:for(let i of e.set){for(let e of t.set){let t=f(i,e,n);if(r||=t!==null,t)continue OUTER}if(r)return!1}return!0},u=[new a(`>=0.0.0-0`)],d=[new a(`>=0.0.0`)],f=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===o){if(t.length===1&&t[0].semver===o)return!0;e=n.includePrerelease?u:d}if(t.length===1&&t[0].semver===o){if(n.includePrerelease)return!0;t=d}let r=new Set,i,a;for(let t of e)t.operator===`>`||t.operator===`>=`?i=p(i,t,n):t.operator===`<`||t.operator===`<=`?a=m(a,t,n):r.add(t.semver);if(r.size>1)return null;let l;if(i&&a&&(l=c(i.semver,a.semver,n),l>0||l===0&&(i.operator!==`>=`||a.operator!==`<=`)))return null;for(let e of r){if(i&&!s(e,String(i),n)||a&&!s(e,String(a),n))return null;for(let r of t)if(!s(e,String(r),n))return!1;return!0}let f,h,g,_,v=a&&!n.includePrerelease&&a.semver.prerelease.length?a.semver:!1,y=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&a.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,i){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(f=p(i,e,n),f===e&&f!==i)return!1}else if(i.operator===`>=`&&!s(i.semver,String(e),n))return!1}if(a){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=m(a,e,n),h===e&&h!==a)return!1}else if(a.operator===`<=`&&!s(a.semver,String(e),n))return!1}if(!e.operator&&(a||i)&&l!==0)return!1}return!(i&&g&&!a&&l!==0||a&&_&&!i&&l!==0||y||v)},p=(e,t,n)=>{if(!e)return t;let r=c(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},m=(e,t,n)=>{if(!e)return t;let r=c(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};r.exports=l})),L=e.t(((e,i)=>{var a=t.m(),o=t.h(),s=t.f(),c=t.p();i.exports={parse:u.r(),valid:u.n(),clean:_(),inc:v(),diff:y(),major:b(),minor:x(),patch:S(),prerelease:C(),compare:t.d(),rcompare:w(),compareLoose:T(),compareBuild:E(),sort:D(),rsort:O(),gt:t.c(),lt:t.o(),eq:t.u(),neq:t.l(),gte:t.s(),lte:t.a(),cmp:t.i(),coerce:k(),Comparator:t.r(),Range:t.n(),satisfies:n.t(),toComparators:A(),maxSatisfying:u.t(),minSatisfying:j(),minVersion:M(),validRange:t.t(),outside:r.n(),gtr:N(),ltr:r.t(),intersects:P(),simplifyRange:F(),subset:I(),SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:c.compareIdentifiers,rcompareIdentifiers:c.rcompareIdentifiers}})),R=e.r(L()),z=()=>(0,p.join)((0,p.dirname)((0,m.realpathSync)(process.argv[1]??``)),`app-template`),B=async({appDirectory:e,appName:t,appDisplayName:n,appDescription:r,shouldIncludeExample:i=!0})=>{let a=z(),o=(0,p.join)(a,`example`);await(0,f.cp)(a,e,{recursive:!0,filter:e=>e!==o}),i&&await(0,f.cp)((0,p.join)(o,`files`),e,{recursive:!0}),await(0,f.writeFile)((0,p.join)(e,`yarn.lock`),``,{flag:`a`});for(let[t,n]of[[`gitignore`,`.gitignore`],[`yarnrc.yml`,`.yarnrc.yml`]])await(0,f.rename)((0,p.join)(e,t),(0,p.join)(e,n));if(i){await(0,f.rename)((0,p.join)(e,`github`),(0,p.join)(e,`.github`)),await(0,f.cp)((0,p.join)(e,`AGENTS.md`),(0,p.join)(e,`CLAUDE.md`));for(let t of[`ci.yml`,`cd.yml`,`publish.yml`]){let n=(0,p.join)(e,`.github`,`workflows`,t);await(0,f.writeFile)(n,(await(0,f.readFile)(n,`utf8`)).replaceAll(`CLI-VERSION-TO-BE-GENERATED`,l.t))}let t=(0,p.join)(e,`src/constants/universal-identifiers.ts`);await(0,f.writeFile)(t,(await(0,f.readFile)(t,`utf8`)).replace(/'DISPLAY-NAME-TO-BE-GENERATED'/g,()=>c.n({value:n})).replace(/'DESCRIPTION-TO-BE-GENERATED'/g,()=>c.n({value:r})).replace(/UUID-TO-BE-GENERATED/g,()=>(0,d.randomUUID)()))}let s=(0,p.join)(e,`package.json`),u=JSON.parse(await(0,f.readFile)(s,`utf8`));u.name=t,u.engines.twenty=`>=${R.default.major(h)}.${R.default.minor(h)}.0`;for(let e of g)u.devDependencies[e]=h;if(i){let e=JSON.parse(await(0,f.readFile)((0,p.join)(o,`scripts.json`),`utf8`));u.scripts={...u.scripts,...e}}await(0,f.writeFile)(s,JSON.stringify(u,null,2))},V=`TO-BE-GENERATED`,H=`yarn.lock`,U=({appDirectory:e,reason:t})=>new s.t({code:`APP_PATH_UNAVAILABLE`,exitCode:s.n.CONFLICT,message:`${e} already exists and ${t}.`,hint:`Choose another app name, or pass --path with a new or empty directory.`,details:{path:e}}),W=async e=>{let t=await(0,f.stat)(e).catch(e=>{if(!o.t(e,`ENOENT`))throw e});if(!i.t(t))return`missing`;if(!t.isDirectory())throw U({appDirectory:e,reason:`is not a directory`});if(a.t(await(0,f.readdir)(e)))throw U({appDirectory:e,reason:`is not empty`});return`empty`},G=async e=>{let t=await(0,f.readdir)(e,{recursive:!0,withFileTypes:!0}),n=[];for(let r of t){let t=(0,p.join)(r.parentPath,r.name),i=(0,p.relative)(e,t);r.isFile()&&i!==H&&(await(0,f.readFile)(t,`utf8`)).includes(V)&&n.push(i)}return n},K=async({stagingDirectory:e,appDirectory:t})=>{let n=[];try{for(let r of await(0,f.readdir)(e,{recursive:!0,withFileTypes:!0})){let i=(0,p.join)(r.parentPath,r.name),a=(0,p.join)(t,(0,p.relative)(e,i));r.isDirectory()?await(0,f.mkdir)(a):await(0,f.copyFile)(i,a,m.constants.COPYFILE_EXCL),n.push({createdPath:a,isDirectory:r.isDirectory()})}}catch(e){for(let{createdPath:e,isDirectory:t}of n.reverse())await(t?(0,f.rmdir)(e):(0,f.unlink)(e)).catch(()=>void 0);throw e}await(0,f.rm)(e,{recursive:!0,force:!0})},q=async({appDirectory:e,appName:t,appDisplayName:n,appDescription:r,shouldIncludeExample:i=!0,signal:o})=>{await W(e);let c=(0,p.dirname)(e);await(0,f.mkdir)(c,{recursive:!0});let l=await(0,f.mkdtemp)((0,p.join)(c,`.${(0,p.basename)(e)}-`));try{await B({appName:t,appDisplayName:n,appDescription:r,shouldIncludeExample:i,appDirectory:l}),o.throwIfAborted();let c=await G(l);if(a.t(c))throw new s.t({code:`APP_INIT_FAILED`,message:`The app template still has placeholders in ${c.join(`, `)}.`,hint:`This CLI ships an app template it cannot render. Upgrade the twenty CLI.`,details:{unrenderedFiles:c}});o.throwIfAborted(),await W(e)===`empty`?await K({stagingDirectory:l,appDirectory:e}):await(0,f.rename)(l,e)}catch(t){throw await(0,f.rm)(l,{recursive:!0,force:!0}),t instanceof s.t||o.aborted?t:new s.t({code:`APP_INIT_FAILED`,message:`Could not create ${e}: ${t instanceof Error?t.message:String(t)}`,hint:`Files this command had written there were removed. Fix the cause, then run the command again.`,details:{path:e}})}},J=/^(?:@[a-z0-9~-][a-z0-9._~-]*\/)?[a-z0-9~-][a-z0-9._~-]*$/,Y=214,X=e=>e.length<=Y&&![`node_modules`,`favicon.ico`].includes(e)&&J.test(e);Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}});
@@ -0,0 +1 @@
1
+ var e=require("./build--4zYt4wd.cjs").t(),t=t=>!!(Array.isArray(t)&&(0,e.isNumber)(t.length)&&t.length>0&&0 in t);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1 @@
1
+ var e=e=>typeof e==`object`&&!!e&&!Array.isArray(e);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
@@ -0,0 +1 @@
1
+ var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function t(t){return typeof t==`string`&&e.test(t)}function n(e){if(!t(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var r=e=>t(e)&&n(e)>=4;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1 @@
1
+ var e=e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
@@ -0,0 +1 @@
1
+ var e=function(e){return e.TABLE=`TABLE`,e.KANBAN=`KANBAN`,e.CALENDAR=`CALENDAR`,e.LIST=`LIST`,e.FIELDS_WIDGET=`FIELDS_WIDGET`,e.TABLE_WIDGET=`TABLE_WIDGET`,e.KANBAN_WIDGET=`KANBAN_WIDGET`,e.LIST_WIDGET=`LIST_WIDGET`,e.CALENDAR_WIDGET=`CALENDAR_WIDGET`,e}({}),t=function(e){return e.CASCADE=`CASCADE`,e.RESTRICT=`RESTRICT`,e.SET_NULL=`SET_NULL`,e.NO_ACTION=`NO_ACTION`,e}({}),n=e=>e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/([A-Z])([A-Z][a-z])/g,`$1-$2`).replace(/([a-zA-Z])(\d)/g,`$1-$2`).replace(/(\d)([a-zA-Z])/g,`$1-$2`).replace(/[\s_]+/g,`-`).replace(/[^a-zA-Z0-9-]+/g,`-`).toLowerCase();Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -0,0 +1 @@
1
+ const e=require("./AssetDirectory-c_JEwMr2.cjs");let t=require("tinyglobby");var n=[`**/*.ts`,`**/*.tsx`],r=[`**/node_modules/**`,`${e.t}/**`,`**/*.d.ts`,`**/dist/**`,`**/.twenty/**`],i=async e=>(await(0,t.glob)(n,{cwd:e,absolute:!0,ignore:r,onlyFiles:!0})).sort();Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs");let r=require("node:path"),i=require("node:module");var a=e.t();function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function s(e,...t){if(!o(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function c(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function l(e,t){s(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function u(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function d(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function f(e,t){return e<<32-t|e>>>t}var p=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function h(e){if(s(e),p)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=m[e[n]];return t}function g(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function _(e){return typeof e==`string`&&(e=g(e)),s(e),e}var v=class{};function y(e){let t=t=>e().update(_(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function b(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function x(e,t,n){return e&t^~e&n}function S(e,t,n){return e&t^e&n^t&n}var C=class extends v{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=d(this.buffer)}update(e){c(this),e=_(e),s(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=d(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){c(this),l(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,u(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;b(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=d(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let f=s/4,p=this.get();if(f>p.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<f;e++)o.setUint32(4*e,p[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},w=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),T=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),E=BigInt(2**32-1),D=BigInt(32);function O(e,t=!1){return t?{h:Number(e&E),l:Number(e>>D&E)}:{h:Number(e>>D&E)|0,l:Number(e&E)|0}}function k(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=O(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var A=(e,t,n)=>e>>>n,j=(e,t,n)=>e<<32-n|t>>>n,M=(e,t,n)=>e>>>n|t<<32-n,N=(e,t,n)=>e<<32-n|t>>>n,P=(e,t,n)=>e<<64-n|t>>>n-32,F=(e,t,n)=>e>>>n-32|t<<64-n;function I(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var L=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),R=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,z=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),ee=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,te=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),B=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,V=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),H=new Uint32Array(64),U=class extends C{constructor(e=32){super(64,e,8,!1),this.A=w[0]|0,this.B=w[1]|0,this.C=w[2]|0,this.D=w[3]|0,this.E=w[4]|0,this.F=w[5]|0,this.G=w[6]|0,this.H=w[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)H[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=H[e-15],n=H[e-2],r=f(t,7)^f(t,18)^t>>>3;H[e]=(f(n,17)^f(n,19)^n>>>10)+H[e-7]+r+H[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=f(o,6)^f(o,11)^f(o,25),u=l+t+x(o,s,c)+V[e]+H[e]|0,d=(f(n,2)^f(n,13)^f(n,22))+S(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){u(H)}destroy(){this.set(0,0,0,0,0,0,0,0),u(this.buffer)}},W=k(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),G=W[0],K=W[1],q=new Uint32Array(80),J=new Uint32Array(80),Y=class extends C{constructor(e=64){super(128,e,16,!1),this.Ah=T[0]|0,this.Al=T[1]|0,this.Bh=T[2]|0,this.Bl=T[3]|0,this.Ch=T[4]|0,this.Cl=T[5]|0,this.Dh=T[6]|0,this.Dl=T[7]|0,this.Eh=T[8]|0,this.El=T[9]|0,this.Fh=T[10]|0,this.Fl=T[11]|0,this.Gh=T[12]|0,this.Gl=T[13]|0,this.Hh=T[14]|0,this.Hl=T[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)q[n]=e.getUint32(t),J[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=q[e-15]|0,n=J[e-15]|0,r=M(t,n,1)^M(t,n,8)^A(t,n,7),i=N(t,n,1)^N(t,n,8)^j(t,n,7),a=q[e-2]|0,o=J[e-2]|0,s=M(a,o,19)^P(a,o,61)^A(a,o,6),c=z(i,N(a,o,19)^F(a,o,61)^j(a,o,6),J[e-7],J[e-16]);q[e]=ee(c,r,s,q[e-7],q[e-16])|0,J[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=M(u,d,14)^M(u,d,18)^P(u,d,41),v=N(u,d,14)^N(u,d,18)^F(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=te(_,v,b,K[e],J[e]),S=B(x,g,t,y,G[e],q[e]),C=x|0,w=M(n,r,28)^P(n,r,34)^P(n,r,39),T=N(n,r,28)^F(n,r,34)^F(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=I(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=L(C,T,D);n=R(O,S,w,E),r=O|0}({h:n,l:r}=I(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=I(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=I(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=I(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=I(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=I(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=I(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=I(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){u(q,J)}destroy(){u(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},X=y(()=>new U),Z=y(()=>new Y),ne=e=>{let{SystemPermissionFlag:t}=(0,i.createRequire)((0,r.join)(e,`package.json`))(`twenty-sdk/define`);return n.t(t)?Object.fromEntries(Object.getOwnPropertyNames(t).map(e=>[e,t[e]]).filter(e=>(0,a.isString)(e[1]))):{}},Q=``,re=5e4,$=new Map,ie=e=>typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(String.fromCharCode(...e)),ae=(e,n=``)=>{let r=e+Q+(n||``),i=$.get(r);if(t.t(i))return i;let a=ie(X(g(r))).slice(0,6);return $.size>=re&&$.clear(),$.set(r,a),a},oe=e=>{let n=[];for(let[r,i]of Object.entries(e)){if(typeof i==`string`){n.push({message:r,translation:i});continue}if(t.t(i)&&typeof i==`object`)for(let[e,t]of Object.entries(i))typeof t==`string`&&n.push({message:e,context:r,translation:t})}return n},se=e=>{let n=Object.create(null),r=[...e].sort((e,t)=>(e.context??``).localeCompare(t.context??``)||e.message.localeCompare(t.message));for(let{message:e,context:i,translation:a}of r){if(!t.t(i)){n[e]=a;continue}let r=n[i];typeof r==`object`&&t.t(r)?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]={[e]:a}}return n};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return se}});
@@ -1 +1 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./cli-error-CrUD8uMp.cjs");require("./resolve-request-url-I1EOOumy.cjs"),require("./result-item-limit.constant-QX3teiuy.cjs");var n=e.t(),r=async e=>{let r=[],i=new Set,a,o=0,s=!0;for(;s;){let c=await e(a);for(let{node:e}of c.edges){if(o+=Buffer.byteLength(JSON.stringify(e),`utf8`),r.length>=1e4||o>16777216)throw new t.t({code:`RESPONSE_LIMIT_EXCEEDED`,message:`Metadata exceeds the 10,000-item or 16 MiB inspection limit.`,hint:`Use api graphql to select and page the metadata you need.`});r.push(e)}if(s=c.pageInfo.hasNextPage!==!1,s){let e=c.pageInfo.endCursor;if(c.pageInfo.hasNextPage!==!0||!(0,n.isNonEmptyString)(e)||i.has(e)||c.edges.length===0)throw new t.t({code:`INVALID_RESPONSE`,message:`The metadata server returned invalid pagination information.`});i.add(e),a=e}}return r},i=1e3;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./cli-error-CrUD8uMp.cjs");require("./resolve-request-url-CfvGDGkw.cjs"),require("./result-item-limit.constant-QX3teiuy.cjs");var n=e.t(),r=async e=>{let r=[],i=new Set,a,o=0,s=!0;for(;s;){let c=await e(a);for(let{node:e}of c.edges){if(o+=Buffer.byteLength(JSON.stringify(e),`utf8`),r.length>=1e4||o>16777216)throw new t.t({code:`RESPONSE_LIMIT_EXCEEDED`,message:`Metadata exceeds the 10,000-item or 16 MiB inspection limit.`,hint:`Use api graphql to select and page the metadata you need.`});r.push(e)}if(s=c.pageInfo.hasNextPage!==!1,s){let e=c.pageInfo.endCursor;if(c.pageInfo.hasNextPage!==!0||!(0,n.isNonEmptyString)(e)||i.has(e)||c.edges.length===0)throw new t.t({code:`INVALID_RESPONSE`,message:`The metadata server returned invalid pagination information.`});i.add(e),a=e}}return r},i=1e3;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs"),t=require("./cli-error-CrUD8uMp.cjs"),n=require("./api-url-protocols.constant-EEmR3Pmg.cjs");var r=e=>`${e.origin}${e.pathname.replace(/\/+$/,``)}`,i=({rawUrl:i,sourceName:a})=>{let o=URL.parse(i.trim());if(!(e.t(o)&&n.t.includes(o.protocol)&&o.username===``&&o.password===``&&o.search===``&&o.hash===``))throw new t.t({code:`INVALID_API_URL`,exitCode:t.n.USAGE,message:`${a} must be an http or https URL without credentials, query or fragment.`,hint:`For example: https://acme.twenty.com`});return r(o)};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isPlainObject-fJEJm71P.cjs"),n=require("./cli-error-CrUD8uMp.cjs"),r=require("./FileFolder-BmCXp_bX.cjs"),i=require("./AssetDirectory-c_JEwMr2.cjs"),a=require("./is-same-universal-identifier-Bm_wb6Ez.cjs"),o=require("./is-exported-manifest-C4lO285q.cjs");var s=e=>{if(!(e.endsWith(`.ts`)||e.endsWith(`.tsx`))||e.endsWith(`.d.ts`)||e.startsWith(`/`)||/^[a-z]:/i.test(e)||e.includes(`\\`))return!1;let t=[`..`,`.`,``,`node_modules`,`dist`,`.twenty`];return e.split(`/`).every(e=>!t.includes(e))},c=e=>e,l=e.t(),u=e=>{try{return t.t(JSON.parse(e))}catch{return!1}},d=({value:e,frontComponents:a=[]})=>{if(!(0,l.isArray)(e))throw new n.t({code:`INVALID_RESPONSE`,message:`The exported files must be an array.`});let o=[],c=new Set;for(let d of e){if(!t.t(d)||!(0,l.isString)(d.folder)||!(0,l.isString)(d.path)||!(0,l.isString)(d.content))throw new n.t({code:`INVALID_RESPONSE`,message:`The server returned an invalid exported file.`});let e=d.folder===r.t.Source&&a.some(e=>e.sourceComponentPath===d.path)&&s(d.path),f=d.folder===r.t.PublicAsset;if(!f&&!e&&(d.folder!==r.t.Dependencies||![`package.json`,`yarn.lock`].includes(d.path)))throw new n.t({code:`TOOLING_UNSUPPORTED`,message:`This CLI can only pull dependency files, public assets and declared front component sources. No local files were changed.`});if(f&&(!d.path.startsWith(`public/`)||d.path.includes(`\\`)||d.path.includes(`\0`)||d.path.split(`/`).some(e=>[``,`.`,`..`].includes(e))))throw new n.t({code:`INVALID_RESPONSE`,message:`The exported public asset ${d.path} must have a safe path under ${i.t}/.`});if(f&&Buffer.from(d.content,`base64`).toString(`base64`)!==d.content)throw new n.t({code:`INVALID_RESPONSE`,message:`The exported public asset ${d.path} is not valid base64.`});if(c.has(d.path.toLowerCase()))throw new n.t({code:`INVALID_RESPONSE`,message:`The server exported ${d.path} more than once.`});if(d.path===`package.json`&&!u(d.content))throw new n.t({code:`INVALID_RESPONSE`,message:`The exported package.json must contain a JSON object.`});c.add(d.path.toLowerCase()),o.push({folder:d.folder,path:d.path,content:d.content})}return o},f=e=>t.t(e)&&(0,l.isString)(e.metadataName)&&(0,l.isString)(e.universalIdentifier)&&(0,l.isString)(e.status)&&((0,l.isString)(e.reason)||(0,l.isNull)(e.reason)),p=({value:e,universalIdentifier:r})=>{let i=e;if(!t.t(i)||!t.t(i.application)||!(0,l.isString)(i.application.universalIdentifier)||!a.t({value:i.application.universalIdentifier,universalIdentifier:r})||!(0,l.isString)(i.application.displayName)||!(0,l.isString)(i.application.sourceType)||!o.t(i.manifest)||!a.t({value:i.manifest.application.universalIdentifier,universalIdentifier:r})||!(0,l.isArray)(i.coverage)||!i.coverage.every(f)||!(0,l.isArray)(i.files))throw new n.t({code:`INVALID_RESPONSE`,message:`The server returned an export of ${r} that this CLI cannot read.`});return{application:{universalIdentifier:i.application.universalIdentifier,displayName:i.application.displayName,sourceType:i.application.sourceType},manifest:i.manifest,coverage:i.coverage,files:d({value:i.files,frontComponents:c(i.manifest).frontComponents??[]})}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs"),t=require("./is-supported-locale-DUMI9QQ2.cjs"),n=require("./cli-error-CrUD8uMp.cjs");var r=r=>{if(e.t(r)){if(r===`en`||!t.t(r))throw new n.t({code:`USAGE`,exitCode:n.n.USAGE,message:`"${r}" is not a supported target locale.`,hint:`Choose one of: ${Object.keys(t.n).filter(e=>e!==`en`).join(`, `)}.`});return r}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./resolve-request-url-CfvGDGkw.cjs"),a=require("./create-http-status-error-1VM7PoVZ.cjs");var o={core:`/graphql`,metadata:`/metadata`},s=e.t(),c=100,l=`METADATA_VALIDATION_FAILED`,u=[`nameSingular`,`namePlural`,`name`,`label`,`universalIdentifier`,`id`],d=e=>{for(let t of u){let n=e[t];if((0,s.isNonEmptyString)(n))return n}},f=e=>n.t(e)&&(0,s.isArray)(e.errors)&&n.t(e.flatEntityMinimalInformation),p=({errorsByMetadata:e,limit:r})=>{let i=[];for(let[a,o]of Object.entries(e))if((0,s.isArray)(o))for(let e of o){if(!f(e))continue;let o=d(e.flatEntityMinimalInformation);for(let c of e.errors)if(!(!n.t(c)||!(0,s.isString)(c.message))&&(i.push({metadataName:a,...t.t(o)?{entityLabel:o}:{},...(0,s.isString)(c.code)?{code:c.code}:{},...(0,s.isString)(c.userFriendlyMessage)?{userFriendlyMessage:c.userFriendlyMessage}:{},message:c.message}),i.length>=r))return i}return i},m=e=>{let r=[],i;for(let a of e){if(!n.t(a)||!n.t(a.extensions)||a.extensions.code!==l||!n.t(a.extensions.errors))continue;let e=p({errorsByMetadata:a.extensions.errors,limit:c-r.length});if(e.length!==0&&(!t.t(i)&&(0,s.isString)(a.extensions.message)&&(i=a.extensions.message),r.push(...e),r.length>=c))break}return{...t.t(i)?{summary:i}:{},errors:r}},h=e=>{let t=n.t(e)?e:{};return{message:(0,s.isString)(t.message)?t.message:`Unknown GraphQL error`,path:(0,s.isArray)(t.path)?t.path:null,code:n.t(t.extensions)&&(0,s.isString)(t.extensions.code)?t.extensions.code:null,...n.t(t.extensions)&&(0,s.isString)(t.extensions.subCode)?{subCode:t.extensions.subCode}:{}}},g=e=>e.length===1?e[0].message:`${e[0].message} (and ${e.length-1} more errors)`,_=({errors:e,data:t,status:n,headers:i,target:o})=>{let s=e.map(h),c=s.map(e=>e.code),l=m(e),u={status:n,headers:a.n(i),errors:s,data:t??null,...l.errors.length>0?{validationErrors:l.errors}:{}};return n===401||c.includes(`UNAUTHENTICATED`)?new r.t({code:`AUTH_REQUIRED`,exitCode:r.n.AUTHENTICATION,message:`${o.apiUrl} rejected the credentials.`,hint:a.r(o),details:u}):n===403||c.includes(`FORBIDDEN`)?new r.t({code:`PERMISSION_DENIED`,exitCode:r.n.AUTHENTICATION,message:g(s),details:u}):new r.t({code:`GRAPHQL_ERROR`,message:l.summary??g(s),details:u})},v=async({response:e,target:o})=>{let c=await i.n(e),l=n.t(c)?c:void 0;if((0,s.isNonEmptyArray)(l?.errors))throw _({errors:l.errors,data:l.data,status:e.status,headers:e.headers,target:o});if(!e.ok)throw a.t({status:e.status,headers:e.headers,body:c,target:o});if(!t.t(l)||!(`data`in l))throw new r.t({code:`INVALID_RESPONSE`,message:`The server answered without a GraphQL result.`,details:{status:e.status,headers:a.n(e.headers),body:c}});return{data:n.t(l.data)?l.data:null}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
@@ -0,0 +1 @@
1
+ const e=require("./isPlainObject-fJEJm71P.cjs"),t=require("./cli-error-CrUD8uMp.cjs");var n=(e,n)=>new t.t({code:`INVALID_INPUT`,exitCode:t.n.USAGE,message:`${e} is not valid JSON: ${n}`}),r=({text:e,optionName:t})=>{try{return JSON.parse(e)}catch(e){throw n(t,e instanceof Error?e.message:String(e))}},i=({text:t,optionName:i})=>{let a=r({text:t,optionName:i});if(!e.t(a))throw n(i,`expected a JSON object.`);return a};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1,3 @@
1
+ const e=require("./isDefined-CJctgvfE.cjs");var t=/^[A-Za-z_$][A-Za-z0-9_$]*$/,n=`__proto__`,r=Symbol(`typescriptExpression`),i=e=>({[r]:e}),a=e=>r in e,o=e=>`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/[\uD800-\uDFFF]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}'`,s=e=>e===n?`[${o(e)}]`:t.test(e)?e:o(e),c=e=>` `.repeat(e),l=({value:t,depth:n=0,path:i=[],resolveEnumSymbol:u})=>{if(t===null)return`null`;if(typeof t==`string`){let n=u?.({path:i,value:t});return e.t(n)?n:o(t)}if(typeof t==`number`||typeof t==`boolean`)return String(t);if(Array.isArray(t))return t.length===0?`[]`:`[\n${t.map(e=>`${c(n+1)}${l({value:e,depth:n+1,path:[...i,`[]`],resolveEnumSymbol:u})},`).join(`
2
+ `)}\n${c(n)}]`;if(typeof t==`object`&&a(t))return t[r];if(typeof t==`object`){let e=Object.entries(t).filter(([,e])=>e!==void 0);return e.length===0?`{}`:`{\n${e.map(([e,t])=>`${c(n+1)}${s(e)}: ${l({value:t,depth:n+1,path:[...i,e],resolveEnumSymbol:u})},`).join(`
3
+ `)}\n${c(n)}}`}return`null`};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
@@ -0,0 +1 @@
1
+ var e={HEADERS:`TWENTY_PROXY_HEADERS`,HEADER_COMMAND:`TWENTY_PROXY_HEADER_COMMAND`};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
@@ -0,0 +1,6 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./get-field-universal-identifier.util-d1401qKf.cjs"),r=require("./standard-object-fields.constant-C4AVX0t2.cjs"),i=require("./kebab-case-B3kq7ANN.cjs"),a=require("./TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs"),o=require("./print-typescript-value-BjYn0ZFT.cjs");var s=function(e){return e.IS=`IS`,e.IS_NOT_NULL=`IS_NOT_NULL`,e.IS_NOT=`IS_NOT`,e.LESS_THAN_OR_EQUAL=`LESS_THAN_OR_EQUAL`,e.GREATER_THAN_OR_EQUAL=`GREATER_THAN_OR_EQUAL`,e.IS_BEFORE=`IS_BEFORE`,e.IS_AFTER=`IS_AFTER`,e.CONTAINS=`CONTAINS`,e.DOES_NOT_CONTAIN=`DOES_NOT_CONTAIN`,e.IS_EMPTY=`IS_EMPTY`,e.IS_NOT_EMPTY=`IS_NOT_EMPTY`,e.IS_RELATIVE=`IS_RELATIVE`,e.IS_IN_PAST=`IS_IN_PAST`,e.IS_IN_FUTURE=`IS_IN_FUTURE`,e.IS_TODAY=`IS_TODAY`,e.VECTOR_SEARCH=`VECTOR_SEARCH`,e}({}),c=function(e){return e.MIN=`MIN`,e.MAX=`MAX`,e.AVG=`AVG`,e.SUM=`SUM`,e.COUNT=`COUNT`,e.COUNT_UNIQUE_VALUES=`COUNT_UNIQUE_VALUES`,e.COUNT_EMPTY=`COUNT_EMPTY`,e.COUNT_NOT_EMPTY=`COUNT_NOT_EMPTY`,e.COUNT_TRUE=`COUNT_TRUE`,e.COUNT_FALSE=`COUNT_FALSE`,e.PERCENTAGE_EMPTY=`PERCENTAGE_EMPTY`,e.PERCENTAGE_NOT_EMPTY=`PERCENTAGE_NOT_EMPTY`,e}({}),l=function(e){return e.FLOAT=`float`,e.INT=`int`,e.BIGINT=`bigint`,e}({}),u=function(e){return e.RELATIVE=`RELATIVE`,e.USER_SETTINGS=`USER_SETTINGS`,e.CUSTOM=`CUSTOM`,e}({}),d=function(e){return e.BTREE=`BTREE`,e.GIN=`GIN`,e}({}),f=function(e){return e.VIEW=`VIEW`,e.FOLDER=`FOLDER`,e.LINK=`LINK`,e.OBJECT=`OBJECT`,e.RECORD=`RECORD`,e.PAGE_LAYOUT=`PAGE_LAYOUT`,e.AGENT_CHAT_CHANNEL=`AGENT_CHAT_CHANNEL`,e.NATIVE_PAGE=`NATIVE_PAGE`,e.WORKFLOW=`WORKFLOW`,e.AGENT=`AGENT`,e}({}),p=function(e){return e.SIDE_PANEL=`SIDE_PANEL`,e.RECORD_PAGE=`RECORD_PAGE`,e.USER_CHOICE=`USER_CHOICE`,e}({}),m=function(e){return e.DAY=`DAY`,e.MONTH=`MONTH`,e.QUARTER=`QUARTER`,e.YEAR=`YEAR`,e.WEEK=`WEEK`,e.DAY_OF_THE_WEEK=`DAY_OF_THE_WEEK`,e.MONTH_OF_THE_YEAR=`MONTH_OF_THE_YEAR`,e.QUARTER_OF_THE_YEAR=`QUARTER_OF_THE_YEAR`,e.NONE=`NONE`,e}({}),h=function(e){return e.AND=`AND`,e.OR=`OR`,e}({}),g=function(e){return e.DAY=`DAY`,e.WEEK=`WEEK`,e.MONTH=`MONTH`,e}({}),ee=function(e){return e.AND=`AND`,e.OR=`OR`,e.NOT=`NOT`,e}({}),te=function(e){return e.SIDE_PANEL=`SIDE_PANEL`,e.RECORD_PAGE=`RECORD_PAGE`,e}({}),ne=function(e){return e.ASC=`ASC`,e.DESC=`DESC`,e}({}),re=function(e){return e.WORKSPACE=`WORKSPACE`,e.UNLISTED=`UNLISTED`,e}({}),_=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:r})=>n.n({entityNamespace:`pageLayout`,value:t?`${t}:${r}`:r,applicationUniversalIdentifier:e}),v=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutUniversalIdentifier:t,title:r})=>n.n({entityNamespace:`pageLayoutTab`,value:`${t}:${r}`,applicationUniversalIdentifier:e}),y=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutTabUniversalIdentifier:t,title:r})=>n.n({entityNamespace:`pageLayoutWidget`,value:`${t}:${r}`,applicationUniversalIdentifier:e}),b=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>_({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:r.c.RECORD_FORM}),x=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>_({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:r.c.RECORD_PAGE}),S=({objectUniversalIdentifier:e,tabs:t})=>{let n=x({objectMetadataApplicationUniversalIdentifier:a.t,objectUniversalIdentifier:e});return{universalIdentifier:n,tabs:Object.fromEntries(Object.entries(t).map(([e,{title:t,widgets:r}])=>{let i=v({objectMetadataApplicationUniversalIdentifier:a.t,pageLayoutUniversalIdentifier:n,title:t});return[e,{universalIdentifier:i,widgets:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{universalIdentifier:y({objectMetadataApplicationUniversalIdentifier:a.t,pageLayoutTabUniversalIdentifier:i,title:t})}]))}]}))}},ie={myFirstDashboard:{universalIdentifier:`20202020-d001-4d01-8d01-da5ab0a00001`,tabs:{tab1:{universalIdentifier:`20202020-d011-4d11-8d11-da5ab0a01001`,widgets:{welcomeRichText:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11001`},dealsByCompany:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11002`},pipelineValueByStage:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11003`},revenueTimeline:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11004`},opportunitiesByOwner:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11005`},stockMarketIframe:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11006`},dealsCreatedThisMonth:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11007`},dealValueCreatedThisMonth:{universalIdentifier:`20202020-d111-4d11-8d11-da5ab0a11008`}}}}},workspaceMemberRecordPage:S({objectUniversalIdentifier:r.n.workspaceMember,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}}}}),attachmentRecordPage:S({objectUniversalIdentifier:r.n.attachment,tabs:{home:{title:`Home`,widgets:{preview:`Preview`,fields:`Fields`,attachedTo:`Attached to`}}}}),companyRecordPage:S({objectUniversalIdentifier:r.n.company,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,people:`People`,opportunities:`Opportunities`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},tasks:{title:`Tasks`,widgets:{tasks:`Tasks`}},notes:{title:`Notes`,widgets:{notes:`Notes`}},files:{title:`Files`,widgets:{files:`Files`}},emails:{title:`Emails`,widgets:{emails:`Emails`}},conversations:{title:`Conversations`,widgets:{conversations:`Conversations`}},calendar:{title:`Calendar`,widgets:{calendar:`Calendar`}}}}),personRecordPage:S({objectUniversalIdentifier:r.n.person,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,company:`Company`,pointOfContactForOpportunities:`Opportunities`,listMemberships:`Lists`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},tasks:{title:`Tasks`,widgets:{tasks:`Tasks`}},notes:{title:`Notes`,widgets:{notes:`Notes`}},files:{title:`Files`,widgets:{files:`Files`}},emails:{title:`Emails`,widgets:{emails:`Emails`}},conversations:{title:`Conversations`,widgets:{conversations:`Conversations`}},calendar:{title:`Calendar`,widgets:{calendar:`Calendar`}}}}),opportunityRecordPage:S({objectUniversalIdentifier:r.n.opportunity,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,pointOfContact:`Point of Contact`,company:`Company`,owner:`Owner`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},tasks:{title:`Tasks`,widgets:{tasks:`Tasks`}},notes:{title:`Notes`,widgets:{notes:`Notes`}},files:{title:`Files`,widgets:{files:`Files`}},emails:{title:`Emails`,widgets:{emails:`Emails`}},conversations:{title:`Conversations`,widgets:{conversations:`Conversations`}},calendar:{title:`Calendar`,widgets:{calendar:`Calendar`}}}}),noteRecordPage:S({objectUniversalIdentifier:r.n.note,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,noteRichText:`Note`}},note:{title:`Note`,widgets:{noteRichText:`Note`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},files:{title:`Files`,widgets:{files:`Files`}}}}),taskRecordPage:S({objectUniversalIdentifier:r.n.task,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,taskRichText:`Task`}},note:{title:`Note`,widgets:{taskRichText:`Task`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},files:{title:`Files`,widgets:{files:`Files`}}}}),workflowVersionRecordPage:S({objectUniversalIdentifier:r.n.workflowVersion,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},flow:{title:`Flow`,widgets:{workflowVersion:`Flow`}}}}),workflowRunRecordPage:S({objectUniversalIdentifier:r.n.workflowRun,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},flow:{title:`Flow`,widgets:{workflowRun:`Flow`}}}}),agentChatThreadRecordPage:S({objectUniversalIdentifier:r.n.agentChatThread,tabs:{chat:{title:`Chat`,widgets:{chat:`Chat`}}}}),blocklistRecordPage:S({objectUniversalIdentifier:r.n.blocklist,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),calendarChannelEventAssociationRecordPage:S({objectUniversalIdentifier:r.n.calendarChannelEventAssociation,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),calendarEventRecordPage:S({objectUniversalIdentifier:r.n.calendarEvent,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,participants:`Participants`,callRecordings:`Call Recordings`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},summary:{title:`Summary`,widgets:{summary:`Summary`}},callRecording:{title:`Call Recording`,widgets:{transcript:`Transcript`}}}}),calendarEventParticipantRecordPage:S({objectUniversalIdentifier:r.n.calendarEventParticipant,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),callRecordingRecordPage:S({objectUniversalIdentifier:r.n.callRecording,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}},summary:{title:`Summary`,widgets:{summary:`Summary`}},callRecording:{title:`Call Recording`,widgets:{transcript:`Transcript`}}}}),messageChannelMessageAssociationRecordPage:S({objectUniversalIdentifier:r.n.messageChannelMessageAssociation,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),messageChannelMessageAssociationMessageFolderRecordPage:S({objectUniversalIdentifier:r.n.messageChannelMessageAssociationMessageFolder,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),messageParticipantRecordPage:S({objectUniversalIdentifier:r.n.messageParticipant,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}},timeline:{title:`Timeline`,widgets:{timeline:`Timeline`}}}}),messageRecordPage:S({objectUniversalIdentifier:r.n.message,tabs:{home:{title:`Home`,widgets:{fields:`Fields`}}}}),messageThreadRecordPage:S({objectUniversalIdentifier:r.n.messageThread,tabs:{home:{title:`Home`,widgets:{emailThread:`Thread`}}}}),messageListRecordPage:S({objectUniversalIdentifier:r.n.messageList,tabs:{home:{title:`Home`,widgets:{fields:`Fields`,members:`Members`}},members:{title:`Members`,widgets:{members:`Members`}}}}),messageCampaignRecordPage:S({objectUniversalIdentifier:r.n.messageCampaign,tabs:{home:{title:`Home`,widgets:{details:`Details`,list:`List`,recipients:`Recipients`,fields:`Fields`}},composer:{title:`Email`,widgets:{messageCampaign:`Email`}}}})},C=e.t(),ae=80,oe=new Map(Object.entries(r.t).flatMap(([e,t])=>Object.entries(t).map(([t,{universalIdentifier:n}])=>[n,{objectName:e,fieldName:t}]))),w=e=>(0,C.isNonEmptyString)(e)&&(0,C.isNonEmptyString)(i.t(e).replace(/-+/g,``)),T=e=>e.slice(0,ae).replace(/-+$/g,``),E=({segments:e,universalIdentifier:n})=>{let r=T(e.filter(t.t).map(i.t).join(`-`).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``));return(0,C.isNonEmptyString)(r)?r:n.slice(0,8)},D=({indexManifest:e,objectName:t,fieldLocationByUniversalIdentifier:n})=>E({segments:[t,...e.fields.map(({fieldUniversalIdentifier:e})=>n.get(e)?.fieldName??null)],universalIdentifier:e.universalIdentifier}),O=({viewFieldManifest:e,fieldLocationByUniversalIdentifier:n})=>{let r=n.get(e.fieldMetadataUniversalIdentifier)??oe.get(e.fieldMetadataUniversalIdentifier);return E({segments:t.t(r)?[r.objectName,r.fieldName]:[],universalIdentifier:e.universalIdentifier})},k=80,A=e=>[{path:[...e,`type`],symbol:`FieldType`,members:n.a},{path:[...e,`universalSettings`,`relationType`],symbol:`RelationType`,members:n.i},{path:[...e,`universalSettings`,`onDelete`],symbol:`OnDeleteAction`,members:i.n},{path:[...e,`universalSettings`,`dataType`],symbol:`NumberDataType`,members:l},{path:[...e,`universalSettings`,`displayFormat`],symbol:`DateDisplayFormat`,members:u}],j=A([]),M=[{path:[`openRecordIn`],symbol:`ObjectOpenRecordIn`,members:p},...A([`fields`,`[]`])],N=[{path:[`indexType`],symbol:`IndexType`,members:d}],P=5,F=e=>[`recordsPermissions`,`objects`,`[]`,`rowLevelRecordsPermissions`,`[]`,...Array.from({length:e},()=>[`predicateGroups`,`[]`]).flat()],I=()=>[...Array.from({length:6},(e,t)=>({path:[...F(t),`predicates`,`[]`,`operand`],symbol:`RowLevelPermissionPredicateOperand`,members:s})),...Array.from({length:P},(e,t)=>({path:[...F(t+1),`logicalOperator`],symbol:`RowLevelPermissionPredicateGroupLogicalOperator`,members:h}))],L=e=>[...I(),{path:[`rowLevelPermissionPredicateGroups`,`[]`,`logicalOperator`],symbol:`RowLevelPermissionPredicateGroupLogicalOperator`,members:h},{path:[`rowLevelPermissionPredicates`,`[]`,`operand`],symbol:`RowLevelPermissionPredicateOperand`,members:s},{path:[`permissionFlagUniversalIdentifiers`,`[]`],symbol:`SystemPermissionFlag`,members:e}];L(r.r);var R=e=>({path:e,symbol:`AggregateOperations`,members:c}),z=[R([`aggregateOperation`])],B=[{path:[`type`],symbol:`ViewType`,members:i.r},{path:[`visibility`],symbol:`ViewVisibility`,members:re},{path:[`openRecordIn`],symbol:`ViewOpenRecordIn`,members:te},R([`kanbanAggregateOperation`]),{path:[`calendarLayout`],symbol:`ViewCalendarLayout`,members:g},R([`fields`,`[]`,`aggregateOperation`]),{path:[`filters`,`[]`,`operand`],symbol:`ViewFilterOperand`,members:r.u},{path:[`filterGroups`,`[]`,`logicalOperator`],symbol:`ViewFilterGroupLogicalOperator`,members:ee},{path:[`sorts`,`[]`,`direction`],symbol:`ViewSortDirection`,members:ne}],V=e=>[{path:[...e,`type`],symbol:`WidgetType`,members:r.d},{path:[...e,`position`,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:r.l},R([...e,`configuration`,`aggregateOperation`]),...[`dateGranularity`,`primaryAxisDateGranularity`,`secondaryAxisGroupByDateGranularity`].map(t=>({path:[...e,`configuration`,t],symbol:`ObjectRecordGroupByDateGranularity`,members:m}))],H=e=>[{path:[...e,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:r.l},...V([...e,`widgets`,`[]`])],U=V([]),W=H([]),G=[{path:[`type`],symbol:`NavigationMenuItemType`,members:f}],K=[{path:[`type`],symbol:`PageLayoutType`,members:r.c},...H([`tabs`,`[]`])],q=[`version`,`steps`,`[]`],J=e=>({path:e,symbol:`ViewFilterOperand`,members:r.u}),se=[J([`version`,`trigger`,`settings`,`filter`,`stepFilters`,`[]`,`operand`]),J([...q,`input`,`stepFilters`,`[]`,`operand`]),J([...q,`input`,`filter`,`recordFilters`,`[]`,`operand`]),{path:[...q,`input`,`[]`,`type`],symbol:`FieldType`,members:n.a}],ce=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),le=({definer:e,config:n,enumBindings:r=[],importStatements:i=[]})=>{let a=new Set,s=o.n({value:n,resolveEnumSymbol:({path:e,value:n})=>{let i=r.find(t=>ce(t.path,e));if(!t.t(i))return;let o=Object.keys(i.members).find(e=>i.members[e]===n);if(t.t(o))return a.add(i.symbol),`${i.symbol}.${o}`}}),c=[e,...[...a].sort()],l=`import { ${c.join(`, `)} } from 'twenty-sdk/define';`,u=l.length<=k?l:`import {\n${c.map(e=>` ${e},`).join(`
2
+ `)}\n} from 'twenty-sdk/define';`;return{content:`${[...i,u].join(`
3
+ `)}
4
+
5
+ export default ${e}(${s});
6
+ `,requiredSdkExports:c}},ue=`__typename`,Y=e=>Array.isArray(e)?e.map(Y):typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==ue).map(([e,t])=>[e,Y(t)])),de=new Set([`packageJsonChecksum`,`yarnLockChecksum`,`requiredServerVersionRange`,`aboutDescription`,`postInstallLogicFunction`,`preInstallLogicFunction`,`uninstallLogicFunction`,`healthCheckLogicFunction`,`settingsFrontComponent`,`settingsCustomTabFrontComponentUniversalIdentifier`,`frontComponentSharedDependencies`,`logoUrl`,`screenshots`]),fe=`public/cover.generated.png`,pe=e=>(e.roles??[]).some(({universalIdentifier:t})=>t===e.application.defaultRoleUniversalIdentifier),me=e=>{let t=Object.fromEntries(Object.entries(e.application).filter(([t])=>!de.has(t)&&!(t===`defaultRoleUniversalIdentifier`&&pe(e)))),{galleryImages:n}=t;if(!Array.isArray(n)||n.length===0||n.every(e=>e===fe)){let{galleryImages:e,...n}=t;return n}return t},X=({permissions:e,getDerivedUniversalIdentifier:t})=>e.map(({universalIdentifier:e,...n})=>e===t(n)?n:{universalIdentifier:e,...n}),he=({roleManifest:e,applicationUniversalIdentifier:n})=>{let{universalIdentifier:i,objectPermissions:a,recordsPermissions:o,fieldPermissions:s}=e;return{...e,...t.t(a)?{objectPermissions:X({permissions:a,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>r.o({applicationUniversalIdentifier:n,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.t(o?.objects)?{recordsPermissions:{...o,objects:X({permissions:o.objects,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>r.o({applicationUniversalIdentifier:n,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}}:{},...t.t(s)?{fieldPermissions:X({permissions:s,getDerivedUniversalIdentifier:({fieldUniversalIdentifier:e})=>r.s({applicationUniversalIdentifier:n,roleUniversalIdentifier:i,fieldUniversalIdentifier:e})})}:{}}},Z=({objectName:e,fieldName:t,fieldUniversalIdentifier:n})=>E({segments:[e,t],universalIdentifier:n}),ge=new Map(Object.entries(r.n).map(([e,t])=>[t,e])),Q=({objectUniversalIdentifier:e,manifest:t})=>(t.objects??[]).find(t=>t.universalIdentifier===e)?.nameSingular??ge.get(e)??null,_e=new Map(Object.entries(ie).map(([e,{universalIdentifier:t}])=>[t,e])),$=({pageLayoutUniversalIdentifier:e,manifest:n})=>{let r=n.pageLayouts?.find(t=>t.universalIdentifier===e);if(t.t(r))return r.name;let i=_e.get(e);if(t.t(i))return i;let a=n.application.universalIdentifier;for(let t of n.objects??[]){let n={objectMetadataApplicationUniversalIdentifier:a,objectUniversalIdentifier:t.universalIdentifier};if(x(n)===e)return`${t.nameSingular}RecordPage`;if(b(n)===e)return`${t.nameSingular}RecordForm`}return null},ve=({viewUniversalIdentifier:e,manifest:n})=>{let i=n.views?.find(t=>t.universalIdentifier===e);if(t.t(i))return i.name;let a=n.application.universalIdentifier;for(let t of n.objects??[])if(r.i({objectMetadataApplicationUniversalIdentifier:a,objectUniversalIdentifier:t.universalIdentifier,viewKey:r.a.INDEX})===e)return`${t.nameSingular}IndexView`;return null},ye=({navigationMenuItemManifest:e,manifest:n})=>{let{type:r,name:i,targetObjectUniversalIdentifier:a,viewUniversalIdentifier:o,pageLayoutUniversalIdentifier:s}=e;return w(i)?i:r===f.OBJECT&&t.t(a)?Q({objectUniversalIdentifier:a,manifest:n}):r===f.VIEW&&t.t(o)?ve({viewUniversalIdentifier:o,manifest:n}):r===f.PAGE_LAYOUT&&t.t(s)?$({pageLayoutUniversalIdentifier:s,manifest:n}):null},be=({navigationMenuItemManifest:e,manifest:t})=>E({segments:[ye({navigationMenuItemManifest:e,manifest:t})],universalIdentifier:e.universalIdentifier}),xe=({folderUniversalIdentifier:e,manifest:t})=>{let n=t.navigationMenuItems?.find(t=>t.universalIdentifier===e)?.name;return w(n)?n:null},Se=[`application`,`frontComponent`,`object`,`field`,`index`,`permissionFlag`,`role`,`view`,`viewField`,`pageLayout`,`pageLayoutTab`,`navigationMenuItem`,`pageLayoutWidget`,`workflow`,`skill`,`agent`,`validationRule`,`relatedRecordPath`],Ce=({manifest:e,sourceFileByUniversalIdentifier:n=new Map,systemPermissionFlag:a=r.r})=>{let o=e.application.universalIdentifier,s=[],c=[];s.push({kind:`application`,universalIdentifier:o,definer:`defineApplication`,config:me(e),enumBindings:[],defaultFolder:`src`,fileSuffix:`.config.ts`,fileBaseName:`application`,parentName:null});let l=new Set,u=new Map,d=[...e.fields??[]];for(let t of e.objects??[]){let e=[];for(let r of t.fields??[])u.set(r.universalIdentifier,{objectName:t.nameSingular,fieldName:r.name}),n.get(r.universalIdentifier.toLowerCase())?.entityKey===`fields`?d.push({...r,objectUniversalIdentifier:t.universalIdentifier}):e.push(r);l.add(t.universalIdentifier),s.push({kind:`object`,universalIdentifier:t.universalIdentifier,definer:`defineObject`,config:{...t,fields:e},enumBindings:M,defaultFolder:`src/objects`,fileSuffix:`.object.ts`,fileBaseName:i.t(t.nameSingular),parentName:null})}for(let t of d){let n=Q({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});u.set(t.universalIdentifier,{objectName:n,fieldName:t.name}),s.push({kind:`field`,universalIdentifier:t.universalIdentifier,definer:`defineField`,config:t,enumBindings:j,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(!l.has(t.objectUniversalIdentifier)){c.push({kind:`index`,universalIdentifier:t.universalIdentifier,reason:`its object is not part of the written source`});continue}let n=Q({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});s.push({kind:`index`,universalIdentifier:t.universalIdentifier,definer:`defineIndex`,config:t,enumBindings:N,defaultFolder:`src/indexes`,fileSuffix:`.index.ts`,fileBaseName:D({indexManifest:t,objectName:n,fieldLocationByUniversalIdentifier:u}),parentName:n})}for(let t of e.validationRules??[])s.push({kind:`validationRule`,universalIdentifier:t.universalIdentifier,definer:`defineValidationRule`,config:t,enumBindings:[],defaultFolder:`src/validation-rules`,fileSuffix:`.validation-rule.ts`,fileBaseName:E({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:Q({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e})});for(let t of e.permissionFlags??[])s.push({kind:`permissionFlag`,universalIdentifier:t.universalIdentifier,definer:`definePermissionFlag`,config:t,enumBindings:[],defaultFolder:`src/permission-flags`,fileSuffix:`.permission-flag.ts`,fileBaseName:E({segments:[t.key],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.roles??[])s.push({kind:`role`,universalIdentifier:t.universalIdentifier,definer:t.universalIdentifier===e.application.defaultRoleUniversalIdentifier?`defineApplicationRole`:`defineRole`,config:he({roleManifest:t,applicationUniversalIdentifier:o}),enumBindings:L(a),defaultFolder:`src/roles`,fileSuffix:`.role.ts`,fileBaseName:E({segments:[t.label],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.views??[])s.push({kind:`view`,universalIdentifier:t.universalIdentifier,definer:`defineView`,config:t,enumBindings:B,defaultFolder:`src/views`,fileSuffix:`.view.ts`,fileBaseName:E({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:Q({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e})});for(let t of e.viewFields??[])s.push({kind:`viewField`,universalIdentifier:t.universalIdentifier,definer:`defineViewField`,config:t,enumBindings:z,defaultFolder:`src/view-fields`,fileSuffix:`.view-field.ts`,fileBaseName:O({viewFieldManifest:t,fieldLocationByUniversalIdentifier:u}),parentName:null});for(let n of e.pageLayouts??[])s.push({kind:`pageLayout`,universalIdentifier:n.universalIdentifier,definer:`definePageLayout`,config:Y(n),enumBindings:K,defaultFolder:`src/page-layouts`,fileSuffix:`.page-layout.ts`,fileBaseName:E({segments:[n.name],universalIdentifier:n.universalIdentifier}),parentName:t.t(n.objectUniversalIdentifier)?Q({objectUniversalIdentifier:n.objectUniversalIdentifier,manifest:e}):null});for(let n of e.pageLayoutTabs??[]){let{pageLayoutUniversalIdentifier:r}=n;if(!t.t(r)){c.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,reason:`it does not name the page layout it belongs to`});continue}s.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutTab`,config:Y(n),enumBindings:W,defaultFolder:`src/page-layout-tabs`,fileSuffix:`.page-layout-tab.ts`,fileBaseName:E({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:$({pageLayoutUniversalIdentifier:r,manifest:e})})}for(let n of e.navigationMenuItems??[]){let{folderUniversalIdentifier:r}=n;s.push({kind:`navigationMenuItem`,universalIdentifier:n.universalIdentifier,definer:`defineNavigationMenuItem`,config:n,enumBindings:G,defaultFolder:`src/navigation-menu-items`,fileSuffix:`.navigation-menu-item.ts`,fileBaseName:be({navigationMenuItemManifest:n,manifest:e}),parentName:t.t(r)?xe({folderUniversalIdentifier:r,manifest:e}):null})}for(let n of e.pageLayoutWidgets??[]){let{objectUniversalIdentifier:r}=n;s.push({kind:`pageLayoutWidget`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutWidget`,config:Y(n),enumBindings:U,defaultFolder:`src/page-layout-widgets`,fileSuffix:`.page-layout-widget.ts`,fileBaseName:E({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:t.t(r)?Q({objectUniversalIdentifier:r,manifest:e}):null})}for(let t of e.workflows??[])s.push({kind:`workflow`,universalIdentifier:t.universalIdentifier,definer:`defineWorkflow`,config:t,enumBindings:se,defaultFolder:`src/workflows`,fileSuffix:`.workflow.ts`,fileBaseName:E({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.skills??[])s.push({kind:`skill`,universalIdentifier:t.universalIdentifier,definer:`defineSkill`,config:t,enumBindings:[],defaultFolder:`src/skills`,fileSuffix:`.skill.ts`,fileBaseName:E({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.relatedRecordPaths??[])s.push({kind:`relatedRecordPath`,universalIdentifier:t.universalIdentifier,definer:`defineRelatedRecordPath`,config:t,enumBindings:[],defaultFolder:`src/related-record-paths`,fileSuffix:`.related-record-path.ts`,fileBaseName:E({segments:[],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.agents??[])s.push({kind:`agent`,universalIdentifier:t.universalIdentifier,definer:`defineAgent`,config:t,enumBindings:[],defaultFolder:`src/agents`,fileSuffix:`.agent.ts`,fileBaseName:E({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:null});return{entities:s,skipped:c}},we=`2.50.0`;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return we}});
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-CJctgvfE.cjs"),r=require("./isPlainObject-fJEJm71P.cjs"),i=require("./is-supported-locale-DUMI9QQ2.cjs"),a=require("./pull-minimum-sdk-version.constant-DUMi_IUD.cjs"),o=require("./isValidUniversalIdentifier-DymFerYs.cjs"),s=require("./kebab-case-B3kq7ANN.cjs"),c=require("./has-error-code-DsJeqbZq.cjs"),l=require("./fs-utils-DoSmCBu8.cjs"),u=require("./cli-error-CrUD8uMp.cjs"),d=require("./get-tooling-error-context-CZKTM7Q6.cjs"),f=require("./FileFolder-BmCXp_bX.cjs"),p=require("./locale-catalog-format-BD4XDEnl.cjs"),m=require("./parse-app-export-BC81wdmc.cjs"),h=require("./list-application-source-files-DcyU-HrX.cjs"),g=require("./code-step-file-suffix.constant-B6vqrfcU.cjs"),_=require("./extract-manifest-from-file-DPDIhnyg.cjs"),v=require("./collect-translatable-strings-AWv41yIv.cjs"),y=require("./constants-Cf5-CwMu.cjs"),b=require("./assert-pull-paths-TFGZvzZO.cjs"),x=require("./is-locale-catalog-T4W5NhnW.cjs"),S=require("./is-exported-manifest-C4lO285q.cjs"),C=require("./create-pull-base-write-CX8xZhMz.cjs"),w=require("./print-typescript-value-BjYn0ZFT.cjs"),T=require("./read-application-identity-5sO-Mqb1.cjs");let E=require("node:fs/promises"),D=require("node:path"),O=require("node:module"),k=require("esbuild"),A=require("typescript");A=e.r(A);var j=t.t(),ee=async({appPath:e,files:t,sourceFingerprints:r={},publicAssetFingerprints:i={}})=>{await b.t({appPath:e,relativePaths:t.map(({path:e})=>e)});let a=[],o={},s={};for(let{path:c,content:u}of t){let t=Buffer.from(u,`base64`),d=C.i(t);o[c]=d;let f=(0,D.join)(e,c),p=await l.i(f)?await(0,E.readFile)(f):void 0;if(!(n.t(p)&&(i[c]??r[c])===d)){if(p?.equals(t)){s[c]=d;continue}a.push({kind:`publicAsset`,universalIdentifier:`public-asset/${c}`,relativePath:c,content:t,requiredSdkExports:[],isRegeneration:n.t(p)})}}return{writes:a,fingerprints:o,unchangedSourceFingerprints:s,unchangedCount:t.length-a.length}},te=async({appPath:e,manifest:t,baseManifest:r,files:i,scannedFiles:a,protectedIdentifiers:o,reservedPaths:s,remoteSourceFingerprints:c={},sourceFingerprints:d={}})=>{let p=[],m=[],h=0,g={},_={},v=new Set(s);for(let o of t.frontComponents??[]){let{universalIdentifier:t,sourceComponentPath:s}=o,m=i.find(e=>e.folder===f.t.Source&&e.path===s),y=a.find(e=>e.entityKey===`frontComponents`&&e.universalIdentifier?.toLowerCase()===t.toLowerCase()),b=(y?.relativePath??s).split(`\\`).join(`/`),x=b.toLowerCase(),S=await l.i((0,D.join)(e,b))?await(0,E.readFile)((0,D.join)(e,b),`utf8`):void 0;if(!n.t(m)||v.has(x)||n.t(S)&&!n.t(y))throw new u.t({code:`CONFLICT`,message:n.t(m)?`Cannot restore front component ${t}: ${b} is occupied by another local file or definition. No local files were changed.`:`Source for front component ${t} was not exported. No local files were changed.`});v.add(x);let w=C.i(m.content);g[s]=w,S===m.content&&(_[b]=w);let T=r?.frontComponents?.find(e=>e.universalIdentifier.toLowerCase()===t.toLowerCase()),O=(n.t(T)?c[T.sourceComponentPath]:void 0)??d[b];if(S===m.content||n.t(S)&&n.t(T)&&(n.t(O)?O===w:JSON.stringify(T)===JSON.stringify(o))){h++;continue}p.push({kind:`frontComponent`,universalIdentifier:t,relativePath:b,content:m.content,requiredSdkExports:[`defineFrontComponent`],isRegeneration:n.t(S)})}for(let e of r?.frontComponents??[]){if(o.has(e.universalIdentifier.toLowerCase())){let r=c[e.sourceComponentPath];if(!n.t(r)||t.frontComponents?.some(t=>t.universalIdentifier.toLowerCase()===e.universalIdentifier.toLowerCase()))continue;g[e.sourceComponentPath]=r;continue}let r=a.find(t=>t.entityKey===`frontComponents`&&t.universalIdentifier?.toLowerCase()===e.universalIdentifier.toLowerCase())?.relativePath.split(`\\`).join(`/`);n.t(r)&&!v.has(r.toLowerCase())&&m.push({universalIdentifier:e.universalIdentifier,relativePath:r})}return{writes:p,deletions:m,unchangedCount:h,fingerprints:g,unchangedSourceFingerprints:_}},M=({value:e,identifiers:t})=>{(0,j.isArray)(e)?e.forEach(e=>M({value:e,identifiers:t})):r.t(e)&&((0,j.isString)(e.universalIdentifier)&&t.add(e.universalIdentifier.toLowerCase()),Object.values(e).forEach(e=>M({value:e,identifiers:t})))},N=[`import { readFileSync } from 'node:fs';`,`import { join } from 'node:path';`],P=e=>D.posix.basename(e).replace(/(\.workflow)?\.tsx?$/,``),F=e=>D.posix.join(D.posix.dirname(e),P(e)),I=({folderPath:e,fileBaseName:t,universalIdentifier:r,localFileName:i,takenFileNames:a,isCodeStepPathAvailable:o})=>{let s=r.slice(0,8),c=t=>!a.has(t)&&o({relativePath:D.posix.join(e,t),stepUniversalIdentifier:r}),l=[`${t}${g.t}`,`${s}-${t}${g.t}`],u=`${s}-${t}-`,d=e=>l.includes(e)||e.startsWith(u)&&e.endsWith(`.code.ts`)&&/^([2-9]|[1-9]\d+)$/.test(e.slice(u.length,-8)),f=e=>(a.add(e),e);if(n.t(i)&&d(i)&&c(i))return f(i);let[p]=l;c(p)||(p=l[1]);for(let e=2;!c(p);e++)p=`${u}${e}${g.t}`;return f(p)},L=({config:e,workflowRelativePath:t,isCodeStepPathAvailable:i=()=>!0,localCodeStepPathByStepIdentifier:o})=>{if(!r.t(e)||!r.t(e.version)||!Array.isArray(e.version.steps))return{config:e,importStatements:[],codeStepFiles:[]};let s=P(t),c=F(t),l=new Set,u=[],d=e.version.steps.map(e=>{if(!r.t(e)||e.type!==`CODE`||!(0,j.isString)(e.universalIdentifier)||!r.t(e.input)||!(0,j.isString)(e.input.code))return e;let t=o?.get(e.universalIdentifier.toLowerCase()),d=I({folderPath:c,fileBaseName:a.o({segments:[(0,j.isString)(e.name)?e.name:null],universalIdentifier:e.universalIdentifier}),universalIdentifier:e.universalIdentifier,localFileName:n.t(t)&&D.posix.dirname(t)===c?D.posix.basename(t):void 0,takenFileNames:l,isCodeStepPathAvailable:i});return u.push({universalIdentifier:e.universalIdentifier,relativePath:D.posix.join(c,d),content:e.input.code}),{...e,input:{...e.input,code:w.r(`readFileSync(join(__dirname, ${w.t(s)}, ${w.t(d)}), 'utf8')`)}}});return u.length===0?{config:e,importStatements:[],codeStepFiles:u}:{config:{...e,version:{...e.version,steps:d}},importStatements:N,codeStepFiles:u}},ne=async({manifest:e,frontComponentSourcePaths:t})=>{let r=[...v.t(e),...await v.n(t)],a=new Map(r.map(e=>[p.r(e.message,e.context),e]));return Object.entries(e.translations??{}).filter(e=>i.t(e[0])&&x.t(e[1])).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let r=[],i={};for(let[e,o]of Object.entries(t)){let t=a.get(e);n.t(t)?r.push({message:t.message,context:t.context,translation:o}):i[e]=o}return{locale:e,authored:p.t(r),compiled:i}})},R=e=>n.t(e)&&typeof e==`object`&&!Array.isArray(e),z=e=>`${JSON.stringify(e,null,2)}\n`,B=e=>{if(!n.t(e))return{};try{let t=JSON.parse(e);return n.t(t)&&typeof t==`object`?t:{}}catch{return{}}},V=({message:e,context:t})=>JSON.stringify([t??null,e]),re=({catalog:e,existingAuthoredContent:t,existingCompiledContent:n})=>{let r=new Set(p.n(e.authored).map(e=>p.r(e.message,e.context))),i=new Set(Object.keys(B(n)).filter(t=>!(t in e.compiled)&&r.has(t)));if(i.size===0)return null;let a=p.n(B(t)),o=new Set(a.map(V)),s=p.n(e.authored).filter(e=>i.has(p.r(e.message,e.context))&&!o.has(V(e)));return p.t([...a,...s])},H=e=>`${y.n}/${e}.json`,U=e=>`${y.t}/${e}.json`,W=async e=>await l.i(e)?await(0,E.readFile)(e,`utf8`):null,G=async({appPath:e,manifest:t,baseManifest:r,frontComponentSourcePaths:a})=>{let o=[],s=[],c={},u=t.translations;if(!R(u))return{writes:o,deletions:s,compiledEntryCountByLocale:c};let d=await ne({manifest:t,frontComponentSourcePaths:a}),f=new Set(Object.keys(u)),p=R(r?.translations)?r.translations:{},m=u;for(let t of d){let{locale:r,authored:i,compiled:a}=t,l=Object.keys(a).length;l>0&&(c[r]=l);let u=H(r),d=U(r),f=await W((0,D.join)(e,u)),h=await W((0,D.join)(e,d)),g=r in p&&JSON.stringify(p[r])===JSON.stringify(m[r]),_=(Object.keys(i).length===0||n.t(f))&&(l===0||n.t(h)),v=g&&_?re({catalog:t,existingAuthoredContent:f,existingCompiledContent:h}):null;if(g&&_&&!n.t(v))continue;let y=[{relativePath:u,content:z(v??i),isWanted:Object.keys(v??i).length>0,existingContent:f},{relativePath:d,content:z(a),isWanted:l>0,existingContent:h}];for(let{relativePath:e,content:t,isWanted:i,existingContent:a}of y){let c=n.t(a);if(!i){c&&e===d&&s.push({universalIdentifier:r,relativePath:e});continue}a!==t&&o.push({kind:`translation`,requiredSdkExports:[],universalIdentifier:r,relativePath:e,content:t,isRegeneration:c})}}for(let[t,n]of Object.entries(p))if(!(f.has(t)||!i.t(t)||!x.t(n)))for(let n of[H(t),U(t)])await l.i((0,D.join)(e,n))&&s.push({universalIdentifier:t,relativePath:n});return{writes:o,deletions:s,compiledEntryCountByLocale:c}},K=({entity:e,relativePath:t,isCodeStepPathAvailable:n,localCodeStepPathByStepIdentifier:r})=>{if(e.kind!==`workflow`)return{...a.i({definer:e.definer,config:e.config,enumBindings:e.enumBindings}),codeStepFiles:[]};let{config:i,importStatements:o,codeStepFiles:s}=L({config:e.config,workflowRelativePath:t,isCodeStepPathAvailable:n,localCodeStepPathByStepIdentifier:r});return{...a.i({definer:e.definer,config:i,enumBindings:e.enumBindings,importStatements:o}),codeStepFiles:s}},ie=async({appPath:e,baseManifest:t,writes:r,deletions:i,frontComponentSourcePaths:o,sourceFingerprints:s,baseEntities:c,localCodeStepFilesByWorkflowPath:l})=>{if(!n.t(t))return[];let u=new Map(c.map(e=>[e.universalIdentifier,e])),d=await G({appPath:e,manifest:t,baseManifest:null,frontComponentSourcePaths:o}),f=new Map(d.writes.map(e=>[e.relativePath,e.content])),p=new Set(d.deletions.map(({relativePath:e})=>e)),m=new Map(c.flatMap(e=>e.kind===`workflow`?L({config:e.config,workflowRelativePath:``}).codeStepFiles.map(({universalIdentifier:e,content:t})=>[e.toLowerCase(),t]):[])),h=[...l.values()].flat(),g=new Map(h.map(({universalIdentifier:e,relativePath:t})=>[e.toLowerCase(),t])),_=new Map(h.flatMap(({universalIdentifier:e,relativePath:t})=>{let r=m.get(e.toLowerCase());return n.t(r)?[[t,r]]:[]})),v=({universalIdentifier:e,relativePath:t})=>{let r=u.get(e);if(n.t(r))return[K({entity:r,relativePath:t,localCodeStepPathByStepIdentifier:g}).content,a.i({definer:r.definer,config:r.config,enumBindings:r.enumBindings}).content];let i=_.get(t)??f.get(t);return n.t(i)?[i]:[]},y=[];for(let{universalIdentifier:t,relativePath:a}of[...r.filter(e=>e.isRegeneration),...i]){let r=s?.[a];if(n.t(r)){C.i(await(0,E.readFile)((0,D.join)(e,a)))!==r&&y.push({universalIdentifier:t,relativePath:a});continue}let i=v({universalIdentifier:t,relativePath:a});(p.has(a)||i.length>0&&!i.includes(await(0,E.readFile)((0,D.join)(e,a),`utf8`)))&&y.push({universalIdentifier:t,relativePath:a})}return y},q=e=>e.split(`\\`).join(`/`),J=({node:e,name:t})=>n.t(e)&&A.isIdentifier(e)&&e.text===t,Y=({objectLiteral:e,propertyName:t})=>e.properties.find(e=>A.isPropertyAssignment(e)&&!A.isComputedPropertyName(e.name)&&e.name.text===t)?.initializer,ae=e=>{if(!n.t(e)||!A.isCallExpression(e)||!J({node:e.expression,name:`readFileSync`}))return;let[t]=e.arguments;if(!n.t(t)||!A.isCallExpression(t)||!J({node:t.expression,name:`join`}))return;let[r,...i]=t.arguments;return J({node:r,name:`__dirname`})&&i.every(A.isStringLiteralLike)?i.map(e=>e.text):void 0},oe=({workflowPath:e,source:t})=>{let r=new Map,i=t=>{if(A.isObjectLiteralExpression(t)){let i=Y({objectLiteral:t,propertyName:`universalIdentifier`}),a=Y({objectLiteral:t,propertyName:`input`}),o=n.t(a)&&A.isObjectLiteralExpression(a)?ae(Y({objectLiteral:a,propertyName:`code`})):void 0;n.t(i)&&A.isStringLiteralLike(i)&&n.t(o)&&r.set(i.text.toLowerCase(),D.posix.join(D.posix.dirname(e),...o))}A.forEachChild(t,i)};return i(A.createSourceFile(e,t,A.ScriptTarget.Latest,!1)),r},se=async({appPath:e,scannedFiles:t,baseEntities:r})=>{let i=new Set(t.filter(e=>e.isReadable).map(e=>q(e.relativePath))),a=new Map(r.filter(e=>e.kind===`workflow`).map(e=>[e.universalIdentifier.toLowerCase(),e.config])),o=new Map;for(let r of t){if(r.entityKey!==`workflows`)continue;let t=q(r.relativePath),s=`${F(t)}/`,c=new Map,l=new Set,u=e=>e.startsWith(s)&&e.endsWith(`.code.ts`)&&i.has(e)&&!l.has(e),d=({stepIdentifier:e,relativePath:t})=>{c.set(e,t),l.add(t)};for(let[n,r]of oe({workflowPath:t,source:await(0,E.readFile)((0,D.join)(e,t),`utf8`)}))u(r)&&d({stepIdentifier:n,relativePath:r});let f=L({config:n.t(r.universalIdentifier)?a.get(r.universalIdentifier.toLowerCase()):void 0,workflowRelativePath:t,localCodeStepPathByStepIdentifier:c}).codeStepFiles;for(let{universalIdentifier:t,relativePath:n,content:r}of f){let i=t.toLowerCase();!c.has(i)&&u(n)&&await(0,E.readFile)((0,D.join)(e,n),`utf8`)===r&&d({stepIdentifier:i,relativePath:n})}o.set(t,[...c].map(([e,t])=>({universalIdentifier:e,relativePath:t})))}return o},ce=async({appPath:e,applicationExport:t,target:i,signal:a})=>{a.throwIfAborted();let o=C.n(i),s=m.n({value:t.files,frontComponents:m.r(t.manifest).frontComponents??[]});if(await b.t({appPath:e,relativePaths:[C.r,...s.map(e=>e.path)]}),!r.t(JSON.parse(await(0,E.readFile)((0,D.join)(e,`package.json`),`utf8`))))throw Error(`Pull requires a project with a package.json object.`);let c=await T.t({appPath:e,signal:a});if(n.t(c.application)&&c.application.universalIdentifier.toLowerCase()!==t.application.universalIdentifier.toLowerCase())throw Error(`This project declares application ${c.application.universalIdentifier}, but the export belongs to ${t.application.universalIdentifier}. Pull it into a different directory.`);return a.throwIfAborted(),{applicationExport:{...t,files:s},target:o}},le=({entities:e,unreconciledUniversalIdentifiers:t})=>e.map(e=>{if(e.kind!==`application`||!r.t(e.config)||!(0,j.isString)(e.config.defaultRoleUniversalIdentifier)||!t?.has(e.config.defaultRoleUniversalIdentifier.toLowerCase()))return e;let{defaultRoleUniversalIdentifier:n,...i}=e.config;return{...e,config:i}}),ue=({manifest:e,baseManifest:t,scannedFiles:r,unreconciledUniversalIdentifiers:i,systemPermissionFlag:o})=>{let s=new Map;for(let e of r)e.isReadable&&n.t(e.universalIdentifier)&&s.set(e.universalIdentifier.toLowerCase(),e);let{entities:c,skipped:l}=a.r({manifest:e,sourceFileByUniversalIdentifier:s,systemPermissionFlag:o});return{entities:c,baseEntities:le({entities:n.t(t)?a.r({manifest:t,sourceFileByUniversalIdentifier:s}).entities:[],unreconciledUniversalIdentifiers:i}),skipped:l}},de=({entities:e,baseEntities:t,protectedIdentifiers:r,writes:i,deletions:a,scannedFiles:o})=>{let s=new Set;M({value:t,identifiers:s});let c=new Map(o.map(e=>{let t=new Set;return M({value:e.config,identifiers:t}),[e.relativePath.split(`\\`).join(`/`),t]})),l=new Map(e.map(e=>[e.universalIdentifier.toLowerCase(),e.config])),u=new Map(t.map(e=>[e.universalIdentifier.toLowerCase(),e])),d=[...i.filter(e=>e.kind!==`translation`&&e.isRegeneration),...a.flatMap(e=>{let t=u.get(e.universalIdentifier.toLowerCase());return n.t(t)?[{...e,kind:t.kind}]:[]})],f=[],p=new Set,m=[],h;do{h=p.size;let e=new Map(c);for(let t of i){if(t.kind===`translation`||p.has(t.relativePath))continue;let n=new Set;M({value:l.get(t.universalIdentifier.toLowerCase()),identifiers:n}),e.set(t.relativePath,n)}for(let t of a)p.has(t.relativePath)||e.delete(t.relativePath);let t=new Set([...e.values()].flatMap(e=>[...e]));for(let e of d){if(p.has(e.relativePath)||e.kind===`translation`||e.kind===`dependency`||e.kind===`publicAsset`)continue;let i=[...c.get(e.relativePath)??[]].find(e=>!t.has(e)&&(r.has(e)||!s.has(e)));if(n.t(i)){if(p.add(e.relativePath),e.kind===`workflow`){let t=new Set(c.get(e.relativePath));M({value:l.get(e.universalIdentifier.toLowerCase()),identifiers:t}),m.push({codeStepFolderPath:`${F(e.relativePath)}/`,identifiers:t})}f.push({kind:e.kind,universalIdentifier:e.universalIdentifier,reason:`preserving ${e.relativePath}, replacement would remove nested local definition ${i} without a confirmed remote deletion`})}}}while(p.size!==h);let g=({relativePath:e,universalIdentifier:t})=>p.has(e)||m.some(({codeStepFolderPath:n,identifiers:r})=>e.startsWith(n)&&r.has(t.toLowerCase()));return{writes:i.filter(e=>!g(e)),deletions:a.filter(e=>!g(e)),skipped:f}},fe=({manifest:e,baseManifest:t,unreconciledUniversalIdentifiers:i,protectedIdentifiers:a})=>{let o=e=>r.t(e)&&(0,j.isString)(e.universalIdentifier)?e.universalIdentifier.toLowerCase():void 0,s=(e,t)=>{let s=new Map(t.map(e=>[o(e),e])),l=e.filter(e=>{let t=o(e);return!n.t(t)||!i.has(t)}).map(e=>{let t=o(e),i=s.get(t);return!n.t(t)||!r.t(e)||!r.t(i)?e:c(e,i)}),u=new Set(l.map(o)),d=t.filter(e=>{let t=o(e);return n.t(t)&&!u.has(t)&&(i.has(t)||a.has(t))});return[...l,...d]},c=(e,t)=>{let n={...e};for(let r of new Set([...Object.keys(e),...Object.keys(t??{})])){let i=e[r],a=t?.[r];if(!(0,j.isArray)(i)&&!(0,j.isArray)(a))continue;let o=s((0,j.isArray)(i)?i:[],(0,j.isArray)(a)?a:[]);((0,j.isArray)(i)||o.length>0)&&(n[r]=o)}return n},l={...e,...c(e,t)};return n.t(t)&&i.has(e.application.universalIdentifier.toLowerCase())&&(l.application=t.application),l},pe=/^[0-9a-f]{64}$/,X=e=>r.t(e)&&Object.values(e).every(e=>(0,j.isString)(e)&&pe.test(e)),me=async({appPath:e,target:t,applicationUniversalIdentifier:i})=>{await b.t({appPath:e,relativePaths:[C.r]});let a=C.n(t);try{let t=JSON.parse(await(0,E.readFile)((0,D.join)(e,C.r),`utf8`));if(r.t(t)&&t.version===1)return{status:`unbound`,manifest:null};if(!r.t(t)||t.version!==2||!r.t(t.target)||!(0,j.isString)(t.target.apiUrl)||!(0,j.isString)(t.target.workspaceId)||!(0,j.isString)(t.applicationUniversalIdentifier)||!S.t(t.manifest)||t.applicationUniversalIdentifier.toLowerCase()!==t.manifest.application.universalIdentifier.toLowerCase()||n.t(t.unreconciledUniversalIdentifiers)&&(!(0,j.isArray)(t.unreconciledUniversalIdentifiers)||!t.unreconciledUniversalIdentifiers.every(e=>(0,j.isString)(e)&&o.t(e)))||n.t(t.sourceFingerprints)&&!X(t.sourceFingerprints)||n.t(t.publicAssetFingerprints)&&!X(t.publicAssetFingerprints)||n.t(t.remoteSourceFingerprints)&&!X(t.remoteSourceFingerprints)||n.t(t.dependencyFingerprints)&&!X(t.dependencyFingerprints))return{status:`unreadable`,manifest:null};let s=C.n({apiUrl:t.target.apiUrl,workspaceId:t.target.workspaceId});return s.apiUrl!==a.apiUrl||s.workspaceId!==a.workspaceId||t.applicationUniversalIdentifier.toLowerCase()!==i.toLowerCase()?{status:`other-target`,manifest:null}:{status:`used`,manifest:t.manifest,unreconciledUniversalIdentifiers:t.unreconciledUniversalIdentifiers?.filter(j.isString).map(e=>e.toLowerCase()),dependencyFingerprints:X(t.dependencyFingerprints)?t.dependencyFingerprints:void 0,publicAssetFingerprints:X(t.publicAssetFingerprints)?t.publicAssetFingerprints:void 0,remoteSourceFingerprints:X(t.remoteSourceFingerprints)?t.remoteSourceFingerprints:void 0,sourceFingerprints:X(t.sourceFingerprints)?t.sourceFingerprints:void 0}}catch(e){return{status:c.t(e,`ENOENT`)?`missing`:`unreadable`,manifest:null}}},he=({appPath:e,writes:t})=>{let r=new Set(t.flatMap(e=>e.requiredSdkExports));if(r.size===0)return;let i=(0,O.createRequire)((0,D.join)(e,`package.json`))(`twenty-sdk/define`),o=[...r].filter(e=>!n.t(i[e])).sort();if(o.length>0)throw new u.t({code:`SDK_SOURCE_UNSUPPORTED`,message:`The app's twenty-sdk cannot read the generated definitions. Missing exports: ${o.join(`, `)}.`,hint:`Upgrade the app to a compatible twenty-sdk version (${a.t} or later).`,details:{missingNames:o}})},ge=`.twenty/cli`,_e=async({appPath:e,writes:t,deletions:n})=>{let r=t.map(e=>e.relativePath);if(new Set(r).size!==r.length)throw Error(`Refusing to write: two entities resolved to the same file path`);let i=(0,D.resolve)(e);for(let t of[...r,...n.map(e=>e.relativePath)]){let n=(0,D.relative)(i,(0,D.resolve)(i,t));if(n.length===0||n===`..`||n.startsWith(`..${D.sep}`)||(0,D.isAbsolute)(n))throw Error(`Refusing to write: ${t} leaves the application directory`);let r=(0,D.join)(e,t);if(await l.i(r)&&(await(0,E.lstat)(r)).isDirectory())throw Error(`Refusing to write: ${t} is a directory, and pull never deletes a folder`)}},ve=async({appPath:e,backupDirectory:t,relativePath:n})=>{let r=(0,D.join)(e,n);if(!await l.i(r))return!1;let i=(0,D.join)(t,n);return await l.r((0,D.dirname)(i)),await l.t(r,i),!0},ye=async({appPath:e,backupDirectory:t,backedUpRelativePaths:n,writtenRelativePaths:r})=>{for(let t of r)await(0,E.rm)((0,D.join)(e,t),{force:!0});for(let r of n){let n=(0,D.join)(e,r);await l.r((0,D.dirname)(n)),await(0,E.rm)(n,{force:!0}),await l.t((0,D.join)(t,r),n)}},be=async({appPath:e,writes:t,deletions:n,finalWrite:r,signal:i})=>{let a=r?[...t,r]:t;i?.throwIfAborted(),await _e({appPath:e,writes:a,deletions:n});let o=(0,D.join)(e,ge);await l.r(o);let s=await(0,E.mkdtemp)((0,D.join)(o,`pull-staging-`)),c=await(0,E.mkdtemp)((0,D.join)(o,`pull-backup-`)),d=[],f=[];try{for(let e of a){let t=(0,D.join)(s,e.relativePath);await l.r((0,D.dirname)(t)),await(0,E.writeFile)(t,e.content,e===r?{mode:384}:void 0)}for(let t of[...a.map(e=>e.relativePath),...n.map(e=>e.relativePath)])await ve({appPath:e,backupDirectory:c,relativePath:t})&&d.push(t);i?.throwIfAborted();for(let n of t){let t=(0,D.join)(e,n.relativePath);await l.r((0,D.dirname)(t)),f.push(n.relativePath),await l.t((0,D.join)(s,n.relativePath),t)}for(let t of n)await(0,E.rm)((0,D.join)(e,t.relativePath),{force:!0});if(r){let t=(0,D.join)(e,r.relativePath);await l.r((0,D.dirname)(t)),f.push(r.relativePath),await l.t((0,D.join)(s,r.relativePath),t)}}catch(t){try{await ye({appPath:e,backupDirectory:c,backedUpRelativePaths:d,writtenRelativePaths:f.filter(e=>!d.includes(e))})}catch(e){throw await l.s(s).catch(()=>void 0),new u.t({code:`PULL_FAILED`,details:{outcome:`unknown`,backupDirectory:c},message:`Pull failed and could not restore every file it had replaced. The originals are kept in ${c}.\nOriginal failure: ${t instanceof Error?t.message:String(t)}\nRestore failure: ${e instanceof Error?e.message:String(e)}`})}throw await l.s(s),await l.s(c),i?.aborted&&Object.is(t,i.reason)?t:new u.t({code:`PULL_FAILED`,message:t instanceof Error?t.message:String(t),details:{outcome:`unchanged`}})}try{await l.s(s),await l.s(c)}catch(e){throw new u.t({code:`PULL_FAILED`,message:`Pull completed, but temporary files could not be removed: ${e instanceof Error?e.message:String(e)}`,details:{outcome:`pulled`,backupDirectory:c,stagingDirectory:s}})}},xe=[`nameSingular`,`name`,`label`,`title`],Se=e=>{let t={},i=[{value:e}];for(;i.length>0;){let e=i.pop();if(!n.t(e))break;let{value:a,parentLabel:o}=e;if(Array.isArray(a)){for(let e of[...a].reverse())i.push({value:e,parentLabel:o});continue}if(!r.t(a))continue;let s=xe.map(e=>a[e]).find(j.isNonEmptyString),c=n.t(s)&&n.t(o)?`${o}.${s}`:s??o;n.t(s)&&n.t(c)&&(0,j.isNonEmptyString)(a.universalIdentifier)&&(t[a.universalIdentifier]=c);for(let e of Object.values(a).reverse())i.push({value:e,parentLabel:c})}return t},Ce=e=>{let t=new Map;for(let n of e){let e=`${n.defaultFolder}/${n.fileBaseName}${n.fileSuffix}`,r=t.get(e)??[];r.push(n),t.set(e,r)}let r=new Map;for(let e of t.values()){if(e.length===1){r.set(e[0].universalIdentifier,e[0].fileBaseName);continue}let t=e.map(e=>n.t(e.parentName)?a.a(`${s.t(e.parentName)}-${e.fileBaseName}`):e.fileBaseName),i=new Map;for(let e of t)i.set(e,(i.get(e)??0)+1);e.forEach((e,n)=>{let o=t[n],s=i.get(o)===1;r.set(e.universalIdentifier,s?o:a.a(`${e.universalIdentifier.slice(0,8)}-${o}`))})}return r},Z=e=>e.toLowerCase(),Q=e=>e.split(`\\`).join(`/`),we=({scannedFiles:e,entityKey:t})=>{let n=new Map;for(let r of e){if(r.entityKey!==t)continue;let e=Q((0,D.dirname)(r.relativePath));n.set(e,(n.get(e)??0)+1)}return[...n.entries()].sort(([e,t],[n,r])=>r-t||e.localeCompare(n))[0]?.[0]??null},Te=({folder:e,fileBaseName:t,fileSuffix:n,universalIdentifier:r,takenRelativePaths:i})=>{let a=r.slice(0,8),o=[t,`${a}-${t}`,...Array.from({length:100},(e,n)=>`${a}-${t}-${n+2}`)];for(let t of o){let r=D.posix.join(e,`${t}${n}`);if(!i.has(Z(r)))return r}throw Error(`Could not find a free file name for ${r} in ${e}`)},Ee=({entity:e,applicationFile:t,scannedFileByUniversalIdentifier:n})=>e.kind===`application`?t:n.get(e.universalIdentifier.toLowerCase()),De=({entities:e,baseEntities:t,scannedFiles:r,workspaceUniversalIdentifiers:i,unreconciledUniversalIdentifiers:a,localCodeStepFilesByWorkflowPath:o})=>{let s=new Set(e.map(e=>e.universalIdentifier.toLowerCase())),c=new Map(t.map(e=>[e.universalIdentifier,JSON.stringify(e.config)])),l=Ce(e),u=new Map,d=r.find(e=>e.entityKey===`application`);for(let e of r)n.t(e.universalIdentifier)&&u.set(e.universalIdentifier.toLowerCase(),e);let f=[],p=[],m=new Set,h=new Set(r.map(e=>Z(Q(e.relativePath)))),g=new Set(h),_=[],v=new Set,y=e=>o?.get(e)??[];for(let t of e){let e=Ee({entity:t,applicationFile:d,scannedFileByUniversalIdentifier:u}),i=n.t(e)?Q(e.relativePath):void 0,o=we({scannedFiles:r,entityKey:S.n[t.kind]})??t.defaultFolder,b=l.get(t.universalIdentifier)??t.fileBaseName,x=i??Te({folder:o,fileBaseName:b,fileSuffix:t.fileSuffix,universalIdentifier:t.universalIdentifier,takenRelativePaths:g});m.add(x),g.add(Z(x)),v.add(Z(x));let C=c.get(t.universalIdentifier),w=new Set,T=new Set;M({value:e?.config,identifiers:w}),M({value:t.config,identifiers:T});let E=[...w].some(e=>!T.has(e)&&s.has(e));if(n.t(e)&&e.targetFunctionName===t.definer&&!E&&!a?.has(t.universalIdentifier.toLowerCase())&&n.t(C)&&C===JSON.stringify(t.config)){p.push(t);continue}let D=n.t(i)?y(i):[],O=new Map(D.map(e=>[e.universalIdentifier.toLowerCase(),Z(e.relativePath)])),{codeStepFiles:k,...A}=K({entity:t,relativePath:x,isCodeStepPathAvailable:({relativePath:e,stepUniversalIdentifier:t})=>{let n=Z(e);return!g.has(n)||!v.has(n)&&O.get(t.toLowerCase())===n}});f.push({kind:t.kind,universalIdentifier:t.universalIdentifier,relativePath:x,...A,isRegeneration:n.t(i)});for(let e of k){let n=Z(e.relativePath);f.push({kind:t.kind,...e,requiredSdkExports:[],isRegeneration:h.has(n)}),m.add(e.relativePath),g.add(n),v.add(n)}_.push(...D)}let b=[];for(let e of c.keys()){if(s.has(e.toLowerCase()))continue;let t=u.get(e.toLowerCase()),r=n.t(t)?Q(t.relativePath):void 0;!n.t(r)||m.has(r)||(b.push({universalIdentifier:e,relativePath:r}),i.has(e)||_.push(...y(r)))}let x=r.filter(e=>n.t(e.universalIdentifier)&&!s.has(e.universalIdentifier.toLowerCase())&&!c.has(e.universalIdentifier)&&!i.has(e.universalIdentifier)&&!m.has(Q(e.relativePath))).map(e=>Q(e.relativePath));return{writes:f,unchanged:p,deletions:b,codeStepFileDeletions:_.filter(e=>!m.has(e.relativePath)),localOnlyRelativePaths:x}},$=[`dependencies`,`devDependencies`,`peerDependencies`],Oe=({content:e,existingContent:t})=>{let n=JSON.parse(e),i=JSON.parse(t);if($.some(e=>{let t=n[e];return r.t(t)&&Object.hasOwn(t,`twenty-sdk`)}))return e;for(let e of $){let t=i[e];if(!r.t(t)||!(0,j.isString)(t[`twenty-sdk`]))continue;let a=n[e];return n[e]={...r.t(a)?a:{},"twenty-sdk":t[`twenty-sdk`]},`${JSON.stringify(n,null,2)}\n`}return e},ke=async({appPath:e,files:t,sourceFingerprints:r={},dependencyFingerprints:i={}})=>{let a=[],o={},s={};for(let{path:c,content:u}of t){let t=(0,D.join)(e,c),d=await l.i(t)?await(0,E.readFile)(t,`utf8`):void 0,f=C.i(u);if(o[c]=f,n.t(d)&&(i[c]??r[c])===f)continue;let p=c===`package.json`&&n.t(d)?Oe({content:u,existingContent:d}):u;if(d===p){s[c]=C.i(p);continue}a.push({kind:`dependency`,universalIdentifier:`dependencies/${c}`,relativePath:c,content:p,requiredSdkExports:[],isRegeneration:n.t(d)})}return{writes:a,fingerprints:o,unchangedSourceFingerprints:s,unchangedCount:t.length-a.length}},Ae=async({appPath:e,includeConfig:t=!1,signal:r})=>{r.throwIfAborted();let i=await h.t(e),a=[];for(let o of i){r.throwIfAborted();let i=(0,D.relative)(e,o),s;try{s=await(0,E.readFile)(o,`utf-8`)}catch{a.push({relativePath:i,entityKey:null,targetFunctionName:null,universalIdentifier:null,isReadable:!1});continue}let c=_.r({fileContent:s,filePath:o});if(!n.t(c)){a.push({relativePath:i,entityKey:null,targetFunctionName:null,universalIdentifier:null,isReadable:!0});continue}let l=_.n[c],d={},f=!0;try{d=(await _.t({appPath:e,filePath:o})).config}catch(e){if(e instanceof u.t&&e.code===`SDK_SOURCE_UNSUPPORTED`)throw e;d={},f=!1}a.push({relativePath:i,entityKey:l,targetFunctionName:c,universalIdentifier:(0,j.isString)(d.universalIdentifier)?d.universalIdentifier:null,isReadable:f,...t?{config:d}:{}})}return r.throwIfAborted(),a},je=({sourceFingerprints:e={},writes:t,deletions:n})=>{let r=new Set(n.map(e=>e.relativePath));return{...Object.fromEntries(Object.entries(e).filter(([e])=>!r.has(e))),...Object.fromEntries(t.map(e=>[e.relativePath,C.i(e.content)]))}},Me=async e=>{let{appPath:t,signal:r}=e;try{let{applicationExport:i,target:a}=await ce(e),o=m.r(i.manifest),s=await me({appPath:t,target:a,applicationUniversalIdentifier:i.application.universalIdentifier}),c=n.t(s.manifest)?m.r(s.manifest):null,l=await Ae({appPath:t,includeConfig:!0,signal:r}),u=new Set(s.unreconciledUniversalIdentifiers),{entities:d,baseEntities:h,skipped:g}=ue({manifest:o,baseManifest:c,scannedFiles:l,unreconciledUniversalIdentifiers:u,systemPermissionFlag:p.i(t)});r?.throwIfAborted();let _=new Set(i.coverage.map(e=>e.universalIdentifier)),v=await se({appPath:t,scannedFiles:l,baseEntities:h}),y=De({entities:d,baseEntities:h,scannedFiles:l,workspaceUniversalIdentifiers:_,unreconciledUniversalIdentifiers:u,localCodeStepFilesByWorkflowPath:v}),x=new Set;M({value:o,identifiers:x}),M({value:i.coverage,identifiers:x});let S=l.filter(e=>e.entityKey===`frontComponents`).map(e=>(0,D.join)(t,e.relativePath)),w=await G({appPath:t,manifest:o,baseManifest:c,frontComponentSourcePaths:S}),T=de({entities:d,baseEntities:h,protectedIdentifiers:x,writes:y.writes,deletions:[...y.deletions.filter(e=>!x.has(e.universalIdentifier.toLowerCase())),...y.codeStepFileDeletions],scannedFiles:l}),E=await ke({appPath:t,files:i.files.filter(e=>e.folder===f.t.Dependencies),sourceFingerprints:s.sourceFingerprints,dependencyFingerprints:s.dependencyFingerprints}),O=await ee({appPath:t,files:i.files.filter(({folder:e})=>e===f.t.PublicAsset),sourceFingerprints:s.sourceFingerprints,publicAssetFingerprints:s.publicAssetFingerprints}),k=await te({appPath:t,manifest:o,baseManifest:c,files:i.files,scannedFiles:l,protectedIdentifiers:x,remoteSourceFingerprints:s.remoteSourceFingerprints,sourceFingerprints:s.sourceFingerprints,reservedPaths:new Set([...T.writes,...w.writes,...E.writes,...O.writes].map(e=>e.relativePath.toLowerCase()))}),A=[...T.writes,...w.writes,...E.writes,...O.writes,...k.writes],j=[...T.deletions,...k.deletions,...w.deletions.filter(e=>n.t(c?.translations)&&e.universalIdentifier in c.translations)],N=[...g,...T.skipped],P=new Set(N.map(e=>e.universalIdentifier.toLowerCase())),F=C.t({target:a,manifest:fe({manifest:i.manifest,baseManifest:s.manifest,unreconciledUniversalIdentifiers:P,protectedIdentifiers:x}),unreconciledUniversalIdentifiers:[...P],remoteSourceFingerprints:k.fingerprints,publicAssetFingerprints:{...s.publicAssetFingerprints,...O.fingerprints},dependencyFingerprints:{...s.dependencyFingerprints,...E.fingerprints},sourceFingerprints:je({sourceFingerprints:{...s.sourceFingerprints,...E.unchangedSourceFingerprints,...O.unchangedSourceFingerprints,...k.unchangedSourceFingerprints},writes:A,deletions:j})});await b.t({appPath:t,relativePaths:[...A.map(e=>e.relativePath),...j.map(e=>e.relativePath),F.relativePath]});let I=await ie({appPath:t,baseManifest:c,writes:A,deletions:j,frontComponentSourcePaths:S,baseEntities:h,localCodeStepFilesByWorkflowPath:v,sourceFingerprints:s.sourceFingerprints}),L=Se(o);return he({appPath:t,writes:A}),r?.throwIfAborted(),await be({appPath:t,writes:A,deletions:j,finalWrite:F,signal:r}),{success:!0,data:{application:{universalIdentifier:i.application.universalIdentifier,displayName:i.application.displayName},base:{status:s.status},writes:A.map(({content:e,requiredSdkExports:t,...n})=>n),deletions:j,overwrittenLocalChanges:I,unchangedCount:y.unchanged.length+E.unchangedCount+O.unchangedCount+k.unchangedCount,localOnlyRelativePaths:y.localOnlyRelativePaths,unreadableRelativePaths:l.filter(e=>!e.isReadable).map(e=>e.relativePath),skipped:N,compiledTranslationEntryCountByLocale:w.compiledEntryCountByLocale,entityLabelByUniversalIdentifier:L},diagnostics:[]}}catch(e){return{success:!1,error:{code:r?.aborted&&Object.is(e,r.reason)?`CANCELLED`:e instanceof u.t?e.code:`PULL_FAILED`,message:e instanceof Error?e.message:String(e),...d.t(e),details:{outcome:`unchanged`,...e instanceof u.t?e.details:{}}},diagnostics:[]}}},Ne=async e=>{try{let t=e.applicationExport,n=r.t(t)&&r.t(t.application)&&(0,j.isString)(t.application.universalIdentifier)?t.application.universalIdentifier:``;return await Me({...e,applicationExport:m.t({value:t,universalIdentifier:n})})}finally{await(0,k.stop)()}};exports.pullSource=Ne;
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isPlainObject-fJEJm71P.cjs"),n=require("./isValidUniversalIdentifier-DymFerYs.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./resolve-source-sdk-C4Hu045V.cjs"),a=require("./create-cancelled-error-BBhAY8fS.cjs"),o=require("./to-worker-output-diagnostics-w1hZPfn0.cjs");var s=e.t(),c=e=>{if(!t.t(e))return;if((0,s.isNull)(e.application))return{data:{application:null}};let r=e.application;if(!(!t.t(r)||!(0,s.isString)(r.universalIdentifier)||!n.t(r.universalIdentifier)||!(0,s.isString)(r.displayName)&&!(0,s.isNull)(r.displayName)))return{data:{application:{universalIdentifier:r.universalIdentifier,displayName:r.displayName}}}},l=async({appPath:e,signal:t,warn:n})=>{t.throwIfAborted();let s=await i.t({appPath:e,warn:n}),l=await o.n({request:{type:`readSourceIdentity`,appPath:e},signal:t});if(t.aborted)throw a.t();let u=o.s({value:l.result,parseData:c}),d=[...u.diagnostics,...o.t(l.output)];if(!u.success)throw new r.t({code:u.error.code===`SDK_SOURCE_UNSUPPORTED`?`SDK_SOURCE_UNSUPPORTED`:`IDENTITY_READ_FAILED`,message:u.error.message,hint:u.error.hint??(u.error.code===`SDK_SOURCE_UNSUPPORTED`?`Use the SDK define functions, rename local helpers with the same names, or install a compatible twenty-sdk version.`:void 0),details:{...u.error.details,sdkVersion:s.version,diagnostics:d}});return{...u.data,diagnostics:d}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./isValidUniversalIdentifier-DymFerYs.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./is-same-universal-identifier-Bm_wb6Ez.cjs"),o=require("./read-command-values-l5T9Lba4.cjs"),s=require("./to-worker-output-diagnostics-w1hZPfn0.cjs"),c=require("./read-app-identity-Cny6sAGs.cjs"),l=require("./resolve-app-project-B4IjfcM-.cjs"),u=require("./is-application-not-found-error-CQ7k4hGU.cjs"),d=require("./create-metadata-client-FopHnDj0.cjs"),f=require("./create-app-not-installed-error-sN4TzjlV.cjs");var p=e.t(),m=async({universalIdentifier:e,target:t,signal:r})=>{let o=(await d.t({target:t,signal:r}).query({__name:`FindInstalledApplication`,findOneApplication:{__args:{universalIdentifier:e},name:!0,universalIdentifier:!0,canBeUninstalled:!0}}).catch(n=>{throw u.t({error:n,field:`findOneApplication`})?f.t({universalIdentifier:e,apiUrl:t.apiUrl}):n}))?.findOneApplication;if(!n.t(o)||!(0,p.isNonEmptyString)(o.name)||!a.t({value:o.universalIdentifier,universalIdentifier:e})||!(0,p.isBoolean)(o.canBeUninstalled))throw new i.t({code:`INVALID_RESPONSE`,message:`The server returned an invalid installed application.`});return{name:o.name,canBeUninstalled:o.canBeUninstalled}},h=async({context:e,onIdentityRead:n})=>{let a=o.i(e.options,`universalIdentifier`);if(t.t(a)){if(!r.t(a))throw new i.t({code:`INVALID_INPUT`,exitCode:i.n.USAGE,message:`--universal-identifier must be a UUID of version 4 or later, not ${a}.`});return a.toLowerCase()}let{options:u,output:d,outputMode:f,signal:p}=e,m=await c.t({appPath:(await l.t({explicitPath:o.i(u,`path`),workingDirectory:process.cwd()})).path,signal:p,warn:d.warn});if(!t.t(m.application))throw new i.t({code:`INVALID_INPUT`,exitCode:i.n.USAGE,message:`This project has no application definition.`});if(f===`human`)for(let e of m.diagnostics)d.progress({message:s.c(e)});return n(),m.application.universalIdentifier.toLowerCase()};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isValidUniversalIdentifier-DymFerYs.cjs"),r=require("./list-application-source-files-DcyU-HrX.cjs"),i=require("./extract-manifest-from-file-DPDIhnyg.cjs");let a=require("node:fs/promises"),o=require("node:path");var s=e.t(),c=async({appPath:e,signal:c})=>{if(c.throwIfAborted(),!(0,o.isAbsolute)(e)||!(await(0,a.stat)(e)).isDirectory())throw Error(`The app path must be an absolute directory path.`);let l=await r.t(e),u=null;for(let r of l){if(c.throwIfAborted(),i.r({fileContent:await(0,a.readFile)(r,`utf8`),filePath:r})!==`defineApplication`)continue;if(t.t(u))throw Error(`The project declares more than one application.`);let{config:l}=await i.t({appPath:e,filePath:r});if(!(0,s.isString)(l.universalIdentifier)||!n.t(l.universalIdentifier))throw Error(`Could not read the application identifier in ${(0,o.relative)(e,r)}.`);u={universalIdentifier:l.universalIdentifier,displayName:(0,s.isString)(l.displayName)?l.displayName:null}}return c.throwIfAborted(),{application:u}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./cli-error-CrUD8uMp.cjs");var r,i=async()=>{try{let{EnvHttpProxyAgent:t}=await Promise.resolve().then(()=>e.r(require("./undici-BfHt0Tny.cjs").default));return new t}catch{throw new n.t({code:`INVALID_CONFIG`,message:`Could not configure the network proxy.`,hint:`Check HTTP_PROXY, HTTPS_PROXY, http_proxy and https_proxy.`})}},a=async(t,n,a)=>{let o=process.env.http_proxy??process.env.HTTP_PROXY,s=process.env.https_proxy??process.env.HTTPS_PROXY;if(!o&&!s&&a===void 0)return fetch(t,n);let c;o||s?(r??=i(),c=await r):c=(await Promise.resolve().then(()=>e.r(require("./undici-BfHt0Tny.cjs").default))).getGlobalDispatcher();let l=a===void 0?c:{dispatch:(e,t)=>c.dispatch({...e,headersTimeout:a,bodyTimeout:a},t)},u={...n,dispatcher:l};return fetch(t,u)},o=e=>new n.t({code:`RESPONSE_LIMIT_EXCEEDED`,message:`The response is larger than ${e/1024/1024} MiB.`,hint:`Ask for less data, for example a smaller page or fewer fields.`,details:{byteLimit:e}}),s=async(e,n)=>{let r=Number(e.headers.get(`content-length`));if(Number.isFinite(r)&&r>n)throw await e.body?.cancel(),o(n);if(!t.t(e.body))return new Uint8Array;let i=e.body.getReader(),a=[],s=0,c=await i.read();for(;!c.done;){if(s+=c.value.byteLength,s>n)throw await i.cancel(),o(n);a.push(c.value),c=await i.read()}return Buffer.concat(a)};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
@@ -0,0 +1 @@
1
+ var e=require("./build--4zYt4wd.cjs").t(),t=(t,n)=>{let r=t[n];return(0,e.isString)(r)?r:void 0},n=(t,n)=>{let r=t[n];return(0,e.isArray)(r)?r.filter(e.isString):void 0},r=(e,t)=>e[t]===!0,i=(t,n)=>{let r=t[n];return(0,e.isString)(r)?r:void 0};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1 @@
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-CJctgvfE.cjs"),n=require("./isPlainObject-fJEJm71P.cjs"),r=require("./has-error-code-DsJeqbZq.cjs"),i=require("./cli-error-CrUD8uMp.cjs");let a=require("node:fs/promises");var o=e.t(),s=`default`,c=`local`,l={twentyCLIAccessToken:[`accessToken`,`applicationAccessToken`],twentyCLIRefreshToken:[`refreshToken`,`applicationRefreshToken`],twentyCLIRegistrationClientId:[`oauthClientId`]},u=Object.values(l).flat(),d=[`apiUrl`,`apiKey`,`appRegistrationId`,`appRegistrationClientId`,...Object.entries(l).flat(2)],f=e=>{if(!n.t(e)||!(0,o.isString)(e.apiUrl))return;let r=Object.fromEntries(Object.entries(l).flatMap(([n,r])=>{let i=[n,...r].map(t=>e[t]).find(o.isString);return t.t(i)?[[n,i]]:[]}));return{...Object.fromEntries(Object.entries(e).filter(([e])=>!u.includes(e))),apiUrl:e.apiUrl,...r}},p=e=>{if(!n.t(e))return;let r={};for(let[n,i]of Object.entries(e)){let e=f(i);if(!t.t(e))return;r[n]=e}return r},m=e=>{if(!Object.hasOwn(e,s)||Object.hasOwn(e,c))return{remotes:e,isRenamed:!1};let{[s]:t,...n}=e;return{remotes:{...n,[c]:t},isRenamed:!0}},h=e=>{let n=p(e.profiles??{}),r=p(e.remotes??{});if(!t.t(n)||!t.t(r))return;let i=f(Object.fromEntries(d.filter(t=>t in e).map(t=>[t,e[t]]))),a=Object.fromEntries(Object.entries(e).filter(([e])=>!d.includes(e)&&![`profiles`,`remotes`,`defaultWorkspace`,`version`].includes(e))),{remotes:l,isRenamed:u}=m({...n,...r});t.t(i)&&!Object.hasOwn(l,c)&&(l[c]=i);let h=u&&e.defaultWorkspace===s?c:e.defaultWorkspace;return{...a,version:1,remotes:l,...(0,o.isString)(h)?{defaultRemote:h}:{}}},g=e=>{if(!n.t(e))return;if(!t.t(e.version)&&(`profiles`in e||`apiUrl`in e))return h(e);let r=p(e.remotes??{});if(!(!t.t(r)||t.t(e.defaultRemote)&&!(0,o.isString)(e.defaultRemote)))return{...e,version:1,remotes:r}},_={version:1,remotes:{}},v=(e,t)=>new i.t({code:`INVALID_CONFIG`,exitCode:i.n.USAGE,message:`${e} is not a valid Twenty config: ${t}`,hint:`Fix or move the file. It is never overwritten while it is invalid.`,details:{configPath:e}}),y=/line (\d+) column (\d+)/,b=e=>{let n=e instanceof Error?y.exec(e.message):null;return t.t(n)?`invalid JSON at line ${n[1]}, column ${n[2]}.`:`invalid JSON.`},x=async e=>{try{return await(0,a.readFile)(e,`utf8`)}catch(t){if(r.t(t,`ENOENT`))return``;throw new i.t({code:`INVALID_CONFIG`,exitCode:i.n.USAGE,message:`Could not read ${e}.`,details:{configPath:e,reason:t instanceof Error?t.message:String(t)}})}},S=async e=>{let r=await x(e);if(r.trim()===``)return _;let i;try{i=JSON.parse(r)}catch(t){throw v(e,b(t))}if(n.t(i)&&t.t(i.version)&&i.version!==1)throw v(e,`version ${(0,o.isNumber)(i.version)?i.version:`unknown`} is not supported by this CLI.`);let a=g(i);if(!t.t(a))throw v(e,`remotes need an apiUrl and defaultRemote must be a name.`);return a};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});