twenty 2.54.3 → 2.56.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 (147) hide show
  1. package/CONTRIBUTING.md +1 -0
  2. package/dist/app-template/example/files/AGENTS.md +1 -1
  3. package/dist/app-template/yarn.lock +102 -102
  4. package/dist/app-worker.cjs +1 -1
  5. package/dist/chunks/application-xzYK_VZV.cjs +5 -0
  6. package/dist/chunks/{build-source-manifest-BJyDykpG.cjs → build-source-manifest-CWg4z3sT.cjs} +1 -1
  7. package/dist/chunks/build-source-snapshot-CNIkoxN6.cjs +26 -0
  8. package/dist/chunks/check-node-requirement-CIDuA1s-.cjs +1 -0
  9. package/dist/chunks/{cli-version.constant-BRiLR-nG.cjs → cli-version.constant-CXTtLO6W.cjs} +1 -1
  10. package/dist/chunks/{collect-translatable-strings-BWzloBoB.cjs → collect-translatable-strings-Drwh6Av8.cjs} +1 -1
  11. package/dist/chunks/compile-application-translations-BS7FQ7zb.cjs +870 -0
  12. package/dist/chunks/constants-BVRtHFho-CGmbRR4M.cjs +55 -0
  13. package/dist/chunks/{create-http-status-error-CSxveq4d.cjs → create-http-status-error-DGznRpsu.cjs} +1 -1
  14. package/dist/chunks/create-metadata-client-CZSrLZOR.cjs +6 -0
  15. package/dist/chunks/{create-pull-base-write-BAapBdLz.cjs → create-pull-base-write-BxCvm_m8.cjs} +1 -1
  16. package/dist/chunks/{create-rest-client-eb80-tts.cjs → create-rest-client-8cQWvHwx.cjs} +1 -1
  17. package/dist/chunks/extract-manifest-from-file-CAbBympP.cjs +1 -0
  18. package/dist/chunks/{extract-source-translations-BHy14v8o.cjs → extract-source-translations-BUR0Rc6f.cjs} +1 -1
  19. package/dist/chunks/{fetch-metadata-inspection-IuAwjjQT.cjs → fetch-metadata-inspection-BBWnhrft.cjs} +1 -1
  20. package/dist/chunks/{fetch-signed-in-identity-BFxRufRI.cjs → fetch-signed-in-identity-C-qQ3udY.cjs} +1 -1
  21. package/dist/chunks/{fetch-workspace-or-throw-CgPc8IBL.cjs → fetch-workspace-or-throw-J79slzbc.cjs} +1 -1
  22. package/dist/chunks/{format-data-value-Cln0Hv7L.cjs → format-data-value-fs3RrhMv.cjs} +1 -1
  23. package/dist/chunks/{format-metadata-fields-BltFjIsO.cjs → format-metadata-fields-9yjjSDbM.cjs} +1 -1
  24. package/dist/chunks/{format-metadata-owner-DpOc_B3P.cjs → format-metadata-owner-BeV6-_Th.cjs} +1 -1
  25. package/dist/chunks/{generate-application-client-CL8nm0q9.cjs → generate-application-client-B4yPRWWv.cjs} +1 -1
  26. package/dist/chunks/{get-client-generation-skip-reason-BJFlVAos.cjs → get-client-generation-skip-reason-DTIfgD_s.cjs} +1 -1
  27. package/dist/chunks/get-engine-version-range-DZGIWoR6.cjs +1 -0
  28. package/dist/chunks/get-local-status-D52rgA2e.cjs +1 -0
  29. package/dist/chunks/{get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs → get-system-view-universal-identifier.util-Bq8_ovT3-CXfImcpX.cjs} +1 -1
  30. package/dist/chunks/global-flags.constant-EQCqyBC2.cjs +1 -0
  31. package/dist/chunks/has-yarn-plug-and-play-BGlTmmrM.cjs +1 -0
  32. package/dist/chunks/{is-access-token-expiring-B3WtsewG.cjs → is-access-token-expiring-DYNdux1L.cjs} +1 -1
  33. package/dist/chunks/{is-application-not-found-error-BC7jyU0p.cjs → is-application-not-found-error-AJka4bNR.cjs} +1 -1
  34. package/dist/chunks/is-exported-manifest-Bj0l5om_.cjs +1 -0
  35. package/dist/chunks/is-valid-package-name-DvFQq5au.cjs +1 -0
  36. package/dist/chunks/list-ancestor-directories-BtB2hNt6.cjs +1 -0
  37. package/dist/chunks/{locale-catalog-format-C_5EGBEn.cjs → locale-catalog-format-D2tDWYnc.cjs} +1 -1
  38. package/dist/chunks/ltr-BS5BTFWS.cjs +1 -0
  39. package/dist/chunks/max-satisfying-BNYDQrne.cjs +1 -0
  40. package/dist/chunks/metadata-BYjbOpo6.cjs +1 -0
  41. package/dist/chunks/{metadata-page.constant-7kxmFenL.cjs → metadata-page.constant-qMNOJLjJ.cjs} +1 -1
  42. package/dist/chunks/{parse-app-export-CpZxFIlO.cjs → parse-app-export-hG8ubXTU.cjs} +1 -1
  43. package/dist/chunks/parse-graphql-response-C2la3nev.cjs +1 -0
  44. package/dist/chunks/{parse-json-input-kEwLo8mG.cjs → parse-json-input-DPZY9jQQ.cjs} +1 -1
  45. package/dist/chunks/print-typescript-value-BsjFUceV.cjs +3 -0
  46. package/dist/chunks/pull-minimum-sdk-version.constant-EdauMnSl.cjs +6 -0
  47. package/dist/chunks/pull-source-DeVIgzVE.cjs +1 -0
  48. package/dist/chunks/{read-app-identity-CJZThpUC.cjs → read-app-identity-D6Cp_N-A.cjs} +1 -1
  49. package/dist/chunks/{read-application-identifier-D6YPuiA7.cjs → read-application-identifier-CR_a7oUp.cjs} +1 -1
  50. package/dist/chunks/{read-application-identity-CWSIB1Jd.cjs → read-application-identity-CbZIanaH.cjs} +1 -1
  51. package/dist/chunks/read-bounded-body-BHRu5J2Y.cjs +1 -0
  52. package/dist/chunks/{read-config-9Dv5cmvw.cjs → read-config-BwRvqqhW.cjs} +1 -1
  53. package/dist/chunks/{read-infer-deletion-option-DtCw0TsU.cjs → read-infer-deletion-option-BQJz4Jqq.cjs} +1 -1
  54. package/dist/chunks/{read-json-object-BlyNzzdk.cjs → read-json-object-BP1Q_W12.cjs} +1 -1
  55. package/dist/chunks/read-local-container-CidDipKg.cjs +1 -0
  56. package/dist/chunks/read-snapshot-file-BPLzlSH_.cjs +1 -0
  57. package/dist/chunks/{read-source-identity-BQ_YGISo.cjs → read-source-identity-CDv42KDj.cjs} +1 -1
  58. package/dist/chunks/{record-pull-base-BIlU7Fj1.cjs → record-pull-base-BiVlDaBW.cjs} +1 -1
  59. package/dist/chunks/{record-typecheck-config-inputs-BGVirGsR.cjs → record-typecheck-config-inputs-DV3LeWK2.cjs} +1 -1
  60. package/dist/chunks/{request-oauth-tokens-BkL-WsAM.cjs → request-oauth-tokens-DJatgiZE.cjs} +1 -1
  61. package/dist/chunks/resolve-app-project-DrRcP_gL.cjs +1 -0
  62. package/dist/chunks/{resolve-command-target-C4r6LuWk.cjs → resolve-command-target-Czttq45g.cjs} +1 -1
  63. package/dist/chunks/{resolve-metadata-object-C3sDavWu.cjs → resolve-metadata-object-xK90Ursp.cjs} +1 -1
  64. package/dist/chunks/resolve-project-typescript-BxIGFhr6.cjs +1 -0
  65. package/dist/chunks/resolve-request-url-I1EOOumy.cjs +1 -0
  66. package/dist/chunks/resolve-source-sdk-DQnc0tSq.cjs +1 -0
  67. package/dist/chunks/{run-api-graphql-command-D-Pu9EdU.cjs → run-api-graphql-command-CmGTtFbD.cjs} +1 -1
  68. package/dist/chunks/{run-api-rest-command-BuDANSQa.cjs → run-api-rest-command-CnYQWgNv.cjs} +1 -1
  69. package/dist/chunks/run-app-add-command-o4tAyrDF.cjs +174 -0
  70. package/dist/chunks/{run-app-apply-command-CilkY9ws.cjs → run-app-apply-command-CnVUshfx.cjs} +1 -1
  71. package/dist/chunks/{run-app-build-command-DaKa_eKF.cjs → run-app-build-command-hjBbY-k_.cjs} +1 -1
  72. package/dist/chunks/{run-app-dev-command-BnSJIUgg.cjs → run-app-dev-command-Ml0sKfeA.cjs} +1 -1
  73. package/dist/chunks/{run-app-exec-command-BPlfFt9-.cjs → run-app-exec-command-DMpczF0l.cjs} +2 -2
  74. package/dist/chunks/{run-app-generate-client-command-7t5Hs10P.cjs → run-app-generate-client-command-D6c8FnpJ.cjs} +1 -1
  75. package/dist/chunks/{run-app-init-command-DhPC_GBU.cjs → run-app-init-command-XjO6SJpP.cjs} +1 -1
  76. package/dist/chunks/{run-app-install-command-DOzp9bOL.cjs → run-app-install-command-DlXSkmZV.cjs} +1 -1
  77. package/dist/chunks/run-app-logs-command-IlwI3B9r.cjs +9 -0
  78. package/dist/chunks/{run-app-operation-BbsxjrjR.cjs → run-app-operation-kyBLbhLr.cjs} +1 -1
  79. package/dist/chunks/{run-app-plan-command-Bt3IwVec.cjs → run-app-plan-command-1we4YlYM.cjs} +1 -1
  80. package/dist/chunks/{run-app-publish-command-CoGrZA2a.cjs → run-app-publish-command-cPw8ZxuU.cjs} +1 -1
  81. package/dist/chunks/{run-app-pull-command-gUX-w9BE.cjs → run-app-pull-command-Douf4yQq.cjs} +3 -3
  82. package/dist/chunks/{run-app-translations-extract-command-LUAa7jb9.cjs → run-app-translations-extract-command-BIHvH8MO.cjs} +1 -1
  83. package/dist/chunks/{run-app-typecheck-command-CbHawvU8.cjs → run-app-typecheck-command-C3z8IIuQ.cjs} +1 -1
  84. package/dist/chunks/{run-app-uninstall-command-BK-JAeo2.cjs → run-app-uninstall-command-BjqZ4eN7.cjs} +1 -1
  85. package/dist/chunks/{run-auth-login-command-CN6Xqgpx.cjs → run-auth-login-command-7E6YFU2x.cjs} +1 -1
  86. package/dist/chunks/{run-auth-logout-command-Dw6CLfIY.cjs → run-auth-logout-command-BJj49Lps.cjs} +1 -1
  87. package/dist/chunks/{run-auth-status-command-CXRrXjvh.cjs → run-auth-status-command-CEKg6671.cjs} +1 -1
  88. package/dist/chunks/{run-cli-CsDjb96b.cjs → run-cli-yIhKkhUO.cjs} +4 -4
  89. package/dist/chunks/{run-commands-command-CLTVI96u.cjs → run-commands-command-3PU3OrJ-.cjs} +1 -1
  90. package/dist/chunks/{run-data-get-command-BD7i13MO.cjs → run-data-get-command-J8vwRqXK.cjs} +1 -1
  91. package/dist/chunks/{run-data-list-command-tcCgbeZj.cjs → run-data-list-command-B4mffvAw.cjs} +1 -1
  92. package/dist/chunks/{run-doctor-command-CDKbN2os.cjs → run-doctor-command-CGAJlZ8M.cjs} +2 -2
  93. package/dist/chunks/run-local-logs-command-DYNNZaAA.cjs +1 -0
  94. package/dist/chunks/run-local-reset-command-txQMpX4Y.cjs +2 -0
  95. package/dist/chunks/run-local-start-command-DMqvXuI8.cjs +1 -0
  96. package/dist/chunks/run-local-status-command-JakSWQH2.cjs +1 -0
  97. package/dist/chunks/run-local-stop-command-CKzb8k8I.cjs +1 -0
  98. package/dist/chunks/run-local-upgrade-command-BxhahQIt.cjs +1 -0
  99. package/dist/chunks/{run-metadata-field-describe-command-BX5_s1m0.cjs → run-metadata-field-describe-command-C8NDfCQv.cjs} +1 -1
  100. package/dist/chunks/{run-metadata-field-list-command-BVFDiJv2.cjs → run-metadata-field-list-command-Dq8JWMNS.cjs} +1 -1
  101. package/dist/chunks/{run-metadata-object-describe-command-CWYI0V42.cjs → run-metadata-object-describe-command-BeyWRTEV.cjs} +1 -1
  102. package/dist/chunks/{run-metadata-object-list-command-Y3yebZrT.cjs → run-metadata-object-list-command-CSCOKM3y.cjs} +1 -1
  103. package/dist/chunks/{run-open-command-BUEQSKSk.cjs → run-open-command-DWajZfpf.cjs} +1 -1
  104. package/dist/chunks/{run-remote-list-command-BExGjyKO.cjs → run-remote-list-command-BSOS3z6p.cjs} +1 -1
  105. package/dist/chunks/{run-remote-remove-command-D2thQnCU.cjs → run-remote-remove-command-B485SDzS.cjs} +1 -1
  106. package/dist/chunks/{run-remote-rename-command-DI0Adm5U.cjs → run-remote-rename-command-6uSnN2c_.cjs} +1 -1
  107. package/dist/chunks/{run-remote-use-command-CXnu5zDY.cjs → run-remote-use-command-DyUpoMX7.cjs} +1 -1
  108. package/dist/chunks/{run-version-command-Brk-Nbh7.cjs → run-version-command-BvTg8tp9.cjs} +1 -1
  109. package/dist/chunks/satisfies-Jm-ashRt.cjs +1 -0
  110. package/dist/chunks/{select-target-CJ2FyoVQ.cjs → select-target-g9eHGzvk.cjs} +1 -1
  111. package/dist/chunks/{sign-in-to-remote-again-CwXAgGif.cjs → sign-in-to-remote-again-m84b1K-f.cjs} +1 -1
  112. package/dist/chunks/{sign-in-with-browser-DdjoPq5d.cjs → sign-in-with-browser-PLGwMTwd.cjs} +1 -1
  113. package/dist/chunks/{to-worker-output-diagnostics-Hj6aQiK9.cjs → to-worker-output-diagnostics-BrOMgkAW.cjs} +1 -1
  114. package/dist/chunks/{typecheck-application-nkgv6qiA.cjs → typecheck-application-rMuH9bYM.cjs} +1 -1
  115. package/dist/chunks/{update-config-XYMqGokt.cjs → update-config-D0Y-TAiW.cjs} +1 -1
  116. package/dist/chunks/{utils-RCpFyoX5-DF7Gq1IH.cjs → utils-BZkF-gp5-DunD-YmD.cjs} +2 -2
  117. package/dist/chunks/{valid-DnUN-PQ0.cjs → valid-BPaM0XRk.cjs} +1 -1
  118. package/dist/chunks/wait-for-local-environment-B1bVbQGm.cjs +1 -0
  119. package/dist/chunks/{write-config-atomically-BxCEc8_P.cjs → write-config-atomically-BheBtCVO.cjs} +1 -1
  120. package/dist/cli.cjs +1 -1
  121. package/docs/commands.md +63 -0
  122. package/package.json +2 -2
  123. package/src/app/add/README.md +6 -6
  124. package/src/app/pull/README.md +1 -1
  125. package/dist/chunks/application-pYRHxplP.cjs +0 -5
  126. package/dist/chunks/build-source-snapshot-Ds_ZZGnl.cjs +0 -865
  127. package/dist/chunks/check-node-requirement-CnwHKQBp.cjs +0 -1
  128. package/dist/chunks/compile-application-translations-qdigcX2V.cjs +0 -1
  129. package/dist/chunks/constants-Cbb71hpl-CrSqydxj.cjs +0 -55
  130. package/dist/chunks/create-metadata-client-CJRFQ20Z.cjs +0 -6
  131. package/dist/chunks/extract-manifest-from-file-CEK5X5YP.cjs +0 -1
  132. package/dist/chunks/global-flags.constant-uA1jkBmk.cjs +0 -1
  133. package/dist/chunks/has-yarn-plug-and-play-X3ay5Xl0.cjs +0 -1
  134. package/dist/chunks/is-exported-manifest-D8cwSas4.cjs +0 -1
  135. package/dist/chunks/is-valid-package-name-9YIecMQm.cjs +0 -1
  136. package/dist/chunks/metadata-CY9y5wYc.cjs +0 -1
  137. package/dist/chunks/parse-graphql-response-Di8aFmnF.cjs +0 -1
  138. package/dist/chunks/print-typescript-value-ChOUZ7Mm.cjs +0 -3
  139. package/dist/chunks/pull-minimum-sdk-version.constant-JDRwzl32.cjs +0 -5
  140. package/dist/chunks/pull-source-CpAYRk5s.cjs +0 -1
  141. package/dist/chunks/read-snapshot-file-Dgc3WCDM.cjs +0 -1
  142. package/dist/chunks/resolve-app-project-DP27LYGR.cjs +0 -1
  143. package/dist/chunks/resolve-project-typescript-BOAxXiKm.cjs +0 -1
  144. package/dist/chunks/resolve-request-url-BwELN2oQ.cjs +0 -1
  145. package/dist/chunks/resolve-source-sdk-CyvER2l1.cjs +0 -1
  146. package/dist/chunks/run-app-add-command-C0b2LVQN.cjs +0 -163
  147. package/dist/chunks/run-app-logs-command-CQDO_gce.cjs +0 -9
