twenty 2.55.0 → 2.57.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 (127) hide show
  1. package/dist/app-template/yarn.lock +38 -38
  2. package/dist/app-worker.cjs +1 -1
  3. package/dist/chunks/api-key-stdin-hint.constant-BTPNgm3m.cjs +1 -0
  4. package/dist/chunks/application-T4xvzjbB.cjs +5 -0
  5. package/dist/chunks/{build-source-manifest-CS9qVNh-.cjs → build-source-manifest-tGYOCdor.cjs} +1 -1
  6. package/dist/chunks/{build-source-snapshot-CpGCu13I.cjs → build-source-snapshot-CzwiB8HK.cjs} +3 -3
  7. package/dist/chunks/{cli-version.constant-Cu5tVcCH.cjs → cli-version.constant-1uwk-lMz.cjs} +1 -1
  8. package/dist/chunks/{collect-translatable-strings-DCyYBNLJ.cjs → collect-translatable-strings-BB6KpZT2.cjs} +1 -1
  9. package/dist/chunks/compile-application-translations-S-xuODkF.cjs +870 -0
  10. package/dist/chunks/constants-Bw_pUpSi-BsJPlw-e.cjs +55 -0
  11. package/dist/chunks/{create-http-status-error-C0btwkS0.cjs → create-http-status-error-DBUhBnxP.cjs} +1 -1
  12. package/dist/chunks/create-metadata-client-wHecaKNL.cjs +6 -0
  13. package/dist/chunks/create-pull-base-write-BZnZwrLk.cjs +1 -0
  14. package/dist/chunks/{create-rest-client-YAG6kSAm.cjs → create-rest-client-B-kdRm7C.cjs} +1 -1
  15. package/dist/chunks/extract-manifest-from-file-CNGCZF6o.cjs +1 -0
  16. package/dist/chunks/{extract-source-translations-DhYrd7jw.cjs → extract-source-translations-BHWNS2e9.cjs} +1 -1
  17. package/dist/chunks/{fetch-metadata-inspection-DzssW2Dw.cjs → fetch-metadata-inspection-Dqn8jToW.cjs} +1 -1
  18. package/dist/chunks/{fetch-signed-in-identity-CId23qtn.cjs → fetch-signed-in-identity-DCqCwASL.cjs} +1 -1
  19. package/dist/chunks/fetch-workspace-or-throw-CBKYiJI0.cjs +1 -0
  20. package/dist/chunks/{format-data-value-pZjy4e4h.cjs → format-data-value-DuQjxLye.cjs} +1 -1
  21. package/dist/chunks/{format-metadata-fields-Dh6CmU5G.cjs → format-metadata-fields-DPClLlzD.cjs} +1 -1
  22. package/dist/chunks/{format-metadata-owner-CCxXpga0.cjs → format-metadata-owner-ffrpq9D6.cjs} +1 -1
  23. package/dist/chunks/{generate-application-client-pMdNJ3g0.cjs → generate-application-client-DjE_Tp0M.cjs} +1 -1
  24. package/dist/chunks/{get-client-generation-skip-reason-DruQtHYQ.cjs → get-client-generation-skip-reason-DZmeP0IC.cjs} +1 -1
  25. package/dist/chunks/{get-system-view-universal-identifier.util-BjGghzoH-Cg8Rg3uX.cjs → get-system-view-universal-identifier.util-DgYnPEO1-CKEQWit5.cjs} +1 -1
  26. package/dist/chunks/global-flags.constant-C8Yu1rWc.cjs +1 -0
  27. package/dist/chunks/{is-access-token-expiring-BcJiLtlE.cjs → is-access-token-expiring-Cin0OQ-E.cjs} +1 -1
  28. package/dist/chunks/{is-application-not-found-error-C8ifQUn8.cjs → is-application-not-found-error-BAsQDAoQ.cjs} +1 -1
  29. package/dist/chunks/is-exported-manifest-COVWXnDs.cjs +1 -0
  30. package/dist/chunks/{is-valid-package-name-YNq-0I2a.cjs → is-valid-package-name-CfHS8_Lr.cjs} +1 -1
  31. package/dist/chunks/{locale-catalog-format-CFYxqgvL.cjs → locale-catalog-format-Cg9YplKA.cjs} +2 -2
  32. package/dist/chunks/metadata-Db5EuDpT.cjs +1 -0
  33. package/dist/chunks/parse-app-export-Dnu8mFrS.cjs +1 -0
  34. package/dist/chunks/{parse-graphql-response-C_4SPebO.cjs → parse-graphql-response-BSRJqolm.cjs} +1 -1
  35. package/dist/chunks/{parse-json-input-B87VP1pj.cjs → parse-json-input-CN9Wyj73.cjs} +1 -1
  36. package/dist/chunks/print-typescript-value-BsjFUceV.cjs +3 -0
  37. package/dist/chunks/pull-minimum-sdk-version.constant-BxmmUfee.cjs +6 -0
  38. package/dist/chunks/pull-source-BPng2lln.cjs +1 -0
  39. package/dist/chunks/{read-app-identity-DK9znGhT.cjs → read-app-identity-yX9-Ylxj.cjs} +1 -1
  40. package/dist/chunks/{read-application-identifier-BXkar-mo.cjs → read-application-identifier-DuI_jnU7.cjs} +1 -1
  41. package/dist/chunks/read-application-identity-BFQ0oOna.cjs +1 -0
  42. package/dist/chunks/{read-config-DWLaxc3C.cjs → read-config-DdGLulo-.cjs} +1 -1
  43. package/dist/chunks/{read-infer-deletion-option-BrShRRHT.cjs → read-infer-deletion-option-uFunybak.cjs} +1 -1
  44. package/dist/chunks/read-json-object-DcNHNB8I.cjs +1 -0
  45. package/dist/chunks/{read-local-container-C_kAPeoE.cjs → read-local-container-CPiVE1-D.cjs} +1 -1
  46. package/dist/chunks/{read-source-identity-BXYVcnXR.cjs → read-source-identity-CaErC5Qk.cjs} +1 -1
  47. package/dist/chunks/{record-pull-base-CkpPTblT.cjs → record-pull-base-RQ2mlIWr.cjs} +1 -1
  48. package/dist/chunks/{record-typecheck-config-inputs-DKn7fk11.cjs → record-typecheck-config-inputs-BAruvIZV.cjs} +1 -1
  49. package/dist/chunks/{request-oauth-tokens-C59XNnQs.cjs → request-oauth-tokens-Bp2eRh4F.cjs} +1 -1
  50. package/dist/chunks/{resolve-app-project-Cu1DLASA.cjs → resolve-app-project-aqOLK3Gb.cjs} +1 -1
  51. package/dist/chunks/{resolve-command-target-DXXwJ9aE.cjs → resolve-command-target-D4gMeXgA.cjs} +1 -1
  52. package/dist/chunks/{resolve-project-typescript-Dozy60cc.cjs → resolve-project-typescript-DkwXiCmt.cjs} +1 -1
  53. package/dist/chunks/{resolve-source-sdk-CizL-ZLW.cjs → resolve-source-sdk-CggXRBVx.cjs} +1 -1
  54. package/dist/chunks/{run-api-graphql-command-D_Gxp4_P.cjs → run-api-graphql-command-C3sJMP8H.cjs} +1 -1
  55. package/dist/chunks/{run-api-rest-command-Bm9KC7bB.cjs → run-api-rest-command-DQOP-cn8.cjs} +1 -1
  56. package/dist/chunks/run-app-add-command-qkKHuv9-.cjs +174 -0
  57. package/dist/chunks/{run-app-apply-command-pqnuwLNJ.cjs → run-app-apply-command-XNJHctjU.cjs} +1 -1
  58. package/dist/chunks/{run-app-build-command-DRslTZoC.cjs → run-app-build-command-CaInzuD2.cjs} +1 -1
  59. package/dist/chunks/{run-app-dev-command-9CKFKDBQ.cjs → run-app-dev-command-D6zVdTId.cjs} +1 -1
  60. package/dist/chunks/{run-app-exec-command-Bu_SM816.cjs → run-app-exec-command-DMHS9gpq.cjs} +2 -2
  61. package/dist/chunks/{run-app-generate-client-command-BKfbtgIG.cjs → run-app-generate-client-command-Ddq9lT40.cjs} +1 -1
  62. package/dist/chunks/{run-app-init-command-BDu78coZ.cjs → run-app-init-command-DcS8RfBK.cjs} +1 -1
  63. package/dist/chunks/{run-app-install-command-BNpFqYXx.cjs → run-app-install-command-DUB3JTon.cjs} +1 -1
  64. package/dist/chunks/{run-app-logs-command-DzQj1tdd.cjs → run-app-logs-command-CQHxh_Dt.cjs} +3 -3
  65. package/dist/chunks/{run-app-operation-Bj0hut-D.cjs → run-app-operation-KdXiXPb6.cjs} +1 -1
  66. package/dist/chunks/{run-app-plan-command-CIFK-61b.cjs → run-app-plan-command-DcjgbzTy.cjs} +1 -1
  67. package/dist/chunks/{run-app-publish-command-CuLrcX3d.cjs → run-app-publish-command-DEV9zgL1.cjs} +1 -1
  68. package/dist/chunks/{run-app-pull-command-CKoe_QKd.cjs → run-app-pull-command-B-hxnqvY.cjs} +3 -3
  69. package/dist/chunks/{run-app-translations-extract-command-riW4Ozc-.cjs → run-app-translations-extract-command-C0OfqFii.cjs} +1 -1
  70. package/dist/chunks/{run-app-typecheck-command-CPDDSwEm.cjs → run-app-typecheck-command-D2Po43IB.cjs} +1 -1
  71. package/dist/chunks/{run-app-uninstall-command-DFOMGmKw.cjs → run-app-uninstall-command-DXyjeBwO.cjs} +1 -1
  72. package/dist/chunks/run-auth-login-command-CVLvoJ7G.cjs +1 -0
  73. package/dist/chunks/{run-auth-logout-command-DjUjq_ug.cjs → run-auth-logout-command-ChrdwI-r.cjs} +1 -1
  74. package/dist/chunks/{run-auth-status-command-OAibzgLu.cjs → run-auth-status-command-X0m6rzI-.cjs} +1 -1
  75. package/dist/chunks/{run-cli-BjMuvO_y.cjs → run-cli-BoGzN25b.cjs} +8 -8
  76. package/dist/chunks/{run-commands-command-BhPkYc2t.cjs → run-commands-command-hMdnwU8-.cjs} +1 -1
  77. package/dist/chunks/{run-data-get-command-tV2bf5h6.cjs → run-data-get-command-DFE4NM2R.cjs} +1 -1
  78. package/dist/chunks/{run-data-list-command-D16ADH_r.cjs → run-data-list-command-BMEzitv6.cjs} +1 -1
  79. package/dist/chunks/{run-doctor-command-CEFSxor5.cjs → run-doctor-command-Bj2UR9ai.cjs} +2 -2
  80. package/dist/chunks/{run-local-logs-command-CkDxKsj7.cjs → run-local-logs-command-mUwB2XdV.cjs} +1 -1
  81. package/dist/chunks/{run-local-reset-command-pPzlL7jd.cjs → run-local-reset-command-WooW50PQ.cjs} +1 -1
  82. package/dist/chunks/{run-local-start-command-B_vDDsVi.cjs → run-local-start-command-CiXP155w.cjs} +1 -1
  83. package/dist/chunks/{run-local-status-command-CKh4246H.cjs → run-local-status-command-ClvEgxcU.cjs} +1 -1
  84. package/dist/chunks/{run-local-stop-command-BWJbZxK2.cjs → run-local-stop-command-BuV_YdJ7.cjs} +1 -1
  85. package/dist/chunks/{run-local-upgrade-command-CFDAkOsj.cjs → run-local-upgrade-command--O_EiVZc.cjs} +1 -1
  86. package/dist/chunks/{run-metadata-field-describe-command-D7q8KpLp.cjs → run-metadata-field-describe-command-iEw4KqIg.cjs} +1 -1
  87. package/dist/chunks/{run-metadata-field-list-command-yLteJu7m.cjs → run-metadata-field-list-command-YCsoqOo1.cjs} +1 -1
  88. package/dist/chunks/{run-metadata-object-describe-command-CHKnSf0E.cjs → run-metadata-object-describe-command-DpTobKR3.cjs} +1 -1
  89. package/dist/chunks/{run-metadata-object-list-command-D8CLvav9.cjs → run-metadata-object-list-command-BnSIIMDP.cjs} +1 -1
  90. package/dist/chunks/{run-open-command-CyBcIK9P.cjs → run-open-command-DWLQ7z_P.cjs} +1 -1
  91. package/dist/chunks/{run-remote-list-command-WKiOwCbu.cjs → run-remote-list-command-0f2QIf8C.cjs} +1 -1
  92. package/dist/chunks/{run-remote-remove-command-DPKQXI17.cjs → run-remote-remove-command-ClFB0Ub7.cjs} +1 -1
  93. package/dist/chunks/{run-remote-rename-command-CwuCickV.cjs → run-remote-rename-command-BVUcpZxq.cjs} +1 -1
  94. package/dist/chunks/{run-remote-use-command-BlB3SFV7.cjs → run-remote-use-command-ByRTqnq5.cjs} +1 -1
  95. package/dist/chunks/{run-version-command-BuWJdr6h.cjs → run-version-command-_9OGraNf.cjs} +1 -1
  96. package/dist/chunks/{select-target-DiY6zT7M.cjs → select-target-BHGEOc55.cjs} +1 -1
  97. package/dist/chunks/{sign-in-to-remote-again-DalF_h0k.cjs → sign-in-to-remote-again-DF27JFsz.cjs} +1 -1
  98. package/dist/chunks/{sign-in-with-browser-B2nBTir7.cjs → sign-in-with-browser-BNG4oa7e.cjs} +1 -1
  99. package/dist/chunks/{to-worker-output-diagnostics-CUKNJ_L6.cjs → to-worker-output-diagnostics-WZlUWvcj.cjs} +1 -1
  100. package/dist/chunks/{typecheck-application-BcS7ldNI.cjs → typecheck-application-BYPGp8lW.cjs} +1 -1
  101. package/dist/chunks/{update-config-D63n0BNZ.cjs → update-config-ClCVH3C5.cjs} +1 -1
  102. package/dist/chunks/{utils-BJdjZ6I2-DgqSVlwy.cjs → utils-Ds_lD5Ag-DfSfzJJP.cjs} +2 -2
  103. package/dist/chunks/{wait-for-local-environment-j4IZq_Nn.cjs → wait-for-local-environment-CjCRJnhK.cjs} +1 -1
  104. package/dist/chunks/{write-config-atomically-CkC-GT16.cjs → write-config-atomically-CQdFdvWo.cjs} +1 -1
  105. package/dist/cli.cjs +1 -1
  106. package/docs/commands.md +1 -1
  107. package/package.json +2 -2
  108. package/src/app/add/README.md +6 -6
  109. package/src/app/pull/README.md +6 -2
  110. package/dist/chunks/application-ChMyraCB.cjs +0 -5
  111. package/dist/chunks/compile-application-translations-Bp686pj4.cjs +0 -870
  112. package/dist/chunks/constants-BF6GWIop-98tUMN2U.cjs +0 -55
  113. package/dist/chunks/create-metadata-client-FcJiT9Hx.cjs +0 -6
  114. package/dist/chunks/create-pull-base-write-anQPBDx-.cjs +0 -1
  115. package/dist/chunks/extract-manifest-from-file-DA5fSI0W.cjs +0 -1
  116. package/dist/chunks/fetch-workspace-or-throw-BroNuadP.cjs +0 -1
  117. package/dist/chunks/global-flags.constant-BU7HyPk3.cjs +0 -1
  118. package/dist/chunks/is-exported-manifest-mJcgLfg0.cjs +0 -1
  119. package/dist/chunks/metadata-Cu3_OTI1.cjs +0 -1
  120. package/dist/chunks/parse-app-export-DAfsN3RE.cjs +0 -1
  121. package/dist/chunks/print-typescript-value-ChOUZ7Mm.cjs +0 -3
  122. package/dist/chunks/pull-minimum-sdk-version.constant-Dm7g3dNP.cjs +0 -5
  123. package/dist/chunks/pull-source-DvVJhvaO.cjs +0 -1
  124. package/dist/chunks/read-application-identity-D7fnqlw6.cjs +0 -1
  125. package/dist/chunks/read-json-object-B5Q55dbM.cjs +0 -1
  126. package/dist/chunks/run-app-add-command-BcuwnGCB.cjs +0 -163
  127. package/dist/chunks/run-auth-login-command-DOILzUGB.cjs +0 -1
@@ -1,2 +1,2 @@
1
- const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-BF6GWIop-98tUMN2U.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.a(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.a(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.a(e)||!(0,d.isString)(e.buildId)||!f(e.directory)||!(0,d.isString)(e.contentHash)||!n.a(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.a(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.a(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.a(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.a(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.a(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.a(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?`
1
+ const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Bw_pUpSi-BsJPlw-e.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
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-Dozy60cc.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-DkwXiCmt.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-DWLaxc3C.cjs"),t=require("./write-config-atomically-CkC-GT16.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-DdGLulo-.cjs"),t=require("./write-config-atomically-CQdFdvWo.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}});