twenty 2.53.0 → 2.54.2

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 (142) hide show
  1. package/CONTRIBUTING.md +5 -1
  2. package/dist/app-template/example/scripts.json +6 -0
  3. package/dist/app-template/package.json +1 -4
  4. package/dist/app-template/yarn.lock +30 -30
  5. package/dist/app-worker.cjs +1 -1
  6. package/dist/chunks/{application-BxIKWsoy.cjs → application-pYRHxplP.cjs} +3 -3
  7. package/dist/chunks/{build-source-manifest-BIq-ByiX.cjs → build-source-manifest-BJyDykpG.cjs} +1 -1
  8. package/dist/chunks/{build-source-snapshot-d23K-Ikr.cjs → build-source-snapshot-Ds_ZZGnl.cjs} +19 -19
  9. package/dist/chunks/{cli-version.constant-YNWQ9cC0.cjs → cli-version.constant-ByxyxCr8.cjs} +1 -1
  10. package/dist/chunks/{collect-translatable-strings-rQ3M474u.cjs → collect-translatable-strings-BWzloBoB.cjs} +1 -1
  11. package/dist/chunks/compile-application-translations-qdigcX2V.cjs +1 -0
  12. package/dist/chunks/{constants-Bod2d_GP-CQVvzM4m.cjs → constants-Cbb71hpl-CrSqydxj.cjs} +1 -1
  13. package/dist/chunks/{create-http-status-error-BMaFl1lt.cjs → create-http-status-error-CSxveq4d.cjs} +1 -1
  14. package/dist/chunks/create-metadata-client-CJRFQ20Z.cjs +6 -0
  15. package/dist/chunks/create-pull-base-write-BAapBdLz.cjs +1 -0
  16. package/dist/chunks/{create-rest-client-Cqmhix9V.cjs → create-rest-client-eb80-tts.cjs} +1 -1
  17. package/dist/chunks/execa-CAd0sJ7f.cjs +3 -0
  18. package/dist/chunks/extract-manifest-from-file-CEK5X5YP.cjs +1 -0
  19. package/dist/chunks/{extract-source-translations-BqDJ4wJe.cjs → extract-source-translations-BHy14v8o.cjs} +1 -1
  20. package/dist/chunks/{fetch-metadata-inspection-FViKeZE2.cjs → fetch-metadata-inspection-IuAwjjQT.cjs} +1 -1
  21. package/dist/chunks/{fetch-signed-in-identity-DetIg3mY.cjs → fetch-signed-in-identity-BFxRufRI.cjs} +1 -1
  22. package/dist/chunks/fetch-workspace-or-throw-CgPc8IBL.cjs +1 -0
  23. package/dist/chunks/{format-data-value-CSmt_osQ.cjs → format-data-value-Cln0Hv7L.cjs} +1 -1
  24. package/dist/chunks/{format-metadata-fields-CIlW-vcz.cjs → format-metadata-fields-BltFjIsO.cjs} +1 -1
  25. package/dist/chunks/{format-metadata-owner-boZrxwKt.cjs → format-metadata-owner-DpOc_B3P.cjs} +1 -1
  26. package/dist/chunks/{generate-application-client-CApCs5PX.cjs → generate-application-client-CL8nm0q9.cjs} +1 -1
  27. package/dist/chunks/{get-client-generation-skip-reason-D9u3PsGX.cjs → get-client-generation-skip-reason-BJFlVAos.cjs} +1 -1
  28. package/dist/chunks/{get-system-view-universal-identifier.util-C6XI2VGC-Dy2DReV-.cjs → get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs} +1 -1
  29. package/dist/chunks/global-flags.constant-BJ3B_dc8.cjs +1 -0
  30. package/dist/chunks/{is-access-token-expiring-hGgVV9T8.cjs → is-access-token-expiring-B3WtsewG.cjs} +1 -1
  31. package/dist/chunks/{is-application-not-found-error-DH5B4tzI.cjs → is-application-not-found-error-BC7jyU0p.cjs} +1 -1
  32. package/dist/chunks/{is-exported-manifest-CoOxJ1Ku.cjs → is-exported-manifest-D8cwSas4.cjs} +1 -1
  33. package/dist/chunks/is-valid-package-name-CiTztEPu.cjs +1 -0
  34. package/dist/chunks/locale-catalog-format-C_5EGBEn.cjs +20 -0
  35. package/dist/chunks/metadata-CY9y5wYc.cjs +1 -0
  36. package/dist/chunks/parse-app-export-CpZxFIlO.cjs +1 -0
  37. package/dist/chunks/{parse-graphql-response-8IMbTRp8.cjs → parse-graphql-response-Di8aFmnF.cjs} +1 -1
  38. package/dist/chunks/{parse-json-input-CJEnFJw_.cjs → parse-json-input-kEwLo8mG.cjs} +1 -1
  39. package/dist/chunks/pull-minimum-sdk-version.constant-JDRwzl32.cjs +5 -0
  40. package/dist/chunks/pull-source-CpAYRk5s.cjs +1 -0
  41. package/dist/chunks/{read-app-identity-BbNKSUV5.cjs → read-app-identity-CJZThpUC.cjs} +1 -1
  42. package/dist/chunks/{read-application-identifier-BxzrxUSf.cjs → read-application-identifier-D6YPuiA7.cjs} +1 -1
  43. package/dist/chunks/{read-application-identity-uq1DePso.cjs → read-application-identity-CWSIB1Jd.cjs} +1 -1
  44. package/dist/chunks/{read-config-BinH4NbQ.cjs → read-config-9Dv5cmvw.cjs} +1 -1
  45. package/dist/chunks/{read-infer-deletion-option-BFdfPWCc.cjs → read-infer-deletion-option-DtCw0TsU.cjs} +1 -1
  46. package/dist/chunks/read-json-object-BlyNzzdk.cjs +1 -0
  47. package/dist/chunks/{read-source-identity-DmwOw5xO.cjs → read-source-identity-BQ_YGISo.cjs} +1 -1
  48. package/dist/chunks/record-pull-base-BIlU7Fj1.cjs +1 -0
  49. package/dist/chunks/{record-typecheck-config-inputs-BxgLBZ_x.cjs → record-typecheck-config-inputs-BGVirGsR.cjs} +1 -1
  50. package/dist/chunks/{request-oauth-tokens-DCmkyPd1.cjs → request-oauth-tokens-BkL-WsAM.cjs} +1 -1
  51. package/dist/chunks/{resolve-app-project-CMuYw_Z4.cjs → resolve-app-project-DP27LYGR.cjs} +1 -1
  52. package/dist/chunks/{resolve-command-target-BFHhx0DC.cjs → resolve-command-target-C4r6LuWk.cjs} +1 -1
  53. package/dist/chunks/{resolve-project-typescript-D66veK53.cjs → resolve-project-typescript-BOAxXiKm.cjs} +1 -1
  54. package/dist/chunks/{resolve-source-sdk-Cfn4KCbU.cjs → resolve-source-sdk-CyvER2l1.cjs} +1 -1
  55. package/dist/chunks/{run-api-graphql-command-Byg29Kwt.cjs → run-api-graphql-command-D-Pu9EdU.cjs} +1 -1
  56. package/dist/chunks/{run-api-rest-command-BVxjuvu0.cjs → run-api-rest-command-BuDANSQa.cjs} +1 -1
  57. package/dist/chunks/{run-app-add-command-BzKv_KQW.cjs → run-app-add-command-C0b2LVQN.cjs} +3 -3
  58. package/dist/chunks/{run-app-apply-command-DwhPVSBM.cjs → run-app-apply-command-BDimcFdx.cjs} +1 -1
  59. package/dist/chunks/{run-app-build-command-BeUcVmMK.cjs → run-app-build-command-LK-V8mco.cjs} +1 -1
  60. package/dist/chunks/{run-app-dev-command-BcdQ_GFC.cjs → run-app-dev-command-BnSJIUgg.cjs} +2 -2
  61. package/dist/chunks/{run-app-exec-command-DNbhEfkC.cjs → run-app-exec-command-BPlfFt9-.cjs} +2 -2
  62. package/dist/chunks/{run-app-generate-client-command-DxN3fEA1.cjs → run-app-generate-client-command-7t5Hs10P.cjs} +1 -1
  63. package/dist/chunks/run-app-init-command-CCTOr_Nf.cjs +2 -0
  64. package/dist/chunks/{run-app-install-command-Btc0jUCP.cjs → run-app-install-command-DOzp9bOL.cjs} +1 -1
  65. package/dist/chunks/{run-app-logs-command-dfLruOJn.cjs → run-app-logs-command-CQDO_gce.cjs} +3 -3
  66. package/dist/chunks/{run-app-operation-Or8xoNyS.cjs → run-app-operation-BkbulYeD.cjs} +1 -1
  67. package/dist/chunks/{run-app-plan-command-4BoAWJL8.cjs → run-app-plan-command-CqFauRLP.cjs} +1 -1
  68. package/dist/chunks/run-app-publish-command-C4LkGgHH.cjs +1 -0
  69. package/dist/chunks/run-app-pull-command-Bo00XMOR.cjs +6 -0
  70. package/dist/chunks/{run-app-translations-extract-command-BtKIasjA.cjs → run-app-translations-extract-command-LUAa7jb9.cjs} +1 -1
  71. package/dist/chunks/{run-app-typecheck-command-CpaU-SSu.cjs → run-app-typecheck-command-BdNa6fFY.cjs} +1 -1
  72. package/dist/chunks/{run-app-uninstall-command-BxFxIq7d.cjs → run-app-uninstall-command-BK-JAeo2.cjs} +1 -1
  73. package/dist/chunks/{run-auth-login-command-B2mdQ2u2.cjs → run-auth-login-command-CN6Xqgpx.cjs} +1 -1
  74. package/dist/chunks/{run-auth-logout-command-ChQscyV4.cjs → run-auth-logout-command-Dw6CLfIY.cjs} +1 -1
  75. package/dist/chunks/{run-auth-status-command-kdN443Ay.cjs → run-auth-status-command-CXRrXjvh.cjs} +1 -1
  76. package/dist/chunks/{run-cli-BYGyQans.cjs → run-cli-B6yyUJ--.cjs} +2 -2
  77. package/dist/chunks/{run-commands-command-CZnZ6zyN.cjs → run-commands-command-Dz7piZQN.cjs} +1 -1
  78. package/dist/chunks/{run-data-get-command--GOFyb1w.cjs → run-data-get-command-BD7i13MO.cjs} +1 -1
  79. package/dist/chunks/{run-data-list-command-By_8ux8l.cjs → run-data-list-command-tcCgbeZj.cjs} +1 -1
  80. package/dist/chunks/{run-doctor-command-BSwxxXiE.cjs → run-doctor-command-Y_jubJ67.cjs} +2 -2
  81. package/dist/chunks/{run-metadata-field-describe-command-Dyfd4C9K.cjs → run-metadata-field-describe-command-BX5_s1m0.cjs} +1 -1
  82. package/dist/chunks/{run-metadata-field-list-command-Cd7YnAki.cjs → run-metadata-field-list-command-BVFDiJv2.cjs} +1 -1
  83. package/dist/chunks/{run-metadata-object-describe-command-DJUVk4c3.cjs → run-metadata-object-describe-command-CWYI0V42.cjs} +1 -1
  84. package/dist/chunks/{run-metadata-object-list-command-CYfHKqwb.cjs → run-metadata-object-list-command-Y3yebZrT.cjs} +1 -1
  85. package/dist/chunks/{run-open-command-smX2pJKi.cjs → run-open-command-BUEQSKSk.cjs} +1 -1
  86. package/dist/chunks/{run-remote-list-command-OotTwa0W.cjs → run-remote-list-command-BExGjyKO.cjs} +1 -1
  87. package/dist/chunks/{run-remote-remove-command-C43pSDK9.cjs → run-remote-remove-command-D2thQnCU.cjs} +1 -1
  88. package/dist/chunks/{run-remote-rename-command-fphQG7fM.cjs → run-remote-rename-command-DI0Adm5U.cjs} +1 -1
  89. package/dist/chunks/{run-remote-use-command-CpgiMu-K.cjs → run-remote-use-command-CXnu5zDY.cjs} +1 -1
  90. package/dist/chunks/{run-version-command-BugTbUa0.cjs → run-version-command-iRMLBmH6.cjs} +1 -1
  91. package/dist/chunks/{select-target-CgDTzZ8p.cjs → select-target-CJ2FyoVQ.cjs} +1 -1
  92. package/dist/chunks/{sign-in-to-remote-again-BmojAqdV.cjs → sign-in-to-remote-again-CwXAgGif.cjs} +1 -1
  93. package/dist/chunks/{sign-in-with-browser-1-CK0mOu.cjs → sign-in-with-browser-DdjoPq5d.cjs} +1 -1
  94. package/dist/chunks/{to-worker-output-diagnostics-BD6M8RST.cjs → to-worker-output-diagnostics-Hj6aQiK9.cjs} +2 -2
  95. package/dist/chunks/{typecheck-application-CQG69ztM.cjs → typecheck-application-nkgv6qiA.cjs} +1 -1
  96. package/dist/chunks/{update-config-BHs_Zv8h.cjs → update-config-XYMqGokt.cjs} +1 -1
  97. package/dist/chunks/{utils-BMycM5SC-9TsAPfH8.cjs → utils-RCpFyoX5-DF7Gq1IH.cjs} +2 -2
  98. package/dist/chunks/{write-config-atomically-BHOlbOl_.cjs → write-config-atomically-BxCEc8_P.cjs} +1 -1
  99. package/dist/cli.cjs +1 -1
  100. package/docs/commands.md +7 -3
  101. package/package.json +2 -3
  102. package/src/app/bundles/README.md +3 -2
  103. package/src/app/pull/README.md +5 -2
  104. package/dist/chunks/compile-application-translations-Q8K18JOI.cjs +0 -1
  105. package/dist/chunks/create-metadata-client-C_ezBBSL.cjs +0 -6
  106. package/dist/chunks/create-pull-base-write-CyAWuU4_.cjs +0 -1
  107. package/dist/chunks/extract-manifest-from-file-CiZT_2AN.cjs +0 -1
  108. package/dist/chunks/fetch-workspace-id-BjsaXgwT.cjs +0 -1
  109. package/dist/chunks/global-flags.constant-DzvO9WzG.cjs +0 -1
  110. package/dist/chunks/locale-catalog-format-Dbn6JD4p.cjs +0 -20
  111. package/dist/chunks/metadata-BWVl-AS0.cjs +0 -1
  112. package/dist/chunks/parse-app-export-Ci1VgDGB.cjs +0 -1
  113. package/dist/chunks/pull-minimum-sdk-version.constant-B-1PY5i8.cjs +0 -5
  114. package/dist/chunks/pull-source-DcvqGJro.cjs +0 -1
  115. package/dist/chunks/read-json-object-ht56HC80.cjs +0 -1
  116. package/dist/chunks/record-pull-base-lUZgKmne.cjs +0 -1
  117. package/dist/chunks/run-app-init-command-b6UCdbdu.cjs +0 -2
  118. package/dist/chunks/run-app-publish-command-BSoeN498.cjs +0 -3
  119. package/dist/chunks/run-app-pull-command-_T-gRpRM.cjs +0 -3
  120. /package/dist/app-template/{AGENTS.md → example/files/AGENTS.md} +0 -0
  121. /package/dist/app-template/{CHANGELOG.md → example/files/CHANGELOG.md} +0 -0
  122. /package/dist/app-template/{README.md → example/files/README.md} +0 -0
  123. /package/dist/app-template/{SETUP.md → example/files/SETUP.md} +0 -0
  124. /package/dist/app-template/{github → example/files/github}/workflows/cd.yml +0 -0
  125. /package/dist/app-template/{github → example/files/github}/workflows/ci.yml +0 -0
  126. /package/dist/app-template/{github → example/files/github}/workflows/publish.yml +0 -0
  127. /package/dist/app-template/{locales → example/files/locales}/en.json +0 -0
  128. /package/dist/app-template/{public → example/files/public}/logo.svg +0 -0
  129. /package/dist/app-template/{src → example/files/src}/__tests__/application-config.test.ts +0 -0
  130. /package/dist/app-template/{src → example/files/src}/__tests__/global-setup.ts +0 -0
  131. /package/dist/app-template/{src → example/files/src}/__tests__/run-twenty.ts +0 -0
  132. /package/dist/app-template/{src → example/files/src}/__tests__/schema.integration-test.ts +0 -0
  133. /package/dist/app-template/{src → example/files/src}/application-config.ts +0 -0
  134. /package/dist/app-template/{src → example/files/src}/constants/universal-identifiers.ts +0 -0
  135. /package/dist/app-template/{src → example/files/src}/default-role.ts +0 -0
  136. /package/dist/app-template/{src → example/files/src}/front-components/main-page.tsx +0 -0
  137. /package/dist/app-template/{src → example/files/src}/logic-functions/health-check.ts +0 -0
  138. /package/dist/app-template/{src → example/files/src}/navigation-menu-items/main-page.navigation-menu-item.ts +0 -0
  139. /package/dist/app-template/{src → example/files/src}/page-layouts/main-page.page-layout.ts +0 -0
  140. /package/dist/app-template/{tsconfig.spec.json → example/files/tsconfig.spec.json} +0 -0
  141. /package/dist/app-template/{vitest.config.ts → example/files/vitest.config.ts} +0 -0
  142. /package/dist/app-template/{vitest.unit.config.ts → example/files/vitest.unit.config.ts} +0 -0