@@ -1,2 +1,2 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./check-node-requirement-CnwHKQBp.cjs"),n=require("./cli-node-version-range.constant-D3XrqV07.cjs"),r=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),i=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),a=require("./constants-Cbb71hpl-CrSqydxj.cjs"),o=require("./read-json-object-BlyNzzdk.cjs"),s=require("./has-yarn-plug-and-play-X3ay5Xl0.cjs"),c=require("./cli-error-CrUD8uMp.cjs"),l=require("./resolve-source-sdk-CyvER2l1.cjs"),u=require("./parse-api-url-jHzjLWX1.cjs"),d=require("./read-command-values-rGaU2qHz.cjs"),f=require("./target-environment-variable.constant-D7z8AihP.cjs"),p=require("./style-BR52fK4V.cjs"),m=require("./resolve-app-project-DP27LYGR.cjs"),h=require("./cli-version.constant-BRiLR-nG.cjs"),g=require("./to-public-target-D00so1uO.cjs"),_=require("./select-target-CJ2FyoVQ.cjs"),v=require("./get-config-path-C-D-QHuX.cjs"),y=require("./read-config-9Dv5cmvw.cjs"),b=require("./is-access-token-expiring-B3WtsewG.cjs"),x=require("./config-file-mode.constant-DLBzKKUl.cjs"),S=require("./fetch-signed-in-identity-BFxRufRI.cjs");let C=require("node:fs/promises"),w=require("node:path"),T=require("node:fs");var E={pass:`green`,warning:`yellow`,fail:`red`,skipped:`yellow`},D=(e,t=process.stdout)=>e.map(e=>{let n=i.t(e.hint)?`\n ${e.hint}`:``;return`${p.n(E[e.status],`[${e.status.toUpperCase()}]`,t)} ${e.id}: ${e.message}${n}`}).join(`
2
- `),O=e.t(),k={AUTH_REQUIRED:{message:`The metadata endpoint rejected these credentials.`,hint:`Check the configured credentials, or sign in again.`},PERMISSION_DENIED:{message:`The metadata endpoint denied access to the workspace identity.`,hint:`Check the selected remote and the permissions granted to its credentials.`},INVALID_RESPONSE:{message:`The server did not return a valid metadata API response.`,hint:`Check the API URL and base path, and whether a proxy returned another page.`},UNSUPPORTED_RESPONSE_TYPE:{message:`The metadata endpoint returned an unsupported response type.`,hint:`Check the API URL and base path, and whether a proxy returned another page.`},REDIRECT_NOT_FOLLOWED:{message:`The metadata endpoint redirected the request. No redirect was followed.`,hint:`Configure the final Twenty API URL, including the correct protocol and base path.`},TIMEOUT:{message:`The metadata endpoint did not respond before the request timed out.`,hint:`Check server availability and the network connection.`},NETWORK_ERROR:{message:`Could not connect to the metadata endpoint.`,hint:`Check the API URL, network connection, server availability and TLS configuration.`}},A={ENOTFOUND:`DNS could not resolve the metadata endpoint hostname.`,EAI_AGAIN:`DNS resolution of the metadata endpoint temporarily failed.`,ECONNREFUSED:`The metadata endpoint refused the connection.`,ECONNRESET:`The connection to the metadata endpoint was reset.`,EHOSTUNREACH:`The metadata endpoint host is unreachable.`,ENETUNREACH:`The network containing the metadata endpoint is unreachable.`,ETIMEDOUT:`The connection to the metadata endpoint timed out.`,UND_ERR_CONNECT_TIMEOUT:`The connection to the metadata endpoint timed out.`,CERT_HAS_EXPIRED:`The metadata endpoint TLS certificate has expired.`,ERR_TLS_CERT_ALTNAME_INVALID:`The metadata endpoint TLS certificate does not match its hostname.`,DEPTH_ZERO_SELF_SIGNED_CERT:`The metadata endpoint uses an untrusted self-signed TLS certificate.`,SELF_SIGNED_CERT_IN_CHAIN:`The metadata endpoint TLS certificate chain contains an untrusted self-signed certificate.`,UNABLE_TO_VERIFY_LEAF_SIGNATURE:`The metadata endpoint TLS certificate chain could not be verified.`,UNABLE_TO_GET_ISSUER_CERT_LOCALLY:`The metadata endpoint TLS certificate issuer is not trusted locally.`},j=e=>{let t=e instanceof c.t?e.code:`INTERNAL_ERROR`,n=k[t]??{message:`The metadata endpoint could not be verified (${t}).`,hint:`Check the API URL and server availability.`},r=e instanceof c.t&&t===`NETWORK_ERROR`?e.details?.networkCode:void 0,a=(0,O.isString)(r)&&Object.hasOwn(A,r)?A[r]:void 0;return{id:`metadata-api`,status:`fail`,code:t,message:a??n.message,hint:e instanceof c.t&&t===`AUTH_REQUIRED`&&i.t(e.hint)?e.hint:n.hint,...i.t(a)?{details:{networkCode:r}}:{}}},M=async({configPath:e,environment:t,remoteFlag:n,offline:r,signal:a})=>{let o=[],s,l;a.throwIfAborted();try{if(s=await y.t(e),o.push({id:`configuration`,status:`pass`,message:`CLI configuration checked at ${e}.`,details:{path:e,remoteCount:Object.keys(s.remotes).length,defaultRemote:s.defaultRemote??null}}),process.platform!==`win32`){let t=await(0,C.stat)(e).catch(()=>void 0);i.t(t)&&t.mode&63&&o.push({id:`configuration-permissions`,status:`warning`,message:`Other users may access the CLI configuration file.`,hint:`Review its permissions; ${x.t.PRIVATE_FILE.toString(8)} is the expected mode. Doctor does not change them.`})}}catch(t){l=t,o.push({id:`configuration`,status:`fail`,code:t instanceof c.t?t.code:`INVALID_CONFIG`,message:t instanceof c.t?t.message:`The CLI configuration is unreadable or invalid.`,hint:t instanceof c.t?t.hint:`Check ${e}. Doctor does not overwrite it.`})}let d;try{let e=await _.t({environment:t,remoteFlag:n,loadConfig:async()=>{if(!i.t(s))throw l;return s},warn:e=>o.push({id:`target-precedence`,status:`warning`,code:e.code,message:e.message})}),r=u.t({rawUrl:e.source===`remote`?e.remote.apiUrl:e.apiUrl,sourceName:e.source===`remote`?`The URL of remote ${e.remoteName}`:f.t.API_URL}),a={apiUrl:r,source:e.source,remote:e.source===`remote`?e.remoteName:null};o.push({id:`target`,status:`pass`,message:`Selected ${r} from ${e.source}.`,details:a});let c=e.source===`remote`?e.remote.twentyCLIAccessToken:void 0,p=(0,O.isNonEmptyString)(c)?`oauth`:`apiKey`,m=e.source===`remote`?e.remote.apiKey:e.apiKey,h=(0,O.isNonEmptyString)(c)?c:m;if(!(0,O.isNonEmptyString)(h))return o.push({id:`credentials`,status:`fail`,code:`AUTH_REQUIRED`,message:`The selected remote has no saved credentials.`,hint:`Sign in with twenty auth login, then rerun doctor.`}),[...o,{id:`metadata-api`,status:`skipped`,message:`No credentials are available.`}];let g=p===`oauth`?b.t(h):void 0;if(i.t(g)&&g<=Date.now()){let t=e.source===`remote`&&(0,O.isNonEmptyString)(e.remote.twentyCLIRefreshToken);return o.push({id:`credentials`,status:t?`warning`:`fail`,code:`AUTH_REQUIRED`,message:t?`The OAuth access token has expired. A refresh token is saved, but renewal has not been verified.`:`The saved OAuth access token has expired and no refresh token is available.`,hint:`Run twenty auth status with the same remote to refresh the session, or sign in again. Doctor does not refresh credentials.`}),[...o,{id:`metadata-api`,status:`skipped`,message:`The access token has expired.`}]}d={apiUrl:r,source:e.source,...e.source===`remote`?{remoteName:e.remoteName}:{},credentialKind:p,bearerToken:h},o.push({id:`credentials`,status:`pass`,message:`${p===`oauth`?`OAuth token`:`API key`} configured; acceptance is checked separately.`,details:{kind:p}})}catch(e){a.throwIfAborted();let t=e instanceof c.t?e.code:`INTERNAL_ERROR`;return o.push({id:`target`,status:t===`TARGET_REQUIRED`?`skipped`:`fail`,code:t,message:e instanceof c.t?e.message:`Could not select a workspace.`,hint:e instanceof c.t?e.hint:void 0}),[...o,{id:`credentials`,status:`skipped`,message:`No workspace was selected.`},{id:`metadata-api`,status:`skipped`,message:`No workspace was selected.`}]}if(r)return[...o,{id:`metadata-api`,status:`skipped`,message:`Network checks disabled by --offline.`}];try{a.throwIfAborted(),await S.t({target:d,signal:a}),o.push({id:`metadata-api`,status:`pass`,message:`The metadata endpoint accepted the configured credentials.`,details:{...g.t(d)}})}catch(e){a.throwIfAborted(),o.push(j(e))}return o},N=async e=>{for(let t of s.n((0,w.dirname)(e))){let n=await o.t((0,w.join)(t,`package.json`));if(!i.t(n))continue;let r=n.bin,s=(0,O.isString)(r)&&n.name===`twenty`?r:void 0,c=a.i(r)&&(0,O.isString)(r.twenty)?r.twenty:s;if(i.t(c)&&await(0,C.realpath)((0,w.resolve)(t,c)).catch(()=>void 0)===e)return{name:(0,O.isString)(n.name)?n.name:`unknown`,version:(0,O.isString)(n.version)?n.version:`unknown`}}return null},P=async({environment:e,workingDirectory:t,signal:n})=>{let a=[],o=process.platform===`win32`?[`twenty.exe`,`twenty.cmd`,`twenty.bat`,`twenty`]:[`twenty`],s=i.t(e.PATH)?e.PATH.split(w.delimiter):[];for(let e of new Set(s))for(let r of o){n.throwIfAborted();let i=(0,w.resolve)(t,e,r);if(!await(0,C.access)(i,T.constants.X_OK).then(()=>(0,C.stat)(i).then(e=>e.isFile()),()=>!1))continue;let o=await(0,C.realpath)(i);a.push({path:i,resolvedPath:o,owner:await N(o)})}let c=a[0],l=process.argv[1],u=i.t(l)?await(0,C.realpath)((0,w.resolve)(t,l)).catch(()=>void 0):void 0,d=a.filter(e=>e.owner?.name===`twenty-sdk`);return r.n(d)?{id:`path`,status:`warning`,message:`PATH contains legacy twenty-sdk executable(s) named twenty: ${d.map(e=>e.path).join(`, `)}.`,hint:`If this is a global twenty-sdk installation, remove it before installing the twenty CLI so the CLI owns the twenty name. Removing the SDK afterward can remove that executable link. Keep app-local SDK dependencies; use the intended CLI by its full path when needed. Doctor does not change installations.`,details:{candidates:a}}:i.t(c)?i.t(u)&&c.resolvedPath!==u?{id:`path`,status:`warning`,message:`${c.path} is first on PATH and differs from the running CLI.`,hint:`Use the intended executable by its full path, or review PATH order. Shell aliases, functions and command caches are not inspected.`,details:{candidates:a,runningPath:u}}:{id:`path`,status:c.owner?.name===`twenty`?`pass`:`warning`,message:i.t(c.owner)?`First twenty executable on PATH: ${c.path} (${c.owner.name} ${c.owner.version}).`:`First twenty executable on PATH: ${c.path}. Its package owner could not be determined.`,hint:`Shell aliases, functions and command caches are not inspected.`,details:{candidates:a}}:{id:`path`,status:`warning`,message:`No executable named twenty was found on PATH.`,hint:`Use the CLI entry point shown above, or your package manager to invoke the installed CLI.`,details:{candidates:a}}},F=async({explicitPath:e,workingDirectory:t,signal:n})=>{let r;n.throwIfAborted();try{r=await m.t({explicitPath:e,workingDirectory:t})}catch(t){return n.throwIfAborted(),[{id:`project`,status:!i.t(e)&&t instanceof c.t&&(t.code===`APP_NOT_FOUND`||t.code===`APP_PATH_REQUIRED`)?`skipped`:`fail`,message:t instanceof c.t?t.message:`Could not inspect the app directory.`,hint:`Use --path <app directory> to check a specific app.`},{id:`sdk`,status:`skipped`,message:`No app was selected.`}]}let a={id:`project`,status:`pass`,message:`${r.name} at ${r.path}.`,details:{name:r.name,path:r.path}};try{n.throwIfAborted();let e=[],t=await l.t({appPath:r.path,warn:t=>e.push(t)}),[o]=e,s={version:t.version,path:t.packagePath};return[a,i.t(o)?{id:`sdk`,status:`warning`,code:o.code,message:o.message,hint:`Builds continue. If one fails, switch to a Node version in that range.`,details:s}:{id:`sdk`,status:`pass`,message:`twenty-sdk ${t.version} provides the authoring exports required by the CLI.`,details:s}]}catch(e){return n.throwIfAborted(),[a,{id:`sdk`,status:`fail`,code:e instanceof c.t?e.code:`INTERNAL_ERROR`,message:e instanceof c.t?e.message:`Could not inspect the app SDK installation.`,hint:e instanceof c.t?e.hint:`Check that the app dependencies are installed and readable.`}]}},I=()=>{let e=t.t({version:process.versions.node,range:n.t})===`satisfied`;return[{id:`node`,status:e?`pass`:`fail`,message:`Node ${process.versions.node}, required ${n.t}.`,...e?{}:{hint:`Switch to a supported Node version and rerun doctor.`},details:{version:process.versions.node,required:n.t}},{id:`cli`,status:`pass`,message:`twenty ${h.t}, entry point ${process.argv[1]??`unknown`}.`,details:{version:h.t,nodeExecutable:process.execPath,entryPoint:process.argv[1]??null,platform:process.platform,arch:process.arch}}]},L=async({options:e,signal:t,outputMode:n})=>{let i=I(),a=process.cwd();try{i.push(await P({environment:process.env,workingDirectory:a,signal:t}))}catch{t.throwIfAborted(),i.push({id:`path`,status:`fail`,message:`Could not inspect executables on PATH.`})}i.push(...await F({explicitPath:d.r(e,`path`),workingDirectory:a,signal:t})),i.push(...await M({environment:process.env,configPath:v.t(),remoteFlag:d.r(e,`remote`),offline:d.t(e,`offline`),signal:t})),t.throwIfAborted();let o=i.filter(e=>e.status===`fail`),s=D(i,r.n(o)?process.stderr:process.stdout);if(r.n(o))throw new c.t({code:`DOCTOR_FAILED`,message:`${o.length} doctor ${o.length===1?`check`:`checks`} failed.`,hint:n===`human`?s:`Read error.details.checks for the failures and recovery hints.`,details:{checks:i}});return{data:{checks:i},human:s}};exports.runDoctorCommand=L;
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./check-node-requirement-CIDuA1s-.cjs"),n=require("./cli-node-version-range.constant-D3XrqV07.cjs"),r=require("./utils-BZkF-gp5-DunD-YmD.cjs"),i=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),a=require("./constants-BVRtHFho-CGmbRR4M.cjs"),o=require("./read-json-object-BP1Q_W12.cjs"),s=require("./list-ancestor-directories-BtB2hNt6.cjs"),c=require("./cli-error-CrUD8uMp.cjs"),l=require("./resolve-source-sdk-DQnc0tSq.cjs"),u=require("./parse-api-url-jHzjLWX1.cjs"),d=require("./read-command-values-rGaU2qHz.cjs"),f=require("./target-environment-variable.constant-D7z8AihP.cjs"),p=require("./style-BR52fK4V.cjs"),m=require("./resolve-app-project-DrRcP_gL.cjs"),h=require("./cli-version.constant-CXTtLO6W.cjs"),g=require("./to-public-target-D00so1uO.cjs"),_=require("./select-target-g9eHGzvk.cjs"),v=require("./get-config-path-C-D-QHuX.cjs"),y=require("./read-config-BwRvqqhW.cjs"),b=require("./is-access-token-expiring-DYNdux1L.cjs"),x=require("./config-file-mode.constant-DLBzKKUl.cjs"),S=require("./fetch-signed-in-identity-C-qQ3udY.cjs");let C=require("node:fs/promises"),w=require("node:path"),T=require("node:fs");var E={pass:`green`,warning:`yellow`,fail:`red`,skipped:`yellow`},D=(e,t=process.stdout)=>e.map(e=>{let n=i.t(e.hint)?`\n ${e.hint}`:``;return`${p.n(E[e.status],`[${e.status.toUpperCase()}]`,t)} ${e.id}: ${e.message}${n}`}).join(`
2
+ `),O=e.t(),k={AUTH_REQUIRED:{message:`The metadata endpoint rejected these credentials.`,hint:`Check the configured credentials, or sign in again.`},PERMISSION_DENIED:{message:`The metadata endpoint denied access to the workspace identity.`,hint:`Check the selected remote and the permissions granted to its credentials.`},INVALID_RESPONSE:{message:`The server did not return a valid metadata API response.`,hint:`Check the API URL and base path, and whether a proxy returned another page.`},UNSUPPORTED_RESPONSE_TYPE:{message:`The metadata endpoint returned an unsupported response type.`,hint:`Check the API URL and base path, and whether a proxy returned another page.`},REDIRECT_NOT_FOLLOWED:{message:`The metadata endpoint redirected the request. No redirect was followed.`,hint:`Configure the final Twenty API URL, including the correct protocol and base path.`},TIMEOUT:{message:`The metadata endpoint did not respond before the request timed out.`,hint:`Check server availability and the network connection.`},NETWORK_ERROR:{message:`Could not connect to the metadata endpoint.`,hint:`Check the API URL, network connection, server availability and TLS configuration.`}},A={ENOTFOUND:`DNS could not resolve the metadata endpoint hostname.`,EAI_AGAIN:`DNS resolution of the metadata endpoint temporarily failed.`,ECONNREFUSED:`The metadata endpoint refused the connection.`,ECONNRESET:`The connection to the metadata endpoint was reset.`,EHOSTUNREACH:`The metadata endpoint host is unreachable.`,ENETUNREACH:`The network containing the metadata endpoint is unreachable.`,ETIMEDOUT:`The connection to the metadata endpoint timed out.`,UND_ERR_CONNECT_TIMEOUT:`The connection to the metadata endpoint timed out.`,CERT_HAS_EXPIRED:`The metadata endpoint TLS certificate has expired.`,ERR_TLS_CERT_ALTNAME_INVALID:`The metadata endpoint TLS certificate does not match its hostname.`,DEPTH_ZERO_SELF_SIGNED_CERT:`The metadata endpoint uses an untrusted self-signed TLS certificate.`,SELF_SIGNED_CERT_IN_CHAIN:`The metadata endpoint TLS certificate chain contains an untrusted self-signed certificate.`,UNABLE_TO_VERIFY_LEAF_SIGNATURE:`The metadata endpoint TLS certificate chain could not be verified.`,UNABLE_TO_GET_ISSUER_CERT_LOCALLY:`The metadata endpoint TLS certificate issuer is not trusted locally.`},j=e=>{let t=e instanceof c.t?e.code:`INTERNAL_ERROR`,n=k[t]??{message:`The metadata endpoint could not be verified (${t}).`,hint:`Check the API URL and server availability.`},r=e instanceof c.t&&t===`NETWORK_ERROR`?e.details?.networkCode:void 0,a=(0,O.isString)(r)&&Object.hasOwn(A,r)?A[r]:void 0;return{id:`metadata-api`,status:`fail`,code:t,message:a??n.message,hint:e instanceof c.t&&t===`AUTH_REQUIRED`&&i.t(e.hint)?e.hint:n.hint,...i.t(a)?{details:{networkCode:r}}:{}}},M=async({configPath:e,environment:t,remoteFlag:n,offline:r,signal:a})=>{let o=[],s,l;a.throwIfAborted();try{if(s=await y.t(e),o.push({id:`configuration`,status:`pass`,message:`CLI configuration checked at ${e}.`,details:{path:e,remoteCount:Object.keys(s.remotes).length,defaultRemote:s.defaultRemote??null}}),process.platform!==`win32`){let t=await(0,C.stat)(e).catch(()=>void 0);i.t(t)&&t.mode&63&&o.push({id:`configuration-permissions`,status:`warning`,message:`Other users may access the CLI configuration file.`,hint:`Review its permissions; ${x.t.PRIVATE_FILE.toString(8)} is the expected mode. Doctor does not change them.`})}}catch(t){l=t,o.push({id:`configuration`,status:`fail`,code:t instanceof c.t?t.code:`INVALID_CONFIG`,message:t instanceof c.t?t.message:`The CLI configuration is unreadable or invalid.`,hint:t instanceof c.t?t.hint:`Check ${e}. Doctor does not overwrite it.`})}let d;try{let e=await _.t({environment:t,remoteFlag:n,loadConfig:async()=>{if(!i.t(s))throw l;return s},warn:e=>o.push({id:`target-precedence`,status:`warning`,code:e.code,message:e.message})}),r=u.t({rawUrl:e.source===`remote`?e.remote.apiUrl:e.apiUrl,sourceName:e.source===`remote`?`The URL of remote ${e.remoteName}`:f.t.API_URL}),a={apiUrl:r,source:e.source,remote:e.source===`remote`?e.remoteName:null};o.push({id:`target`,status:`pass`,message:`Selected ${r} from ${e.source}.`,details:a});let c=e.source===`remote`?e.remote.twentyCLIAccessToken:void 0,p=(0,O.isNonEmptyString)(c)?`oauth`:`apiKey`,m=e.source===`remote`?e.remote.apiKey:e.apiKey,h=(0,O.isNonEmptyString)(c)?c:m;if(!(0,O.isNonEmptyString)(h))return o.push({id:`credentials`,status:`fail`,code:`AUTH_REQUIRED`,message:`The selected remote has no saved credentials.`,hint:`Sign in with twenty auth login, then rerun doctor.`}),[...o,{id:`metadata-api`,status:`skipped`,message:`No credentials are available.`}];let g=p===`oauth`?b.t(h):void 0;if(i.t(g)&&g<=Date.now()){let t=e.source===`remote`&&(0,O.isNonEmptyString)(e.remote.twentyCLIRefreshToken);return o.push({id:`credentials`,status:t?`warning`:`fail`,code:`AUTH_REQUIRED`,message:t?`The OAuth access token has expired. A refresh token is saved, but renewal has not been verified.`:`The saved OAuth access token has expired and no refresh token is available.`,hint:`Run twenty auth status with the same remote to refresh the session, or sign in again. Doctor does not refresh credentials.`}),[...o,{id:`metadata-api`,status:`skipped`,message:`The access token has expired.`}]}d={apiUrl:r,source:e.source,...e.source===`remote`?{remoteName:e.remoteName}:{},credentialKind:p,bearerToken:h},o.push({id:`credentials`,status:`pass`,message:`${p===`oauth`?`OAuth token`:`API key`} configured; acceptance is checked separately.`,details:{kind:p}})}catch(e){a.throwIfAborted();let t=e instanceof c.t?e.code:`INTERNAL_ERROR`;return o.push({id:`target`,status:t===`TARGET_REQUIRED`?`skipped`:`fail`,code:t,message:e instanceof c.t?e.message:`Could not select a workspace.`,hint:e instanceof c.t?e.hint:void 0}),[...o,{id:`credentials`,status:`skipped`,message:`No workspace was selected.`},{id:`metadata-api`,status:`skipped`,message:`No workspace was selected.`}]}if(r)return[...o,{id:`metadata-api`,status:`skipped`,message:`Network checks disabled by --offline.`}];try{a.throwIfAborted(),await S.t({target:d,signal:a}),o.push({id:`metadata-api`,status:`pass`,message:`The metadata endpoint accepted the configured credentials.`,details:{...g.t(d)}})}catch(e){a.throwIfAborted(),o.push(j(e))}return o},N=async e=>{for(let t of s.t((0,w.dirname)(e))){let n=await o.t((0,w.join)(t,`package.json`));if(!i.t(n))continue;let r=n.bin,s=(0,O.isString)(r)&&n.name===`twenty`?r:void 0,c=a.i(r)&&(0,O.isString)(r.twenty)?r.twenty:s;if(i.t(c)&&await(0,C.realpath)((0,w.resolve)(t,c)).catch(()=>void 0)===e)return{name:(0,O.isString)(n.name)?n.name:`unknown`,version:(0,O.isString)(n.version)?n.version:`unknown`}}return null},P=async({environment:e,workingDirectory:t,signal:n})=>{let a=[],o=process.platform===`win32`?[`twenty.exe`,`twenty.cmd`,`twenty.bat`,`twenty`]:[`twenty`],s=i.t(e.PATH)?e.PATH.split(w.delimiter):[];for(let e of new Set(s))for(let r of o){n.throwIfAborted();let i=(0,w.resolve)(t,e,r);if(!await(0,C.access)(i,T.constants.X_OK).then(()=>(0,C.stat)(i).then(e=>e.isFile()),()=>!1))continue;let o=await(0,C.realpath)(i);a.push({path:i,resolvedPath:o,owner:await N(o)})}let c=a[0],l=process.argv[1],u=i.t(l)?await(0,C.realpath)((0,w.resolve)(t,l)).catch(()=>void 0):void 0,d=a.filter(e=>e.owner?.name===`twenty-sdk`);return r.r(d)?{id:`path`,status:`warning`,message:`PATH contains legacy twenty-sdk executable(s) named twenty: ${d.map(e=>e.path).join(`, `)}.`,hint:`If this is a global twenty-sdk installation, remove it before installing the twenty CLI so the CLI owns the twenty name. Removing the SDK afterward can remove that executable link. Keep app-local SDK dependencies; use the intended CLI by its full path when needed. Doctor does not change installations.`,details:{candidates:a}}:i.t(c)?i.t(u)&&c.resolvedPath!==u?{id:`path`,status:`warning`,message:`${c.path} is first on PATH and differs from the running CLI.`,hint:`Use the intended executable by its full path, or review PATH order. Shell aliases, functions and command caches are not inspected.`,details:{candidates:a,runningPath:u}}:{id:`path`,status:c.owner?.name===`twenty`?`pass`:`warning`,message:i.t(c.owner)?`First twenty executable on PATH: ${c.path} (${c.owner.name} ${c.owner.version}).`:`First twenty executable on PATH: ${c.path}. Its package owner could not be determined.`,hint:`Shell aliases, functions and command caches are not inspected.`,details:{candidates:a}}:{id:`path`,status:`warning`,message:`No executable named twenty was found on PATH.`,hint:`Use the CLI entry point shown above, or your package manager to invoke the installed CLI.`,details:{candidates:a}}},F=async({explicitPath:e,workingDirectory:t,signal:n})=>{let r;n.throwIfAborted();try{r=await m.t({explicitPath:e,workingDirectory:t})}catch(t){return n.throwIfAborted(),[{id:`project`,status:!i.t(e)&&t instanceof c.t&&(t.code===`APP_NOT_FOUND`||t.code===`APP_PATH_REQUIRED`)?`skipped`:`fail`,message:t instanceof c.t?t.message:`Could not inspect the app directory.`,hint:`Use --path <app directory> to check a specific app.`},{id:`sdk`,status:`skipped`,message:`No app was selected.`}]}let a={id:`project`,status:`pass`,message:`${r.name} at ${r.path}.`,details:{name:r.name,path:r.path}};try{n.throwIfAborted();let e=[],t=await l.t({appPath:r.path,warn:t=>e.push(t)}),[o]=e,s={version:t.version,path:t.packagePath};return[a,i.t(o)?{id:`sdk`,status:`warning`,code:o.code,message:o.message,hint:`Builds continue. If one fails, switch to a Node version in that range.`,details:s}:{id:`sdk`,status:`pass`,message:`twenty-sdk ${t.version} provides the authoring exports required by the CLI.`,details:s}]}catch(e){return n.throwIfAborted(),[a,{id:`sdk`,status:`fail`,code:e instanceof c.t?e.code:`INTERNAL_ERROR`,message:e instanceof c.t?e.message:`Could not inspect the app SDK installation.`,hint:e instanceof c.t?e.hint:`Check that the app dependencies are installed and readable.`}]}},I=()=>{let e=t.t({version:process.versions.node,range:n.t})===`satisfied`;return[{id:`node`,status:e?`pass`:`fail`,message:`Node ${process.versions.node}, required ${n.t}.`,...e?{}:{hint:`Switch to a supported Node version and rerun doctor.`},details:{version:process.versions.node,required:n.t}},{id:`cli`,status:`pass`,message:`twenty ${h.t}, entry point ${process.argv[1]??`unknown`}.`,details:{version:h.t,nodeExecutable:process.execPath,entryPoint:process.argv[1]??null,platform:process.platform,arch:process.arch}}]},L=async({options:e,signal:t,outputMode:n})=>{let i=I(),a=process.cwd();try{i.push(await P({environment:process.env,workingDirectory:a,signal:t}))}catch{t.throwIfAborted(),i.push({id:`path`,status:`fail`,message:`Could not inspect executables on PATH.`})}i.push(...await F({explicitPath:d.r(e,`path`),workingDirectory:a,signal:t})),i.push(...await M({environment:process.env,configPath:v.t(),remoteFlag:d.r(e,`remote`),offline:d.t(e,`offline`),signal:t})),t.throwIfAborted();let o=i.filter(e=>e.status===`fail`),s=D(i,r.r(o)?process.stderr:process.stdout);if(r.r(o))throw new c.t({code:`DOCTOR_FAILED`,message:`${o.length} doctor ${o.length===1?`check`:`checks`} failed.`,hint:n===`human`?s:`Read error.details.checks for the failures and recovery hints.`,details:{checks:i}});return{data:{checks:i},human:s}};exports.runDoctorCommand=L;
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./cli-error-CrUD8uMp.cjs"),n=require("./read-command-values-rGaU2qHz.cjs"),r=require("./read-local-container-CidDipKg.cjs");let i=require("node:events");var a=async({options:a,signal:o,output:s,outputMode:c})=>{let{environment:l}=r.r(a),u=r.a({value:n.r(a,`lines`),name:`--lines`,maximum:1e4})??50,d=a.follow!==!1;await r.o(o);let f=await r.n({environment:l,signal:o});if(!e.t(f))throw new t.t({code:`NOT_FOUND`,message:`No local environment has been created.`,hint:`Run twenty local start first (add --test for the test instance).`});return await s.event(`start`,{name:l.name,shouldFollow:d},o),await r.s({args:[`logs`,`--tail`,String(u),...d?[`--follow`]:[],f.id],signal:o,onOutput:async e=>{c===`ndjson`?await s.event(`record`,{message:e},o):process.stdout.write(e)||await(0,i.once)(process.stdout,`drain`,{signal:o})}}),{data:{name:l.name,shouldFollow:d},human:`Log stream completed.`}};exports.runLocalLogsCommand=a;
@@ -0,0 +1,2 @@
1
+ const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./read-command-values-rGaU2qHz.cjs"),n=require("./is-interaction-allowed-BQLOG8RG.cjs"),r=require("./require-approval-BIgPOy_r.cjs"),i=require("./read-local-container-CidDipKg.cjs");var a=async({options:a,outputMode:o,signal:s})=>{let{environment:c}=i.r(a);await r.t({isApproved:t.t(a,`yes`),canPrompt:n.t({options:a,outputMode:o}),question:`Delete ${c.name} and all its database, file and analytics data?`,code:`CONFIRMATION_REQUIRED`,message:`Reset permanently deletes all data in ${c.name}.`,hint:`Pass --yes to delete this local environment and its data.`,declinedMessage:`Local environment reset cancelled.`,signal:s}),await i.o(s);let l=await i.n({environment:c,signal:s});e.t(l)&&(i.t({environment:c,container:l}),await i.s({args:[`rm`,`--force`,l.id],signal:s}));let u=(await i.s({args:[`volume`,`ls`,`--format`,`{{.Name}}`],signal:s})).trim().split(`
2
+ `),d=Object.values(c.volumes).filter(e=>u.includes(e));return d.length>0&&await i.s({args:[`volume`,`rm`,...d],signal:s}),{data:{name:c.name,reset:!0,removedVolumes:d},human:`Local environment data deleted. Run twenty local start${a.test?` --test`:``} to create a fresh instance.`}};exports.runLocalResetCommand=a;
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./satisfies-Jm-ashRt.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./read-command-values-rGaU2qHz.cjs"),a=require("./read-local-container-CidDipKg.cjs"),o=require("./wait-for-local-environment-B1bVbQGm.cjs");var s=e.r(t.t()),c=async({options:e,arguments:t,output:c,signal:l})=>{let{environment:u,port:d}=a.r(e),f=i.n(t,0),p=n.t(f)?o.r(f):void 0;await a.o(l);let m=await a.n({environment:u,signal:l}),h=m?.port??d??u.port;if(n.t(m)&&(n.t(d)&&d!==m.port||n.t(p)&&p!==m.image))throw new r.t({code:`CONFLICT`,message:`${u.name} already uses ${m.image} on port ${m.port}.`,hint:`Omit --port to reuse this instance. Use twenty local upgrade to change its version.`});let g=n.t(m)?o.i():void 0;if(n.t(m)&&n.t(g)){let e;try{e=await o.a({imageId:m.imageId,signal:l})}catch(e){if(l.throwIfAborted(),!(e instanceof r.t)||e.code!==`INVALID_RESPONSE`)throw e}(!n.t(e)||!(0,s.default)(e,g))&&c.warn({code:`LOCAL_VERSION_MISMATCH`,message:`The existing image ${m.image} does not establish compatibility with engines.twenty ${g}. Use twenty local upgrade to change version.`})}if(n.t(m)&&!m.isRunning&&(c.progress({message:`Starting the existing local environment…`}),await a.s({args:[`start`,m.id],signal:l})),!n.t(m)){let e=p??await o.n({version:void 0,signal:l});c.progress({message:`Pulling ${e}…`}),await a.s({args:[`pull`,e],signal:l}),c.progress({message:`Starting ${e} on http://localhost:${h}…`}),await o.s({environment:u,image:e,port:h,signal:l})}c.progress({message:`Waiting for the local environment to be ready…`});let _=await o.t({environment:{...u,port:h},signal:l});return{data:_,human:`Local Twenty is ready at ${_.url}\nSign in: twenty auth login --url ${_.url} --name ${e.test?`local-test`:`local`}`}};exports.runLocalStartCommand=c;
@@ -0,0 +1 @@
1
+ const e=require("./read-local-container-CidDipKg.cjs"),t=require("./get-local-status-D52rgA2e.cjs");var n=async({options:n,signal:r})=>{let{environment:i}=e.r(n);await e.o(r);let a=await t.t({environment:i,container:await e.n({environment:i,signal:r}),signal:r});return{data:a,human:`Status: ${a.status}\nURL: ${a.url}${a.image?`\nImage: ${a.image}`:``}`}};exports.runLocalStatusCommand=n;
@@ -0,0 +1 @@
1
+ const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./read-local-container-CidDipKg.cjs");var n=async({options:n,signal:r})=>{let{environment:i}=t.r(n);await t.o(r);let a=await t.n({environment:i,signal:r});return a?.isRunning&&await t.s({args:[`stop`,a.id],signal:r}),{data:{name:i.name,stopped:e.t(a),dataPreserved:!0},human:e.t(a)?`Local environment stopped. Data is preserved.`:`No local environment has been created.`}};exports.runLocalStopCommand=n;
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./valid-BPaM0XRk.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./read-command-values-rGaU2qHz.cjs"),a=require("./read-local-container-CidDipKg.cjs"),o=require("./wait-for-local-environment-B1bVbQGm.cjs"),s=require("./get-local-status-D52rgA2e.cjs");var c=e.r(t.o()),l=async({environment:e,existing:t,image:i,environmentVariables:s,signal:c})=>{let l=`${e.name}-previous`;try{await a.s({args:[`rename`,t.id,l],signal:c}),t.isRunning&&await a.s({args:[`stop`,`--time`,`30`,t.id],signal:c}),await o.s({environment:e,image:i,port:t.port,containerPort:t.containerPort,environmentVariables:s,shouldStart:!1,signal:c})}catch(i){let o=AbortSignal.timeout(6e4);try{let r=await a.n({environment:e,signal:o});n.t(r)&&r.id!==t.id&&await a.s({args:[`rm`,r.id],signal:o}),r?.id!==t.id&&await a.s({args:[`rename`,t.id,e.name],signal:o}),t.isRunning&&await a.s({args:[`start`,t.id],signal:o})}catch(e){throw new r.t({code:`LOCAL_ENVIRONMENT_FAILED`,message:`Upgrade failed and the previous container could not be restored automatically.`,hint:`The previous settings remain in container ${t.id}. Inspect it with docker inspect before retrying.`,cause:e,details:{originalError:i instanceof Error?i.message:String(i)}})}throw i}await a.s({args:[`rm`,t.id],signal:AbortSignal.timeout(6e4)}),await a.s({args:[`start`,e.name],signal:c})},u=async({container:e,signal:t})=>{let n=await o.o({imageId:e.imageId,signal:t});return e.environmentVariables.filter(e=>!e.startsWith(`NODE_PORT=`)&&!n.includes(e))},d=async({options:e,arguments:t,output:d,signal:f})=>{let{environment:p}=a.r(e);await a.o(f);let m=await a.n({environment:p,signal:f});if(!n.t(m))throw new r.t({code:`NOT_FOUND`,message:`No local environment has been created.`,hint:`Use twenty local start with the desired version first.`});a.t({environment:p,container:m});let h=await o.n({version:i.n(t,0),signal:f});d.progress({message:`Pulling ${h}…`}),await a.s({args:[`pull`,h],signal:f});let g=(await a.s({args:[`image`,`inspect`,`--format`,`{{.Id}}`,h],signal:f})).trim();if(m.imageId===g)return{data:{...await s.t({environment:p,container:m,signal:f}),isUpgraded:!1},human:`Already using ${h}.`};let _=await o.a({imageId:m.imageId,signal:f}),v=await o.a({imageId:g,signal:f});if((0,c.default)(v,_))throw new r.t({code:`CONFLICT`,message:`Cannot downgrade the local environment from ${_} to ${v}.`,hint:`Database migrations cannot be rolled back. Keep the current version or use a newer one.`});let y=await u({container:m,signal:f});d.progress({message:`Replacing the local environment, preserving its data volumes…`}),await l({environment:p,existing:m,image:h,environmentVariables:y,signal:f});let b=await o.t({environment:{...p,port:m.port},signal:f});return{data:{...b,isUpgraded:!0,isDataPreserved:!0},human:`Local environment upgraded to ${h} at ${b.url}. Data volumes preserved.`}};exports.runLocalUpgradeCommand=d;
@@ -1,3 +1,3 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./read-command-values-rGaU2qHz.cjs"),a=require("./format-details-COEwKz_M.cjs"),o=require("./format-table-4drtI5sP.cjs"),s=require("./format-metadata-owner-DpOc_B3P.cjs"),c=require("./fetch-metadata-inspection-IuAwjjQT.cjs"),l=require("./format-metadata-fields-BltFjIsO.cjs");var u=e.t(),d=e=>n.t(e)?String(e):`unknown`,f=async({arguments:e,target:f,signal:p,output:m})=>{let h=i.n(e,1)??``,{object:g,fields:_}=await c.t({objectName:i.n(e,0)??``,target:f,signal:p,output:m}),v=_.filter(e=>e.name===h);if(v.length>1)throw new r.t({code:`AMBIGUOUS_RESOURCE`,exitCode:r.n.USAGE,message:`More than one field has the API name ${h} on ${g.namePlural}.`});let y=v[0];if(!n.t(y))throw new r.t({code:`NOT_FOUND`,exitCode:r.n.NOT_FOUND,message:`No field has the API name ${h} on ${g.namePlural}.`,hint:`Use an exact API name from twenty metadata field list ${g.namePlural} --all.`});let b=l.r(y);return{data:{object:g,field:y},human:[`${y.label} (${y.name}) on ${g.namePlural}`,a.t([[`ID`,y.id],[`Type`,y.type],[`Owner`,s.t(y.owner)],[`Active`,d(y.isActive)],[`System`,d(y.isSystem)],[`Nullable`,d(y.isNullable)],[`Unique`,d(y.isUnique)],[`Default`,JSON.stringify(y.defaultValue??null)]]),y.description??``,l.n(y),t.n(b)?o.t({rows:b,columns:[{header:`OPTION`,value:e=>String(e.label??``)},{header:`VALUE`,value:e=>String(e.value??``)},{header:`COLOR`,value:e=>String(e.color??``)}]}):``].filter(u.isNonEmptyString).join(`
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./utils-BZkF-gp5-DunD-YmD.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./read-command-values-rGaU2qHz.cjs"),a=require("./format-details-COEwKz_M.cjs"),o=require("./format-table-4drtI5sP.cjs"),s=require("./format-metadata-owner-BeV6-_Th.cjs"),c=require("./fetch-metadata-inspection-BBWnhrft.cjs"),l=require("./format-metadata-fields-9yjjSDbM.cjs");var u=e.t(),d=e=>n.t(e)?String(e):`unknown`,f=async({arguments:e,target:f,signal:p,output:m})=>{let h=i.n(e,1)??``,{object:g,fields:_}=await c.t({objectName:i.n(e,0)??``,target:f,signal:p,output:m}),v=_.filter(e=>e.name===h);if(v.length>1)throw new r.t({code:`AMBIGUOUS_RESOURCE`,exitCode:r.n.USAGE,message:`More than one field has the API name ${h} on ${g.namePlural}.`});let y=v[0];if(!n.t(y))throw new r.t({code:`NOT_FOUND`,exitCode:r.n.NOT_FOUND,message:`No field has the API name ${h} on ${g.namePlural}.`,hint:`Use an exact API name from twenty metadata field list ${g.namePlural} --all.`});let b=l.r(y);return{data:{object:g,field:y},human:[`${y.label} (${y.name}) on ${g.namePlural}`,a.t([[`ID`,y.id],[`Type`,y.type],[`Owner`,s.t(y.owner)],[`Active`,d(y.isActive)],[`System`,d(y.isSystem)],[`Nullable`,d(y.isNullable)],[`Unique`,d(y.isUnique)],[`Default`,JSON.stringify(y.defaultValue??null)]]),y.description??``,l.n(y),t.r(b)?o.t({rows:b,columns:[{header:`OPTION`,value:e=>String(e.label??``)},{header:`VALUE`,value:e=>String(e.value??``)},{header:`COLOR`,value:e=>String(e.color??``)}]}):``].filter(u.isNonEmptyString).join(`
2
2
 
3
3
  `)}};exports.runMetadataFieldDescribeCommand=f;
@@ -1,3 +1,3 @@
1
- const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./fetch-metadata-inspection-IuAwjjQT.cjs"),n=require("./format-metadata-fields-BltFjIsO.cjs");var r=({fields:e,includeSystemFields:t})=>{let n=e.filter(e=>t||e.isSystem!==!0);return{fields:n,hiddenSystemFieldCount:e.length-n.length}},i=async({arguments:i,options:a,target:o,signal:s,output:c})=>{let l=await t.t({objectName:e.n(i,0)??``,target:o,signal:s,output:c}),{object:u}=l,{fields:d,hiddenSystemFieldCount:f}=r({fields:l.fields,includeSystemFields:e.t(a,`all`)});return{data:{object:u,fields:d,hiddenSystemFieldCount:f},human:[`${u.labelPlural} (${u.namePlural})`,n.t({fields:d,hiddenSystemFieldCount:f,labelIdentifierFieldMetadataId:u.labelIdentifierFieldMetadataId})].join(`
1
+ const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./fetch-metadata-inspection-BBWnhrft.cjs"),n=require("./format-metadata-fields-9yjjSDbM.cjs");var r=({fields:e,includeSystemFields:t})=>{let n=e.filter(e=>t||e.isSystem!==!0);return{fields:n,hiddenSystemFieldCount:e.length-n.length}},i=async({arguments:i,options:a,target:o,signal:s,output:c})=>{let l=await t.t({objectName:e.n(i,0)??``,target:o,signal:s,output:c}),{object:u}=l,{fields:d,hiddenSystemFieldCount:f}=r({fields:l.fields,includeSystemFields:e.t(a,`all`)});return{data:{object:u,fields:d,hiddenSystemFieldCount:f},human:[`${u.labelPlural} (${u.namePlural})`,n.t({fields:d,hiddenSystemFieldCount:f,labelIdentifierFieldMetadataId:u.labelIdentifierFieldMetadataId})].join(`
2
2
 