@@ -1,2 +1,2 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Bod2d_GP-CQVvzM4m.cjs"),r=require("./cli-error-CrUD8uMp.cjs"),i=require("./target-environment-variable.constant-D7z8AihP.cjs"),a=require("./create-cancelled-error-BBhAY8fS.cjs"),o=require("./style-BR52fK4V.cjs");let s=require("node:path"),c=require("node:fs"),l=require("node:child_process");var u=({severity:e,code:n,message:r,file:i,line:a,column:s})=>{let c=[t.t(i)?[i,a,s].filter(t.t).join(`:`):void 0,o.i(n,process.stderr),r].filter(t.t).join(` `);return e===`error`?o.a(c):o.s(c)},d=e.t(),f=e=>!t.t(e)||(0,d.isString)(e),p=e=>!t.t(e)||(0,d.isNumber)(e),m=e=>n.n(e)&&(e.severity===`error`||e.severity===`warning`)&&(0,d.isString)(e.code)&&(0,d.isString)(e.message)&&f(e.file)&&p(e.line)&&p(e.column),h=e=>n.n(e)&&(0,d.isString)(e.path)&&(0,d.isString)(e.role)&&(0,d.isString)(e.sourcePath)&&(0,d.isNumber)(e.size)&&(0,d.isString)(e.sha256),g=()=>new r.t({code:`WORKER_FAILED`,message:`The app worker returned a result this CLI cannot read.`,hint:`Check that the app and the CLI use compatible versions.`}),_=e=>{if(!(!n.n(e)||!(0,d.isString)(e.buildId)||!f(e.directory)||!(0,d.isString)(e.contentHash)||!n.n(e.application)||!(0,d.isString)(e.application.universalIdentifier)||!(0,d.isString)(e.application.name)||!(0,d.isString)(e.application.displayName)||!(0,d.isString)(e.manifestFormat)||!n.n(e.manifest)||!(0,d.isArray)(e.files)||!e.files.every(h)))return{data:{buildId:e.buildId,...(0,d.isString)(e.directory)?{directory:e.directory}:{},contentHash:e.contentHash,application:{universalIdentifier:e.application.universalIdentifier,name:e.application.name,displayName:e.application.displayName},manifestFormat:e.manifestFormat,manifest:e.manifest,files:e.files}}},v=e=>(0,d.isNull)(e)?{data:null}:void 0,y=({value:e,parseData:r})=>{if(!n.n(e)||!(0,d.isArray)(e.diagnostics)||!e.diagnostics.every(m))throw g();let i=e.diagnostics;if(e.success===!0){let n=r(e.data);if(!t.t(n))throw g();return{success:!0,data:n.data,diagnostics:i}}if(e.success===!1&&n.n(e.error)&&(0,d.isString)(e.error.code)&&(0,d.isString)(e.error.message))return{success:!1,error:{code:e.error.code,message:e.error.message,...(0,d.isString)(e.error.hint)?{hint:e.error.hint}:{},...n.n(e.error.details)?{details:e.error.details}:{}},diagnostics:i};throw g()},b={CANCEL_GRACE_MILLISECONDS:3e3,OUTPUT_LIMIT_BYTES:64*1024},x=new Set([...Object.values(i.t),`TWENTY_APP_ACCESS_TOKEN`,`TWENTY_APP_APPLICATION_ACCESS_TOKEN`]),S=/^TWENTY_.*(TOKEN|KEY|SECRET|PASSWORD)$/,C=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!x.has(e)&&!S.test(e))),w=e=>{let t=Buffer.alloc(e),n=0,r=!1;return{add:i=>{let a=i.copy(t,n,0,e-n);n+=a,r||=a<i.length},read:()=>({text:t.toString(`utf8`,0,n),isTruncated:r})}},T=()=>({modulePath:(0,s.join)((0,s.dirname)((0,c.realpathSync)(process.argv[1]??``)),`app-worker.cjs`),execArgv:[]}),E=e=>n.n(e)&&(e.type===`result`&&`result`in e&&(e.isSnapshotHeld===!0||e.isSnapshotHeld===!1)||e.type===`released`&&`release`in e||e.type===`failure`&&(0,d.isString)(e.message)&&(!t.t(e.code)||(0,d.isString)(e.code))&&(!t.t(e.hint)||(0,d.isString)(e.hint))&&(!t.t(e.details)||n.n(e.details))),D=async({request:e,signal:n,useHeldSnapshot:i})=>{n.throwIfAborted();let{modulePath:o,execArgv:s}=T(),c=(0,l.fork)(o,[],{cwd:e.appPath,env:C(process.env),execArgv:s,serialization:`json`,stdio:[`ignore`,`pipe`,`pipe`,`ipc`]}),u=w(b.OUTPUT_LIMIT_BYTES),d=w(b.OUTPUT_LIMIT_BYTES);return c.stdout?.on(`data`,u.add),c.stderr?.on(`data`,d.add),new Promise((o,s)=>{let l,f,p,m,h,g=!1,_=()=>{let e=u.read(),t=d.read();return{stdout:e.text,stderr:t.text,isTruncated:e.isTruncated||t.isTruncated}},v=e=>{c.connected&&c.send(e),h=setTimeout(()=>c.kill(`SIGKILL`),b.CANCEL_GRACE_MILLISECONDS)},y=()=>v({type:`cancel`}),x=e=>{g||(g=!0,n.removeEventListener(`abort`,y),clearTimeout(h),e())},S=e=>{n.removeEventListener(`abort`,y),clearTimeout(h),m=(t.t(i)?i({result:e.result,watchInputs:e.watchInputs,output:_()}):Promise.resolve()).then(()=>({isSuccessful:!0}),e=>({isSuccessful:!1,error:e})).finally(()=>v({type:`release`}))},C=({exitCode:e,exitSignal:i,heldOutcome:c})=>x(()=>{let u=_();if(t.t(c)&&!c.isSuccessful){s(c.error);return}if(t.t(l)){o({result:l.result,watchInputs:l.watchInputs,release:l.isSnapshotHeld?p?.release:l.release,isSnapshotHeld:l.isSnapshotHeld,output:u});return}if(n.aborted){s(a.t());return}let d=t.t(i)?`signal ${i}`:`exit code ${e}`;s(new r.t({code:`WORKER_FAILED`,message:t.t(f)?`The app worker failed: ${f.message}`:`The app worker stopped before finishing (${d}). App code or a dependency may have exited the process.`,hint:f?.hint,details:{...f?.details,workerErrorCode:f?.code,exitCode:e,signal:i,output:u}}))});n.addEventListener(`abort`,y,{once:!0}),c.on(`message`,e=>{if(E(e)){if(e.type===`released`){p=e;return}if(e.type===`failure`){f=e;return}l=e,e.isSnapshotHeld&&S(e)}}),c.on(`error`,e=>x(()=>s(new r.t({code:`WORKER_FAILED`,message:`The app worker could not run: ${e.message}`})))),c.on(`close`,(e,n)=>{if(!t.t(m)){C({exitCode:e,exitSignal:n});return}m.then(t=>C({exitCode:e,exitSignal:n,heldOutcome:t})).catch(e=>x(()=>s(e)))}),c.send(e)})},O=e=>[[`stdout`,e.stdout],[`stderr`,e.stderr]].filter(([,e])=>(0,d.isNonEmptyString)(e.trim())).map(([t,n])=>({severity:`warning`,code:`PROJECT_OUTPUT`,message:`The app or twenty-sdk wrote to ${t}:\n${n.trimEnd()}${e.isTruncated?`
2
- (output truncated)`:``}`}));Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}});
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("./target-environment-variable.constant-D7z8AihP.cjs"),a=require("./create-cancelled-error-BBhAY8fS.cjs"),o=require("./style-BR52fK4V.cjs");let s=require("node:path"),c=require("node:fs"),l=require("node:child_process");var u=({severity:e,code:n,message:r,file:i,line:a,column:s})=>{let c=[t.t(i)?[i,a,s].filter(t.t).join(`:`):void 0,o.i(n,process.stderr),r].filter(t.t).join(` `);return e===`error`?o.a(c):o.s(c)},d=e.t(),f=e=>!t.t(e)||(0,d.isString)(e),p=e=>!t.t(e)||(0,d.isNumber)(e),m=e=>n.i(e)&&(e.severity===`error`||e.severity===`warning`)&&(0,d.isString)(e.code)&&(0,d.isString)(e.message)&&f(e.file)&&p(e.line)&&p(e.column),h=e=>n.i(e)&&(0,d.isString)(e.path)&&(0,d.isString)(e.role)&&(0,d.isString)(e.sourcePath)&&(0,d.isNumber)(e.size)&&(0,d.isString)(e.sha256),g=()=>new r.t({code:`WORKER_FAILED`,message:`The app worker returned a result this CLI cannot read.`,hint:`Check that the app and the CLI use compatible versions.`}),_=e=>{if(!(!n.i(e)||!(0,d.isString)(e.buildId)||!f(e.directory)||!(0,d.isString)(e.contentHash)||!n.i(e.application)||!(0,d.isString)(e.application.universalIdentifier)||!(0,d.isString)(e.application.name)||!(0,d.isString)(e.application.displayName)||!(0,d.isString)(e.manifestFormat)||!n.i(e.manifest)||!(0,d.isArray)(e.files)||!e.files.every(h)))return{data:{buildId:e.buildId,...(0,d.isString)(e.directory)?{directory:e.directory}:{},contentHash:e.contentHash,application:{universalIdentifier:e.application.universalIdentifier,name:e.application.name,displayName:e.application.displayName},manifestFormat:e.manifestFormat,manifest:e.manifest,files:e.files}}},v=e=>(0,d.isNull)(e)?{data:null}:void 0,y=({value:e,parseData:r})=>{if(!n.i(e)||!(0,d.isArray)(e.diagnostics)||!e.diagnostics.every(m))throw g();let i=e.diagnostics;if(e.success===!0){let n=r(e.data);if(!t.t(n))throw g();return{success:!0,data:n.data,diagnostics:i}}if(e.success===!1&&n.i(e.error)&&(0,d.isString)(e.error.code)&&(0,d.isString)(e.error.message))return{success:!1,error:{code:e.error.code,message:e.error.message,...(0,d.isString)(e.error.hint)?{hint:e.error.hint}:{},...n.i(e.error.details)?{details:e.error.details}:{}},diagnostics:i};throw g()},b={CANCEL_GRACE_MILLISECONDS:3e3,OUTPUT_LIMIT_BYTES:64*1024},x=new Set([...Object.values(i.t),`TWENTY_APP_ACCESS_TOKEN`,`TWENTY_APP_APPLICATION_ACCESS_TOKEN`]),S=/^TWENTY_.*(TOKEN|KEY|SECRET|PASSWORD)$/,C=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!x.has(e)&&!S.test(e))),w=e=>{let t=Buffer.alloc(e),n=0,r=!1;return{add:i=>{let a=i.copy(t,n,0,e-n);n+=a,r||=a<i.length},read:()=>({text:t.toString(`utf8`,0,n),isTruncated:r})}},T=()=>({modulePath:(0,s.join)((0,s.dirname)((0,c.realpathSync)(process.argv[1]??``)),`app-worker.cjs`),execArgv:[]}),E=e=>n.i(e)&&(e.type===`result`&&`result`in e&&(e.isSnapshotHeld===!0||e.isSnapshotHeld===!1)||e.type===`released`&&`release`in e||e.type===`failure`&&(0,d.isString)(e.message)&&(!t.t(e.code)||(0,d.isString)(e.code))&&(!t.t(e.hint)||(0,d.isString)(e.hint))&&(!t.t(e.details)||n.i(e.details))),D=async({request:e,signal:n,useHeldSnapshot:i})=>{n.throwIfAborted();let{modulePath:o,execArgv:s}=T(),c=(0,l.fork)(o,[],{cwd:e.appPath,env:C(process.env),execArgv:s,serialization:`json`,stdio:[`ignore`,`pipe`,`pipe`,`ipc`]}),u=w(b.OUTPUT_LIMIT_BYTES),d=w(b.OUTPUT_LIMIT_BYTES);return c.stdout?.on(`data`,u.add),c.stderr?.on(`data`,d.add),new Promise((o,s)=>{let l,f,p,m,h,g=!1,_=()=>{let e=u.read(),t=d.read();return{stdout:e.text,stderr:t.text,isTruncated:e.isTruncated||t.isTruncated}},v=e=>{c.connected&&c.send(e),h=setTimeout(()=>c.kill(`SIGKILL`),b.CANCEL_GRACE_MILLISECONDS)},y=()=>v({type:`cancel`}),x=e=>{g||(g=!0,n.removeEventListener(`abort`,y),clearTimeout(h),e())},S=e=>{n.removeEventListener(`abort`,y),clearTimeout(h),m=(t.t(i)?i({result:e.result,watchInputs:e.watchInputs,output:_()}):Promise.resolve()).then(()=>({isSuccessful:!0}),e=>({isSuccessful:!1,error:e})).finally(()=>v({type:`release`}))},C=({exitCode:e,exitSignal:i,heldOutcome:c})=>x(()=>{let u=_();if(t.t(c)&&!c.isSuccessful){s(c.error);return}if(t.t(l)){o({result:l.result,watchInputs:l.watchInputs,release:l.isSnapshotHeld?p?.release:l.release,isSnapshotHeld:l.isSnapshotHeld,output:u});return}if(n.aborted){s(a.t());return}let d=t.t(i)?`signal ${i}`:`exit code ${e}`;s(new r.t({code:`WORKER_FAILED`,message:t.t(f)?`The app worker failed: ${f.message}`:`The app worker stopped before finishing (${d}). App code or a dependency may have exited the process.`,hint:f?.hint,details:{...f?.details,workerErrorCode:f?.code,exitCode:e,signal:i,output:u}}))});n.addEventListener(`abort`,y,{once:!0}),c.on(`message`,e=>{if(E(e)){if(e.type===`released`){p=e;return}if(e.type===`failure`){f=e;return}l=e,e.isSnapshotHeld&&S(e)}}),c.on(`error`,e=>x(()=>s(new r.t({code:`WORKER_FAILED`,message:`The app worker could not run: ${e.message}`})))),c.on(`close`,(e,n)=>{if(!t.t(m)){C({exitCode:e,exitSignal:n});return}m.then(t=>C({exitCode:e,exitSignal:n,heldOutcome:t})).catch(e=>x(()=>s(e)))}),c.send(e)})},O=e=>[[`stdout`,e.stdout],[`stderr`,e.stderr]].filter(([,e])=>(0,d.isNonEmptyString)(e.trim())).map(([t,n])=>({severity:`warning`,code:`PROJECT_OUTPUT`,message:`The app or twenty-sdk wrote to ${t}:\n${n.trimEnd()}${e.isTruncated?`
2
+ (output truncated)`:``}`}));Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}});
@@ -1,2 +1,2 @@
1
- const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./validate-app-path-Dau-PC0a.cjs"),r=require("./collect-watch-inputs-Dn6g1cNu.cjs"),i=require("./resolve-project-typescript-D66veK53.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./get-tooling-error-context-CZKTM7Q6.cjs");let s=require("node:path");var c=e.n({typecheckApplication:()=>d}),l=({diagnostic:e,appPath:n,typescript:r})=>{let i=t.t(e.file)&&t.t(e.start)?e.file.getLineAndCharacterOfPosition(e.start):void 0;return{severity:e.category===r.DiagnosticCategory.Warning?`warning`:`error`,code:`TS${e.code}`,message:r.flattenDiagnosticMessageText(e.messageText,`
1
+ const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./validate-app-path-Dau-PC0a.cjs"),r=require("./collect-watch-inputs-Dn6g1cNu.cjs"),i=require("./resolve-project-typescript-BOAxXiKm.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./get-tooling-error-context-CZKTM7Q6.cjs");let s=require("node:path");var c=e.n({typecheckApplication:()=>d}),l=({diagnostic:e,appPath:n,typescript:r})=>{let i=t.t(e.file)&&t.t(e.start)?e.file.getLineAndCharacterOfPosition(e.start):void 0;return{severity:e.category===r.DiagnosticCategory.Warning?`warning`:`error`,code:`TS${e.code}`,message:r.flattenDiagnosticMessageText(e.messageText,`
2
2
  `),...t.t(e.file)?{file:(0,s.relative)(n,e.file.fileName)}:{},...t.t(i)?{line:i.line+1,column:i.character+1}:{}}},u=({appPath:e,typescript:n})=>{let i=(0,s.join)(e,`tsconfig.json`),a=(e,t)=>(r.r(e),n.sys.readFile(e,t)),o=n.readConfigFile(i,a);if(t.t(o.error))return[o.error];let c=n.parseJsonConfigFileContent(o.config,{...n.sys,readFile:a},e,{noEmit:!0},i);if(c.errors.length>0)return c.errors;let l=n.createCompilerHost(c.options),u=l.readFile;l.readFile=e=>(r.r(e),u(e));let d=l.fileExists;l.fileExists=e=>{let t=d(e);return t||r.i(e),t};let f=n.createProgram({host:l,rootNames:c.fileNames,options:c.options,projectReferences:c.projectReferences});return n.getPreEmitDiagnostics(f)},d=async({appPath:e,signal:t})=>{let r=await n.t(e);if(!r.success)return r;try{t?.throwIfAborted();let n=await i.t(e);t?.throwIfAborted();let r=u({appPath:e,typescript:n});t?.throwIfAborted();let a=r.map(t=>l({diagnostic:t,appPath:e,typescript:n}));return a.some(e=>e.severity===`error`)?{success:!1,error:{code:`TYPECHECK_FAILED`,message:`Typecheck failed.`},diagnostics:a}:{success:!0,data:null,diagnostics:a}}catch(e){return{success:!1,error:{code:t?.aborted?`CANCELLED`:e instanceof a.t?e.code:`TYPECHECK_FAILED`,message:e instanceof Error?e.message:String(e),...o.t(e)},diagnostics:[]}}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
@@ -1 +1 @@
1
- const e=require("./read-config-BinH4NbQ.cjs"),t=require("./write-config-atomically-BHOlbOl_.cjs");var n=({configPath:n,signal:r,update:i})=>t.n({configPath:n,signal:r,operation:async()=>{let{config:a,result:o}=i(await e.t(n));return r.throwIfAborted(),await t.t(n,a),o}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
1
+ const e=require("./read-config-9Dv5cmvw.cjs"),t=require("./write-config-atomically-BxCEc8_P.cjs");var n=({configPath:n,signal:r,update:i})=>t.n({configPath:n,signal:r,operation:async()=>{let{config:a,result:o}=i(await e.t(n));return r.throwIfAborted(),await t.t(n,a),o}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});