3
3
  `)}};exports.runMetadataFieldListCommand=i;
@@ -1,3 +1,3 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./read-command-values-rGaU2qHz.cjs"),n=require("./style-BR52fK4V.cjs"),r=require("./format-data-value-Cln0Hv7L.cjs"),i=require("./format-details-COEwKz_M.cjs"),a=require("./format-metadata-owner-DpOc_B3P.cjs"),o=require("./fetch-metadata-inspection-IuAwjjQT.cjs");var s=e.t(),c=async({arguments:e,target:c,signal:l,output:u})=>{let{object:d}=await o.t({objectName:t.n(e,0)??``,target:c,signal:l,output:u});return{data:{object:d},human:[`${d.labelPlural} (${d.namePlural})`,i.t([[`ID`,d.id],[`API names`,`${d.nameSingular} / ${d.namePlural}`],...(0,s.isNonEmptyString)(d.description)?[[`Description`,r.r(d.description)]]:[],[`Owner`,a.t(d.owner)],[`Active`,String(d.isActive)],[`System`,String(d.isSystem)],[`Searchable`,String(d.isSearchable)]]),`Fields: ${n.r(`twenty metadata field list ${d.namePlural}`)}`].join(`
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./read-command-values-rGaU2qHz.cjs"),n=require("./style-BR52fK4V.cjs"),r=require("./format-data-value-fs3RrhMv.cjs"),i=require("./format-details-COEwKz_M.cjs"),a=require("./format-metadata-owner-BeV6-_Th.cjs"),o=require("./fetch-metadata-inspection-BBWnhrft.cjs");var s=e.t(),c=async({arguments:e,target:c,signal:l,output:u})=>{let{object:d}=await o.t({objectName:t.n(e,0)??``,target:c,signal:l,output:u});return{data:{object:d},human:[`${d.labelPlural} (${d.namePlural})`,i.t([[`ID`,d.id],[`API names`,`${d.nameSingular} / ${d.namePlural}`],...(0,s.isNonEmptyString)(d.description)?[[`Description`,r.r(d.description)]]:[],[`Owner`,a.t(d.owner)],[`Active`,String(d.isActive)],[`System`,String(d.isSystem)],[`Searchable`,String(d.isSearchable)]]),`Fields: ${n.r(`twenty metadata field list ${d.namePlural}`)}`].join(`
2
2
 
3
3
  `)}};exports.runMetadataObjectDescribeCommand=c;
@@ -1,2 +1,2 @@
1
- const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./create-metadata-client-CJRFQ20Z.cjs"),r=require("./format-table-4drtI5sP.cjs"),i=require("./metadata-page.constant-7kxmFenL.cjs"),a=require("./format-metadata-owner-DpOc_B3P.cjs");var o=[`standard`,`application`,`custom`,`unknown`],s=(e,t)=>e.query({objects:{__args:{paging:{first:i.t,after:t},filter:{}},pageInfo:{hasNextPage:!0,endCursor:!0},edges:{node:{nameSingular:!0,namePlural:!0,labelSingular:!0,labelPlural:!0,isSystem:!0,isActive:!0,applicationId:!0}}},currentWorkspace:{workspaceCustomApplicationId:!0}}),c=async({options:c,output:l,target:u,signal:d})=>{let f=e.t(c,`all`),p=n.t({target:u,signal:d}),[{objects:m,currentWorkspace:h},{applications:g,areOwnersNamed:_}]=await Promise.all([s(p),a.r(p)]),v=await i.n(async e=>e===void 0?m:(await s(p,e)).objects);_||l.warn({code:`OWNERS_UNAVAILABLE`,message:`Owners other than Custom show as unknown: listing apps needs the Workspace Apps permission.`});let y=a.n({applications:g,workspaceCustomApplicationId:h.workspaceCustomApplicationId}),b=v.map(({applicationId:e,...t})=>({...t,owner:y(e)})),x=b.filter(e=>f||!e.isSystem).sort((e,t)=>{let n=o.indexOf(e.owner.kind)-o.indexOf(t.owner.kind);return n===0?e.namePlural.localeCompare(t.namePlural):n}),S=b.length-x.length;return{data:{objects:x,hiddenSystemObjectCount:S},human:[r.t({rows:x,columns:[{header:`API NAME`,value:e=>e.namePlural},{header:`LABEL`,value:e=>e.isActive?e.labelPlural:`${e.labelPlural} ${t.i(`(inactive)`)}`},{header:`OWNER`,value:e=>a.t(e.owner)}]}),t.i(S>0?`${x.length} objects · ${S} system objects hidden, show them with --all`:`${x.length} objects`)].join(`
1
+ const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./create-metadata-client-CZSrLZOR.cjs"),r=require("./format-table-4drtI5sP.cjs"),i=require("./metadata-page.constant-qMNOJLjJ.cjs"),a=require("./format-metadata-owner-BeV6-_Th.cjs");var o=[`standard`,`application`,`custom`,`unknown`],s=(e,t)=>e.query({objects:{__args:{paging:{first:i.t,after:t},filter:{}},pageInfo:{hasNextPage:!0,endCursor:!0},edges:{node:{nameSingular:!0,namePlural:!0,labelSingular:!0,labelPlural:!0,isSystem:!0,isActive:!0,applicationId:!0}}},currentWorkspace:{workspaceCustomApplicationId:!0}}),c=async({options:c,output:l,target:u,signal:d})=>{let f=e.t(c,`all`),p=n.t({target:u,signal:d}),[{objects:m,currentWorkspace:h},{applications:g,areOwnersNamed:_}]=await Promise.all([s(p),a.r(p)]),v=await i.n(async e=>e===void 0?m:(await s(p,e)).objects);_||l.warn({code:`OWNERS_UNAVAILABLE`,message:`Owners other than Custom show as unknown: listing apps needs the Workspace Apps permission.`});let y=a.n({applications:g,workspaceCustomApplicationId:h.workspaceCustomApplicationId}),b=v.map(({applicationId:e,...t})=>({...t,owner:y(e)})),x=b.filter(e=>f||!e.isSystem).sort((e,t)=>{let n=o.indexOf(e.owner.kind)-o.indexOf(t.owner.kind);return n===0?e.namePlural.localeCompare(t.namePlural):n}),S=b.length-x.length;return{data:{objects:x,hiddenSystemObjectCount:S},human:[r.t({rows:x,columns:[{header:`API NAME`,value:e=>e.namePlural},{header:`LABEL`,value:e=>e.isActive?e.labelPlural:`${e.labelPlural} ${t.i(`(inactive)`)}`},{header:`OWNER`,value:e=>a.t(e.owner)}]}),t.i(S>0?`${x.length} objects · ${S} system objects hidden, show them with --all`:`${x.length} objects`)].join(`
2
2
  `)}};exports.runMetadataObjectListCommand=c;
@@ -1 +1 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Cbb71hpl-CrSqydxj.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./api-url-protocols.constant-EEmR3Pmg.cjs"),a=require("./read-command-values-rGaU2qHz.cjs"),o=require("./resolve-request-url-BwELN2oQ.cjs"),s=require("./is-interaction-allowed-BQLOG8RG.cjs"),c=require("./create-metadata-client-CJRFQ20Z.cjs"),l=require("./open-browser-LPuVspT7.cjs");var u=({workspaceUrl:e,page:n})=>{if(!t.t(n))return e.href;let i=URL.parse(n,e);if(!t.t(i)||i.origin!==e.origin||i.pathname.startsWith(`//`))throw new r.t({code:`USAGE`,exitCode:r.n.USAGE,message:`${n} is not a page of the workspace.`,hint:`Pass a path inside the workspace, for example settings/applications.`});return i.href},d=e.t(),f=(e,n)=>{let a=(0,d.isNonEmptyString)(e)?URL.parse(e):null;if(!t.t(a)||!i.t.includes(a.protocol))throw new r.t({code:`INVALID_RESPONSE`,message:`${n} did not return a web address for this workspace.`});return a},p=async({target:e,signal:t})=>{let{currentWorkspace:r}=await c.t({target:e,signal:t}).query({currentWorkspace:{workspaceUrls:{customUrl:!0,subdomainUrl:!0}}}),i=r?.workspaceUrls,a=(0,d.isNonEmptyString)(i?.customUrl)?i.customUrl:i?.subdomainUrl;if((0,d.isNonEmptyString)(a))return f(a,e.apiUrl);let s=await o.r({apiUrl:e.apiUrl,signal:t})(o.t({apiUrl:e.apiUrl,path:`/.well-known/oauth-authorization-server`}),{headers:{Accept:`application/json`}}),l=await o.n(s),u=f(s.ok&&n.i(l)?l.authorization_endpoint:void 0,e.apiUrl);return new URL(u.origin)},m=async({arguments:e,options:t,outputMode:n,target:i,signal:o})=>{let c=a.t(t,`urlOnly`);if(!c&&!s.t({options:t,outputMode:n}))throw new r.t({code:`USAGE`,exitCode:r.n.USAGE,message:`twenty open only opens a browser in an interactive terminal, not with --no-input, JSON output, redirected stdin or in CI.`,hint:`Add --url-only to print the address instead.`});let d=u({workspaceUrl:await p({target:i,signal:o}),page:a.n(e,0)});return c?{data:{url:d},human:d}:(l.t(d),{data:{url:d},human:`Opening ${d} in your browser.`})};exports.runOpenCommand=m;
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-BVRtHFho-CGmbRR4M.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./api-url-protocols.constant-EEmR3Pmg.cjs"),a=require("./read-command-values-rGaU2qHz.cjs"),o=require("./resolve-request-url-I1EOOumy.cjs"),s=require("./is-interaction-allowed-BQLOG8RG.cjs"),c=require("./create-metadata-client-CZSrLZOR.cjs"),l=require("./open-browser-LPuVspT7.cjs");var u=({workspaceUrl:e,page:n})=>{if(!t.t(n))return e.href;let i=URL.parse(n,e);if(!t.t(i)||i.origin!==e.origin||i.pathname.startsWith(`//`))throw new r.t({code:`USAGE`,exitCode:r.n.USAGE,message:`${n} is not a page of the workspace.`,hint:`Pass a path inside the workspace, for example settings/applications.`});return i.href},d=e.t(),f=(e,n)=>{let a=(0,d.isNonEmptyString)(e)?URL.parse(e):null;if(!t.t(a)||!i.t.includes(a.protocol))throw new r.t({code:`INVALID_RESPONSE`,message:`${n} did not return a web address for this workspace.`});return a},p=async({target:e,signal:t})=>{let{currentWorkspace:r}=await c.t({target:e,signal:t}).query({currentWorkspace:{workspaceUrls:{customUrl:!0,subdomainUrl:!0}}}),i=r?.workspaceUrls,a=(0,d.isNonEmptyString)(i?.customUrl)?i.customUrl:i?.subdomainUrl;if((0,d.isNonEmptyString)(a))return f(a,e.apiUrl);let s=await o.r({apiUrl:e.apiUrl,signal:t})(o.t({apiUrl:e.apiUrl,path:`/.well-known/oauth-authorization-server`}),{headers:{Accept:`application/json`}}),l=await o.n(s),u=f(s.ok&&n.i(l)?l.authorization_endpoint:void 0,e.apiUrl);return new URL(u.origin)},m=async({arguments:e,options:t,outputMode:n,target:i,signal:o})=>{let c=a.t(t,`urlOnly`);if(!c&&!s.t({options:t,outputMode:n}))throw new r.t({code:`USAGE`,exitCode:r.n.USAGE,message:`twenty open only opens a browser in an interactive terminal, not with --no-input, JSON output, redirected stdin or in CI.`,hint:`Add --url-only to print the address instead.`});let d=u({workspaceUrl:await p({target:i,signal:o}),page:a.n(e,0)});return c?{data:{url:d},human:d}:(l.t(d),{data:{url:d},human:`Opening ${d} in your browser.`})};exports.runOpenCommand=m;
@@ -1 +1 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./read-config-9Dv5cmvw.cjs"),i=require("./get-credential-kind-qxy7oLdW.cjs"),a=require("./credential-kind-labels.constant-CKdoQF8o.cjs"),o=require("./format-table-4drtI5sP.cjs");var s=e.t(),c=async()=>{let e=await r.t(n.t()),c=Object.entries(e.remotes).map(([t,n])=>({name:t,apiUrl:n.apiUrl,credentials:i.t(n),workspaceName:(0,s.isString)(n.workspaceName)?n.workspaceName:null,isDefault:t===e.defaultRemote})).sort((e,t)=>e.name.localeCompare(t.name));return c.length===0?{data:{remotes:c,defaultRemote:null},human:`No saved remotes. ${t.i(`Sign in with: `)}${t.r(`twenty auth login --url <url>`)}`}:{data:{remotes:c,defaultRemote:e.defaultRemote??null},human:o.t({rows:c,columns:[{header:` `,value:e=>e.isDefault?t.n(`green`,`●`):``},{header:`NAME`,value:e=>e.name},{header:`URL`,value:e=>e.apiUrl},{header:`AUTH`,value:e=>a.t[e.credentials]},{header:`WORKSPACE`,value:e=>e.workspaceName??``}]})}};exports.runRemoteListCommand=c;
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./read-config-BwRvqqhW.cjs"),i=require("./get-credential-kind-qxy7oLdW.cjs"),a=require("./credential-kind-labels.constant-CKdoQF8o.cjs"),o=require("./format-table-4drtI5sP.cjs");var s=e.t(),c=async()=>{let e=await r.t(n.t()),c=Object.entries(e.remotes).map(([t,n])=>({name:t,apiUrl:n.apiUrl,credentials:i.t(n),workspaceName:(0,s.isString)(n.workspaceName)?n.workspaceName:null,isDefault:t===e.defaultRemote})).sort((e,t)=>e.name.localeCompare(t.name));return c.length===0?{data:{remotes:c,defaultRemote:null},human:`No saved remotes. ${t.i(`Sign in with: `)}${t.r(`twenty auth login --url <url>`)}`}:{data:{remotes:c,defaultRemote:e.defaultRemote??null},human:o.t({rows:c,columns:[{header:` `,value:e=>e.isDefault?t.n(`green`,`●`):``},{header:`NAME`,value:e=>e.name},{header:`URL`,value:e=>e.apiUrl},{header:`AUTH`,value:e=>a.t[e.credentials]},{header:`WORKSPACE`,value:e=>e.workspaceName??``}]})}};exports.runRemoteListCommand=c;
@@ -1,2 +1,2 @@
1
- const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./find-remote-TcvVyJpy.cjs"),i=require("./update-config-XYMqGokt.cjs");var a=async({arguments:a,signal:o})=>{let s=e.n(a,0)??``,c=await i.t({configPath:n.t(),signal:o,update:e=>{r.t(e,s);let{[s]:t,...n}=e.remotes,{defaultRemote:i,...a}=e,o=i===s;return{result:o,config:{...o?a:e,remotes:n}}}});return{data:{removed:s,wasDefault:c},human:[t.o(`Removed ${s}.`),...c?[t.i(` There is no default remote now. Pick one with: twenty remote use <name>`)]:[]].join(`
1
+ const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./find-remote-TcvVyJpy.cjs"),i=require("./update-config-D0Y-TAiW.cjs");var a=async({arguments:a,signal:o})=>{let s=e.n(a,0)??``,c=await i.t({configPath:n.t(),signal:o,update:e=>{r.t(e,s);let{[s]:t,...n}=e.remotes,{defaultRemote:i,...a}=e,o=i===s;return{result:o,config:{...o?a:e,remotes:n}}}});return{data:{removed:s,wasDefault:c},human:[t.o(`Removed ${s}.`),...c?[t.i(` There is no default remote now. Pick one with: twenty remote use <name>`)]:[]].join(`
2
2
  `)}};exports.runRemoteRemoveCommand=a;
@@ -1 +1 @@
1
- const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./read-command-values-rGaU2qHz.cjs"),n=require("./style-BR52fK4V.cjs"),r=require("./get-config-path-C-D-QHuX.cjs"),i=require("./find-remote-TcvVyJpy.cjs"),a=require("./update-config-XYMqGokt.cjs"),o=require("./validate-remote-name-ZWOgVe80.cjs");var s=async({arguments:s,signal:c})=>{let l=t.n(s,0)??``,u=o.t(t.n(s,1)??``);return{data:{previousName:l,name:u,isDefault:await a.t({configPath:r.t(),signal:c,update:t=>{let n=i.t(t,l);if(Object.hasOwn(t.remotes,u))throw new e.t({code:`REMOTE_EXISTS`,exitCode:e.n.USAGE,message:`A remote named ${u} already exists.`,hint:`Pick another name, or remove it first: twenty remote remove ${u}`});let{[l]:r,...a}=t.remotes,o=t.defaultRemote===l;return{result:o,config:{...t,remotes:{...a,[u]:n},...o?{defaultRemote:u}:{}}}}})},human:n.o(`Renamed ${l} to ${u}.`)}};exports.runRemoteRenameCommand=s;
1
+ const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./read-command-values-rGaU2qHz.cjs"),n=require("./style-BR52fK4V.cjs"),r=require("./get-config-path-C-D-QHuX.cjs"),i=require("./find-remote-TcvVyJpy.cjs"),a=require("./update-config-D0Y-TAiW.cjs"),o=require("./validate-remote-name-ZWOgVe80.cjs");var s=async({arguments:s,signal:c})=>{let l=t.n(s,0)??``,u=o.t(t.n(s,1)??``);return{data:{previousName:l,name:u,isDefault:await a.t({configPath:r.t(),signal:c,update:t=>{let n=i.t(t,l);if(Object.hasOwn(t.remotes,u))throw new e.t({code:`REMOTE_EXISTS`,exitCode:e.n.USAGE,message:`A remote named ${u} already exists.`,hint:`Pick another name, or remove it first: twenty remote remove ${u}`});let{[l]:r,...a}=t.remotes,o=t.defaultRemote===l;return{result:o,config:{...t,remotes:{...a,[u]:n},...o?{defaultRemote:u}:{}}}}})},human:n.o(`Renamed ${l} to ${u}.`)}};exports.runRemoteRenameCommand=s;
@@ -1 +1 @@
1
- const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./find-remote-TcvVyJpy.cjs"),i=require("./update-config-XYMqGokt.cjs");var a=async({arguments:a,signal:o})=>{let s=e.n(a,0)??``,c=await i.t({configPath:n.t(),signal:o,update:e=>({result:r.t(e,s),config:{...e,defaultRemote:s}})});return{data:{defaultRemote:s,apiUrl:c.apiUrl},human:t.o(`Default remote is now ${s} ${t.i(`(${c.apiUrl})`)}`)}};exports.runRemoteUseCommand=a;
1
+ const e=require("./read-command-values-rGaU2qHz.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./get-config-path-C-D-QHuX.cjs"),r=require("./find-remote-TcvVyJpy.cjs"),i=require("./update-config-D0Y-TAiW.cjs");var a=async({arguments:a,signal:o})=>{let s=e.n(a,0)??``,c=await i.t({configPath:n.t(),signal:o,update:e=>({result:r.t(e,s),config:{...e,defaultRemote:s}})});return{data:{defaultRemote:s,apiUrl:c.apiUrl},human:t.o(`Default remote is now ${s} ${t.i(`(${c.apiUrl})`)}`)}};exports.runRemoteUseCommand=a;
@@ -1 +1 @@
1
- const e=require("./style-BR52fK4V.cjs"),t=require("./cli-version.constant-BRiLR-nG.cjs");var n=async()=>{let n={version:t.t,node:process.versions.node,platform:process.platform,arch:process.arch};return{data:n,human:`twenty ${n.version} ${e.i(`(node ${n.node}, ${n.platform}-${n.arch})`)}`}};exports.runVersionCommand=n;
1
+ const e=require("./style-BR52fK4V.cjs"),t=require("./cli-version.constant-CXTtLO6W.cjs");var n=async()=>{let n={version:t.t,node:process.versions.node,platform:process.platform,arch:process.arch};return{data:n,human:`twenty ${n.version} ${e.i(`(node ${n.node}, ${n.platform}-${n.arch})`)}`}};exports.runVersionCommand=n;
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./valid-BPaM0XRk.cjs");var n=e.t(((e,n)=>{var r=t.n();n.exports=(e,t,n)=>{try{t=new r(t,n)}catch{return!1}return t.test(e)}}));Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -1 +1 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./target-environment-variable.constant-D7z8AihP.cjs"),a=require("./find-remote-TcvVyJpy.cjs");var o=e.t(),s=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,c=(e,t)=>{let n=e[t]?.trim();return(0,o.isNonEmptyString)(n)?n:void 0},l=(e,t)=>({source:`remote`,remoteName:t,remote:a.t(e,t)}),u=async({environment:e,remoteFlag:a,loadConfig:o,warn:u})=>{let d=c(e,i.t.REMOTE),f=c(e,i.t.API_URL),p=c(e,i.t.API_KEY);if(n.t(a)){let r=Object.values(i.t).filter(t=>n.t(c(e,t)));return t.n(r)&&u({code:`ENVIRONMENT_TARGET_IGNORED`,message:`Using remote ${a}. Ignoring ${s(r)}.`}),l(await o(),a)}if(n.t(d)){if(n.t(f)||n.t(p))throw new r.t({code:`CONFLICTING_TARGET`,exitCode:r.n.USAGE,message:`${i.t.REMOTE} cannot be combined with ${i.t.API_URL} or ${i.t.API_KEY}.`,hint:`Unset one of them, or choose with --remote.`});return l(await o(),d)}if(n.t(f)!==n.t(p)){let e=n.t(f)?i.t.API_KEY:i.t.API_URL;throw new r.t({code:`INCOMPLETE_TARGET`,exitCode:r.n.USAGE,message:`${e} is not set.`,hint:`Set both ${i.t.API_URL} and ${i.t.API_KEY}, or neither.`})}if(n.t(f)&&n.t(p))return{source:`environment`,apiUrl:f,apiKey:p};let m=await o();if(n.t(m.defaultRemote))return l(m,m.defaultRemote);throw new r.t({code:`TARGET_REQUIRED`,exitCode:r.n.USAGE,message:`No workspace selected.`,hint:`Sign in with: twenty auth login --url <url>. Or set ${i.t.API_URL} and ${i.t.API_KEY}.`})};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./utils-BZkF-gp5-DunD-YmD.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./target-environment-variable.constant-D7z8AihP.cjs"),a=require("./find-remote-TcvVyJpy.cjs");var o=e.t(),s=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,c=(e,t)=>{let n=e[t]?.trim();return(0,o.isNonEmptyString)(n)?n:void 0},l=(e,t)=>({source:`remote`,remoteName:t,remote:a.t(e,t)}),u=async({environment:e,remoteFlag:a,loadConfig:o,warn:u})=>{let d=c(e,i.t.REMOTE),f=c(e,i.t.API_URL),p=c(e,i.t.API_KEY);if(n.t(a)){let r=Object.values(i.t).filter(t=>n.t(c(e,t)));return t.r(r)&&u({code:`ENVIRONMENT_TARGET_IGNORED`,message:`Using remote ${a}. Ignoring ${s(r)}.`}),l(await o(),a)}if(n.t(d)){if(n.t(f)||n.t(p))throw new r.t({code:`CONFLICTING_TARGET`,exitCode:r.n.USAGE,message:`${i.t.REMOTE} cannot be combined with ${i.t.API_URL} or ${i.t.API_KEY}.`,hint:`Unset one of them, or choose with --remote.`});return l(await o(),d)}if(n.t(f)!==n.t(p)){let e=n.t(f)?i.t.API_KEY:i.t.API_URL;throw new r.t({code:`INCOMPLETE_TARGET`,exitCode:r.n.USAGE,message:`${e} is not set.`,hint:`Set both ${i.t.API_URL} and ${i.t.API_KEY}, or neither.`})}if(n.t(f)&&n.t(p))return{source:`environment`,apiUrl:f,apiKey:p};let m=await o();if(n.t(m.defaultRemote))return l(m,m.defaultRemote);throw new r.t({code:`TARGET_REQUIRED`,exitCode:r.n.USAGE,message:`No workspace selected.`,hint:`Sign in with: twenty auth login --url <url>. Or set ${i.t.API_URL} and ${i.t.API_KEY}.`})};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
@@ -1 +1 @@
1
- const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./cli-error-CrUD8uMp.cjs"),n=require("./parse-api-url-jHzjLWX1.cjs"),r=require("./confirm-in-terminal-D2e1lKUY.cjs"),i=require("./read-config-9Dv5cmvw.cjs"),a=require("./get-credential-kind-qxy7oLdW.cjs"),o=require("./sign-in-with-browser-DdjoPq5d.cjs"),s=require("./update-config-XYMqGokt.cjs"),c=require("./fetch-signed-in-identity-BFxRufRI.cjs");var l=(r,i,o)=>{let s=Object.hasOwn(r.remotes,o)?r.remotes[o]:void 0;if(!e.t(s)||a.t(s)!==`oauth`||s.twentyCLIAccessToken!==i.bearerToken||n.t({rawUrl:s.apiUrl,sourceName:o})!==i.apiUrl)throw new t.t({code:`CONFLICT`,exitCode:t.n.CONFLICT,message:`Remote ${o} changed while signing in again. No credentials were saved.`,hint:`Run the command again.`});return s},u=async({target:e,remoteName:t,error:n,configPath:a,output:u,signal:d})=>{if(l(await i.t(a),e,t),!await r.t({question:`Your session on ${t} is no longer valid. Sign in again now?`,signal:d}))throw n;let f=await o.t({apiUrl:e.apiUrl,output:u,signal:d}),p={...e,bearerToken:f.accessToken};return await c.t({target:p,signal:d}),await s.t({configPath:a,signal:d,update:n=>{let r=l(n,e,t);return{result:void 0,config:{...n,remotes:{...n.remotes,[t]:o.n({remote:r,credentials:{kind:`oauth`,...f}})}}}}}),p};exports.signInToRemoteAgain=u;
1
+ const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./cli-error-CrUD8uMp.cjs"),n=require("./parse-api-url-jHzjLWX1.cjs"),r=require("./confirm-in-terminal-D2e1lKUY.cjs"),i=require("./read-config-BwRvqqhW.cjs"),a=require("./get-credential-kind-qxy7oLdW.cjs"),o=require("./sign-in-with-browser-PLGwMTwd.cjs"),s=require("./update-config-D0Y-TAiW.cjs"),c=require("./fetch-signed-in-identity-C-qQ3udY.cjs");var l=(r,i,o)=>{let s=Object.hasOwn(r.remotes,o)?r.remotes[o]:void 0;if(!e.t(s)||a.t(s)!==`oauth`||s.twentyCLIAccessToken!==i.bearerToken||n.t({rawUrl:s.apiUrl,sourceName:o})!==i.apiUrl)throw new t.t({code:`CONFLICT`,exitCode:t.n.CONFLICT,message:`Remote ${o} changed while signing in again. No credentials were saved.`,hint:`Run the command again.`});return s},u=async({target:e,remoteName:t,error:n,configPath:a,output:u,signal:d})=>{if(l(await i.t(a),e,t),!await r.t({question:`Your session on ${t} is no longer valid. Sign in again now?`,signal:d}))throw n;let f=await o.t({apiUrl:e.apiUrl,output:u,signal:d}),p={...e,bearerToken:f.accessToken};return await c.t({target:p,signal:d}),await s.t({configPath:a,signal:d,update:n=>{let r=l(n,e,t);return{result:void 0,config:{...n,remotes:{...n.remotes,[t]:o.n({remote:r,credentials:{kind:`oauth`,...f}})}}}}}),p};exports.signInToRemoteAgain=u;