twenty 2.54.0 → 2.54.3
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.
- package/dist/app-template/yarn.lock +16 -16
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{build-source-manifest-DPsTlw7Z.cjs → build-source-manifest-BJyDykpG.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-BMjdktTk.cjs → build-source-snapshot-Ds_ZZGnl.cjs} +1 -1
- package/dist/chunks/{cli-version.constant-M53Gu1CK.cjs → cli-version.constant-BRiLR-nG.cjs} +1 -1
- package/dist/chunks/compile-application-translations-qdigcX2V.cjs +1 -0
- package/dist/chunks/{extract-source-translations-BKXfzm51.cjs → extract-source-translations-BHy14v8o.cjs} +1 -1
- package/dist/chunks/{global-flags.constant-MWMrKAud.cjs → global-flags.constant-uA1jkBmk.cjs} +1 -1
- package/dist/chunks/{is-valid-package-name-Ij_K6iEL.cjs → is-valid-package-name-9YIecMQm.cjs} +1 -1
- package/dist/chunks/{run-app-apply-command-BnfxBO7o.cjs → run-app-apply-command-CilkY9ws.cjs} +1 -1
- package/dist/chunks/{run-app-build-command-tAj7RilT.cjs → run-app-build-command-DaKa_eKF.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-BTUiHdOH.cjs → run-app-init-command-DhPC_GBU.cjs} +1 -1
- package/dist/chunks/{run-app-operation-BmlaxoZF.cjs → run-app-operation-BbsxjrjR.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-1cb1TuM6.cjs → run-app-plan-command-Bt3IwVec.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-BPosULCY.cjs → run-app-publish-command-CoGrZA2a.cjs} +1 -1
- package/dist/chunks/{run-app-pull-command-BWbRZPTj.cjs → run-app-pull-command-gUX-w9BE.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-3ZJqbU8D.cjs → run-app-typecheck-command-CbHawvU8.cjs} +1 -1
- package/dist/chunks/{run-cli-BbuvDae1.cjs → run-cli-CsDjb96b.cjs} +1 -1
- package/dist/chunks/{run-commands-command-BrwpnI-3.cjs → run-commands-command-CLTVI96u.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-DmZ3dKc7.cjs → run-doctor-command-CDKbN2os.cjs} +1 -1
- package/dist/chunks/{run-version-command-BxhaecEo.cjs → run-version-command-Brk-Nbh7.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/package.json +2 -2
- package/dist/chunks/compile-application-translations-DB-cG9Im.cjs +0 -1
|
@@ -774,9 +774,9 @@ __metadata:
|
|
|
774
774
|
oxlint: "npm:^0.16.0"
|
|
775
775
|
react: "npm:^19.0.0"
|
|
776
776
|
react-dom: "npm:^19.0.0"
|
|
777
|
-
twenty-client-sdk: "npm:2.54.
|
|
778
|
-
twenty-sdk: "npm:2.54.
|
|
779
|
-
twenty-ui: "npm:2.54.
|
|
777
|
+
twenty-client-sdk: "npm:2.54.3"
|
|
778
|
+
twenty-sdk: "npm:2.54.3"
|
|
779
|
+
twenty-ui: "npm:2.54.3"
|
|
780
780
|
typescript: "npm:^5.9.3"
|
|
781
781
|
vite-tsconfig-paths: "npm:^4.2.1"
|
|
782
782
|
vitest: "npm:^4.1.12"
|
|
@@ -1657,37 +1657,37 @@ __metadata:
|
|
|
1657
1657
|
languageName: node
|
|
1658
1658
|
linkType: hard
|
|
1659
1659
|
|
|
1660
|
-
"twenty-client-sdk@npm:2.54.
|
|
1661
|
-
version: 2.54.
|
|
1662
|
-
resolution: "twenty-client-sdk@npm:2.54.
|
|
1660
|
+
"twenty-client-sdk@npm:2.54.3":
|
|
1661
|
+
version: 2.54.3
|
|
1662
|
+
resolution: "twenty-client-sdk@npm:2.54.3"
|
|
1663
1663
|
dependencies:
|
|
1664
1664
|
"@genql/runtime": "npm:^2.10.0"
|
|
1665
1665
|
esbuild: "npm:^0.28.1"
|
|
1666
1666
|
graphql: "npm:^16.8.1"
|
|
1667
1667
|
lodash: "npm:^4.17.21"
|
|
1668
1668
|
prettier: "npm:^3.8.3"
|
|
1669
|
-
checksum: 10c0/
|
|
1669
|
+
checksum: 10c0/773feaa6c84fed4f592b62f388d7c30f46ac72c37886c1636602e07ecdebb5f195e01b6f581be38aed182a86d96b11159a583cb04d13cf475f6c1d31dfdcb20a
|
|
1670
1670
|
languageName: node
|
|
1671
1671
|
linkType: hard
|
|
1672
1672
|
|
|
1673
|
-
"twenty-sdk@npm:2.54.
|
|
1674
|
-
version: 2.54.
|
|
1675
|
-
resolution: "twenty-sdk@npm:2.54.
|
|
1673
|
+
"twenty-sdk@npm:2.54.3":
|
|
1674
|
+
version: 2.54.3
|
|
1675
|
+
resolution: "twenty-sdk@npm:2.54.3"
|
|
1676
1676
|
dependencies:
|
|
1677
1677
|
"@sniptt/guards": "npm:^0.2.0"
|
|
1678
1678
|
esbuild: "npm:^0.28.1"
|
|
1679
1679
|
preact: "npm:^11.0.0"
|
|
1680
1680
|
react: "npm:^19.2.0"
|
|
1681
1681
|
react-dom: "npm:^19.2.0"
|
|
1682
|
-
twenty-client-sdk: "npm:2.54.
|
|
1682
|
+
twenty-client-sdk: "npm:2.54.3"
|
|
1683
1683
|
uuid: "npm:^13.0.2"
|
|
1684
|
-
checksum: 10c0/
|
|
1684
|
+
checksum: 10c0/6ec4d7fa10b5d66ee6447f7d74c7bed74c2bd551eb66487c05d0c840275b5bec61117074c711f0b993a7c9eaf02a65210e5a3ad3a9da99a2e1282add6c4cf1c7
|
|
1685
1685
|
languageName: node
|
|
1686
1686
|
linkType: hard
|
|
1687
1687
|
|
|
1688
|
-
"twenty-ui@npm:2.54.
|
|
1689
|
-
version: 2.54.
|
|
1690
|
-
resolution: "twenty-ui@npm:2.54.
|
|
1688
|
+
"twenty-ui@npm:2.54.3":
|
|
1689
|
+
version: 2.54.3
|
|
1690
|
+
resolution: "twenty-ui@npm:2.54.3"
|
|
1691
1691
|
dependencies:
|
|
1692
1692
|
"@base-ui/react": "npm:^1.9.0"
|
|
1693
1693
|
"@base-ui/utils": "npm:0.5.0"
|
|
@@ -1707,7 +1707,7 @@ __metadata:
|
|
|
1707
1707
|
optional: true
|
|
1708
1708
|
monaco-editor:
|
|
1709
1709
|
optional: true
|
|
1710
|
-
checksum: 10c0/
|
|
1710
|
+
checksum: 10c0/58550cdbd78a4c7c5deb1ad08a62a7744f9bc065bc1be3b578f14307e00e0064fccce5c3f8e63553efb5f4a2b71b2d900f01af917b79c2ed53455a4d2d5307a1
|
|
1711
1711
|
languageName: node
|
|
1712
1712
|
linkType: hard
|
|
1713
1713
|
|
package/dist/app-worker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./chunks/build--4zYt4wd.cjs"),t=require("./chunks/isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./chunks/constants-Cbb71hpl-CrSqydxj.cjs");var r=e.t(),i=5e3,a=new AbortController,o,s=e=>{if(n.i(e)){if(e.type===`cancel`||e.type===`release`)return{type:e.type};if(e.type===`readSourceIdentity`||e.type===`buildManifest`||e.type===`typecheckSource`)return(0,r.isNonEmptyString)(e.appPath)?{type:e.type,appPath:e.appPath}:void 0;if(e.type===`bundleSnapshot`)return(0,r.isNonEmptyString)(e.appPath)?{type:`bundleSnapshot`,collectWatchInputs:e.collectWatchInputs===!0,appPath:e.appPath,holdSnapshot:e.holdSnapshot===!0}:void 0;if(e.type===`pull`)return!(0,r.isNonEmptyString)(e.appPath)||!n.i(e.target)||!(0,r.isNonEmptyString)(e.target.apiUrl)||!(0,r.isNonEmptyString)(e.target.workspaceId)||!n.i(e.applicationExport)||!n.i(e.applicationExport.application)||!(0,r.isNonEmptyString)(e.applicationExport.application.universalIdentifier)?void 0:{type:`pull`,appPath:e.appPath,target:{apiUrl:e.target.apiUrl,workspaceId:e.target.workspaceId},applicationExport:e.applicationExport};if(e.type===`extractTranslations`)return(0,r.isNonEmptyString)(e.appPath)&&(!t.t(e.locale)||(0,r.isString)(e.locale))?{type:`extractTranslations`,appPath:e.appPath,locale:e.locale??void 0}:void 0;if(e.type===`generateSourceClient`)return(0,r.isNonEmptyString)(e.appPath)&&(0,r.isString)(e.schema)?{type:`generateSourceClient`,appPath:e.appPath,schema:e.schema}:void 0}},c=e=>{process.connected||process.exit(1),process.send?.(e,void 0,{},()=>process.exit(0))},l=async()=>{if(!t.t(o))return null;let{snapshotApi:e,buildId:n}=o;return o=void 0,e.releaseSourceSnapshot({buildId:n})},u=()=>{l().then(()=>process.exit(1),()=>process.exit(1))},d=e=>{if(!process.connected){u();return}process.send?.(e)},f=e=>{if(!(!n.i(e)||e.success!==!0||!n.i(e.data)))return(0,r.isNonEmptyString)(e.data.buildId)?e.data.buildId:void 0},p=async({snapshotApi:e,appPath:n,holdSnapshot:r})=>{let i=a.signal,s=await e.buildSourceSnapshot({appPath:n,signal:i}),c=f(s);return t.t(c)?r?(o={snapshotApi:e,buildId:c},{type:`result`,result:s,isSnapshotHeld:!0}):{type:`result`,result:s,release:await e.releaseSourceSnapshot({buildId:c}),isSnapshotHeld:!1}:{type:`result`,result:s,isSnapshotHeld:!1}},m=e=>({type:`failure`,message:e instanceof Error?e.message:String(e),...e instanceof Error&&`code`in e&&(0,r.isString)(e.code)?{code:e.code}:{},...e instanceof Error&&`hint`in e&&(0,r.isString)(e.hint)?{hint:e.hint}:{},...e instanceof Error&&`details`in e&&n.i(e.details)?{details:e.details}:{}});process.on(`SIGINT`,()=>void 0),process.on(`disconnect`,()=>{a.abort(),setTimeout(()=>process.exit(1),i),t.t(o)&&u()}),process.on(`message`,e=>{let n=s(e);if(!t.t(n)){c({type:`failure`,message:`The app worker received a request it cannot read.`});return}if(n.type===`cancel`){a.abort();return}if(n.type===`release`){l().then(e=>c({type:`released`,release:e}),e=>c(m(e)));return}if(n.type===`pull`){Promise.resolve().then(()=>require("./chunks/pull-source-CpAYRk5s.cjs")).then(async({pullSource:e})=>{c({type:`result`,result:await e({...n,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`bundleSnapshot`){Promise.resolve().then(()=>require("./chunks/build-source-snapshot-
|
|
1
|
+
const e=require("./chunks/build--4zYt4wd.cjs"),t=require("./chunks/isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./chunks/constants-Cbb71hpl-CrSqydxj.cjs");var r=e.t(),i=5e3,a=new AbortController,o,s=e=>{if(n.i(e)){if(e.type===`cancel`||e.type===`release`)return{type:e.type};if(e.type===`readSourceIdentity`||e.type===`buildManifest`||e.type===`typecheckSource`)return(0,r.isNonEmptyString)(e.appPath)?{type:e.type,appPath:e.appPath}:void 0;if(e.type===`bundleSnapshot`)return(0,r.isNonEmptyString)(e.appPath)?{type:`bundleSnapshot`,collectWatchInputs:e.collectWatchInputs===!0,appPath:e.appPath,holdSnapshot:e.holdSnapshot===!0}:void 0;if(e.type===`pull`)return!(0,r.isNonEmptyString)(e.appPath)||!n.i(e.target)||!(0,r.isNonEmptyString)(e.target.apiUrl)||!(0,r.isNonEmptyString)(e.target.workspaceId)||!n.i(e.applicationExport)||!n.i(e.applicationExport.application)||!(0,r.isNonEmptyString)(e.applicationExport.application.universalIdentifier)?void 0:{type:`pull`,appPath:e.appPath,target:{apiUrl:e.target.apiUrl,workspaceId:e.target.workspaceId},applicationExport:e.applicationExport};if(e.type===`extractTranslations`)return(0,r.isNonEmptyString)(e.appPath)&&(!t.t(e.locale)||(0,r.isString)(e.locale))?{type:`extractTranslations`,appPath:e.appPath,locale:e.locale??void 0}:void 0;if(e.type===`generateSourceClient`)return(0,r.isNonEmptyString)(e.appPath)&&(0,r.isString)(e.schema)?{type:`generateSourceClient`,appPath:e.appPath,schema:e.schema}:void 0}},c=e=>{process.connected||process.exit(1),process.send?.(e,void 0,{},()=>process.exit(0))},l=async()=>{if(!t.t(o))return null;let{snapshotApi:e,buildId:n}=o;return o=void 0,e.releaseSourceSnapshot({buildId:n})},u=()=>{l().then(()=>process.exit(1),()=>process.exit(1))},d=e=>{if(!process.connected){u();return}process.send?.(e)},f=e=>{if(!(!n.i(e)||e.success!==!0||!n.i(e.data)))return(0,r.isNonEmptyString)(e.data.buildId)?e.data.buildId:void 0},p=async({snapshotApi:e,appPath:n,holdSnapshot:r})=>{let i=a.signal,s=await e.buildSourceSnapshot({appPath:n,signal:i}),c=f(s);return t.t(c)?r?(o={snapshotApi:e,buildId:c},{type:`result`,result:s,isSnapshotHeld:!0}):{type:`result`,result:s,release:await e.releaseSourceSnapshot({buildId:c}),isSnapshotHeld:!1}:{type:`result`,result:s,isSnapshotHeld:!1}},m=e=>({type:`failure`,message:e instanceof Error?e.message:String(e),...e instanceof Error&&`code`in e&&(0,r.isString)(e.code)?{code:e.code}:{},...e instanceof Error&&`hint`in e&&(0,r.isString)(e.hint)?{hint:e.hint}:{},...e instanceof Error&&`details`in e&&n.i(e.details)?{details:e.details}:{}});process.on(`SIGINT`,()=>void 0),process.on(`disconnect`,()=>{a.abort(),setTimeout(()=>process.exit(1),i),t.t(o)&&u()}),process.on(`message`,e=>{let n=s(e);if(!t.t(n)){c({type:`failure`,message:`The app worker received a request it cannot read.`});return}if(n.type===`cancel`){a.abort();return}if(n.type===`release`){l().then(e=>c({type:`released`,release:e}),e=>c(m(e)));return}if(n.type===`pull`){Promise.resolve().then(()=>require("./chunks/pull-source-CpAYRk5s.cjs")).then(async({pullSource:e})=>{c({type:`result`,result:await e({...n,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`bundleSnapshot`){Promise.resolve().then(()=>require("./chunks/build-source-snapshot-Ds_ZZGnl.cjs")).then(async({buildSourceSnapshot:e,releaseSourceSnapshot:t})=>{let r=()=>p({snapshotApi:{buildSourceSnapshot:e,releaseSourceSnapshot:t},appPath:n.appPath,holdSnapshot:n.holdSnapshot});if(!n.collectWatchInputs)return r();let{collectWatchInputs:i}=await Promise.resolve().then(()=>require("./chunks/collect-watch-inputs-Dn6g1cNu.cjs")).then(e=>e.t),{recordTypecheckConfigInputs:a}=await Promise.resolve().then(()=>require("./chunks/record-typecheck-config-inputs-BGVirGsR.cjs")),o=await i(async()=>(await a(n.appPath),r()));return{...o.result,watchInputs:o.watchInputs}}).then(e=>e.type===`result`&&e.isSnapshotHeld?d(e):c(e),e=>c(m(e)));return}if(n.type===`typecheckSource`){Promise.resolve().then(()=>require("./chunks/typecheck-application-nkgv6qiA.cjs")).then(e=>e.n).then(async({typecheckApplication:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`extractTranslations`){Promise.resolve().then(()=>require("./chunks/extract-source-translations-BHy14v8o.cjs")).then(async({extractSourceTranslations:e})=>{c({type:`result`,result:await e({appPath:n.appPath,locale:n.locale,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`buildManifest`){Promise.resolve().then(()=>require("./chunks/build-source-manifest-BJyDykpG.cjs")).then(async({buildSourceManifest:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`readSourceIdentity`){Promise.resolve().then(()=>require("./chunks/read-source-identity-BQ_YGISo.cjs")).then(async({readSourceIdentity:e})=>{c({type:`result`,result:await e({appPath:n.appPath,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}if(n.type===`generateSourceClient`){Promise.resolve().then(()=>require("./chunks/generate-application-client-CL8nm0q9.cjs")).then(async({generateApplicationClient:e})=>{c({type:`result`,result:await e({appPath:n.appPath,schema:n.schema,signal:a.signal}),isSnapshotHeld:!1})}).catch(e=>c(m(e)));return}});
|
package/dist/chunks/{build-source-manifest-DPsTlw7Z.cjs → build-source-manifest-BJyDykpG.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./get-tooling-error-context-CZKTM7Q6.cjs"),n=require("./compile-application-translations-
|
|
1
|
+
const e=require("./cli-error-CrUD8uMp.cjs"),t=require("./get-tooling-error-context-CZKTM7Q6.cjs"),n=require("./compile-application-translations-qdigcX2V.cjs"),r=require("./resolve-source-sdk-CyvER2l1.cjs");let i=require("esbuild");var a=async({appPath:a,signal:o})=>{let s=[],c=e=>{s.push({severity:`warning`,code:`BUILD_WARNING`,message:e})};try{o.throwIfAborted(),await r.t({appPath:a});let e=await n.r(a);if(o.throwIfAborted(),!e.success)return{success:!1,error:{code:`MANIFEST_BUILD_FAILED`,message:e.errors.join(`
|
|
2
2
|
`)},diagnostics:e.errors.map(e=>({severity:`error`,code:`MANIFEST_BUILD_FAILED`,message:e}))};e.warnings.forEach(c);let t=await n.t({appPath:a,onWarning:c});return o.throwIfAborted(),{success:!0,data:{manifest:{...e.manifest,translations:t},filePaths:e.filePaths},diagnostics:s}}catch(n){return{success:!1,error:{code:o.aborted?`CANCELLED`:n instanceof e.t?n.code:`MANIFEST_BUILD_FAILED`,message:n instanceof Error?n.message:String(n),...t.t(n)},diagnostics:s}}finally{await(0,i.stop)()}};exports.buildSourceManifest=a;
|
package/dist/chunks/{build-source-snapshot-BMjdktTk.cjs → build-source-snapshot-Ds_ZZGnl.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./application-pYRHxplP.cjs"),o=require("./validate-app-path-Dau-PC0a.cjs"),s=require("./collect-watch-inputs-Dn6g1cNu.cjs"),c=require("./fs-utils-DoSmCBu8.cjs"),l=require("./cli-error-CrUD8uMp.cjs"),u=require("./get-tooling-error-context-CZKTM7Q6.cjs"),d=require("./typecheck-application-nkgv6qiA.cjs"),f=require("./compile-application-translations-
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./application-pYRHxplP.cjs"),o=require("./validate-app-path-Dau-PC0a.cjs"),s=require("./collect-watch-inputs-Dn6g1cNu.cjs"),c=require("./fs-utils-DoSmCBu8.cjs"),l=require("./cli-error-CrUD8uMp.cjs"),u=require("./get-tooling-error-context-CZKTM7Q6.cjs"),d=require("./typecheck-application-nkgv6qiA.cjs"),f=require("./compile-application-translations-qdigcX2V.cjs"),p=require("./resolve-source-sdk-CyvER2l1.cjs"),m=require("./constants-Cf5-CwMu.cjs"),h=require("./is-supported-locale-C33Of85N.cjs");let g=require("node:crypto"),_=require("node:fs/promises"),v=require("node:path"),y=require("node:module"),ee=require("node:fs"),b=require("esbuild"),x=e.r(b,1);b=e.r(b);let S=require("typescript");S=e.r(S,1);let C=require("path");C=e.r(C);let w=require("crypto");w=e.r(w);var T=({sourcePath:e,destinationPath:t,dereferenceSymlinks:n=!1})=>n?(0,_.copyFile)(e,t):c.t(e,t),te=/^readme(\.[^.]+)?$/i,ne=e=>{let t=e.filter(e=>te.test(e));return t.find(e=>/\.md$/i.test(e))??t[0]},re=async({appPath:e,relativeOutputDir:t=a.a,dereferenceSymlinks:n=!1})=>{let r=ne(await(0,_.readdir)(e));if(r===void 0)return;let i=(0,v.join)(e,t);await c.r(i);let o=(0,v.join)(e,r),l=(0,v.join)(i,r);s.r(o),await T({sourcePath:o,destinationPath:l,dereferenceSymlinks:n})},ie=`twenty-client-sdk`,ae=async({result:e,appPath:t,fileFolder:n,lastChecksums:r,onFileBuilt:a})=>{let o=Object.keys(e.metafile?.outputs??{}).filter(e=>e.endsWith(`.mjs`));for(let s of o){let o=C.default.resolve(s),c=C.default.relative(t,o),l=e.metafile?.outputs?.[s]?.entryPoint||``,u=C.default.relative(t,l),d=await(0,_.readFile)(o),f=n===i.x.BuiltFrontComponent?`sha256`:`md5`,p=w.default.createHash(f).update(d).digest(`hex`);if(r.get(c)===p)continue;r.set(c,p);let m=(e.metafile?.outputs?.[s])?.imports?.some(e=>e.external===!0&&e.path.startsWith(ie))??!1;a&&await a({fileFolder:n,builtPath:c,sourcePath:u,checksum:p,usesSdkClient:m})}},E=async({appPath:e,sourcePaths:t,fileFolder:n,buildOptions:r,onFileBuilt:i})=>{if(t.length===0)return;let a={};for(let n of t){let t=n.replace(/\.tsx?$/,``);if(Object.hasOwn(a,t))throw Error(`Application sources ${C.default.relative(e,a[t])} and ${n} produce the same build output. Rename one of them.`);a[t]=C.default.join(e,n)}await ae({result:await b.build({...r,entryPoints:a,plugins:[...s.n(),...r.plugins??[]]}),appPath:e,fileFolder:n,lastChecksums:new Map,onFileBuilt:i})},oe=[`twenty-client-sdk/core`,`twenty-client-sdk/metadata`,`path`,`fs`,`crypto`,`stream`,`util`,`os`,`url`,`http`,`https`,`events`,`buffer`,`querystring`,`assert`,`zlib`,`net`,`tls`,`child_process`,`worker_threads`],D,se=new Uint8Array(new Uint16Array([1]).buffer)[0]===1;function ce(e,t=`@`){if(!D)throw Error(`Not initialized`);let n=e.length+1,r=(D.__heap_base.value||D.__heap_base)+4*n-D.memory.buffer.byteLength;r>0&&D.memory.grow(Math.ceil(r/65536));let i=D.sa(n);(se?de:ue)(e,new Uint16Array(D.memory.buffer,i,n));let a=D.parseCJS(i,e.length,0,0,0);if(a){let n=Error(`Parse error ${t}${D.e()}:${e.slice(0,D.e()).split(`
|
|
2
2
|
`).length}:${D.e()-e.lastIndexOf(`
|
|
3
3
|
`,D.e()-1)}`);throw Object.assign(n,{idx:D.e()}),a!==5&&a!==6&&a!==7||Object.assign(n,{code:`ERR_LEXER_ESM_SYNTAX`}),n}let o=new Set,s=new Set,c=new Set;for(;D.rre();){let t=O(e.slice(D.res(),D.ree()));t&&s.add(t)}for(;D.ru();)c.add(O(e.slice(D.us(),D.ue())));for(;D.re();){let t=O(e.slice(D.es(),D.ee()));t===void 0||c.has(t)||o.add(t)}return{exports:[...o],reexports:[...s]}}function O(e){if(e[0]!==`"`&&e[0]!==`'`)return e;try{let t=function(e){let t=e[0];if(t===`"`)try{return JSON.parse(e)}catch{}else if(t===`'`&&e.length>1&&e[e.length-1]===`'`&&e.indexOf(`"`)===-1)try{return JSON.parse(`"`+e.slice(1,-1)+`"`)}catch{}let n=``,r={v:1};for(;r.v<e.length;){let i=e[r.v];switch(i){case t:return n;case`\\`:++r.v,n+=le(e,r);break;case`\r`:case`
|
|
4
4
|
`:throw SyntaxError();default:++r.v,n+=i}}throw SyntaxError()}(e);for(let e=0;e<t.length;e++){let n=64512&t.charCodeAt(e);if(!(n<55296)&&(n!==55296||(64512&t.charCodeAt(++e))!=56320))return}return t}catch{}}function le(e,t){if(t.v===e.length)throw SyntaxError();let n=e[t.v];switch(++t.v,n){case`\r`:e[t.v]===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return`2.54.
|
|
1
|
+
Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return`2.54.3`}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./application-pYRHxplP.cjs"),o=require("./get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs"),s=require("./fs-utils-DoSmCBu8.cjs"),c=require("./list-application-source-files-jEau5Rie.cjs"),l=require("./extract-manifest-from-file-CEK5X5YP.cjs"),u=require("./metadata-CY9y5wYc.cjs"),d=require("./locale-catalog-format-C_5EGBEn.cjs"),f=require("./constants-Cf5-CwMu.cjs"),p=require("./is-supported-locale-C33Of85N.cjs");let m=require("node:fs/promises"),h=require("node:path"),g=require("node:fs"),_=require("tinyglobby"),v=require("typescript");v=e.r(v);let y=require("path");y=e.r(y);var b=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function x(e){return typeof e==`string`&&b.test(e)}function S(e){if(!x(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var C=[];for(let e=0;e<256;++e)C.push((e+256).toString(16).slice(1));function ee(e,t=0){return(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+`-`+C[e[t+4]]+C[e[t+5]]+`-`+C[e[t+6]]+C[e[t+7]]+`-`+C[e[t+8]]+C[e[t+9]]+`-`+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase()}function w(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var T=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,E=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function D(e,t,n,r,i,a){let o=typeof n==`string`?w(n):n,s=typeof r==`string`?S(r):r;if(typeof r==`string`&&(r=S(r)),r?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let c=new Uint8Array(16+o.length);if(c.set(s),c.set(o,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=c[e];return i}return ee(c)}function O(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function k(e,t){return e<<t|e>>>32-t}function te(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=k(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],c=n[3],l=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=k(i,5)+O(n,a,s,c)+l+t[n]+r[e]>>>0;l=c,c=s,s=k(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+l>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function A(e,t,n,r){return D(80,te,e,t,n,r)}A.DNS=T,A.URL=E;function ne(e){if(!x(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var re=`a80ff791-b940-4c47-a522-2bb478515415`,ie=e=>e.type!==i.I.SELECT&&e.type!==i.I.MULTI_SELECT||e.options===void 0||e.options===null?e:{...e,options:e.options.map(t=>({...t,id:t.id??A(`${t.label}-${e.universalIdentifier}`,re)}))},j=({fields:e,labelIdentifierFieldMetadataUniversalIdentifier:t})=>r.t(t)&&!e.some(e=>e.universalIdentifier===t),M=`twenty:front-component-shared-dependencies`,N=({objectConfig:e,applicationUniversalIdentifier:t})=>({name:`name`,label:`Name`,description:`Name`,icon:`IconAbc`,isNullable:!0,defaultValue:null,type:i.I.TEXT,universalIdentifier:o.a({applicationUniversalIdentifier:t,objectUniversalIdentifier:e.universalIdentifier,name:`name`})}),P=({objectConfig:e,applicationUniversalIdentifier:t})=>{let n=(e.fields??[]).map(e=>e.name),r=[...e.fields??[]],i=N({objectConfig:e,applicationUniversalIdentifier:t}),a=j({fields:e.fields??[],labelIdentifierFieldMetadataUniversalIdentifier:e.labelIdentifierFieldMetadataUniversalIdentifier});return!n.includes(i.name)&&!a&&r.push(i),{objectFields:r}},ae=({objectConfig:e,applicationUniversalIdentifier:t})=>{let{objectFields:n}=P({objectConfig:e,applicationUniversalIdentifier:t}),r=e.labelIdentifierFieldMetadataUniversalIdentifier??n.find(e=>e.name===`name`)?.universalIdentifier;return r?{objectManifest:{...e,fields:n.map(ie),labelIdentifierFieldMetadataUniversalIdentifier:r},errors:[]}:{objectManifest:null,errors:[`No label identifier field found for object ${e.nameSingular}. Please add a field with name "name" to your object.`]}},F=t.t(),I={type:`object`,properties:{}},L=e=>{let t={type:`unknown`};switch(e.type){case`string`:t.type=`string`;break;case`number`:case`integer`:t.type=`number`;break;case`boolean`:t.type=`boolean`;break;case`array`:t.type=`array`,e.items&&(t.items=L(e.items));break;case`object`:t.type=`object`,e.properties&&(t.properties=Object.fromEntries(Object.entries(e.properties).map(([e,t])=>[e,L(t)])));break;case`record`:t.type=`record`;break;case`records`:t.type=`records`;break;default:t.type=`unknown`}return Array.isArray(e.enum)&&(t.enum=e.enum.filter(e=>typeof e==`string`)),e.multiline===!0&&(t.multiline=!0),(0,F.isNonEmptyString)(e.label)&&(t.label=e.label),(0,F.isNonEmptyString)(e.objectUniversalIdentifier)&&(t.objectUniversalIdentifier=e.objectUniversalIdentifier),t},R=e=>[L(e)];R({type:`object`,properties:{a:{type:`string`},b:{type:`number`}}});var oe=async e=>{let{getFunctionInputSchema:t}=await Promise.resolve().then(()=>require("./get-function-input-schema-GNk3NRLJ-DscBUsKy.cjs")),n=t(e)[0];return n?.type===`object`&&r.t(n.properties)?{type:`object`,properties:n.properties}:I},se=async({logicFunctionConfig:e,sourceCode:t,sourcePath:n})=>{let{handler:r,...i}=e,a=i.toolTriggerSettings&&!i.toolTriggerSettings.inputSchema||i.workflowActionTriggerSettings&&!i.workflowActionTriggerSettings.inputSchema?await oe(t):null,o=i.toolTriggerSettings?{...i.toolTriggerSettings,inputSchema:i.toolTriggerSettings.inputSchema??a??void 0}:void 0,s=i.workflowActionTriggerSettings?{...i.workflowActionTriggerSettings,inputSchema:i.workflowActionTriggerSettings.inputSchema??(a?R(a):void 0)}:void 0;return{...i,...o?{toolTriggerSettings:o}:{},...s?{workflowActionTriggerSettings:s}:{},handlerName:`default.config.handler`,sourceHandlerPath:n,builtHandlerPath:n.replace(/\.tsx?$/,`.mjs`),builtHandlerChecksum:`[default-checksum]`}},ce=({frontComponentConfig:e,sourcePath:t})=>{let{component:n,...r}=e;return{...r,componentName:n.name,sourceComponentPath:t,builtComponentPath:t.replace(/\.tsx?$/,`.mjs`),builtComponentChecksum:``,isHeadless:r.isHeadless??!1}},le=({roleConfig:e,applicationUniversalIdentifier:t})=>({...e,objectPermissions:(e.objectPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??a.t({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})})),fieldPermissions:(e.fieldPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??a.n({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,fieldUniversalIdentifier:n.fieldUniversalIdentifier})})),rowLevelPermissionPredicateGroups:e.rowLevelPermissionPredicateGroups??[],rowLevelPermissionPredicates:e.rowLevelPermissionPredicates??[],permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}),ue=e=>{let t=new Set(e);return t.has(`react`)&&t.add(`react/jsx-runtime`),[...t].sort()},de=[`twenty-client-sdk`,`twenty-sdk`],z=e=>{let t=[],n=new Set;for(let r of e){if(!(0,F.isNonEmptyString)(r)){t.push(`"frontComponentSharedDependencies" entries in package.json must be non-empty strings`);continue}if(r.startsWith(`.`)||y.default.posix.isAbsolute(r)||y.default.win32.isAbsolute(r)){t.push(`Shared dependency "${r}" must be a package specifier, not a relative or absolute path`);continue}if(r===`twenty:front-component-shared-dependencies`){t.push(`Shared dependency "${r}" is reserved and cannot be shared`);continue}if(de.some(e=>r===e||r.startsWith(`${e}/`))){t.push(`Shared dependency "${r}" is already served separately and cannot be shared`);continue}if(n.has(r)){t.push(`Shared dependency "${r}" is declared twice`);continue}n.add(r)}return t},fe=async e=>{let t=y.default.join(e,`package.json`);if(!await s.i(t))return{errors:[]};let n=(await s.o(t)).frontComponentSharedDependencies;if(n===void 0)return{errors:[]};if(!Array.isArray(n))return{errors:[`"frontComponentSharedDependencies" in package.json must be an array of package specifiers`]};if(!(0,F.isNonEmptyArray)(n))return{errors:[]};let r=z(n);return(0,F.isNonEmptyArray)(r)?{errors:r}:{sharedDependencies:{dependencies:ue(n),builtPath:a.d,builtChecksum:null},errors:[]}},B=`pageType.isInSidePanel.isDashboardPageLayoutInEditMode.isLayoutCustomizationModeEnabled.favoriteRecordIds.isSelectAll.hasAnySoftDeleteFilterOnView.numberOfSelectedRecords.objectPermissions.selectedRecords.featureFlags.targetObjectReadPermissions.targetObjectWritePermissions.canImpersonate.canAccessFullAdminPanel.objectMetadataItem.objectMetadataLabel.isDefined.isNonEmptyString.includes.every.everyDefined.everyEquals.some.someDefined.someEquals.none.noneDefined.noneEquals.someNonEmptyString.includesEvery`.split(`.`),V=`conditionalAvailabilityExpression`,H=[`twenty-sdk/define`,`twenty-sdk`],U=new Set(B),W=(e,t)=>{let n=[];for(let i of e.statements){if(!v.default.isImportDeclaration(i)||!v.default.isStringLiteral(i.moduleSpecifier)||!H.includes(i.moduleSpecifier.text))continue;let a=i.importClause;if(!r.t(a)||a.phaseModifier===v.default.SyntaxKind.TypeKeyword)continue;let o=a.namedBindings;if(r.t(o)){if(v.default.isNamespaceImport(o)){let r=t.getSymbolAtLocation(o.name),i=e=>{v.default.isImportDeclaration(e)||v.default.isTypeNode(e)||(v.default.isPropertyAccessExpression(e)&&v.default.isIdentifier(e.expression)&&t.getSymbolAtLocation(e.expression)===r&&U.has(e.name.text)&&n.push({importedName:e.name.text,node:e}),v.default.forEachChild(e,i))};i(e);continue}if(v.default.isNamedImports(o))for(let i of o.elements){if(i.isTypeOnly)continue;let a=(i.propertyName??i.name).text;if(U.has(a)){let o=t.getSymbolAtLocation(i.name),s,c=e=>{if(!(r.t(s)||v.default.isImportDeclaration(e)||v.default.isTypeNode(e))){if(v.default.isIdentifier(e)){let n=v.default.isShorthandPropertyAssignment(e.parent)?t.getShorthandAssignmentValueSymbol(e.parent):t.getSymbolAtLocation(e);r.t(o)&&n===o&&(s=e)}v.default.forEachChild(e,c)}};c(e),r.t(s)&&n.push({importedName:a,node:s})}}}}return n},G=e=>{let t=!1,n=e=>{if(!t){if((v.default.isPropertyAssignment(e)||v.default.isShorthandPropertyAssignment(e))&&(v.default.isIdentifier(e.name)||v.default.isStringLiteral(e.name))&&e.name.text===V){t=!0;return}v.default.forEachChild(e,n)}};return n(e),t},pe=(e,t)=>{if(!B.some(t=>e.includes(t)))return[];let n=v.default.createSourceFile(t,e,v.default.ScriptTarget.Latest,!0,t.endsWith(`.tsx`)?v.default.ScriptKind.TSX:v.default.ScriptKind.TS);if(G(n))return[];let r={noLib:!0,noResolve:!0},i=v.default.createCompilerHost(r);return i.getSourceFile=e=>e===n.fileName?n:void 0,W(n,v.default.createProgram([n.fileName],r,i).getTypeChecker()).map(({importedName:e,node:r})=>{let{line:i,character:a}=n.getLineAndCharacterOfPosition(r.getStart(n));return`${t}:${i+1}:${a+1} - "${e}" is a conditional-availability expression variable from twenty-sdk but this file has no ${V}. These variables can only be used inside a command's ${V}, not at runtime.`})},K={canReadObjectRecords:`read`,canUpdateObjectRecords:`update`,canSoftDeleteObjectRecords:`soft-delete`,canDestroyObjectRecords:`destroy`},q=e=>{let t=new Map;for(let[n,r]of Object.entries(e))t.has(r)||t.set(r,n);return t},me=Object.fromEntries(Object.entries(u.n).map(([e,{universalIdentifier:t}])=>[t,e])),he=({grant:e,objects:t,permissionFlags:n,systemPermissionFlagNameByUniversalIdentifier:r})=>{let i=e=>t.find(t=>t.universalIdentifier===e)?.nameSingular??me[e]??e;switch(e.type){case`ALL_OBJECT_RECORDS`:return`${K[e.action]} all object records`;case`ALL_SETTINGS`:return`update all settings`;case`ALL_TOOLS`:return`access all tools`;case`PERMISSION_FLAG`:return`permission flag ${n.find(t=>t.universalIdentifier===e.permissionFlagUniversalIdentifier)?.key??r.get(e.permissionFlagUniversalIdentifier)??e.permissionFlagUniversalIdentifier}`;case`OBJECT_RECORDS`:return`${K[e.action]} ${i(e.objectUniversalIdentifier)} records`;case`FIELD_VALUE`:return`${e.action===`canReadFieldValue`?`read`:`update`} field ${e.fieldUniversalIdentifier} of ${i(e.objectUniversalIdentifier)}`;case`ROW_LEVEL_RESTRICTION`:return`${i(e.objectUniversalIdentifier)} records without the row-level restriction`}},J=e=>e.map(e=>`"${e}"`).join(`, `),ge=({agents:e,defaultRoleUniversalIdentifier:t})=>{let n=new Map;for(let i of e)!r.t(i.roleUniversalIdentifier)||i.roleUniversalIdentifier===t||n.set(i.roleUniversalIdentifier,[...n.get(i.roleUniversalIdentifier)??[],i.name]);return n},_e=({agentNamesByRoleUniversalIdentifier:e,roles:t})=>[...e].filter(([e])=>!t.some(t=>t.universalIdentifier===e)).map(([e,t])=>`Agent ${J(t)} references role "${e}", which is not defined by this application.`),ve=({agentNamesByRoleUniversalIdentifier:e,applicationRole:t,roles:n,objects:i,permissionFlags:o,systemPermissionFlagNameByUniversalIdentifier:s})=>{let c=o.filter(e=>(e.permissionType??`tool`)===`tool`).map(e=>e.universalIdentifier);return[...e].flatMap(([e,l])=>{let u=n.find(t=>t.universalIdentifier===e);if(!r.t(u))return[];let d=a.i({role:u,superset:t,toolPermissionFlagUniversalIdentifiers:c});if(d.length===0)return[];let f=d.map(e=>he({grant:e,objects:i,permissionFlags:o,systemPermissionFlagNameByUniversalIdentifier:s})).join(`, `);return[`Role "${u.label}" used by agent ${J(l)} grants more than the application role "${t.label}": ${f}. The application role must cover every permission an agent role grants.`]})},ye=({agents:e,roles:t,objects:n,permissionFlags:a,defaultRoleUniversalIdentifier:o,systemPermissionFlag:s=i.r})=>{let c=t.find(e=>e.universalIdentifier===o),l=ge({agents:e,defaultRoleUniversalIdentifier:o});return[..._e({agentNamesByRoleUniversalIdentifier:l,roles:t}),...r.t(c)?ve({agentNamesByRoleUniversalIdentifier:l,applicationRole:c,roles:t,objects:n,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:q(s)}):[]]},be=({views:e,objects:t,fields:a})=>{let o=[],s=new Map;for(let e of a)s.set(e.universalIdentifier,e);for(let e of t)for(let t of e.fields)s.set(t.universalIdentifier,t);for(let t of e)for(let e of t.filters??[]){let t=s.get(e.fieldMetadataUniversalIdentifier);if(!r.t(t))continue;let a=(t.type===i.I.RELATION||t.type===i.I.MORPH_RELATION)&&r.t(e.relationTargetFieldMetadataUniversalIdentifier)?s.get(e.relationTargetFieldMetadataUniversalIdentifier)?.type??t.type:t.type;if(!(a in n.r))continue;let c=n.o({filterType:a,subFieldName:e.subFieldName});c.includes(e.operand)||o.push(`Operand "${e.operand}" is not supported on field "${t.name}" (type "${a}"). Supported operands: ${c.join(`, `)}.`)}return o},xe=e=>{try{let t=JSON.parse((0,g.readFileSync)((0,h.join)(e,`package.json`),`utf-8`)).engines?.twenty;return typeof t==`string`&&t.trim()!==``?t.trim():null}catch{return null}},Se=e=>c.t(e),Ce=async e=>(await(0,_.glob)([`${a.u}/**/*`],{cwd:e,absolute:!0,onlyFiles:!0})).sort(),we=async e=>{try{let t=await(0,m.readFile)((0,y.join)(e,`README.md`),`utf-8`);return t.trim().length>0?t:void 0}catch{return}},Te=async e=>{let t=await Se(e),i=await we(e),a=[],o=[],s,c=[],u=[],f=[],p=[],h=[],g=[],_=[],v=[],b=[],x=[],S=[],C=[],ee=[],w=[],T=[],E=[],D=[],O=[],k=[],te=[],A=[],ne=[],re=[],j=[],M=[],N=[],P=[],F=[],I=[],L=[],R=[],oe=[],ue=[],de=[],z=[],B=[],V=[],H=[],U=[],W=[],G=[],K=[],q=[],me=[],he=[],J=[],ge=[],_e=[],ve=[],Te=[],Ee=[],Y=[],X=[],De=[],Oe=[];for(let i of t){let t=await(0,m.readFile)(i,`utf-8`),d=(0,y.relative)(e,i);a.push(...pe(t,d));let f=l.r(t);if(!f)continue;let _=l.n[f];switch(_){case`application`:{let t=await l.t({appPath:e,filePath:i});s=t.config,a.push(...t.errors),o.push(...t.warnings??[]),oe.push(d);break}case`objects`:{let t=await l.t({appPath:e,filePath:i});c.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),ue.push(d);break}case`fields`:{let t=await l.t({appPath:e,filePath:i}),n=ie(t.config);p.push(n),a.push(...t.errors),o.push(...t.warnings??[]),de.push(d);break}case`permissionFlags`:{let t=await l.t({appPath:e,filePath:i});g.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),B.push(d);break}case`roles`:{let t=await l.t({appPath:e,filePath:i});u.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),V.push(d),f===`defineApplicationRole`&&R.push(t.config.universalIdentifier);break}case`skills`:{let t=await l.t({appPath:e,filePath:i});v.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),H.push(d);break}case`agents`:{let t=await l.t({appPath:e,filePath:i});b.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),U.push(d);break}case`workflows`:{let t=await l.t({appPath:e,filePath:i});x.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),W.push(d);break}case`connectionProviders`:{let t=await l.t({appPath:e,filePath:i});S.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),G.push(d);break}case`messagingProviders`:{let t=await l.t({appPath:e,filePath:i});C.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),K.push(d);break}case`mcpServers`:{let t=await l.t({appPath:e,filePath:i});ee.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),q.push(d);break}case`logicFunctions`:{let n=await l.t({appPath:e,filePath:i});a.push(...n.errors),o.push(...n.warnings??[]),f===`definePreInstallLogicFunction`&&r.t(n.config.serverRouteTriggerSettings)&&a.push(`${d}: pre-install logic functions cannot define serverRouteTriggerSettings.`);let s=await se({logicFunctionConfig:n.config,sourceCode:t,sourcePath:d});if(w.push(s),me.push(d),f===`definePostInstallLogicFunction`){let e=n.config;N.push({universalIdentifier:n.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1,shouldRunSynchronously:e.shouldRunSynchronously??!1})}if(f===`definePreInstallLogicFunction`){let e=n.config;P.push({universalIdentifier:n.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1})}f===`defineUninstallLogicFunction`&&F.push({universalIdentifier:n.config.universalIdentifier}),f===`defineHealthCheck`&&I.push({universalIdentifier:n.config.universalIdentifier});break}case`frontComponents`:{let t=await l.t({appPath:e,filePath:i});a.push(...t.errors),o.push(...t.warnings??[]);let n=ce({frontComponentConfig:t.config,sourcePath:d});T.push(n),he.push(d),f===`defineSettingsFrontComponent`&&L.push(t.config.universalIdentifier);break}case`views`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};D.push(n),a.push(...t.errors),o.push(...t.warnings??[]),ge.push(d);break}case`viewFields`:{let t=await l.t({appPath:e,filePath:i});O.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),_e.push(d);break}case`navigationMenuItems`:{let t=await l.t({appPath:e,filePath:i});k.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),ve.push(d);break}case`pageLayouts`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};te.push(n),a.push(...t.errors),o.push(...t.warnings??[]),Te.push(d);break}case`indexes`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};h.push(n),a.push(...t.errors),o.push(...t.warnings??[]),z.push(d);break}case`pageLayoutTabs`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};A.push(n),a.push(...t.errors),o.push(...t.warnings??[]),Ee.push(d);break}case`pageLayoutWidgets`:{let t=await l.t({appPath:e,filePath:i});ne.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),Y.push(d);break}case`commandMenuItems`:{let t=await l.t({appPath:e,filePath:i});re.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),X.push(d);break}case`timelineActivityTypes`:{let t=await l.t({appPath:e,filePath:i});j.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),De.push(d);break}case`settingsMenuItems`:{let t=await l.t({appPath:e,filePath:i});M.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),Oe.push(d);break}default:n.t(_)}}let ke=await Ce(e);for(let t of ke){let n=(0,y.relative)(e,t);E.push({filePath:n,fileName:(0,y.basename)(t),fileType:(0,y.extname)(t).replace(/^\./,``),checksum:null}),J.push(n)}if(s||a.push(`Cannot build application, please export default defineApplication() to define an application`),s){for(let e of c){let{objectManifest:t,errors:n}=ae({objectConfig:e,applicationUniversalIdentifier:s.universalIdentifier});a.push(...n),t&&f.push(t)}for(let e of u)_.push(le({roleConfig:e,applicationUniversalIdentifier:s.universalIdentifier}))}N.length>1&&a.push(`Only one post install logic function is allowed per application`),P.length>1&&a.push(`Only one pre install logic function is allowed per application`),F.length>1&&a.push(`Only one uninstall logic function is allowed per application`),I.length>1&&a.push(`Only one health check is allowed per application`),L.length>1&&a.push(`Only one settings front component is allowed per application`),R.length>1&&a.push(`Only one defineApplicationRole is allowed per application`);let{sharedDependencies:Ae,errors:je}=await fe(e);a.push(...je);let Z=s?.defaultRoleUniversalIdentifier??(R.length===1?R[0]:void 0);s&&!Z&&a.push("Application must declare a default role: either pass `defaultRoleUniversalIdentifier` to defineApplication() or mark a role file with defineApplicationRole()"),a.push(...be({views:D,objects:f,fields:p})),r.t(s)&&r.t(Z)&&a.push(...ye({agents:b,roles:_,objects:f,permissionFlags:g,defaultRoleUniversalIdentifier:Z,systemPermissionFlag:d.o(e)}));let Q=s&&Z?(()=>{let{logoUrl:t,screenshots:n,...a}=s;return{...a,logo:s.logo,galleryImages:s.galleryImages??[],defaultRoleUniversalIdentifier:Z,aboutDescription:i,yarnLockChecksum:null,packageJsonChecksum:``,requiredServerVersionRange:xe(e),...N.length>=1?{postInstallLogicFunction:N[0]}:{},...P.length>=1?{preInstallLogicFunction:P[0]}:{},...F.length>=1?{uninstallLogicFunction:F[0]}:{},...I.length>=1?{healthCheckLogicFunction:I[0]}:{},...L.length>=1?{settingsFrontComponent:{universalIdentifier:L[0]}}:{},...r.t(Ae)?{frontComponentSharedDependencies:Ae}:{}}})():void 0,$=(e,t)=>e.universalIdentifier.localeCompare(t.universalIdentifier);return{manifest:Q?{application:Q,objects:f.sort($),fields:p.sort($),indexes:h.sort($),permissionFlags:g.sort($),roles:_.sort($),skills:v.sort($),agents:b.sort($),workflows:x.sort($),connectionProviders:S.sort($),messagingProviders:C.sort($),mcpServers:ee.sort($),logicFunctions:w.sort($),frontComponents:T.sort($),publicAssets:E.sort((e,t)=>e.filePath.localeCompare(t.filePath)),views:D.sort($),viewFields:O.sort($),navigationMenuItems:k.sort($),pageLayouts:te.sort($),pageLayoutTabs:A.sort($),pageLayoutWidgets:ne.sort($),commandMenuItems:re.sort($),timelineActivityTypes:j.sort($),settingsMenuItems:M.sort($)}:null,filePaths:{application:oe,objects:ue,fields:de,indexes:z,permissionFlags:B,roles:V,skills:H,agents:U,workflows:W,connectionProviders:G,messagingProviders:K,mcpServers:q,logicFunctions:me,frontComponents:he,publicAssets:J,views:ge,viewFields:_e,navigationMenuItems:ve,pageLayouts:Te,pageLayoutTabs:Ee,pageLayoutWidgets:Y,commandMenuItems:X,timelineActivityTypes:De,settingsMenuItems:Oe},errors:a,warnings:o}},Ee=[i.I.RELATION,i.I.MORPH_RELATION],Y=e=>Ee.includes(e.type),X=e=>{let t=new Set,n=new Set;for(let r of e)t.has(r)?n.add(r):t.add(r);return Array.from(n)},De=({manifest:e,pageLayoutWidgets:t})=>{let n=new Set([e.application.settingsFrontComponent?.universalIdentifier,...e.settingsMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.commandMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.timelineActivityTypes.map(e=>e.frontComponentUniversalIdentifier),...t.map(({configuration:e})=>r.t(e)&&`frontComponentUniversalIdentifier`in e?e.frontComponentUniversalIdentifier:void 0)].filter(r.t));return e.frontComponents.filter(e=>!e.isHeadless&&!r.t(e.widgetAvailability)&&!n.has(e.universalIdentifier)).map(e=>`Front component "${e.name??e.componentName}" declares no widgetAvailability, so it is not offered in any widget picker. Set widgetAvailability to let users add it to record pages or dashboards.`)},Oe=e=>{let t=[],n=[...e.pageLayouts.flatMap(({tabs:e})=>e??[]),...e.pageLayoutTabs];for(let e of n){e.layoutMode===i.R.CANVAS&&t.push(`Page layout tab "${e.title}" uses deprecated CANVAS. For a full-height widget, use VERTICAL_LIST and set the widget's heightBehavior to 'TAB_VIEWPORT'. Existing Canvas layouts remain supported and are not converted.`);for(let n of e.widgets??[])n.position?.layoutMode===i.R.VERTICAL_LIST&&t.push(`Page layout widget "${n.title}" uses a deprecated vertical-list position. Order the widgets array by position.index, remove position, and move any position.heightBehavior to heightBehavior. Existing positions remain supported and keep their indices.`),`gridPosition`in n&&r.t(n.gridPosition)&&t.push(`Page layout widget "${n.title}" uses deprecated gridPosition. If position is already set, it takes precedence; remove the ignored gridPosition. Use position with layoutMode: 'GRID' and the same row, column, rowSpan and columnSpan only when position is absent. Existing gridPosition remains supported as a fallback.`)}return t},ke=[`id`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`deletedAt`,`position`,`searchVector`],Ae=e=>e.objects.flatMap(t=>{let n=t.labelIdentifierFieldMetadataUniversalIdentifier?.toLowerCase();return r.t(n)?[...(t.fields??[]).map(e=>e.universalIdentifier.toLowerCase()),...e.fields.filter(e=>e.objectUniversalIdentifier.toLowerCase()===t.universalIdentifier.toLowerCase()).map(e=>e.universalIdentifier.toLowerCase()),...ke.map(n=>o.a({applicationUniversalIdentifier:e.application.universalIdentifier,objectUniversalIdentifier:t.universalIdentifier,name:n}))].includes(n)?[]:[`Object "${t.nameSingular}" references label field ${n}, which is not declared in this app or a recognized generated field. Check the identifier; the server must resolve this reference before applying.`]:[]}),je=e=>{let t=[],o=X(e.timelineActivityTypes.map(e=>e.name)),s=new Set(e.frontComponents.map(e=>e.universalIdentifier));for(let e of o)t.push(`Timeline activity type name "${e}" is used more than once. Names must be unique within an application.`);for(let o of e.timelineActivityTypes){r.t(o.frontComponentUniversalIdentifier)&&!s.has(o.frontComponentUniversalIdentifier)&&t.push(`Timeline activity type "${o.name}" references front component "${o.frontComponentUniversalIdentifier}", which is not defined by this application.`);let c=o.emit,l=o.replacesTimelineActivityTypeUniversalIdentifier;if(!r.t(c)){r.t(l)&&t.push(`Timeline activity type "${o.name}" declares replacesTimelineActivityTypeUniversalIdentifier without an automatic emit contract.`);continue}let u=c.through,d=u?.triggerFieldUniversalIdentifiers,f=a.p(c.objectUniversalIdentifier);f||t.push(`Timeline activity type "${o.name}" references an invalid object universal identifier "${c.objectUniversalIdentifier}".`),(c.on===`linked`||c.on===`unlinked`)&&!r.t(u)&&t.push(`Timeline activity type "${o.name}" must declare emit.through for a ${c.on} event.`),r.t(d)&&(c.on!==`updated`||!n.n(d)||new Set(d).size!==d.length)&&t.push(`Timeline activity type "${o.name}" trigger fields must be a non-empty list of unique fields on an updated through event.`);let p=f?e.objects.find(e=>e.universalIdentifier===c.objectUniversalIdentifier):void 0;if(!r.t(p)){f&&!r.t(l)&&t.push(`Timeline activity type "${o.name}" targets object "${c.objectUniversalIdentifier}", which is not defined by this application. Types targeting another application's object must declare replacesTimelineActivityTypeUniversalIdentifier.`),r.t(l)&&!a.p(l)&&t.push(`Timeline activity type "${o.name}" references an invalid replacement universal identifier "${l}".`),r.t(u)&&!a.p(u.relationFieldUniversalIdentifier)&&t.push(`Timeline activity type "${o.name}" references an invalid through relation field universal identifier "${u.relationFieldUniversalIdentifier}".`);let e=d?.filter(e=>!a.p(e))??[];e.length>0&&t.push(`Timeline activity type "${o.name}" references invalid trigger field universal identifiers: ${e.join(`, `)}.`);continue}r.t(l)&&t.push(`Timeline activity type "${o.name}" targets an object defined by this application and must not replace another application's type.`);let m=[...p.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===p.universalIdentifier)];if(!r.t(u))continue;let h=m.find(e=>e.universalIdentifier===u.relationFieldUniversalIdentifier);if(r.t(h)?Y(h)&&r.t(h.universalSettings)&&(h.universalSettings.relationType===i.A.MANY_TO_ONE||h.universalSettings.relationType===i.A.ONE_TO_MANY&&(0,F.isNonEmptyString)(h.universalSettings.junctionTargetFieldUniversalIdentifier))||t.push(`Timeline activity type "${o.name}" must route through a MANY_TO_ONE relation or a junction-backed ONE_TO_MANY relation.`):t.push(`Timeline activity type "${o.name}" references relation field "${u.relationFieldUniversalIdentifier}", which is not defined on object "${p.nameSingular}".`),r.t(d)){let e=new Set(m.map(e=>e.universalIdentifier)),n=d.filter(t=>!e.has(t));n.length>0&&t.push(`Timeline activity type "${o.name}" references trigger fields that are not defined on object "${p.nameSingular}": ${n.join(`, `)}.`)}}return t},Z=[i.A.MANY_TO_ONE,i.A.ONE_TO_MANY],Q=`aggregateFieldMetadataId`,$=e=>r.t(e)&&i.T.some(t=>t===e.configurationType),Me=e=>{let t=[];if(!e)return[];for(let[n,r]of Object.entries(e))n===`universalIdentifier`&&typeof r==`string`&&t.push(r),!(n===`postInstallLogicFunction`||n===`preInstallLogicFunction`||n===`uninstallLogicFunction`||n===`healthCheckLogicFunction`||n===`identifyAccountLogicFunction`||n===`authorizeLogicFunction`||n===`callbackLogicFunction`||n===`onConnectLogicFunction`||n===`onDisconnectLogicFunction`||n===`sendMessageLogicFunction`||n===`connectionProvider`||n===`settingsFrontComponent`||n===`input`||n===`expectedBody`||n===`outputSchema`||n===`expectedOutputSchema`)&&typeof r==`object`&&t.push(...Me(r));return t},Ne=e=>{let t=[];for(let n of e){if(!Y(n))continue;let e=n.universalSettings;if(!e?.relationType){t.push(`Relation field "${n.name}" is missing relationType. ${n.type} fields must declare a relationType (${Z.join(` or `)}) in universalSettings.`);continue}if(!Z.includes(e.relationType)){t.push(`Relation field "${n.name}" has invalid relationType "${e.relationType}". Expected ${Z.join(` or `)}.`);continue}e.relationType===i.A.MANY_TO_ONE&&!e.joinColumnName&&t.push(`MANY_TO_ONE relation field "${n.name}" is missing joinColumnName. MANY_TO_ONE relations must declare a joinColumnName in universalSettings.`)}return t},Pe=e=>{let t=e.pageLayouts.flatMap(e=>e.tabs?.flatMap(e=>e.widgets??[])??[]),n=e.pageLayoutTabs.flatMap(e=>e.widgets??[]);return[...t,...n,...e.pageLayoutWidgets??[]]},Fe=e=>{let t=[];for(let n of e){let e=n.configuration;if($(e)&&!(0,F.isNonEmptyString)(e.aggregateFieldMetadataUniversalIdentifier)){let r=Q in e?` Reference the aggregate field with "aggregateFieldMetadataUniversalIdentifier" (not "${Q}").`:``;t.push(`Graph widget "${n.title}" is missing aggregateFieldMetadataUniversalIdentifier.${r}`)}}return t},Ie=({pageLayoutTab:e,pageLayoutType:t})=>{let n=a.f({pageLayoutTabManifest:e,pageLayoutType:t});return n.status===`fail`?n.errors:[]},Le=e=>{let t=new Map(e.pageLayouts.map(e=>[e.universalIdentifier,e.type])),n=e.pageLayouts.flatMap(e=>(e.tabs??[]).flatMap(t=>Ie({pageLayoutTab:t,pageLayoutType:e.type}))),i=e.pageLayoutTabs.flatMap(e=>Ie({pageLayoutTab:e,pageLayoutType:r.t(e.pageLayoutUniversalIdentifier)?t.get(e.pageLayoutUniversalIdentifier):void 0}));return[...n,...i]},Re=e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;if(n.add(r),!x(r)){t.push(`Universal identifier "${r}" is not a valid UUID.`);continue}let e=ne(r);a.p(r)||t.push(`Universal identifier "${r}" is UUID version ${e}. Only UUID version 4 or higher is allowed.`)}return t},ze=e=>{let t=[],n=Pe(e),a=[...Oe(e),...Ae(e),...De({manifest:e,pageLayoutWidgets:n})],o=Me(e),s=X(o.map(e=>e.toLowerCase()));s.length>0&&t.push(`Duplicate universal identifiers: ${s.join(`, `)}`);let c=Re(o);c.length>0&&t.push(`Invalid universal identifiers: ${c.join(`, `)}`);let l=[...e.fields,...e.objects.flatMap(e=>e.fields)];for(let e of l)if((e.type===i.I.SELECT||e.type===i.I.MULTI_SELECT||e.type===i.I.RATING)&&r.t(e.options)){e.options.some(({id:e})=>r.t(e)&&!(0,F.isNonEmptyString)(e))&&t.push(`Field "${e.name}" has empty option IDs. Set distinct non-empty IDs on these options.`);let n=X(e.options.map(e=>e.id).filter(r.t).map(e=>e.toLowerCase()));n.length>0&&t.push(`Field "${e.name}" has duplicate option IDs: ${n.join(`, `)}. Set distinct explicit IDs on these options.`)}return t.push(...Ne(l)),t.push(...Le(e)),t.push(...Fe(n)),t.push(...je(e)),{errors:t,warnings:a,isValid:t.length===0}},Be={"twenty-sdk":`"twenty-sdk" is listed under "dependencies" in package.json. It is a build-time only tool and should be moved to "devDependencies".`,"twenty-client-sdk":`"twenty-client-sdk" is listed under "dependencies" in package.json. It is provided at runtime by Twenty's injected SDK and should be moved to "devDependencies".`},Ve=async e=>{let t=y.default.join(e,`package.json`);if(!await s.i(t))return[];let n=await s.o(t);return[`dependencies`,`optionalDependencies`].flatMap(e=>Object.entries(Be).filter(([t])=>r.t(n[e]?.[t])).map(([,t])=>t.replace(`"dependencies"`,`"${e}"`)))},He=async e=>await s.i(e)?(await(0,m.stat)(e)).size===0?[`yarn.lock is empty. Run "yarn install" to regenerate it before building.`]:[]:[`yarn.lock not found. Run "yarn install" to generate it before building.`],Ue=e=>He(y.default.join(e,`yarn.lock`)),We=async e=>{let t=await Te(e);if(t.errors.length>0||!t.manifest)return{success:!1,errors:t.errors.length>0?t.errors:[`Failed to build manifest.`]};let n=ze(t.manifest);if(!n.isValid)return{success:!1,errors:n.errors};let r=await Ue(e);if(r.length>0)return{success:!1,errors:r};let i=await Ve(e);return{success:!0,manifest:t.manifest,filePaths:t.filePaths,warnings:[...t.warnings,...n.warnings,...i]}},Ge=({catalog:e,onCollision:t})=>{let n={},i=new Map;for(let{message:a,context:o,translation:s}of d.n(e)){if(s.length===0)continue;let e=r.t(o)?`${o} ${a}`:a,c=d.r(a,o),l=i.get(c);r.t(l)&&l!==e&&t?.({messageId:c,keptKey:e,droppedKey:l}),i.set(c,e),n[c]=s}return n},Ke=async({filePath:e,onWarning:t})=>{let n;try{n=await s.o(e)}catch{return t(`Skipping translation file "${y.default.basename(e)}": it is not valid JSON.`),null}return!r.t(n)||typeof n!=`object`||Array.isArray(n)?(t(`Skipping translation file "${y.default.basename(e)}": expected a JSON object.`),null):n},qe=async({appPath:e,onWarning:t})=>{let n=y.default.join(e,f.t);if(!await s.i(n))return{};let r={};for(let e of(await(0,m.readdir)(n)).filter(e=>e.endsWith(`.json`))){let i=y.default.basename(e,`.json`);if(i===`en`)continue;if(!p.t(i)){t(`Skipping compiled translation file "${e}": "${i}" is not a supported locale.`);continue}let a=await Ke({filePath:y.default.join(n,e),onWarning:t});if(a===null)continue;let o=Object.fromEntries(Object.entries(a).filter(e=>typeof e[1]==`string`&&e[1].length>0));Object.keys(o).length>0&&(r[i]=o)}return r},Je=async({appPath:e,onWarning:t=e=>console.warn(e)})=>{let n=y.default.join(e,f.n);if(!await s.i(n))return;let r=(await(0,m.readdir)(n)).filter(e=>e.endsWith(`.json`)),i={};for(let e of r){let r=y.default.basename(e,`.json`);if(r===`en`)continue;if(!p.t(r)){t(`Skipping translation file "${e}": "${r}" is not a supported locale.`);continue}let a=await Ke({filePath:y.default.join(n,e),onWarning:t});if(a===null)continue;let o=Ge({catalog:a,onCollision:({messageId:n,keptKey:r,droppedKey:i})=>t(`Message id collision in "${e}": "${r}" and "${i}" share id "${n}". Keeping "${r}".`)});Object.keys(o).length>0&&(i[r]=o)}for(let[n,r]of Object.entries(await qe({appPath:e,onWarning:t})))i[n]={...r,...i[n]??{}};return i};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Je}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Cbb71hpl-CrSqydxj.cjs"),r=require("./fs-utils-DoSmCBu8.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./get-tooling-error-context-CZKTM7Q6.cjs"),o=require("./locale-catalog-format-C_5EGBEn.cjs"),s=require("./constants-Cf5-CwMu.cjs"),c=require("./build-source-manifest-
|
|
1
|
+
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./constants-Cbb71hpl-CrSqydxj.cjs"),r=require("./fs-utils-DoSmCBu8.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./get-tooling-error-context-CZKTM7Q6.cjs"),o=require("./locale-catalog-format-C_5EGBEn.cjs"),s=require("./constants-Cf5-CwMu.cjs"),c=require("./build-source-manifest-BJyDykpG.cjs"),l=require("./assert-pull-paths-TFGZvzZO.cjs"),u=require("./collect-translatable-strings-BWzloBoB.cjs"),d=require("./is-locale-catalog-D0wFrW8f.cjs"),f=require("./parse-extraction-locale-h0bmy8hf.cjs");let p=require("node:fs/promises"),m=require("node:path");var h=e.t(),g=e=>n.i(e)&&Object.values(e).every(e=>(0,h.isString)(e)||d.t(e)),_=async e=>{try{let t=await r.o(e);if(g(t))return t}catch(t){throw new i.t({code:`INVALID_INPUT`,message:`Cannot read translation catalog ${e}. No catalogs were updated.`,cause:t})}throw new i.t({code:`INVALID_INPUT`,message:`Invalid translation catalog ${e}. Expected messages or context groups with string translations. No catalogs were updated.`})},v=async({appPath:e,manifest:n,frontComponentSourcePaths:i=[],scaffoldLocale:a,signal:c})=>{c.throwIfAborted();let d=[...new Map([...u.t(n),...await u.n(i)].map(e=>[u.r(e.message,e.context),e])).values()],f=(0,m.join)(e,s.n);await l.t({appPath:e,relativePaths:[s.n]});let h=new Set((await r.i(f)?await(0,p.readdir)(f):[]).filter(e=>e.endsWith(`.json`)&&e!==`en.json`));t.t(a)&&h.add(`${a}.json`);let g=new Map([[`en.json`,o.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:e})))]]);await l.t({appPath:e,relativePaths:[...g.keys(),...h].map(e=>(0,m.join)(s.n,e))});for(let e of[...h].sort()){let t=(0,m.join)(f,e),n=await r.i(t)?await _(t):{},i=new Map(o.n(n).map(e=>[u.r(e.message,e.context),e.translation]));g.set(e,o.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:i.get(u.r(e,t))??``}))))}c.throwIfAborted();let v=(0,m.join)(`.twenty`,`cli`);await l.t({appPath:e,relativePaths:[v]}),await r.r(f),await r.r((0,m.join)(e,v));let y=await(0,p.mkdtemp)((0,m.join)(e,v,`extract-`));try{for(let[e,t]of g)c.throwIfAborted(),await r.c((0,m.join)(y,e),t);for(let e of g.keys())c.throwIfAborted(),await(0,p.rename)((0,m.join)(y,e),(0,m.join)(f,e))}finally{await(0,p.rm)(y,{recursive:!0,force:!0})}return{sourceCount:d.length,updatedLocaleFiles:[...g.keys()].map(e=>(0,m.join)(s.n,e))}},y=async({appPath:e,locale:t,signal:n})=>{let r=f.t(t),o=await c.buildSourceManifest({appPath:e,signal:n});if(!o.success)return o;try{return{success:!0,data:await v({appPath:e,manifest:o.data.manifest,frontComponentSourcePaths:o.data.filePaths.frontComponents.map(t=>(0,m.join)(e,t)),scaffoldLocale:r,signal:n}),diagnostics:o.diagnostics}}catch(e){if(!(e instanceof i.t)&&!(e instanceof l.n))throw e;return{success:!1,error:{code:e instanceof i.t?e.code:`APP_PATH_UNAVAILABLE`,message:e.message,...a.t(e)},diagnostics:o.diagnostics}}};exports.extractSourceTranslations=y;
|
package/dist/chunks/{global-flags.constant-MWMrKAud.cjs → global-flags.constant-uA1jkBmk.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={path:[`app`,`install`],description:`Install a registered app package in the target workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Registered app universal identifier, works without a local project`}],examples:[`twenty app install --remote dev`,`twenty app install --path ./apps/billing --json`,`twenty app install --universal-identifier <id> --remote staging --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-install-command-DOzp9bOL.cjs"))).runAppInstallCommand},t={path:[`app`,`publish`],description:`Build and publish the app to npm or a private Twenty registry`,options:[{flags:`--private`,description:`Publish to a Twenty server registry using --remote or the active target`},{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--tag <tag>`,description:`npm dist-tag, for example beta or next`}],examples:[`twenty app publish`,`twenty app publish --private --remote dev`,`twenty app publish --path ./apps/billing --tag beta --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-publish-command-BPosULCY.cjs"))).runAppPublishCommand},n={path:[`app`,`dev`],description:`Watch app source, build complete snapshots and sync changes to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Allow registering and installing an app with no registration`},{flags:`--yes`,description:`Allow object and field deletions without asking`}],examples:[`twenty app dev --remote dev`,`twenty app dev --create --no-prune`,`twenty app dev --format ndjson --no-prune`],outputModes:[`human`,`ndjson`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-dev-command-BnSJIUgg.cjs"))).runAppDevCommand},r={path:[`app`,`add`],description:`Add an object, field, logic function or front component to an app`,arguments:[{name:`entity`,description:`object, field, logic-function or front-component (prompted when omitted)`,required:!1}],options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Definition name; also determines the generated filename`},{flags:`--create-view`,description:`Create a table view for the new object`},{flags:`--create-navigation-menu-item`,description:`Create a navigation menu item for the new object`},{flags:`--create-page-layout`,description:`Create a record page layout and its fields view for the new object`},{flags:`--name-plural <name>`,description:`Plural API name (object)`},{flags:`--label <label>`,description:`Display label (object or field; default: derived from name)`},{flags:`--label-plural <label>`,description:`Plural display label (object; default: derived from plural name)`},{flags:`--type <type>`,description:`Field type, for example TEXT, NUMBER or RELATION (default: TEXT)`},{flags:`--object <uuid>`,description:`Parent object universal identifier (field)`},{flags:`--description <text>`,description:`Field description`},{flags:`--target-object <uuid>`,description:`Target object universal identifier (relation field)`},{flags:`--target-field <uuid>`,description:`Target field universal identifier (relation field)`},{flags:`--relation-type <type>`,description:`ONE_TO_MANY or MANY_TO_ONE (relation field; default: ONE_TO_MANY)`},{flags:`--on-delete <action>`,description:`CASCADE, RESTRICT, SET_NULL, NO_ACTION or None (relation field; default: CASCADE)`}],examples:[`twenty app add`,`twenty app add object --name invoice --name-plural invoices --no-input`,`twenty app add object --name invoice --name-plural invoices --create-view --create-navigation-menu-item --create-page-layout --no-input`,`twenty app add field --name amount --type NUMBER --object <object-universal-identifier> --json`,`twenty app add logic-function --name send-invoice --no-input`,`twenty app add front-component --name invoice-panel --no-input`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-add-command-C0b2LVQN.cjs"))).runAppAddCommand},i={path:[`app`,`exec`],description:`Execute a deployed app logic function as the signed-in user`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Exact deployed function name`},{flags:`--universal-identifier <id>`,description:`Function universal identifier`},{flags:`--post-install`,description:`Execute the post-install hook without installing the app`},{flags:`--pre-install`,description:`Execute the pre-install hook without installing the app`},{flags:`--uninstall-hook`,description:`Execute the uninstall hook without uninstalling the app`},{flags:`--payload <json>`,description:`JSON object, @file or - for stdin (default: {})`}],examples:[`twenty app exec --name add-numbers --remote dev`,`twenty app exec --name add-numbers --payload @payload.json --json`,`twenty app exec --post-install --payload '{}'`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-exec-command-BPlfFt9-.cjs"))).runAppExecCommand},a={path:[`app`,`generate-client`],description:`Regenerate the app's typed API client from the workspace schema, without building or syncing`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app generate-client --remote dev`,`twenty app generate-client --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-app-generate-client-command-7t5Hs10P.cjs"))).runAppGenerateClientCommand},o={path:[`app`,`logs`],description:`Watch new logic-function logs from this app`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Filter all functions with this exact name within the app`},{flags:`--universal-identifier <id>`,description:`Filter one function by universal identifier`}],examples:[`twenty app logs --remote dev`,`twenty app logs --name add-numbers --remote dev`,`twenty app logs --format ndjson`],outputModes:[`human`,`ndjson`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-logs-command-CQDO_gce.cjs"))).runAppLogsCommand},s={path:[`app`,`apply`],description:`Build the app, preview the changes, then upload and sync it to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Register the app and install it in the workspace if it has no registration yet`},{flags:`--yes`,description:`Apply object and field deletions without asking; does not change which entities are deleted`}],examples:[`twenty app apply --remote dev`,`twenty app apply --create --json`,`twenty app apply --no-prune`,`twenty app apply --prune`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-apply-command-BnfxBO7o.cjs"))).runAppApplyCommand},c={path:[`app`,`build`],description:`Build the app with the CLI and report the artifacts`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app build`,`twenty app build --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-build-command-tAj7RilT.cjs"))).runAppBuildCommand},l={path:[`app`,`init`],description:`Create an app from the template bundled with this CLI, without installing anything`,arguments:[{name:`name`,description:`Package name of the app, for example my-app`,required:!0}],options:[{flags:`--path <directory>`,description:`Directory to create (default: ./<name>)`},{flags:`--display-name <name>`,description:`Name shown in Twenty (default: derived from the package name)`},{flags:`--description <text>`,description:`Description shown in Twenty`}],examples:[`twenty app init my-app`,`twenty app init billing --path ./apps/billing --display-name Billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-init-command-BTUiHdOH.cjs"))).runAppInitCommand},u={path:[`app`,`pull`],description:`Pull an app, or create a local project for the workspace custom app`,options:[{flags:`--path <directory>`,description:`App directory, or a new or empty directory for the workspace custom app`},{flags:`--yes`,description:`Create a missing project and install its dependencies without prompting`},{flags:`--verbose`,description:`List coverage details`}],examples:[`twenty app pull --remote dev`,`twenty app pull --path ./apps/billing`,`twenty app pull --path ./workspace-app --yes --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-pull-command-BWbRZPTj.cjs"))).runAppPullCommand},d={path:[`app`,`plan`],description:`Build the app and preview metadata changes without applying them`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0}],examples:[`twenty app plan --remote dev`,`twenty app plan --path ./apps/billing --no-prune --json`,`twenty app plan --prune`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-plan-command-1cb1TuM6.cjs"))).runAppPlanCommand},f={path:[`app`,`translations`,`extract`],description:`Extract app strings and update translation catalogs`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--locale <locale>`,description:`Create a target locale catalog if missing, for example fr-FR`}],examples:[`twenty app translations extract`,`twenty app translations extract --locale fr-FR`,`twenty app translations extract --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-translations-extract-command-LUAa7jb9.cjs"))).runAppTranslationsExtractCommand},p={path:[`app`,`typecheck`],description:`Typecheck the app with its project TypeScript, without building`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app typecheck`,`twenty app typecheck --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-typecheck-command-3ZJqbU8D.cjs"))).runAppTypecheckCommand},m={path:[`app`,`uninstall`],description:`Uninstall the app from the workspace, deleting its objects, fields and their data`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Uninstall the app with this universal identifier, works without a local project`},{flags:`--yes`,description:`Uninstall without asking`}],examples:[`twenty app uninstall --remote dev`,`twenty app uninstall --yes --json`,`twenty app uninstall --universal-identifier <id> --yes`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-uninstall-command-BK-JAeo2.cjs"))).runAppUninstallCommand},h={path:[`auth`,`login`],description:`Sign in with your browser or an API key, and save the remote`,options:[{flags:`--with-token`,description:`Read an API key from standard input`},{flags:`--url <url>`,description:`Twenty server URL, for example https://acme.twenty.com`},{flags:`--name <name>`,description:`Name of the remote to save (defaults to "default")`},{flags:`--use`,description:`Make this remote the default`},{flags:`--replace`,description:`Point an existing remote at a different URL`}],examples:[`twenty auth login --url https://acme.twenty.com`,`twenty auth login --url https://acme.twenty.com --name prod --use`,`printf '%s' "$TWENTY_API_KEY" | twenty auth login --with-token --url https://acme.twenty.com --name prod --use`,`twenty auth login --with-token --remote prod < api-key.txt`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-login-command-CN6Xqgpx.cjs"))).runAuthLoginCommand},g={path:[`auth`,`logout`],description:`Forget the credentials of a saved remote, keeping the remote`,examples:[`twenty auth logout --remote staging`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-logout-command-Dw6CLfIY.cjs"))).runAuthLogoutCommand},_={path:[`auth`,`status`],description:`Show which workspace commands use and check its credentials`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-status-command-CXRrXjvh.cjs"))).runAuthStatusCommand},v={path:[`auth`,`token`],description:`Print the credential commands send, for scripts`,examples:[`curl -H "Authorization: Bearer $(twenty auth token)" https://acme.twenty.com/rest/companies`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-token-command-D4geJ-rx.cjs"))).runAuthTokenCommand},y={path:[`api`,`graphql`],description:`Send a GraphQL query or mutation`,options:[{flags:`--query <query>`,description:`GraphQL document: inline, @file.graphql, or - for standard input`,required:!0},{flags:`--variables <json>`,description:`Variables as a JSON object: inline, @file.json, or - for standard input`},{flags:`--metadata`,description:`Send to the metadata API instead of the core API`}],examples:[`twenty api graphql --query '{ companies(first: 2) { edges { node { name } } } }'`,`twenty api graphql --metadata --query '{ currentWorkspace { displayName } }'`,`twenty api graphql --query @create-company.graphql --variables @variables.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-graphql-command-D-Pu9EdU.cjs"))).runApiGraphqlCommand},b={path:[`api`,`rest`],description:`Send a request to the REST API`,arguments:[{name:`path`,description:`Path under the API URL, for example /rest/companies`,required:!0}],options:[{flags:`-X, --method <method>`,description:`HTTP method, defaults to GET; required with --body`,choices:[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`]},{flags:`--body <json>`,description:`Request body: JSON, @file.json, or - for standard input`}],examples:[`twenty api rest '/rest/companies?limit=5'`,`twenty api rest /rest/companies --method POST --body '{"name":"Linear"}'`,`twenty api rest /rest/companies/<id> --method PATCH --body @changes.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-rest-command-BuDANSQa.cjs"))).runApiRestCommand},x={WORKSPACE:`Workspace:`,APP:`App development:`,TOOLS:`Tools:`},S={path:[`commands`],description:`List the available commands`,helpGroup:x.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-commands-command-BrwpnI-3.cjs"))).runCommandsCommand},C={path:[`data`,`get`],description:`Inspect a record by id`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0},{name:`id`,description:`Record id`,required:!0}],examples:[`twenty data get companies <id>`,`twenty data get people <id> --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-get-command-BD7i13MO.cjs"))).runDataGetCommand},w={path:[`data`,`list`],description:`List records with REST filters and pagination`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--filter <expression>`,description:`REST filter expression, passed through unchanged`},{flags:`--order-by <expression>`,description:`REST order_by expression, passed through unchanged`},{flags:`--fields <names>`,description:`Comma-separated human table columns; JSON and NDJSON retain full records`},{flags:`--limit <count>`,description:`Records per page, 1–200 (default: 50)`},{flags:`--cursor <cursor>`,description:`Start after this opaque REST cursor`},{flags:`--all`,description:`Read every remaining page, bounded unless --format ndjson is used`}],examples:[`twenty data list companies --limit 20`,`twenty data list companies --filter 'employees[gte]:5000' --order-by 'employees[DescNullsLast]'`,`twenty data list people --all --format ndjson`],outputModes:[`human`,`json`,`ndjson`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-list-command-tcCgbeZj.cjs"))).runDataListCommand},T={path:[`doctor`],description:`Diagnose CLI, app SDK and workspace connection problems`,helpGroup:x.TOOLS,options:[{flags:`--path <directory>`,description:`App directory to inspect`},{flags:`--offline`,description:`Skip network checks`}],examples:[`twenty doctor`,`twenty doctor --remote staging --path ./my-app --json`,`twenty doctor --offline`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-doctor-command-DmZ3dKc7.cjs"))).runDoctorCommand},E={path:[`metadata`,`object`,`describe`],description:`Describe an object`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],examples:[`twenty metadata object describe companies`,`twenty metadata object describe person --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-describe-command-CWYI0V42.cjs"))).runMetadataObjectDescribeCommand},D={path:[`metadata`,`field`,`list`],description:`List fields and who owns each one`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--all`,description:`Include system fields`}],examples:[`twenty metadata field list companies`,`twenty metadata field list companies --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-list-command-BVFDiJv2.cjs"))).runMetadataFieldListCommand},O={path:[`metadata`,`field`,`describe`],description:`Describe a field, its constraints, options and relations`,arguments:[{name:`object`,description:`Exact singular or plural object API name`,required:!0},{name:`field`,description:`Exact field API name, including system fields`,required:!0}],examples:[`twenty metadata field describe companies tier`,`twenty metadata field describe people company --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-describe-command-BX5_s1m0.cjs"))).runMetadataFieldDescribeCommand},k={path:[`metadata`,`object`,`list`],description:`List objects and who owns each one`,options:[{flags:`--all`,description:`Include system objects`}],examples:[`twenty metadata object list`,`twenty metadata object list --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-list-command-Y3yebZrT.cjs"))).runMetadataObjectListCommand},A={path:[`open`],description:`Open the workspace in your browser`,helpGroup:x.WORKSPACE,arguments:[{name:`page`,description:`Page to open, for example settings/applications`,required:!1}],options:[{flags:`--url-only`,description:`Print the address instead of opening a browser`}],examples:[`twenty open`,`twenty open settings/applications`,`twenty open --remote staging --url-only --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-open-command-BUEQSKSk.cjs"))).runOpenCommand},j={path:[`remote`,`list`],description:`List saved remotes`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-list-command-BExGjyKO.cjs"))).runRemoteListCommand},M={path:[`remote`,`remove`],description:`Remove a saved remote and its credentials`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-remove-command-D2thQnCU.cjs"))).runRemoteRemoveCommand},N={path:[`remote`,`rename`],description:`Rename a saved remote`,arguments:[{name:`current`,description:`Current name`,required:!0},{name:`new`,description:`New name`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-rename-command-DI0Adm5U.cjs"))).runRemoteRenameCommand},P={path:[`remote`,`use`],description:`Make a saved remote the default`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-use-command-CXnu5zDY.cjs"))).runRemoteUseCommand},F={path:[`version`],description:`Print version information`,helpGroup:x.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-version-command-BxhaecEo.cjs"))).runVersionCommand},I=[r,s,n,i,o,c,a,l,d,u,t,f,p,e,m,h,g,_,v,j,P,N,M,y,b,S,w,C,T,k,E,D,O,A,F],L=e=>e.path.join(` `),R={JSON:`--json`,FORMAT:`--format <format>`,REMOTE:`-r, --remote <name>`,NO_INPUT:`--no-input`,HELP:`-h, --help`,VERSION:`-v, --version`};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return R}});
|
|
1
|
+
var e={path:[`app`,`install`],description:`Install a registered app package in the target workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Registered app universal identifier, works without a local project`}],examples:[`twenty app install --remote dev`,`twenty app install --path ./apps/billing --json`,`twenty app install --universal-identifier <id> --remote staging --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-install-command-DOzp9bOL.cjs"))).runAppInstallCommand},t={path:[`app`,`publish`],description:`Build and publish the app to npm or a private Twenty registry`,options:[{flags:`--private`,description:`Publish to a Twenty server registry using --remote or the active target`},{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--tag <tag>`,description:`npm dist-tag, for example beta or next`}],examples:[`twenty app publish`,`twenty app publish --private --remote dev`,`twenty app publish --path ./apps/billing --tag beta --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-publish-command-CoGrZA2a.cjs"))).runAppPublishCommand},n={path:[`app`,`dev`],description:`Watch app source, build complete snapshots and sync changes to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Allow registering and installing an app with no registration`},{flags:`--yes`,description:`Allow object and field deletions without asking`}],examples:[`twenty app dev --remote dev`,`twenty app dev --create --no-prune`,`twenty app dev --format ndjson --no-prune`],outputModes:[`human`,`ndjson`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-dev-command-BnSJIUgg.cjs"))).runAppDevCommand},r={path:[`app`,`add`],description:`Add an object, field, logic function or front component to an app`,arguments:[{name:`entity`,description:`object, field, logic-function or front-component (prompted when omitted)`,required:!1}],options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Definition name; also determines the generated filename`},{flags:`--create-view`,description:`Create a table view for the new object`},{flags:`--create-navigation-menu-item`,description:`Create a navigation menu item for the new object`},{flags:`--create-page-layout`,description:`Create a record page layout and its fields view for the new object`},{flags:`--name-plural <name>`,description:`Plural API name (object)`},{flags:`--label <label>`,description:`Display label (object or field; default: derived from name)`},{flags:`--label-plural <label>`,description:`Plural display label (object; default: derived from plural name)`},{flags:`--type <type>`,description:`Field type, for example TEXT, NUMBER or RELATION (default: TEXT)`},{flags:`--object <uuid>`,description:`Parent object universal identifier (field)`},{flags:`--description <text>`,description:`Field description`},{flags:`--target-object <uuid>`,description:`Target object universal identifier (relation field)`},{flags:`--target-field <uuid>`,description:`Target field universal identifier (relation field)`},{flags:`--relation-type <type>`,description:`ONE_TO_MANY or MANY_TO_ONE (relation field; default: ONE_TO_MANY)`},{flags:`--on-delete <action>`,description:`CASCADE, RESTRICT, SET_NULL, NO_ACTION or None (relation field; default: CASCADE)`}],examples:[`twenty app add`,`twenty app add object --name invoice --name-plural invoices --no-input`,`twenty app add object --name invoice --name-plural invoices --create-view --create-navigation-menu-item --create-page-layout --no-input`,`twenty app add field --name amount --type NUMBER --object <object-universal-identifier> --json`,`twenty app add logic-function --name send-invoice --no-input`,`twenty app add front-component --name invoice-panel --no-input`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-add-command-C0b2LVQN.cjs"))).runAppAddCommand},i={path:[`app`,`exec`],description:`Execute a deployed app logic function as the signed-in user`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Exact deployed function name`},{flags:`--universal-identifier <id>`,description:`Function universal identifier`},{flags:`--post-install`,description:`Execute the post-install hook without installing the app`},{flags:`--pre-install`,description:`Execute the pre-install hook without installing the app`},{flags:`--uninstall-hook`,description:`Execute the uninstall hook without uninstalling the app`},{flags:`--payload <json>`,description:`JSON object, @file or - for stdin (default: {})`}],examples:[`twenty app exec --name add-numbers --remote dev`,`twenty app exec --name add-numbers --payload @payload.json --json`,`twenty app exec --post-install --payload '{}'`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-exec-command-BPlfFt9-.cjs"))).runAppExecCommand},a={path:[`app`,`generate-client`],description:`Regenerate the app's typed API client from the workspace schema, without building or syncing`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app generate-client --remote dev`,`twenty app generate-client --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-app-generate-client-command-7t5Hs10P.cjs"))).runAppGenerateClientCommand},o={path:[`app`,`logs`],description:`Watch new logic-function logs from this app`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--name <name>`,description:`Filter all functions with this exact name within the app`},{flags:`--universal-identifier <id>`,description:`Filter one function by universal identifier`}],examples:[`twenty app logs --remote dev`,`twenty app logs --name add-numbers --remote dev`,`twenty app logs --format ndjson`],outputModes:[`human`,`ndjson`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`WORKFLOWS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-logs-command-CQDO_gce.cjs"))).runAppLogsCommand},s={path:[`app`,`apply`],description:`Build the app, preview the changes, then upload and sync it to the workspace`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0},{flags:`--create`,description:`Register the app and install it in the workspace if it has no registration yet`},{flags:`--yes`,description:`Apply object and field deletions without asking; does not change which entities are deleted`}],examples:[`twenty app apply --remote dev`,`twenty app apply --create --json`,`twenty app apply --no-prune`,`twenty app apply --prune`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-apply-command-CilkY9ws.cjs"))).runAppApplyCommand},c={path:[`app`,`build`],description:`Build the app with the CLI and report the artifacts`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app build`,`twenty app build --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-build-command-DaKa_eKF.cjs"))).runAppBuildCommand},l={path:[`app`,`init`],description:`Create an app from the template bundled with this CLI, without installing anything`,arguments:[{name:`name`,description:`Package name of the app, for example my-app`,required:!0}],options:[{flags:`--path <directory>`,description:`Directory to create (default: ./<name>)`},{flags:`--display-name <name>`,description:`Name shown in Twenty (default: derived from the package name)`},{flags:`--description <text>`,description:`Description shown in Twenty`}],examples:[`twenty app init my-app`,`twenty app init billing --path ./apps/billing --display-name Billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-init-command-DhPC_GBU.cjs"))).runAppInitCommand},u={path:[`app`,`pull`],description:`Pull an app, or create a local project for the workspace custom app`,options:[{flags:`--path <directory>`,description:`App directory, or a new or empty directory for the workspace custom app`},{flags:`--yes`,description:`Create a missing project and install its dependencies without prompting`},{flags:`--verbose`,description:`List coverage details`}],examples:[`twenty app pull --remote dev`,`twenty app pull --path ./apps/billing`,`twenty app pull --path ./workspace-app --yes --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-pull-command-gUX-w9BE.cjs"))).runAppPullCommand},d={path:[`app`,`plan`],description:`Build the app and preview metadata changes without applying them`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--prune`,description:`Delete remote entities missing from the app source (the default, except for the workspace custom application)`},{flags:`--no-prune`,description:`Keep remote entities missing from the app source`},{flags:`--no-delete`,description:`Deprecated alias of --no-prune`,hidden:!0}],examples:[`twenty app plan --remote dev`,`twenty app plan --path ./apps/billing --no-prune --json`,`twenty app plan --prune`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-plan-command-Bt3IwVec.cjs"))).runAppPlanCommand},f={path:[`app`,`translations`,`extract`],description:`Extract app strings and update translation catalogs`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--locale <locale>`,description:`Create a target locale catalog if missing, for example fr-FR`}],examples:[`twenty app translations extract`,`twenty app translations extract --locale fr-FR`,`twenty app translations extract --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-translations-extract-command-LUAa7jb9.cjs"))).runAppTranslationsExtractCommand},p={path:[`app`,`typecheck`],description:`Typecheck the app with its project TypeScript, without building`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`}],examples:[`twenty app typecheck`,`twenty app typecheck --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-app-typecheck-command-CbHawvU8.cjs"))).runAppTypecheckCommand},m={path:[`app`,`uninstall`],description:`Uninstall the app from the workspace, deleting its objects, fields and their data`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <id>`,description:`Uninstall the app with this universal identifier, works without a local project`},{flags:`--yes`,description:`Uninstall without asking`}],examples:[`twenty app uninstall --remote dev`,`twenty app uninstall --yes --json`,`twenty app uninstall --universal-identifier <id> --yes`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-uninstall-command-BK-JAeo2.cjs"))).runAppUninstallCommand},h={path:[`auth`,`login`],description:`Sign in with your browser or an API key, and save the remote`,options:[{flags:`--with-token`,description:`Read an API key from standard input`},{flags:`--url <url>`,description:`Twenty server URL, for example https://acme.twenty.com`},{flags:`--name <name>`,description:`Name of the remote to save (defaults to "default")`},{flags:`--use`,description:`Make this remote the default`},{flags:`--replace`,description:`Point an existing remote at a different URL`}],examples:[`twenty auth login --url https://acme.twenty.com`,`twenty auth login --url https://acme.twenty.com --name prod --use`,`printf '%s' "$TWENTY_API_KEY" | twenty auth login --with-token --url https://acme.twenty.com --name prod --use`,`twenty auth login --with-token --remote prod < api-key.txt`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-login-command-CN6Xqgpx.cjs"))).runAuthLoginCommand},g={path:[`auth`,`logout`],description:`Forget the credentials of a saved remote, keeping the remote`,examples:[`twenty auth logout --remote staging`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-logout-command-Dw6CLfIY.cjs"))).runAuthLogoutCommand},_={path:[`auth`,`status`],description:`Show which workspace commands use and check its credentials`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-status-command-CXRrXjvh.cjs"))).runAuthStatusCommand},v={path:[`auth`,`token`],description:`Print the credential commands send, for scripts`,examples:[`curl -H "Authorization: Bearer $(twenty auth token)" https://acme.twenty.com/rest/companies`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-auth-token-command-D4geJ-rx.cjs"))).runAuthTokenCommand},y={path:[`api`,`graphql`],description:`Send a GraphQL query or mutation`,options:[{flags:`--query <query>`,description:`GraphQL document: inline, @file.graphql, or - for standard input`,required:!0},{flags:`--variables <json>`,description:`Variables as a JSON object: inline, @file.json, or - for standard input`},{flags:`--metadata`,description:`Send to the metadata API instead of the core API`}],examples:[`twenty api graphql --query '{ companies(first: 2) { edges { node { name } } } }'`,`twenty api graphql --metadata --query '{ currentWorkspace { displayName } }'`,`twenty api graphql --query @create-company.graphql --variables @variables.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-graphql-command-D-Pu9EdU.cjs"))).runApiGraphqlCommand},b={path:[`api`,`rest`],description:`Send a request to the REST API`,arguments:[{name:`path`,description:`Path under the API URL, for example /rest/companies`,required:!0}],options:[{flags:`-X, --method <method>`,description:`HTTP method, defaults to GET; required with --body`,choices:[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`]},{flags:`--body <json>`,description:`Request body: JSON, @file.json, or - for standard input`}],examples:[`twenty api rest '/rest/companies?limit=5'`,`twenty api rest /rest/companies --method POST --body '{"name":"Linear"}'`,`twenty api rest /rest/companies/<id> --method PATCH --body @changes.json`],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-api-rest-command-BuDANSQa.cjs"))).runApiRestCommand},x={WORKSPACE:`Workspace:`,APP:`App development:`,TOOLS:`Tools:`},S={path:[`commands`],description:`List the available commands`,helpGroup:x.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-commands-command-CLTVI96u.cjs"))).runCommandsCommand},C={path:[`data`,`get`],description:`Inspect a record by id`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0},{name:`id`,description:`Record id`,required:!0}],examples:[`twenty data get companies <id>`,`twenty data get people <id> --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-get-command-BD7i13MO.cjs"))).runDataGetCommand},w={path:[`data`,`list`],description:`List records with REST filters and pagination`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--filter <expression>`,description:`REST filter expression, passed through unchanged`},{flags:`--order-by <expression>`,description:`REST order_by expression, passed through unchanged`},{flags:`--fields <names>`,description:`Comma-separated human table columns; JSON and NDJSON retain full records`},{flags:`--limit <count>`,description:`Records per page, 1–200 (default: 50)`},{flags:`--cursor <cursor>`,description:`Start after this opaque REST cursor`},{flags:`--all`,description:`Read every remaining page, bounded unless --format ndjson is used`}],examples:[`twenty data list companies --limit 20`,`twenty data list companies --filter 'employees[gte]:5000' --order-by 'employees[DescNullsLast]'`,`twenty data list people --all --format ndjson`],outputModes:[`human`,`json`,`ndjson`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-data-list-command-tcCgbeZj.cjs"))).runDataListCommand},T={path:[`doctor`],description:`Diagnose CLI, app SDK and workspace connection problems`,helpGroup:x.TOOLS,options:[{flags:`--path <directory>`,description:`App directory to inspect`},{flags:`--offline`,description:`Skip network checks`}],examples:[`twenty doctor`,`twenty doctor --remote staging --path ./my-app --json`,`twenty doctor --offline`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-doctor-command-CDKbN2os.cjs"))).runDoctorCommand},E={path:[`metadata`,`object`,`describe`],description:`Describe an object`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],examples:[`twenty metadata object describe companies`,`twenty metadata object describe person --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-describe-command-CWYI0V42.cjs"))).runMetadataObjectDescribeCommand},D={path:[`metadata`,`field`,`list`],description:`List fields and who owns each one`,arguments:[{name:`object`,description:`Exact singular or plural API name`,required:!0}],options:[{flags:`--all`,description:`Include system fields`}],examples:[`twenty metadata field list companies`,`twenty metadata field list companies --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-list-command-BVFDiJv2.cjs"))).runMetadataFieldListCommand},O={path:[`metadata`,`field`,`describe`],description:`Describe a field, its constraints, options and relations`,arguments:[{name:`object`,description:`Exact singular or plural object API name`,required:!0},{name:`field`,description:`Exact field API name, including system fields`,required:!0}],examples:[`twenty metadata field describe companies tier`,`twenty metadata field describe people company --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-field-describe-command-BX5_s1m0.cjs"))).runMetadataFieldDescribeCommand},k={path:[`metadata`,`object`,`list`],description:`List objects and who owns each one`,options:[{flags:`--all`,description:`Include system objects`}],examples:[`twenty metadata object list`,`twenty metadata object list --all --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-metadata-object-list-command-Y3yebZrT.cjs"))).runMetadataObjectListCommand},A={path:[`open`],description:`Open the workspace in your browser`,helpGroup:x.WORKSPACE,arguments:[{name:`page`,description:`Page to open, for example settings/applications`,required:!1}],options:[{flags:`--url-only`,description:`Print the address instead of opening a browser`}],examples:[`twenty open`,`twenty open settings/applications`,`twenty open --remote staging --url-only --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!0,load:async()=>(await Promise.resolve().then(()=>require("./run-open-command-BUEQSKSk.cjs"))).runOpenCommand},j={path:[`remote`,`list`],description:`List saved remotes`,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-list-command-BExGjyKO.cjs"))).runRemoteListCommand},M={path:[`remote`,`remove`],description:`Remove a saved remote and its credentials`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-remove-command-D2thQnCU.cjs"))).runRemoteRemoveCommand},N={path:[`remote`,`rename`],description:`Rename a saved remote`,arguments:[{name:`current`,description:`Current name`,required:!0},{name:`new`,description:`New name`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-rename-command-DI0Adm5U.cjs"))).runRemoteRenameCommand},P={path:[`remote`,`use`],description:`Make a saved remote the default`,arguments:[{name:`name`,description:`Saved remote`,required:!0}],outputModes:[`human`,`json`],writes:!0,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-remote-use-command-CXnu5zDY.cjs"))).runRemoteUseCommand},F={path:[`version`],description:`Print version information`,helpGroup:x.TOOLS,outputModes:[`human`,`json`],writes:!1,needsProject:!1,needsTarget:!1,load:async()=>(await Promise.resolve().then(()=>require("./run-version-command-Brk-Nbh7.cjs"))).runVersionCommand},I=[r,s,n,i,o,c,a,l,d,u,t,f,p,e,m,h,g,_,v,j,P,N,M,y,b,S,w,C,T,k,E,D,O,A,F],L=e=>e.path.join(` `),R={JSON:`--json`,FORMAT:`--format <format>`,REMOTE:`-r, --remote <name>`,NO_INPUT:`--no-input`,HELP:`-h, --help`,VERSION:`-v, --version`};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return R}});
|
package/dist/chunks/{is-valid-package-name-Ij_K6iEL.cjs → is-valid-package-name-9YIecMQm.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./valid-DnUN-PQ0.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./has-error-code-DsJeqbZq.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./print-typescript-value-ChOUZ7Mm.cjs"),s=require("./cli-version.constant-M53Gu1CK.cjs");let c=require("node:crypto"),l=require("node:fs/promises"),u=require("node:path"),d=require("node:fs");var f=`2.54.0`,p=[`twenty-client-sdk`,`twenty-sdk`,`twenty-ui`],m=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n=!1)=>{if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}})),h=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),g=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),_=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n,i,a)=>{typeof n==`string`&&(a=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,a).version}catch{return null}}})),v=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l)return!c.patch&&!c.minor?`major`:s.patch?`patch`:s.minor?`minor`:`major`;let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),y=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).major})),b=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).minor})),x=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).patch})),S=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),C=e.t(((e,n)=>{var r=t.m();n.exports=(e,t,n)=>r(t,e,n)})),w=e.t(((e,n)=>{var r=t.m();n.exports=(e,t)=>r(e,t,!0)})),T=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n)=>{let i=new r(e,n),a=new r(t,n);return i.compare(a)||i.compareBuild(a)}})),E=e.t(((e,t)=>{var n=T();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),D=e.t(((e,t)=>{var n=T();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),O=e.t(((e,n)=>{var r=t.h(),i=m(),{safeRe:a,t:o}=t._();n.exports=(e,t)=>{if(e instanceof r)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?a[o.COERCEFULL]:a[o.COERCE]);else{let r=t.includePrerelease?a[o.COERCERTLFULL]:a[o.COERCERTL],i;for(;(i=r.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||i.index+i[0].length!==n.index+n[0].length)&&(n=i),r.lastIndex=i.index+i[1].length+i[2].length;r.lastIndex=-1}if(n===null)return null;let s=n[2];return i(`${s}.${n[3]||`0`}.${n[4]||`0`}${t.includePrerelease&&n[5]?`-${n[5]}`:``}${t.includePrerelease&&n[6]?`+${n[6]}`:``}`,t)}})),k=e.t(((e,n)=>{var r=t.a();n.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),A=e.t(((e,n)=>{var r=t.h(),i=t.a();n.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new r(a,n))}),a}})),j=e.t(((e,n)=>{var r=t.h(),i=t.a();n.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new r(a,n))}),a}})),M=e.t(((e,n)=>{var r=t.h(),i=t.a(),a=t.d();n.exports=(e,t)=>{e=new i(e,t);let n=new r(`0.0.0`);if(e.test(n)||(n=new r(`0.0.0-0`),e.test(n)))return n;n=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],o=null;i.forEach(e=>{let t=new r(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||a(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!n||a(n,o))&&(n=o)}return n&&e.test(n)?n:null}})),N=e.t(((e,n)=>{var r=t.r();n.exports=(e,t,n)=>r(e,t,`>`,n)})),P=e.t(((e,n)=>{var r=t.a();n.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))})),F=e.t(((e,n)=>{var r=t.i(),i=t.m();n.exports=(e,t,n)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>i(e,t,n));for(let e of c)r(e,t,n)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),I=e.t(((e,n)=>{var r=t.a(),i=t.o(),{ANY:a}=i,o=t.i(),s=t.m(),c=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;OUTER:for(let r of e.set){for(let e of t.set){let t=d(r,e,n);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},l=[new i(`>=0.0.0-0`)],u=[new i(`>=0.0.0`)],d=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===a){if(t.length===1&&t[0].semver===a)return!0;e=n.includePrerelease?l:u}if(t.length===1&&t[0].semver===a){if(n.includePrerelease)return!0;t=u}let r=new Set,i,c;for(let t of e)t.operator===`>`||t.operator===`>=`?i=f(i,t,n):t.operator===`<`||t.operator===`<=`?c=p(c,t,n):r.add(t.semver);if(r.size>1)return null;let d;if(i&&c&&(d=s(i.semver,c.semver,n),d>0||d===0&&(i.operator!==`>=`||c.operator!==`<=`)))return null;for(let e of r){if(i&&!o(e,String(i),n)||c&&!o(e,String(c),n))return null;for(let r of t)if(!o(e,String(r),n))return!1;return!0}let m,h,g,_,v=c&&!n.includePrerelease&&c.semver.prerelease.length?c.semver:!1,y=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&c.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,i){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=f(i,e,n),m===e&&m!==i)return!1}else if(i.operator===`>=`&&!o(i.semver,String(e),n))return!1}if(c){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=p(c,e,n),h===e&&h!==c)return!1}else if(c.operator===`<=`&&!o(c.semver,String(e),n))return!1}if(!e.operator&&(c||i)&&d!==0)return!1}return!(i&&g&&!c&&d!==0||c&&_&&!i&&d!==0||y||v)},f=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},p=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};n.exports=c})),L=e.t(((e,n)=>{var r=t._(),i=t.v(),a=t.h(),o=t.g();n.exports={parse:m(),valid:h(),clean:g(),inc:_(),diff:v(),major:y(),minor:b(),patch:x(),prerelease:S(),compare:t.m(),rcompare:C(),compareLoose:w(),compareBuild:T(),sort:E(),rsort:D(),gt:t.d(),lt:t.l(),eq:t.p(),neq:t.f(),gte:t.u(),lte:t.c(),cmp:t.s(),coerce:O(),Comparator:t.o(),Range:t.a(),satisfies:t.i(),toComparators:k(),maxSatisfying:A(),minSatisfying:j(),minVersion:M(),validRange:t.t(),outside:t.r(),gtr:N(),ltr:t.n(),intersects:P(),simplifyRange:F(),subset:I(),SemVer:a,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}})),R=e.r(L()),z=()=>(0,u.join)((0,u.dirname)((0,d.realpathSync)(process.argv[1]??``)),`app-template`),B=async({appDirectory:e,appName:t,appDisplayName:n,appDescription:r,shouldIncludeExample:i=!0})=>{let a=z(),d=(0,u.join)(a,`example`);await(0,l.cp)(a,e,{recursive:!0,filter:e=>e!==d}),i&&await(0,l.cp)((0,u.join)(d,`files`),e,{recursive:!0}),await(0,l.writeFile)((0,u.join)(e,`yarn.lock`),``,{flag:`a`});for(let[t,n]of[[`gitignore`,`.gitignore`],[`yarnrc.yml`,`.yarnrc.yml`]])await(0,l.rename)((0,u.join)(e,t),(0,u.join)(e,n));if(i){await(0,l.rename)((0,u.join)(e,`github`),(0,u.join)(e,`.github`)),await(0,l.cp)((0,u.join)(e,`AGENTS.md`),(0,u.join)(e,`CLAUDE.md`));for(let t of[`ci.yml`,`cd.yml`,`publish.yml`]){let n=(0,u.join)(e,`.github`,`workflows`,t);await(0,l.writeFile)(n,(await(0,l.readFile)(n,`utf8`)).replaceAll(`CLI-VERSION-TO-BE-GENERATED`,s.t))}let t=(0,u.join)(e,`src/constants/universal-identifiers.ts`);await(0,l.writeFile)(t,(await(0,l.readFile)(t,`utf8`)).replace(/'DISPLAY-NAME-TO-BE-GENERATED'/g,()=>o.t({value:n})).replace(/'DESCRIPTION-TO-BE-GENERATED'/g,()=>o.t({value:r})).replace(/UUID-TO-BE-GENERATED/g,()=>(0,c.randomUUID)()))}let m=(0,u.join)(e,`package.json`),h=JSON.parse(await(0,l.readFile)(m,`utf8`));h.name=t,h.engines.twenty=`>=${R.default.major(f)}.${R.default.minor(f)}.0`;for(let e of p)h.devDependencies[e]=f;if(i){let e=JSON.parse(await(0,l.readFile)((0,u.join)(d,`scripts.json`),`utf8`));h.scripts={...h.scripts,...e}}await(0,l.writeFile)(m,JSON.stringify(h,null,2))},V=`TO-BE-GENERATED`,H=`yarn.lock`,U=({appDirectory:e,reason:t})=>new a.t({code:`APP_PATH_UNAVAILABLE`,exitCode:a.n.CONFLICT,message:`${e} already exists and ${t}.`,hint:`Choose another app name, or pass --path with a new or empty directory.`,details:{path:e}}),W=async e=>{let t=await(0,l.stat)(e).catch(e=>{if(!i.t(e,`ENOENT`))throw e});if(!r.t(t))return`missing`;if(!t.isDirectory())throw U({appDirectory:e,reason:`is not a directory`});if(n.n(await(0,l.readdir)(e)))throw U({appDirectory:e,reason:`is not empty`});return`empty`},G=async e=>{let t=await(0,l.readdir)(e,{recursive:!0,withFileTypes:!0}),n=[];for(let r of t){let t=(0,u.join)(r.parentPath,r.name),i=(0,u.relative)(e,t);r.isFile()&&i!==H&&(await(0,l.readFile)(t,`utf8`)).includes(V)&&n.push(i)}return n},K=async({stagingDirectory:e,appDirectory:t})=>{let n=[];try{for(let r of await(0,l.readdir)(e,{recursive:!0,withFileTypes:!0})){let i=(0,u.join)(r.parentPath,r.name),a=(0,u.join)(t,(0,u.relative)(e,i));r.isDirectory()?await(0,l.mkdir)(a):await(0,l.copyFile)(i,a,d.constants.COPYFILE_EXCL),n.push({createdPath:a,isDirectory:r.isDirectory()})}}catch(e){for(let{createdPath:e,isDirectory:t}of n.reverse())await(t?(0,l.rmdir)(e):(0,l.unlink)(e)).catch(()=>void 0);throw e}await(0,l.rm)(e,{recursive:!0,force:!0})},q=async({appDirectory:e,appName:t,appDisplayName:r,appDescription:i,shouldIncludeExample:o=!0,signal:s})=>{await W(e);let c=(0,u.dirname)(e);await(0,l.mkdir)(c,{recursive:!0});let d=await(0,l.mkdtemp)((0,u.join)(c,`.${(0,u.basename)(e)}-`));try{await B({appName:t,appDisplayName:r,appDescription:i,shouldIncludeExample:o,appDirectory:d}),s.throwIfAborted();let c=await G(d);if(n.n(c))throw new a.t({code:`APP_INIT_FAILED`,message:`The app template still has placeholders in ${c.join(`, `)}.`,hint:`This CLI ships an app template it cannot render. Upgrade the twenty CLI.`,details:{unrenderedFiles:c}});s.throwIfAborted(),await W(e)===`empty`?await K({stagingDirectory:d,appDirectory:e}):await(0,l.rename)(d,e)}catch(t){throw await(0,l.rm)(d,{recursive:!0,force:!0}),t instanceof a.t||s.aborted?t:new a.t({code:`APP_INIT_FAILED`,message:`Could not create ${e}: ${t instanceof Error?t.message:String(t)}`,hint:`Files this command had written there were removed. Fix the cause, then run the command again.`,details:{path:e}})}},J=/^(?:@[a-z0-9~-][a-z0-9._~-]*\/)?[a-z0-9~-][a-z0-9._~-]*$/,Y=214,X=e=>e.length<=Y&&![`node_modules`,`favicon.ico`].includes(e)&&J.test(e);Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}});
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./valid-DnUN-PQ0.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./has-error-code-DsJeqbZq.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./print-typescript-value-ChOUZ7Mm.cjs"),s=require("./cli-version.constant-BRiLR-nG.cjs");let c=require("node:crypto"),l=require("node:fs/promises"),u=require("node:path"),d=require("node:fs");var f=`2.54.3`,p=[`twenty-client-sdk`,`twenty-sdk`,`twenty-ui`],m=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n=!1)=>{if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}})),h=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),g=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),_=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n,i,a)=>{typeof n==`string`&&(a=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,a).version}catch{return null}}})),v=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l)return!c.patch&&!c.minor?`major`:s.patch?`patch`:s.minor?`minor`:`major`;let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),y=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).major})),b=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).minor})),x=e.t(((e,n)=>{var r=t.h();n.exports=(e,t)=>new r(e,t).patch})),S=e.t(((e,t)=>{var n=m();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),C=e.t(((e,n)=>{var r=t.m();n.exports=(e,t,n)=>r(t,e,n)})),w=e.t(((e,n)=>{var r=t.m();n.exports=(e,t)=>r(e,t,!0)})),T=e.t(((e,n)=>{var r=t.h();n.exports=(e,t,n)=>{let i=new r(e,n),a=new r(t,n);return i.compare(a)||i.compareBuild(a)}})),E=e.t(((e,t)=>{var n=T();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),D=e.t(((e,t)=>{var n=T();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),O=e.t(((e,n)=>{var r=t.h(),i=m(),{safeRe:a,t:o}=t._();n.exports=(e,t)=>{if(e instanceof r)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?a[o.COERCEFULL]:a[o.COERCE]);else{let r=t.includePrerelease?a[o.COERCERTLFULL]:a[o.COERCERTL],i;for(;(i=r.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||i.index+i[0].length!==n.index+n[0].length)&&(n=i),r.lastIndex=i.index+i[1].length+i[2].length;r.lastIndex=-1}if(n===null)return null;let s=n[2];return i(`${s}.${n[3]||`0`}.${n[4]||`0`}${t.includePrerelease&&n[5]?`-${n[5]}`:``}${t.includePrerelease&&n[6]?`+${n[6]}`:``}`,t)}})),k=e.t(((e,n)=>{var r=t.a();n.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),A=e.t(((e,n)=>{var r=t.h(),i=t.a();n.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new r(a,n))}),a}})),j=e.t(((e,n)=>{var r=t.h(),i=t.a();n.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new r(a,n))}),a}})),M=e.t(((e,n)=>{var r=t.h(),i=t.a(),a=t.d();n.exports=(e,t)=>{e=new i(e,t);let n=new r(`0.0.0`);if(e.test(n)||(n=new r(`0.0.0-0`),e.test(n)))return n;n=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],o=null;i.forEach(e=>{let t=new r(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||a(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!n||a(n,o))&&(n=o)}return n&&e.test(n)?n:null}})),N=e.t(((e,n)=>{var r=t.r();n.exports=(e,t,n)=>r(e,t,`>`,n)})),P=e.t(((e,n)=>{var r=t.a();n.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))})),F=e.t(((e,n)=>{var r=t.i(),i=t.m();n.exports=(e,t,n)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>i(e,t,n));for(let e of c)r(e,t,n)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),I=e.t(((e,n)=>{var r=t.a(),i=t.o(),{ANY:a}=i,o=t.i(),s=t.m(),c=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;OUTER:for(let r of e.set){for(let e of t.set){let t=d(r,e,n);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},l=[new i(`>=0.0.0-0`)],u=[new i(`>=0.0.0`)],d=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===a){if(t.length===1&&t[0].semver===a)return!0;e=n.includePrerelease?l:u}if(t.length===1&&t[0].semver===a){if(n.includePrerelease)return!0;t=u}let r=new Set,i,c;for(let t of e)t.operator===`>`||t.operator===`>=`?i=f(i,t,n):t.operator===`<`||t.operator===`<=`?c=p(c,t,n):r.add(t.semver);if(r.size>1)return null;let d;if(i&&c&&(d=s(i.semver,c.semver,n),d>0||d===0&&(i.operator!==`>=`||c.operator!==`<=`)))return null;for(let e of r){if(i&&!o(e,String(i),n)||c&&!o(e,String(c),n))return null;for(let r of t)if(!o(e,String(r),n))return!1;return!0}let m,h,g,_,v=c&&!n.includePrerelease&&c.semver.prerelease.length?c.semver:!1,y=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&c.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,i){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=f(i,e,n),m===e&&m!==i)return!1}else if(i.operator===`>=`&&!o(i.semver,String(e),n))return!1}if(c){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=p(c,e,n),h===e&&h!==c)return!1}else if(c.operator===`<=`&&!o(c.semver,String(e),n))return!1}if(!e.operator&&(c||i)&&d!==0)return!1}return!(i&&g&&!c&&d!==0||c&&_&&!i&&d!==0||y||v)},f=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},p=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};n.exports=c})),L=e.t(((e,n)=>{var r=t._(),i=t.v(),a=t.h(),o=t.g();n.exports={parse:m(),valid:h(),clean:g(),inc:_(),diff:v(),major:y(),minor:b(),patch:x(),prerelease:S(),compare:t.m(),rcompare:C(),compareLoose:w(),compareBuild:T(),sort:E(),rsort:D(),gt:t.d(),lt:t.l(),eq:t.p(),neq:t.f(),gte:t.u(),lte:t.c(),cmp:t.s(),coerce:O(),Comparator:t.o(),Range:t.a(),satisfies:t.i(),toComparators:k(),maxSatisfying:A(),minSatisfying:j(),minVersion:M(),validRange:t.t(),outside:t.r(),gtr:N(),ltr:t.n(),intersects:P(),simplifyRange:F(),subset:I(),SemVer:a,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}})),R=e.r(L()),z=()=>(0,u.join)((0,u.dirname)((0,d.realpathSync)(process.argv[1]??``)),`app-template`),B=async({appDirectory:e,appName:t,appDisplayName:n,appDescription:r,shouldIncludeExample:i=!0})=>{let a=z(),d=(0,u.join)(a,`example`);await(0,l.cp)(a,e,{recursive:!0,filter:e=>e!==d}),i&&await(0,l.cp)((0,u.join)(d,`files`),e,{recursive:!0}),await(0,l.writeFile)((0,u.join)(e,`yarn.lock`),``,{flag:`a`});for(let[t,n]of[[`gitignore`,`.gitignore`],[`yarnrc.yml`,`.yarnrc.yml`]])await(0,l.rename)((0,u.join)(e,t),(0,u.join)(e,n));if(i){await(0,l.rename)((0,u.join)(e,`github`),(0,u.join)(e,`.github`)),await(0,l.cp)((0,u.join)(e,`AGENTS.md`),(0,u.join)(e,`CLAUDE.md`));for(let t of[`ci.yml`,`cd.yml`,`publish.yml`]){let n=(0,u.join)(e,`.github`,`workflows`,t);await(0,l.writeFile)(n,(await(0,l.readFile)(n,`utf8`)).replaceAll(`CLI-VERSION-TO-BE-GENERATED`,s.t))}let t=(0,u.join)(e,`src/constants/universal-identifiers.ts`);await(0,l.writeFile)(t,(await(0,l.readFile)(t,`utf8`)).replace(/'DISPLAY-NAME-TO-BE-GENERATED'/g,()=>o.t({value:n})).replace(/'DESCRIPTION-TO-BE-GENERATED'/g,()=>o.t({value:r})).replace(/UUID-TO-BE-GENERATED/g,()=>(0,c.randomUUID)()))}let m=(0,u.join)(e,`package.json`),h=JSON.parse(await(0,l.readFile)(m,`utf8`));h.name=t,h.engines.twenty=`>=${R.default.major(f)}.${R.default.minor(f)}.0`;for(let e of p)h.devDependencies[e]=f;if(i){let e=JSON.parse(await(0,l.readFile)((0,u.join)(d,`scripts.json`),`utf8`));h.scripts={...h.scripts,...e}}await(0,l.writeFile)(m,JSON.stringify(h,null,2))},V=`TO-BE-GENERATED`,H=`yarn.lock`,U=({appDirectory:e,reason:t})=>new a.t({code:`APP_PATH_UNAVAILABLE`,exitCode:a.n.CONFLICT,message:`${e} already exists and ${t}.`,hint:`Choose another app name, or pass --path with a new or empty directory.`,details:{path:e}}),W=async e=>{let t=await(0,l.stat)(e).catch(e=>{if(!i.t(e,`ENOENT`))throw e});if(!r.t(t))return`missing`;if(!t.isDirectory())throw U({appDirectory:e,reason:`is not a directory`});if(n.n(await(0,l.readdir)(e)))throw U({appDirectory:e,reason:`is not empty`});return`empty`},G=async e=>{let t=await(0,l.readdir)(e,{recursive:!0,withFileTypes:!0}),n=[];for(let r of t){let t=(0,u.join)(r.parentPath,r.name),i=(0,u.relative)(e,t);r.isFile()&&i!==H&&(await(0,l.readFile)(t,`utf8`)).includes(V)&&n.push(i)}return n},K=async({stagingDirectory:e,appDirectory:t})=>{let n=[];try{for(let r of await(0,l.readdir)(e,{recursive:!0,withFileTypes:!0})){let i=(0,u.join)(r.parentPath,r.name),a=(0,u.join)(t,(0,u.relative)(e,i));r.isDirectory()?await(0,l.mkdir)(a):await(0,l.copyFile)(i,a,d.constants.COPYFILE_EXCL),n.push({createdPath:a,isDirectory:r.isDirectory()})}}catch(e){for(let{createdPath:e,isDirectory:t}of n.reverse())await(t?(0,l.rmdir)(e):(0,l.unlink)(e)).catch(()=>void 0);throw e}await(0,l.rm)(e,{recursive:!0,force:!0})},q=async({appDirectory:e,appName:t,appDisplayName:r,appDescription:i,shouldIncludeExample:o=!0,signal:s})=>{await W(e);let c=(0,u.dirname)(e);await(0,l.mkdir)(c,{recursive:!0});let d=await(0,l.mkdtemp)((0,u.join)(c,`.${(0,u.basename)(e)}-`));try{await B({appName:t,appDisplayName:r,appDescription:i,shouldIncludeExample:o,appDirectory:d}),s.throwIfAborted();let c=await G(d);if(n.n(c))throw new a.t({code:`APP_INIT_FAILED`,message:`The app template still has placeholders in ${c.join(`, `)}.`,hint:`This CLI ships an app template it cannot render. Upgrade the twenty CLI.`,details:{unrenderedFiles:c}});s.throwIfAborted(),await W(e)===`empty`?await K({stagingDirectory:d,appDirectory:e}):await(0,l.rename)(d,e)}catch(t){throw await(0,l.rm)(d,{recursive:!0,force:!0}),t instanceof a.t||s.aborted?t:new a.t({code:`APP_INIT_FAILED`,message:`Could not create ${e}: ${t instanceof Error?t.message:String(t)}`,hint:`Files this command had written there were removed. Fix the cause, then run the command again.`,details:{path:e}})}},J=/^(?:@[a-z0-9~-][a-z0-9._~-]*\/)?[a-z0-9~-][a-z0-9._~-]*$/,Y=214,X=e=>e.length<=Y&&![`node_modules`,`favicon.ico`].includes(e)&&J.test(e);Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}});
|
package/dist/chunks/{run-app-apply-command-BnfxBO7o.cjs → run-app-apply-command-CilkY9ws.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
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("./style-BR52fK4V.cjs"),o=require("./resolve-app-project-DP27LYGR.cjs"),s=require("./record-pull-base-BIlU7Fj1.cjs"),c=require("./read-infer-deletion-option-DtCw0TsU.cjs"),l=require("./format-data-value-Cln0Hv7L.cjs"),u=require("./format-app-duration-gu2oRLB4.cjs"),d=require("./get-client-generation-skip-reason-BJFlVAos.cjs"),f=require("./run-app-operation-
|
|
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("./style-BR52fK4V.cjs"),o=require("./resolve-app-project-DP27LYGR.cjs"),s=require("./record-pull-base-BIlU7Fj1.cjs"),c=require("./read-infer-deletion-option-DtCw0TsU.cjs"),l=require("./format-data-value-Cln0Hv7L.cjs"),u=require("./format-app-duration-gu2oRLB4.cjs"),d=require("./get-client-generation-skip-reason-BJFlVAos.cjs"),f=require("./run-app-operation-BbsxjrjR.cjs");var p=e.t(),m=({count:e,label:t,color:n})=>{let r=`${e} ${t}`;return e===0?a.i(r):a.n(n,r)},h=({applicationName:e,apiUrl:r,summary:i,upload:o,isRegistrationCreated:s,clientGeneration:c,durationMilliseconds:d})=>{let f=n.t(i)?[m({count:i.create,label:`added`,color:`green`}),m({count:i.update,label:`changed`,color:`yellow`}),m({count:i.delete,label:`deleted`,color:`red`})].join(a.i(` · `)):a.i(`changes not reported`),h=o.fileCount===1?`file`:`files`;return[a.o(`Applied ${l.r(e)} to ${r} ${a.i(`in ${u.t(d)}`)}`),` ${f}${a.i(` · ${o.fileCount} ${h} uploaded (${t.a(o.byteCount)})`)}`,s?a.i(` Registered the app and installed it in this workspace.`):``,c===`generated`?a.i(` Regenerated the typed API client.`):``].filter(p.isNonEmptyString).join(`
|
|
2
2
|
`)},g=async e=>{let t=performance.now(),a=c.t(e),l,u=await s.n((await o.t({explicitPath:i.r(e.options,`path`),workingDirectory:process.cwd()})).path).catch(()=>void 0),{project:p,sdk:m,data:g,diagnostics:_}=await f.t({context:e,useHeldBuild:async t=>{l=await s.i({build:t.data,appPath:t.project.path,context:e,inferDeletionFromMissingEntities:a,isCreationApproved:i.t(e.options,`create`),isDeletionApproved:i.t(e.options,`yes`)})}});if(!n.t(l))throw new r.t({code:`TOOLING_UNSUPPORTED`,message:`The app worker did not keep its build snapshot for upload, so nothing was applied.`});let v=n.t(l.appliedActions)?c.n(l.appliedActions):void 0;n.t(v)||e.output.warn({code:`SYNC_REPORT_UNAVAILABLE`,message:`The sync succeeded, but the server did not return a readable list of its changes.`});let y;try{y=await s.t({appPath:p.path,universalIdentifier:l.acknowledgedUniversalIdentifier,sourceFingerprints:u,context:e}),y===`recorded`&&l.completedPhases.push(`pullBase`)}catch(t){throw s.r({error:t,phase:`pullBase`,applicationName:g.application.displayName,apiUrl:e.target.apiUrl,completedPhases:l.completedPhases,signal:e.signal})}let b=await d.t({appPath:p.path}),x=`skipped`;if(n.t(b))e.output.warn({code:`CLIENT_NOT_GENERATED`,message:`The app's typed API client was not regenerated: ${b}`});else try{_.push(...await d.r({appPath:p.path,applicationUniversalIdentifier:l.acknowledgedUniversalIdentifier,sdk:m,context:e})),x=`generated`,l.completedPhases.push(`clientGeneration`)}catch(t){throw s.r({error:t,phase:`clientGeneration`,applicationName:g.application.displayName,apiUrl:e.target.apiUrl,completedPhases:l.completedPhases,signal:e.signal})}let S=Math.round(performance.now()-t);return{data:{app:{path:p.path,name:p.name},sdk:{version:m.version},application:g.application,contentHash:g.contentHash,inferDeletionFromMissingEntities:a??null,registrationCreated:l.isRegistrationCreated,completedPhases:l.completedPhases,actions:l.appliedActions??null,summary:v??null,upload:{fileCount:l.upload.fileCount,byteCount:l.upload.byteCount},clientGeneration:x,pullBase:y,diagnostics:_,durationMilliseconds:S},human:h({applicationName:g.application.displayName,apiUrl:e.target.apiUrl,summary:v,upload:l.upload,isRegistrationCreated:l.isRegistrationCreated,clientGeneration:x,durationMilliseconds:S})}};exports.runAppApplyCommand=g;
|
package/dist/chunks/{run-app-build-command-tAj7RilT.cjs → run-app-build-command-DaKa_eKF.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./format-app-duration-gu2oRLB4.cjs"),r=require("./cli-version.constant-
|
|
1
|
+
const e=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./format-app-duration-gu2oRLB4.cjs"),r=require("./cli-version.constant-BRiLR-nG.cjs"),i=require("./run-app-operation-BbsxjrjR.cjs");var a={"built-logic-function":[`logic function`,`logic functions`],"built-front-component":[`front component`,`front components`],source:[`source file`,`source files`],dependencies:[`dependency file`,`dependency files`],"public-asset":[`asset`,`assets`]},o=Object.keys(a),s=e=>{let t=o.indexOf(e);return t===-1?o.length:t},c=e=>{let t=new Map;for(let n of e.files)t.set(n.role,(t.get(n.role)??0)+1);return[...t].sort(([e],[t])=>s(e)-s(t)).map(([e,t])=>`${t} ${(a[e]??[e,e])[t===1?0:1]}`).join(` · `)},l=({build:i,durationMilliseconds:a})=>{let o=i.files.reduce((e,t)=>e+t.size,0);return[t.o(`Built ${i.application.displayName} with twenty ${r.t} ${t.i(`in ${n.t(a)}`)}`),t.i(` ${i.files.length} files · ${e.a(o)} · content hash ${i.contentHash.slice(0,12)}`),t.i(` ${c(i)}`),t.i(` Nothing was uploaded.`)].join(`
|
|
2
2
|
`)},u=async e=>{let{project:t,sdk:n,data:r,diagnostics:a,durationMilliseconds:o}=await i.t({context:e});return{data:{app:{path:t.path,name:t.name},sdk:{version:n.version},application:r.application,contentHash:r.contentHash,files:r.files,manifestFormat:r.manifestFormat,manifest:r.manifest,diagnostics:a,durationMilliseconds:o},human:l({build:r,durationMilliseconds:o})}};exports.runAppBuildCommand=u;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./cli-error-CrUD8uMp.cjs"),r=require("./read-command-values-rGaU2qHz.cjs"),i=require("./convert-to-label-CbLHl7Lv.cjs"),a=require("./style-BR52fK4V.cjs"),o=require("./format-display-path-CZLIKwPT.cjs"),s=require("./is-valid-package-name-
|
|
1
|
+
const e=require("./build--4zYt4wd.cjs"),t=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),n=require("./cli-error-CrUD8uMp.cjs"),r=require("./read-command-values-rGaU2qHz.cjs"),i=require("./convert-to-label-CbLHl7Lv.cjs"),a=require("./style-BR52fK4V.cjs"),o=require("./format-display-path-CZLIKwPT.cjs"),s=require("./is-valid-package-name-9YIecMQm.cjs"),c=require("./select-target-CJ2FyoVQ.cjs"),l=require("./get-config-path-C-D-QHuX.cjs"),u=require("./read-config-9Dv5cmvw.cjs");let d=require("node:path");var f=e.t(),p=({appName:e,location:t,packageNames:n,packageVersion:r,nextSteps:i})=>{let o=Math.max(...i.map(({command:e})=>e.length));return[a.o(`Created ${e} in ${t}`),a.i(` ${c.n(n)} pinned to ${r}. Nothing was installed.`),``,a.t(`Next steps`),...i.map(({command:e,description:t})=>` ${a.r(e.padEnd(o))} ${a.i(`# ${t}`)}`)].join(`
|
|
2
2
|
`)},m=/^[\w./-]+$/,h=e=>m.test(e)?e:process.platform===`win32`?`'${e.replace(/'/g,`''`)}'`:`'${e.replace(/'/g,`'\\''`)}'`,g=({displayPath:e,isTargetConfigured:n,remoteName:r})=>{let i=t.t(r)?` --remote ${h(r)}`:``;return[...e===`.`?[]:[{command:`cd ${h(e.startsWith(`-`)?`./${e}`:e)}`,description:`Enter the new app`}],{command:`yarn install`,description:`Install the pinned dependencies`},...n?[]:[{command:`twenty auth login --url <url>${t.t(r)?` --name ${h(r)}`:``}`,description:`Connect a workspace`}],{command:`twenty app apply --create${i}`,description:`Build the app and install it in your workspace`}].map(e=>({...e,description:process.platform===`win32`?`${e.description} (PowerShell)`:e.description}))},_=({environment:e,remoteFlag:t})=>c.t({environment:e,remoteFlag:t,loadConfig:()=>u.t(l.t()),warn:()=>void 0}).then(()=>!0,()=>!1),v=async({arguments:e,options:t,output:a,signal:c})=>{let l=r.n(e,0)?.trim()??``;if(!s.t(l))throw new n.t({code:`INVALID_APP_NAME`,exitCode:n.n.USAGE,message:`"${l}" is not a valid package name.`,hint:`Use lowercase letters, digits, hyphens, dots or underscores, for example my-app.`});let u=process.cwd(),m=(0,d.resolve)(u,r.r(t,`path`)??(0,d.basename)(l)),h=r.r(t,`displayName`)?.trim(),v=(0,f.isNonEmptyString)(h)?h:i.t(l),y=r.r(t,`description`)?.trim()??``,b=o.t({workingDirectory:u,targetPath:m}),x=b===`.`?`the current directory`:b;a.progress({message:`Creating ${l} in ${x}…`}),await s.n({appDirectory:m,appName:l,appDisplayName:v,appDescription:y,signal:c});let S=r.r(t,`remote`),C=g({displayPath:b,isTargetConfigured:await _({environment:process.env,remoteFlag:S}),remoteName:S}),w=[...s.r];return process.platform===`win32`&&a.warn({code:`PLATFORM_UNSUPPORTED`,message:`Building apps is only supported on macOS and Linux. On Windows, work inside WSL 2.`}),{data:{app:{name:l,displayName:v,description:y,path:m},packages:w.map(e=>({name:e,version:s.i})),nextSteps:C},human:p({appName:l,location:x,packageNames:w,packageVersion:s.i,nextSteps:C})}};exports.runAppInitCommand=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./constants-Cbb71hpl-CrSqydxj.cjs"),n=require("./resolve-source-sdk-CyvER2l1.cjs"),r=require("./read-command-values-rGaU2qHz.cjs"),i=require("./to-worker-output-diagnostics-Hj6aQiK9.cjs"),a=require("./resolve-app-project-DP27LYGR.cjs"),o=require("./create-tooling-failure-0Foyei1R.cjs"),s=require("./cli-version.constant-
|
|
1
|
+
const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./constants-Cbb71hpl-CrSqydxj.cjs"),n=require("./resolve-source-sdk-CyvER2l1.cjs"),r=require("./read-command-values-rGaU2qHz.cjs"),i=require("./to-worker-output-diagnostics-Hj6aQiK9.cjs"),a=require("./resolve-app-project-DP27LYGR.cjs"),o=require("./create-tooling-failure-0Foyei1R.cjs"),s=require("./cli-version.constant-BRiLR-nG.cjs");var c={build:`Building`,typecheck:`Typechecking`},l=({release:e,isSnapshotHeld:n})=>n?!t.i(e)||e.success!==!0:t.i(e)&&e.success===!1,u=async({operation:t,parseData:u,context:{options:d,output:f,outputMode:p,signal:m},useHeldBuild:h})=>{let g=await a.t({explicitPath:r.r(d,`path`),workingDirectory:process.cwd()}),_=await n.t({appPath:g.path,warn:f.warn});f.progress({message:`${c[t]} ${g.name} with twenty ${s.t}…`});let v=performance.now(),y=({result:e,output:t})=>{let n=i.s({value:e,parseData:u}),r=[...n.diagnostics,...i.t(t)];if(p===`human`)for(let e of r)f.progress({message:i.c(e)});if(!n.success)throw o.t({error:n.error,diagnostics:r,sdkVersion:_.version});return{data:n.data,diagnostics:r}},b,x=await i.n({request:t===`build`?{type:`bundleSnapshot`,appPath:g.path,holdSnapshot:e.t(h)}:{type:`typecheckSource`,appPath:g.path},signal:m,...e.t(h)?{useHeldSnapshot:async e=>{b=y(e),await h({project:g,sdk:_,...b})}}:{}});e.t(b)||m.throwIfAborted();let{data:S,diagnostics:C}=b??y(x);return l(x)&&f.warn({code:`SNAPSHOT_RELEASE_FAILED`,message:`The temporary build snapshot could not be removed. You can delete .twenty/cli/snapshots once no build is running.`}),{project:g,sdk:_,data:S,diagnostics:C,durationMilliseconds:Math.round(performance.now()-v)}},d=({context:e,useHeldBuild:t})=>u({operation:`build`,parseData:i.a,context:e,useHeldBuild:t}),f=({context:e})=>u({operation:`typecheck`,parseData:i.o,context:e});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./read-infer-deletion-option-DtCw0TsU.cjs"),t=require("./run-app-operation-
|
|
1
|
+
const e=require("./read-infer-deletion-option-DtCw0TsU.cjs"),t=require("./run-app-operation-BbsxjrjR.cjs");var n=async n=>{let r=performance.now(),i=e.t(n),{project:a,sdk:o,data:s,diagnostics:c}=await t.t({context:n});n.output.progress({message:`Computing metadata plan (read-only, nothing will be applied)…`});let l=await e.a({build:s,inferDeletionFromMissingEntities:i,target:n.target,signal:n.signal}),u=e.n(l);return{data:{app:{path:a.path,name:a.name},sdk:{version:o.version},application:s.application,contentHash:s.contentHash,plan:!0,inferDeletionFromMissingEntities:i??null,actions:l,summary:u,diagnostics:c,durationMilliseconds:Math.round(performance.now()-r)},human:e.r({applicationName:s.application.displayName,apiUrl:n.target.apiUrl,actions:l,summary:u,inferDeletionFromMissingEntities:i})}};exports.runAppPlanCommand=n;
|
package/dist/chunks/{run-app-publish-command-BPosULCY.cjs → run-app-publish-command-CoGrZA2a.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Cbb71hpl-CrSqydxj.cjs"),i=require("./application-pYRHxplP.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./read-command-values-rGaU2qHz.cjs"),s=require("./create-cancelled-error-BBhAY8fS.cjs"),c=require("./is-interaction-allowed-BQLOG8RG.cjs"),l=require("./style-BR52fK4V.cjs"),u=require("./with-phase-details-CRqY0f3c.cjs"),d=require("./to-cli-error-4pSpVaW9.cjs"),f=require("./create-metadata-client-CJRFQ20Z.cjs"),p=require("./read-snapshot-file-Dgc3WCDM.cjs"),m=require("./run-app-operation-
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Cbb71hpl-CrSqydxj.cjs"),i=require("./application-pYRHxplP.cjs"),a=require("./cli-error-CrUD8uMp.cjs"),o=require("./read-command-values-rGaU2qHz.cjs"),s=require("./create-cancelled-error-BBhAY8fS.cjs"),c=require("./is-interaction-allowed-BQLOG8RG.cjs"),l=require("./style-BR52fK4V.cjs"),u=require("./with-phase-details-CRqY0f3c.cjs"),d=require("./to-cli-error-4pSpVaW9.cjs"),f=require("./create-metadata-client-CJRFQ20Z.cjs"),p=require("./read-snapshot-file-Dgc3WCDM.cjs"),m=require("./run-app-operation-BbsxjrjR.cjs"),h=require("./to-public-target-D00so1uO.cjs"),g=require("./resolve-command-target-C4r6LuWk.cjs"),_=require("./execa-CAd0sJ7f.cjs");let v=require("node:fs/promises"),y=require("node:path"),b=require("node:fs");var x=t.t(),S=async({packedApp:e,context:{target:t,signal:i,output:o}})=>{let s=`prepare-upload`,c=[],l;try{i.throwIfAborted();let{size:n}=await(0,v.stat)(e.path),u=f.t({target:t,signal:i}),d=(await u.mutation({__name:`CreateAppTarballUpload`,createFileUpload:{__args:{filename:(0,y.basename)(e.path),size:n,fileFolder:`AppTarball`},fileId:!0,uploadUrl:!0,contentType:!0}})).createFileUpload;if(!r.i(d)||!(0,x.isNonEmptyString)(d.fileId)||!(0,x.isNonEmptyString)(d.uploadUrl)||!(0,x.isNonEmptyString)(d.contentType))throw new a.t({code:`INVALID_RESPONSE`,message:`The server returned an invalid tarball upload target.`});l=d.fileId,c.push(s),s=`upload`,o.progress({message:`Uploading ${e.name}@${e.version} to ${t.apiUrl}…`});let m=await p.r({uploadUrl:d.uploadUrl,contentType:d.contentType,bytes:await(0,b.openAsBlob)(e.path),signal:i});if(m<200||m>=300)throw new a.t({code:`UPLOAD_FAILED`,message:`File storage answered ${m}.`});c.push(s),i.throwIfAborted(),o.progress({message:`Registering the uploaded app…`}),s=`register`;let g=(await u.mutation({__name:`CompleteAppTarballUpload`,completeAppTarballUpload:{__args:{fileId:l},id:!0,name:!0,universalIdentifier:!0}})).completeAppTarballUpload;if(!r.i(g)||!(0,x.isNonEmptyString)(g.id)||!(0,x.isNonEmptyString)(g.name)||!(0,x.isNonEmptyString)(g.universalIdentifier))throw new a.t({code:`INVALID_RESPONSE`,message:`The server did not return the published app registration.`});return c.push(s),{target:`private`,registry:h.t(t),name:e.name,version:e.version,registration:g,fileId:l,installed:!1}}catch(e){let r=u.t({error:d.t(e,i),phase:s,completedPhases:c,outcome:s===`register`?`unknown`:`not-published`,hint:s===`register`?`The app may already be registered. Check the server registry before retrying; publishing does not install the app.`:`Fix the problem, then run twenty app publish --private again to create a fresh upload.`});throw new a.t({cause:r,code:r.code,exitCode:r.exitCode,message:r.message,hint:r.hint,details:{...r.details,...n.t(l)?{fileId:l}:{},registry:h.t(t)}})}},C=e.r(_.t()),w=async({args:e,appPath:t,signal:r,canInteract:i=!1,onOutput:o})=>{r.throwIfAborted();let c=(0,C.default)(`npm`,e,{cwd:t,stdio:i?`inherit`:[`ignore`,`pipe`,`pipe`],reject:!1,maxBuffer:4*1024*1024}),l=()=>c.kill(`SIGTERM`,{forceKillAfterTimeout:1e3});r.addEventListener(`abort`,l,{once:!0}),r.aborted&&l();try{let t=await c;if(r.aborted)throw s.t();if(!i&&n.t(o)&&((0,x.isNonEmptyString)(t.stdout)&&o(t.stdout),(0,x.isNonEmptyString)(t.stderr)&&o(t.stderr)),t.failed)throw new a.t({code:`PUBLISH_FAILED`,message:`npm ${e[0]} failed.`,hint:`Check that npm is installed and your npm registry credentials and package version are valid.`,details:{exitCode:t.exitCode,stdout:t.stdout?.slice(-16384)??``,stderr:t.stderr?.slice(-16384)??``}});return t.stdout??``}finally{r.removeEventListener(`abort`,l)}},T=async({packedApp:e,appPath:t,tag:r,context:i})=>{let a=n.t(process.env.ACTIONS_ID_TOKEN_REQUEST_URL)&&process.env.TWENTY_APP_PUBLISH_DISABLE_PROVENANCE!==`true`;return i.output.progress({message:`Publishing ${e.name}@${e.version} to npm…`}),await w({args:[`publish`,e.path,`--access`,`public`,`--ignore-scripts`,`--workspaces=false`,...a?[`--provenance`]:[],...n.t(r)?[`--tag`,r]:[]],appPath:t,signal:i.signal,canInteract:c.t(i),...i.outputMode===`human`?{onOutput:e=>i.output.progress({message:e})}:{}}),{target:`npm`,name:e.name,version:e.version,...n.t(r)?{tag:r}:{}}},E=async e=>{let t=(0,y.join)(e,i.s);await(0,v.mkdir)((0,y.dirname)(t),{recursive:!0}),await(0,v.copyFile)((0,y.join)(e,`yarn.lock`),t)},D=e=>{let t;try{t=JSON.parse(e)}catch(e){throw new a.t({code:`PUBLISH_FAILED`,message:`npm pack returned invalid JSON.`,cause:e})}let n=(0,x.isArray)(t)&&t.length===1?t[0]:void 0;if(!r.i(n)||!(0,x.isNonEmptyString)(n.name)||!(0,x.isNonEmptyString)(n.version)||!(0,x.isNonEmptyString)(n.filename)||(0,y.basename)(n.filename)!==n.filename||n.filename.includes(`\\`)||!n.filename.endsWith(`.tgz`)||!(0,x.isArray)(n.files))throw new a.t({code:`PUBLISH_FAILED`,message:`npm pack returned an invalid package description.`});let i=n.files.map(e=>{if(!r.i(e)||!(0,x.isNonEmptyString)(e.path))throw new a.t({code:`PUBLISH_FAILED`,message:`npm pack returned an invalid package file.`});return{path:e.path}});return{name:n.name,version:n.version,filename:n.filename,files:i}},O=async({appPath:e,build:t,signal:n,output:r,usePackage:o})=>{let s=p.a({build:t,appPath:e});for(let e of t.files)n.throwIfAborted(),await p.t({snapshotDirectory:s,artifact:e});await E(s);let c=await(0,v.mkdtemp)((0,y.join)((0,y.dirname)(s),`package-`));try{r.progress({message:`Packing the built app…`});let l=D(await w({args:[`pack`,s,`--json`,`--ignore-scripts`,`--workspaces=false`,`--pack-destination`,c],appPath:e,signal:n})),u=new Set(l.files.map(e=>e.path)),d=[`manifest.json`,`package.json`,...t.files.map(e=>e.path).filter(e=>e!==`yarn.lock`),i.s],f=[...new Set(d)].filter(e=>!u.has(e));if(f.length>0)throw new a.t({code:`PUBLISH_FAILED`,message:`The npm package is missing files required by the built app.`,hint:`Update the files field in package.json to include the manifest and built files.`,details:{missingPaths:f}});return n.throwIfAborted(),await o({path:(0,y.join)(c,l.filename),name:l.name,version:l.version})}finally{await(0,v.rm)(c,{recursive:!0,force:!0}).catch(()=>{r.warn({code:`PACKAGE_CLEANUP_FAILED`,message:`Could not remove temporary package folder ${c}.`})})}},k=async e=>{let t=o.r(e.options,`tag`),r=o.t(e.options,`private`);if(r&&n.t(t))throw new a.t({code:`INVALID_INPUT`,exitCode:a.n.USAGE,message:`--tag only applies to npm publishing.`});if(n.t(t)&&!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t))throw new a.t({code:`INVALID_INPUT`,exitCode:a.n.USAGE,message:`Invalid npm tag: ${t}.`});if(!r&&n.t(o.r(e.options,`remote`)))throw new a.t({code:`INVALID_INPUT`,exitCode:a.n.USAGE,message:`npm publishing does not use a Twenty remote.`});let i=r?await g.t(e):void 0,s,{project:c,diagnostics:u}=await m.t({context:e,useHeldBuild:async({project:r,data:a})=>{s=await O({appPath:r.path,build:a,signal:e.signal,output:e.output,usePackage:async a=>n.t(i)?S({packedApp:a,context:{target:i,signal:e.signal,output:e.output}}):T({packedApp:a,appPath:r.path,tag:t,context:e})})}});if(!n.t(s))throw new a.t({code:`PUBLISH_FAILED`,message:`The build did not provide a package to publish.`});return{data:{app:{path:c.path,name:c.name},...s,diagnostics:u},human:l.o(`Published ${s.name}@${s.version} to ${i?.apiUrl??`npm`}${r?`. Existing installations may upgrade automatically.`:``}`)}};exports.runAppPublishCommand=k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Cbb71hpl-CrSqydxj.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./pull-minimum-sdk-version.constant-JDRwzl32.cjs"),o=require("./kebab-case-D0usAzG-.cjs"),s=require("./read-command-values-rGaU2qHz.cjs"),c=require("./create-cancelled-error-BBhAY8fS.cjs"),l=require("./confirm-in-terminal-D2e1lKUY.cjs"),u=require("./is-interaction-allowed-BQLOG8RG.cjs"),d=require("./style-BR52fK4V.cjs"),f=require("./to-worker-output-diagnostics-Hj6aQiK9.cjs"),p=require("./read-app-identity-CJZThpUC.cjs"),m=require("./resolve-app-project-DP27LYGR.cjs"),h=require("./format-data-value-Cln0Hv7L.cjs"),g=require("./require-approval-BIgPOy_r.cjs"),_=require("./fetch-workspace-or-throw-CgPc8IBL.cjs"),v=require("./is-valid-package-name-
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),r=require("./constants-Cbb71hpl-CrSqydxj.cjs"),i=require("./cli-error-CrUD8uMp.cjs"),a=require("./pull-minimum-sdk-version.constant-JDRwzl32.cjs"),o=require("./kebab-case-D0usAzG-.cjs"),s=require("./read-command-values-rGaU2qHz.cjs"),c=require("./create-cancelled-error-BBhAY8fS.cjs"),l=require("./confirm-in-terminal-D2e1lKUY.cjs"),u=require("./is-interaction-allowed-BQLOG8RG.cjs"),d=require("./style-BR52fK4V.cjs"),f=require("./to-worker-output-diagnostics-Hj6aQiK9.cjs"),p=require("./read-app-identity-CJZThpUC.cjs"),m=require("./resolve-app-project-DP27LYGR.cjs"),h=require("./format-data-value-Cln0Hv7L.cjs"),g=require("./require-approval-BIgPOy_r.cjs"),_=require("./fetch-workspace-or-throw-CgPc8IBL.cjs"),v=require("./is-valid-package-name-9YIecMQm.cjs"),y=require("./execa-CAd0sJ7f.cjs");let b=require("node:path");var x=e.r(y.t()),S=async({appPath:e,signal:t,output:n})=>{t.throwIfAborted(),n.progress({message:`Installing app dependencies with yarn install…`});let r=(0,x.default)(`yarn`,[`install`],{cwd:e,env:{...f.r(process.env),YARN_ENABLE_IMMUTABLE_INSTALLS:`false`,COREPACK_ENABLE_DOWNLOAD_PROMPT:`0`},extendEnv:!1,stdio:[`ignore`,`pipe`,`pipe`],reject:!1,maxBuffer:4*1024*1024}),a=()=>r.kill(`SIGTERM`,{forceKillAfterTimeout:1e3});t.addEventListener(`abort`,a,{once:!0}),t.aborted&&a();try{let n=await r;if(t.aborted)throw c.t();if(n.failed)throw new i.t({code:`APP_INIT_FAILED`,message:`Could not install dependencies for the new app.`,hint:[(n.stderr?.trim()||n.stdout?.trim()||``).slice(-4e3).split(`
|
|
2
2
|
`).map(h.r).join(`
|
|
3
3
|
`),`The project was created at ${h.r(e)}. Fix the installation error, run yarn install there, then run twenty app pull again.`].filter(Boolean).join(`
|
|
4
4
|
`),details:{path:e,exitCode:n.exitCode,stdout:n.stdout?.slice(-16384)??``,stderr:n.stderr?.slice(-16384)??``}})}finally{t.removeEventListener(`abort`,a)}},C=async({context:e,displayName:t})=>{let{options:r,signal:a,output:c}=e,d=u.t(e),f=o.t(t)||`workspace-app`,p=s.r(r,`path`);if(!n.t(p)&&d&&(p=(await l.n({question:`No Twenty app found. Directory for the workspace custom app [./${h.r(f)}]: `,signal:a})).trim()||f),!n.t(p))throw new i.t({code:`APP_PATH_REQUIRED`,exitCode:i.n.USAGE,message:`Choose a directory for the workspace custom application.`,hint:`Pass --path <new-or-empty-directory> --yes to create the project, install its dependencies and pull.`});let m=(0,b.resolve)(process.cwd(),p),_=o.t((0,b.basename)(m));if(!v.t(_))throw new i.t({code:`INVALID_APP_NAME`,exitCode:i.n.USAGE,message:`The directory name cannot be used as an app package name.`,hint:`Choose a directory such as workspace-app.`});return await g.t({isApproved:s.t(r,`yes`),canPrompt:d,question:`Create ${h.r(t)} in ${h.r(m)}, install its dependencies and pull?`,code:`CONFIRMATION_REQUIRED`,message:`Pull needs to create a local project and install its dependencies.`,hint:`Pass --yes to create the project and install its dependencies.`,declinedMessage:`Pull stopped before creating the project.`,signal:a}),c.progress({message:`Creating ${_} in ${h.r(m)}…`}),await v.n({appDirectory:m,appName:_,appDisplayName:t,appDescription:``,shouldIncludeExample:!1,signal:a}),await S({appPath:m,signal:a,output:c}),{path:m,name:_}},w=20,T=[{status:`UNSUPPORTED`,title:`Not written, unsupported by this version`},{status:`FOREIGN_OWNED`,title:`Owned by another application, not written`},{status:`EXCLUDED`,title:`Excluded as workspace runtime state`},{status:`ENGINE_DERIVED`,title:`Derived by the engine, rebuilt on apply`}],E=({title:e,relativePaths:t})=>t.length===0?[]:t.slice().sort().map(t=>` ${e.padEnd(13)}${t}`),D=e=>{let t=new Map;for(let n of e){let e=JSON.stringify([n.metadataName,n.reason]),r=t.get(e)??{metadataName:n.metadataName,reason:n.reason,identifiers:[]};r.identifiers.push(n.universalIdentifier),t.set(e,r)}return[...t.values()].sort((e,t)=>e.metadataName.localeCompare(t.metadataName)||(e.reason??``).localeCompare(t.reason??``))},O=({writes:e,deletions:t,unchangedCount:r,skipped:i,coverage:a,localOnlyRelativePaths:o,unreadableRelativePaths:s=[],compiledTranslationEntryCountByLocale:c={},entityLabelByUniversalIdentifier:l={},verbose:u=!1})=>{let d=[...E({title:`written`,relativePaths:e.filter(e=>!e.isRegeneration).map(e=>e.relativePath)}),...E({title:`regenerated`,relativePaths:e.filter(e=>e.isRegeneration).map(e=>e.relativePath)}),...E({title:`deleted`,relativePaths:t.map(e=>e.relativePath)})];if(r>0&&d.push(` unchanged ${r} file(s)`),i.length>0){d.push(``,`Not written by the writer:`);for(let e of i)d.push(` ${e.kind} ${e.reason}`)}s.length>0&&d.push(``,`Could not be read, so a second file may now define the same entity (check their diagnostics and SDK dependencies before pulling again):`,...s.slice().sort().map(e=>` ${e}`)),o.length>0&&d.push(``,`Local entities the workspace does not have (left untouched):`,...o.slice().sort().map(e=>` ${e}`));let f=a.filter(e=>e.status===`EXPORTED`&&n.t(e.reason)).map(e=>` ${e.metadataName} ${l[e.universalIdentifier]??e.universalIdentifier}: ${e.reason}`).sort();if(f.length>0){let e=u?f:f.slice(0,w);d.push(``,`Written without their workspace-local state (${f.length} row(s)):`,...e),f.length>e.length&&d.push(` …and ${f.length-e.length} more, listed with --verbose`)}for(let e of T){let t=a.filter(t=>t.status===e.status);if(t.length!==0){d.push(``,`${e.title} (${t.length} row(s)):`);for(let{metadataName:e,reason:n,identifiers:r}of D(t))if(d.push(` ${e.padEnd(34)}${String(r.length).padEnd(6)}${n??``}`.trimEnd()),u){for(let e of r.slice(0,w))d.push(` ${e}`);r.length>w&&d.push(` …and ${r.length-w} more`)}}}let p=Object.entries(c).filter(([,e])=>e>0).sort(([e],[t])=>e.localeCompare(t));return p.length>0&&d.push(``,`Translations kept in compiled form until their source strings are in this tree (see locales/compiled/):`,...p.map(([e,t])=>` ${e.padEnd(13)}${t} ${t===1?`entry`:`entries`}`)),d.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./style-BR52fK4V.cjs"),t=require("./format-app-duration-gu2oRLB4.cjs"),n=require("./run-app-operation-
|
|
1
|
+
const e=require("./style-BR52fK4V.cjs"),t=require("./format-app-duration-gu2oRLB4.cjs"),n=require("./run-app-operation-BbsxjrjR.cjs");var r=async r=>{let{project:i,sdk:a,diagnostics:o,durationMilliseconds:s}=await n.n({context:r});return{data:{app:{path:i.path,name:i.name},sdk:{version:a.version},diagnostics:o,durationMilliseconds:s},human:e.o(`No type errors in ${i.name} ${e.i(`· project TypeScript · ${t.t(s)}`)}`)}};exports.runAppTypecheckCommand=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./capitalize-DFPVt1IM-CF4z3TZK.cjs"),o=require("./cli-error-CrUD8uMp.cjs"),s=require("./is-interaction-allowed-BQLOG8RG.cjs"),c=require("./style-BR52fK4V.cjs"),l=require("./to-cli-error-4pSpVaW9.cjs"),u=require("./cli-version.constant-
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./capitalize-DFPVt1IM-CF4z3TZK.cjs"),o=require("./cli-error-CrUD8uMp.cjs"),s=require("./is-interaction-allowed-BQLOG8RG.cjs"),c=require("./style-BR52fK4V.cjs"),l=require("./to-cli-error-4pSpVaW9.cjs"),u=require("./cli-version.constant-BRiLR-nG.cjs"),d=require("./format-progress-line-Cj65-DU5.cjs"),f=require("./to-public-target-D00so1uO.cjs"),p=require("./resolve-command-target-C4r6LuWk.cjs"),m=require("./global-flags.constant-uA1jkBmk.cjs");let h=require("node:events"),g=require("node:readline");var _=t.t();function ee({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var te=ee();function v(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(``)?e:e.replace(te,``)}var y=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],b=[12288,12288,65281,65376,65504,65510],x=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],S=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],C=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],w=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},ne=y[0],re=y.at(-1),ie=b[0],ae=b.at(-1);x[0],x.at(-1),S[0],S.at(-1);var oe=C[0],se=C.at(-1),T=19968,[ce,le]=ue(C);function ue(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(T>=i&&T<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var de=e=>e<ne||e>re?!1:w(y,e),fe=e=>e<ie||e>ae?!1:w(b,e),pe=e=>e>=ce&&e<=le?!0:e<oe||e>se?!1:w(C,e);function me(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function E(e,{ambiguousAsWide:t=!1}={}){return me(e),fe(e)||pe(e)||t&&de(e)?2:1}var he=new Intl.Segmenter,ge=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,_e=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,ve=/^\p{RGI_Emoji}$/v,D=/^[\d#*]\u20E3$/,O=/\p{Extended_Pictographic}/gu;function k(e){if(e.length>50)return!1;if(D.test(e))return!0;if(e.includes(``)){let t=e.match(O);return t!==null&&t.length>=2}return!1}function A(e){return e.replace(_e,``)}function j(e){return ge.test(e)}function M(e,t){let n=0;if(e.length>1)for(let r of e.slice(1))r>=``&&r<=``&&(n+=E(r.codePointAt(0),t));return n}function N(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(``))&&(i=v(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of he.segment(i)){if(j(e))continue;if(ve.test(e)||k(e)){a+=2;continue}let t=A(e).codePointAt(0);a+=E(t,o),a+=M(e,o)}return a}var P=({stream:e,text:t})=>{e.write(t.endsWith(`
|
|
2
2
|
`)?t:`${t}\n`)},F=({mode:e})=>{let t=!1,n=()=>{t&&=((0,g.cursorTo)(process.stderr,0),(0,g.clearLine)(process.stderr,0),!1)};return{write:({message:i,percentage:a})=>{let o=r.t(a)?`${a}%`:``,c=Math.min(20,(process.stderr.columns??80)-N(i)-o.length-5);if(n(),e!==`human`||!process.stderr.isTTY||s.n()||process.env.TERM===`dumb`||!r.t(a)||!Number.isFinite(a)||c<4){P({stream:process.stderr,text:d.t({message:i,percentage:a})});return}let l=Math.round(Math.min(100,Math.max(0,a))/100*c),u=`█`.repeat(l)+`░`.repeat(c-l);process.stderr.write(`${i} ${u} ${o}`),t=!0},clear:n}},ye=e=>e.map(({metadataName:e,entityLabel:t,message:n})=>`• ${e}${r.t(t)?` ${t}`:``}: ${n}`).join(`
|
|
3
3
|
`),be=e=>!r.t(e)||!(0,_.isArray)(e.validationErrors)?[]:e.validationErrors.filter(e=>i.i(e)&&(0,_.isString)(e.metadataName)&&(0,_.isString)(e.message)),xe=async(e,t)=>{t.throwIfAborted(),process.stdout.write(`${JSON.stringify(e)}\n`)||await(0,h.once)(process.stdout,`drain`,{signal:t}),t.throwIfAborted()},I=e=>{P({stream:process.stdout,text:JSON.stringify(e)})},L=e=>e.split(`
|
|
4
4
|
`).map(e=>(0,_.isNonEmptyString)(e)?` ${e}`:e).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./global-flags.constant-
|
|
1
|
+
const e=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),t=require("./style-BR52fK4V.cjs"),n=require("./global-flags.constant-uA1jkBmk.cjs"),r=require("./format-table-4drtI5sP.cjs");var i=async()=>{let i=n.r.map(t=>({name:n.n(t),description:t.description,arguments:(t.arguments??[]).map(({name:e,required:t})=>({name:e,required:t})),flags:(t.options??[]).filter(({hidden:e})=>e!==!0).map(({flags:e})=>e),outputs:t.outputModes,writes:t.writes,needsProject:t.needsProject,needsTarget:t.needsTarget,...e.t(t.requiredPermissions)?{requiredPermissions:t.requiredPermissions}:{}})).sort((e,t)=>e.name.localeCompare(t.name));return{data:{commands:i,globalFlags:Object.values(n.t)},human:[r.t({rows:i,columns:[{header:`COMMAND`,value:e=>e.name},{header:`DESCRIPTION`,value:e=>e.description}]}),`${t.i(`${i.length} commands · details: `)}${t.r(`twenty <command> --help`)}`].join(`
|
|
2
2
|
`)}};exports.runCommandsCommand=i;
|
|
@@ -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-
|
|
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
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 +1 @@
|
|
|
1
|
-
const e=require("./style-BR52fK4V.cjs"),t=require("./cli-version.constant-
|
|
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;
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const e=require("./chunks/check-node-requirement-CnwHKQBp.cjs"),t=require("./chunks/cli-node-version-range.constant-D3XrqV07.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-
|
|
2
|
+
const e=require("./chunks/check-node-requirement-CnwHKQBp.cjs"),t=require("./chunks/cli-node-version-range.constant-D3XrqV07.cjs");process.stdout.on(`error`,e=>{if(e.code!==`EPIPE`)throw e;process.exit()}),(async({args:n,nodeVersion:r,loadCli:i})=>{if(e.t({version:r,range:`>=24.5.0`})!==`satisfied`){process.stderr.write(`twenty requires Node.js ${t.t}; this is Node.js ${r}. Switch to a supported Node.js version, then try again.\n`),process.exitCode=1;return}await(await i()).runCli(n)})({args:process.argv.slice(2),nodeVersion:process.versions.node,loadCli:()=>Promise.resolve().then(()=>require("./chunks/run-cli-CsDjb96b.cjs"))});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty",
|
|
3
|
-
"version": "2.54.
|
|
3
|
+
"version": "2.54.3",
|
|
4
4
|
"description": "The Twenty command line.",
|
|
5
5
|
"homepage": "https://twenty.com",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"npm-pick-manifest": "^11.0.1",
|
|
35
35
|
"semver": "7.6.3",
|
|
36
36
|
"string-width": "^8.2.0",
|
|
37
|
-
"twenty-client-sdk": "2.54.
|
|
37
|
+
"twenty-client-sdk": "2.54.3",
|
|
38
38
|
"twenty-shared": "0.0.0",
|
|
39
39
|
"undici": "^7.30.1",
|
|
40
40
|
"uuid": "^13.0.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./utils-RCpFyoX5-DF7Gq1IH.cjs"),r=require("./isDefined-Dtu5EYqP-CJctgvfE.cjs"),i=require("./constants-Cbb71hpl-CrSqydxj.cjs"),a=require("./application-pYRHxplP.cjs"),o=require("./get-system-view-universal-identifier.util-C31V-2Dl-Cm-ouuA6.cjs"),s=require("./fs-utils-DoSmCBu8.cjs"),c=require("./list-application-source-files-jEau5Rie.cjs"),l=require("./extract-manifest-from-file-CEK5X5YP.cjs"),u=require("./metadata-CY9y5wYc.cjs"),d=require("./locale-catalog-format-C_5EGBEn.cjs"),f=require("./constants-Cf5-CwMu.cjs"),p=require("./is-supported-locale-C33Of85N.cjs");let m=require("node:fs/promises"),h=require("node:path"),g=require("node:fs"),_=require("tinyglobby"),v=require("typescript");v=e.r(v);let y=require("path");y=e.r(y);var b=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function x(e){return typeof e==`string`&&b.test(e)}function S(e){if(!x(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var C=[];for(let e=0;e<256;++e)C.push((e+256).toString(16).slice(1));function ee(e,t=0){return(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+`-`+C[e[t+4]]+C[e[t+5]]+`-`+C[e[t+6]]+C[e[t+7]]+`-`+C[e[t+8]]+C[e[t+9]]+`-`+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase()}function te(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var ne=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,re=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function w(e,t,n,r,i,a){let o=typeof n==`string`?te(n):n,s=typeof r==`string`?S(r):r;if(typeof r==`string`&&(r=S(r)),r?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let c=new Uint8Array(16+o.length);if(c.set(s),c.set(o,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=c[e];return i}return ee(c)}function ie(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function T(e,t){return e<<t|e>>>32-t}function ae(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=T(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],c=n[3],l=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=T(i,5)+ie(n,a,s,c)+l+t[n]+r[e]>>>0;l=c,c=s,s=T(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+l>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function E(e,t,n,r){return w(80,ae,e,t,n,r)}E.DNS=ne,E.URL=re;function D(e){if(!x(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var O=`a80ff791-b940-4c47-a522-2bb478515415`,oe=e=>e.type!==i.I.SELECT&&e.type!==i.I.MULTI_SELECT||e.options===void 0||e.options===null?e:{...e,options:e.options.map(t=>({...t,id:t.id??E(`${t.label}-${e.universalIdentifier}`,O)}))},k=({fields:e,labelIdentifierFieldMetadataUniversalIdentifier:t})=>r.t(t)&&!e.some(e=>e.universalIdentifier===t),se=`twenty:front-component-shared-dependencies`,A=({objectConfig:e,applicationUniversalIdentifier:t})=>({name:`name`,label:`Name`,description:`Name`,icon:`IconAbc`,isNullable:!0,defaultValue:null,type:i.I.TEXT,universalIdentifier:o.a({applicationUniversalIdentifier:t,objectUniversalIdentifier:e.universalIdentifier,name:`name`})}),j=({objectConfig:e,applicationUniversalIdentifier:t})=>{let n=(e.fields??[]).map(e=>e.name),r=[...e.fields??[]],i=A({objectConfig:e,applicationUniversalIdentifier:t}),a=k({fields:e.fields??[],labelIdentifierFieldMetadataUniversalIdentifier:e.labelIdentifierFieldMetadataUniversalIdentifier});return!n.includes(i.name)&&!a&&r.push(i),{objectFields:r}},ce=({objectConfig:e,applicationUniversalIdentifier:t})=>{let{objectFields:n}=j({objectConfig:e,applicationUniversalIdentifier:t}),r=e.labelIdentifierFieldMetadataUniversalIdentifier??n.find(e=>e.name===`name`)?.universalIdentifier;return r?{objectManifest:{...e,fields:n.map(oe),labelIdentifierFieldMetadataUniversalIdentifier:r},errors:[]}:{objectManifest:null,errors:[`No label identifier field found for object ${e.nameSingular}. Please add a field with name "name" to your object.`]}},M=t.t(),N={type:`object`,properties:{}},P=e=>{let t={type:`unknown`};switch(e.type){case`string`:t.type=`string`;break;case`number`:case`integer`:t.type=`number`;break;case`boolean`:t.type=`boolean`;break;case`array`:t.type=`array`,e.items&&(t.items=P(e.items));break;case`object`:t.type=`object`,e.properties&&(t.properties=Object.fromEntries(Object.entries(e.properties).map(([e,t])=>[e,P(t)])));break;case`record`:t.type=`record`;break;case`records`:t.type=`records`;break;default:t.type=`unknown`}return Array.isArray(e.enum)&&(t.enum=e.enum.filter(e=>typeof e==`string`)),e.multiline===!0&&(t.multiline=!0),(0,M.isNonEmptyString)(e.label)&&(t.label=e.label),(0,M.isNonEmptyString)(e.objectUniversalIdentifier)&&(t.objectUniversalIdentifier=e.objectUniversalIdentifier),t},F=e=>[P(e)];F({type:`object`,properties:{a:{type:`string`},b:{type:`number`}}});var le=async e=>{let{getFunctionInputSchema:t}=await Promise.resolve().then(()=>require("./get-function-input-schema-GNk3NRLJ-DscBUsKy.cjs")),n=t(e)[0];return n?.type===`object`&&r.t(n.properties)?{type:`object`,properties:n.properties}:N},ue=async({logicFunctionConfig:e,sourceCode:t,sourcePath:n})=>{let{handler:r,...i}=e,a=i.toolTriggerSettings&&!i.toolTriggerSettings.inputSchema||i.workflowActionTriggerSettings&&!i.workflowActionTriggerSettings.inputSchema?await le(t):null,o=i.toolTriggerSettings?{...i.toolTriggerSettings,inputSchema:i.toolTriggerSettings.inputSchema??a??void 0}:void 0,s=i.workflowActionTriggerSettings?{...i.workflowActionTriggerSettings,inputSchema:i.workflowActionTriggerSettings.inputSchema??(a?F(a):void 0)}:void 0;return{...i,...o?{toolTriggerSettings:o}:{},...s?{workflowActionTriggerSettings:s}:{},handlerName:`default.config.handler`,sourceHandlerPath:n,builtHandlerPath:n.replace(/\.tsx?$/,`.mjs`),builtHandlerChecksum:`[default-checksum]`}},de=({frontComponentConfig:e,sourcePath:t})=>{let{component:n,...r}=e;return{...r,componentName:n.name,sourceComponentPath:t,builtComponentPath:t.replace(/\.tsx?$/,`.mjs`),builtComponentChecksum:``,isHeadless:r.isHeadless??!1}},fe=({roleConfig:e,applicationUniversalIdentifier:t})=>({...e,objectPermissions:(e.objectPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??a.t({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})})),fieldPermissions:(e.fieldPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??a.n({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,fieldUniversalIdentifier:n.fieldUniversalIdentifier})})),rowLevelPermissionPredicateGroups:e.rowLevelPermissionPredicateGroups??[],rowLevelPermissionPredicates:e.rowLevelPermissionPredicates??[],permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}),pe=e=>{let t=new Set(e);return t.has(`react`)&&t.add(`react/jsx-runtime`),[...t].sort()},I=[`twenty-client-sdk`,`twenty-sdk`],L=e=>{let t=[],n=new Set;for(let r of e){if(!(0,M.isNonEmptyString)(r)){t.push(`"frontComponentSharedDependencies" entries in package.json must be non-empty strings`);continue}if(r.startsWith(`.`)||y.default.posix.isAbsolute(r)||y.default.win32.isAbsolute(r)){t.push(`Shared dependency "${r}" must be a package specifier, not a relative or absolute path`);continue}if(r===`twenty:front-component-shared-dependencies`){t.push(`Shared dependency "${r}" is reserved and cannot be shared`);continue}if(I.some(e=>r===e||r.startsWith(`${e}/`))){t.push(`Shared dependency "${r}" is already served separately and cannot be shared`);continue}if(n.has(r)){t.push(`Shared dependency "${r}" is declared twice`);continue}n.add(r)}return t},me=async e=>{let t=y.default.join(e,`package.json`);if(!await s.i(t))return{errors:[]};let n=(await s.o(t)).frontComponentSharedDependencies;if(n===void 0)return{errors:[]};if(!Array.isArray(n))return{errors:[`"frontComponentSharedDependencies" in package.json must be an array of package specifiers`]};if(!(0,M.isNonEmptyArray)(n))return{errors:[]};let r=L(n);return(0,M.isNonEmptyArray)(r)?{errors:r}:{sharedDependencies:{dependencies:pe(n),builtPath:a.d,builtChecksum:null},errors:[]}},R=`pageType.isInSidePanel.isDashboardPageLayoutInEditMode.isLayoutCustomizationModeEnabled.favoriteRecordIds.isSelectAll.hasAnySoftDeleteFilterOnView.numberOfSelectedRecords.objectPermissions.selectedRecords.featureFlags.targetObjectReadPermissions.targetObjectWritePermissions.canImpersonate.canAccessFullAdminPanel.objectMetadataItem.objectMetadataLabel.isDefined.isNonEmptyString.includes.every.everyDefined.everyEquals.some.someDefined.someEquals.none.noneDefined.noneEquals.someNonEmptyString.includesEvery`.split(`.`),z=`conditionalAvailabilityExpression`,B=[`twenty-sdk/define`,`twenty-sdk`],V=new Set(R),H=(e,t)=>{let n=[];for(let i of e.statements){if(!v.default.isImportDeclaration(i)||!v.default.isStringLiteral(i.moduleSpecifier)||!B.includes(i.moduleSpecifier.text))continue;let a=i.importClause;if(!r.t(a)||a.phaseModifier===v.default.SyntaxKind.TypeKeyword)continue;let o=a.namedBindings;if(r.t(o)){if(v.default.isNamespaceImport(o)){let r=t.getSymbolAtLocation(o.name),i=e=>{v.default.isImportDeclaration(e)||v.default.isTypeNode(e)||(v.default.isPropertyAccessExpression(e)&&v.default.isIdentifier(e.expression)&&t.getSymbolAtLocation(e.expression)===r&&V.has(e.name.text)&&n.push({importedName:e.name.text,node:e}),v.default.forEachChild(e,i))};i(e);continue}if(v.default.isNamedImports(o))for(let i of o.elements){if(i.isTypeOnly)continue;let a=(i.propertyName??i.name).text;if(V.has(a)){let o=t.getSymbolAtLocation(i.name),s,c=e=>{if(!(r.t(s)||v.default.isImportDeclaration(e)||v.default.isTypeNode(e))){if(v.default.isIdentifier(e)){let n=v.default.isShorthandPropertyAssignment(e.parent)?t.getShorthandAssignmentValueSymbol(e.parent):t.getSymbolAtLocation(e);r.t(o)&&n===o&&(s=e)}v.default.forEachChild(e,c)}};c(e),r.t(s)&&n.push({importedName:a,node:s})}}}}return n},U=e=>{let t=!1,n=e=>{if(!t){if((v.default.isPropertyAssignment(e)||v.default.isShorthandPropertyAssignment(e))&&(v.default.isIdentifier(e.name)||v.default.isStringLiteral(e.name))&&e.name.text===z){t=!0;return}v.default.forEachChild(e,n)}};return n(e),t},he=(e,t)=>{if(!R.some(t=>e.includes(t)))return[];let n=v.default.createSourceFile(t,e,v.default.ScriptTarget.Latest,!0,t.endsWith(`.tsx`)?v.default.ScriptKind.TSX:v.default.ScriptKind.TS);if(U(n))return[];let r={noLib:!0,noResolve:!0},i=v.default.createCompilerHost(r);return i.getSourceFile=e=>e===n.fileName?n:void 0,H(n,v.default.createProgram([n.fileName],r,i).getTypeChecker()).map(({importedName:e,node:r})=>{let{line:i,character:a}=n.getLineAndCharacterOfPosition(r.getStart(n));return`${t}:${i+1}:${a+1} - "${e}" is a conditional-availability expression variable from twenty-sdk but this file has no ${z}. These variables can only be used inside a command's ${z}, not at runtime.`})},W={canReadObjectRecords:`read`,canUpdateObjectRecords:`update`,canSoftDeleteObjectRecords:`soft-delete`,canDestroyObjectRecords:`destroy`},G=e=>{let t=new Map;for(let[n,r]of Object.entries(e))t.has(r)||t.set(r,n);return t},K=Object.fromEntries(Object.entries(u.n).map(([e,{universalIdentifier:t}])=>[t,e])),ge=({grant:e,objects:t,permissionFlags:n,systemPermissionFlagNameByUniversalIdentifier:r})=>{let i=e=>t.find(t=>t.universalIdentifier===e)?.nameSingular??K[e]??e;switch(e.type){case`ALL_OBJECT_RECORDS`:return`${W[e.action]} all object records`;case`ALL_SETTINGS`:return`update all settings`;case`ALL_TOOLS`:return`access all tools`;case`PERMISSION_FLAG`:return`permission flag ${n.find(t=>t.universalIdentifier===e.permissionFlagUniversalIdentifier)?.key??r.get(e.permissionFlagUniversalIdentifier)??e.permissionFlagUniversalIdentifier}`;case`OBJECT_RECORDS`:return`${W[e.action]} ${i(e.objectUniversalIdentifier)} records`;case`FIELD_VALUE`:return`${e.action===`canReadFieldValue`?`read`:`update`} field ${e.fieldUniversalIdentifier} of ${i(e.objectUniversalIdentifier)}`;case`ROW_LEVEL_RESTRICTION`:return`${i(e.objectUniversalIdentifier)} records without the row-level restriction`}},q=e=>e.map(e=>`"${e}"`).join(`, `),_e=({agents:e,defaultRoleUniversalIdentifier:t})=>{let n=new Map;for(let i of e)!r.t(i.roleUniversalIdentifier)||i.roleUniversalIdentifier===t||n.set(i.roleUniversalIdentifier,[...n.get(i.roleUniversalIdentifier)??[],i.name]);return n},ve=({applicationRole:e,defaultRoleUniversalIdentifier:t})=>r.t(e)?[]:[`Application default role "${t}" is not defined by this application.`],ye=({agentNamesByRoleUniversalIdentifier:e,roles:t})=>[...e].filter(([e])=>!t.some(t=>t.universalIdentifier===e)).map(([e,t])=>`Agent ${q(t)} references role "${e}", which is not defined by this application.`),be=({agentNamesByRoleUniversalIdentifier:e,applicationRole:t,roles:n,objects:i,permissionFlags:o,systemPermissionFlagNameByUniversalIdentifier:s})=>{let c=o.filter(e=>(e.permissionType??`tool`)===`tool`).map(e=>e.universalIdentifier);return[...e].flatMap(([e,l])=>{let u=n.find(t=>t.universalIdentifier===e);if(!r.t(u))return[];let d=a.i({role:u,superset:t,toolPermissionFlagUniversalIdentifiers:c});if(d.length===0)return[];let f=d.map(e=>ge({grant:e,objects:i,permissionFlags:o,systemPermissionFlagNameByUniversalIdentifier:s})).join(`, `);return[`Role "${u.label}" used by agent ${q(l)} grants more than the application role "${t.label}": ${f}. The application role must cover every permission an agent role grants.`]})},xe=({agents:e,roles:t,objects:n,permissionFlags:a,defaultRoleUniversalIdentifier:o,systemPermissionFlag:s=i.r})=>{let c=t.find(e=>e.universalIdentifier===o),l=_e({agents:e,defaultRoleUniversalIdentifier:o});return[...ve({applicationRole:c,defaultRoleUniversalIdentifier:o}),...ye({agentNamesByRoleUniversalIdentifier:l,roles:t}),...r.t(c)?be({agentNamesByRoleUniversalIdentifier:l,applicationRole:c,roles:t,objects:n,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:G(s)}):[]]},Se=({views:e,objects:t,fields:a})=>{let o=[],s=new Map;for(let e of a)s.set(e.universalIdentifier,e);for(let e of t)for(let t of e.fields)s.set(t.universalIdentifier,t);for(let t of e)for(let e of t.filters??[]){let t=s.get(e.fieldMetadataUniversalIdentifier);if(!r.t(t))continue;let a=(t.type===i.I.RELATION||t.type===i.I.MORPH_RELATION)&&r.t(e.relationTargetFieldMetadataUniversalIdentifier)?s.get(e.relationTargetFieldMetadataUniversalIdentifier)?.type??t.type:t.type;if(!(a in n.r))continue;let c=n.o({filterType:a,subFieldName:e.subFieldName});c.includes(e.operand)||o.push(`Operand "${e.operand}" is not supported on field "${t.name}" (type "${a}"). Supported operands: ${c.join(`, `)}.`)}return o},Ce=e=>{try{let t=JSON.parse((0,g.readFileSync)((0,h.join)(e,`package.json`),`utf-8`)).engines?.twenty;return typeof t==`string`&&t.trim()!==``?t.trim():null}catch{return null}},we=e=>c.t(e),Te=async e=>(await(0,_.glob)([`${a.u}/**/*`],{cwd:e,absolute:!0,onlyFiles:!0})).sort(),Ee=async e=>{try{let t=await(0,m.readFile)((0,y.join)(e,`README.md`),`utf-8`);return t.trim().length>0?t:void 0}catch{return}},De=async e=>{let t=await we(e),i=await Ee(e),a=[],o=[],s,c=[],u=[],f=[],p=[],h=[],g=[],_=[],v=[],b=[],x=[],S=[],C=[],ee=[],te=[],ne=[],re=[],w=[],ie=[],T=[],ae=[],E=[],D=[],O=[],k=[],se=[],A=[],j=[],M=[],N=[],P=[],F=[],le=[],pe=[],I=[],L=[],R=[],z=[],B=[],V=[],H=[],U=[],W=[],G=[],K=[],ge=[],q=[],_e=[],ve=[],ye=[],be=[],De=[],J=[],Y=[],X=[],Oe=[];for(let i of t){let t=await(0,m.readFile)(i,`utf-8`),d=(0,y.relative)(e,i);a.push(...he(t,d));let f=l.r(t);if(!f)continue;let _=l.n[f];switch(_){case`application`:{let t=await l.t({appPath:e,filePath:i});s=t.config,a.push(...t.errors),o.push(...t.warnings??[]),le.push(d);break}case`objects`:{let t=await l.t({appPath:e,filePath:i});c.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),pe.push(d);break}case`fields`:{let t=await l.t({appPath:e,filePath:i}),n=oe(t.config);p.push(n),a.push(...t.errors),o.push(...t.warnings??[]),I.push(d);break}case`permissionFlags`:{let t=await l.t({appPath:e,filePath:i});g.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),R.push(d);break}case`roles`:{let t=await l.t({appPath:e,filePath:i});u.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),z.push(d),f===`defineApplicationRole`&&F.push(t.config.universalIdentifier);break}case`skills`:{let t=await l.t({appPath:e,filePath:i});v.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),B.push(d);break}case`agents`:{let t=await l.t({appPath:e,filePath:i});b.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),V.push(d);break}case`workflows`:{let t=await l.t({appPath:e,filePath:i});x.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),H.push(d);break}case`connectionProviders`:{let t=await l.t({appPath:e,filePath:i});S.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),U.push(d);break}case`messagingProviders`:{let t=await l.t({appPath:e,filePath:i});C.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),W.push(d);break}case`mcpServers`:{let t=await l.t({appPath:e,filePath:i});ee.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),G.push(d);break}case`logicFunctions`:{let n=await l.t({appPath:e,filePath:i});a.push(...n.errors),o.push(...n.warnings??[]),f===`definePreInstallLogicFunction`&&r.t(n.config.serverRouteTriggerSettings)&&a.push(`${d}: pre-install logic functions cannot define serverRouteTriggerSettings.`);let s=await ue({logicFunctionConfig:n.config,sourceCode:t,sourcePath:d});if(te.push(s),K.push(d),f===`definePostInstallLogicFunction`){let e=n.config;A.push({universalIdentifier:n.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1,shouldRunSynchronously:e.shouldRunSynchronously??!1})}if(f===`definePreInstallLogicFunction`){let e=n.config;j.push({universalIdentifier:n.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1})}f===`defineUninstallLogicFunction`&&M.push({universalIdentifier:n.config.universalIdentifier}),f===`defineHealthCheck`&&N.push({universalIdentifier:n.config.universalIdentifier});break}case`frontComponents`:{let t=await l.t({appPath:e,filePath:i});a.push(...t.errors),o.push(...t.warnings??[]);let n=de({frontComponentConfig:t.config,sourcePath:d});ne.push(n),ge.push(d),f===`defineSettingsFrontComponent`&&P.push(t.config.universalIdentifier);break}case`views`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};w.push(n),a.push(...t.errors),o.push(...t.warnings??[]),_e.push(d);break}case`viewFields`:{let t=await l.t({appPath:e,filePath:i});ie.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),ve.push(d);break}case`navigationMenuItems`:{let t=await l.t({appPath:e,filePath:i});T.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),ye.push(d);break}case`pageLayouts`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};ae.push(n),a.push(...t.errors),o.push(...t.warnings??[]),be.push(d);break}case`indexes`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};h.push(n),a.push(...t.errors),o.push(...t.warnings??[]),L.push(d);break}case`pageLayoutTabs`:{let t=await l.t({appPath:e,filePath:i}),n={...t.config};E.push(n),a.push(...t.errors),o.push(...t.warnings??[]),De.push(d);break}case`pageLayoutWidgets`:{let t=await l.t({appPath:e,filePath:i});D.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),J.push(d);break}case`commandMenuItems`:{let t=await l.t({appPath:e,filePath:i});O.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),Y.push(d);break}case`timelineActivityTypes`:{let t=await l.t({appPath:e,filePath:i});k.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),X.push(d);break}case`settingsMenuItems`:{let t=await l.t({appPath:e,filePath:i});se.push(t.config),a.push(...t.errors),o.push(...t.warnings??[]),Oe.push(d);break}default:n.t(_)}}let ke=await Te(e);for(let t of ke){let n=(0,y.relative)(e,t);re.push({filePath:n,fileName:(0,y.basename)(t),fileType:(0,y.extname)(t).replace(/^\./,``),checksum:null}),q.push(n)}if(s||a.push(`Cannot build application, please export default defineApplication() to define an application`),s){for(let e of c){let{objectManifest:t,errors:n}=ce({objectConfig:e,applicationUniversalIdentifier:s.universalIdentifier});a.push(...n),t&&f.push(t)}for(let e of u)_.push(fe({roleConfig:e,applicationUniversalIdentifier:s.universalIdentifier}))}A.length>1&&a.push(`Only one post install logic function is allowed per application`),j.length>1&&a.push(`Only one pre install logic function is allowed per application`),M.length>1&&a.push(`Only one uninstall logic function is allowed per application`),N.length>1&&a.push(`Only one health check is allowed per application`),P.length>1&&a.push(`Only one settings front component is allowed per application`),F.length>1&&a.push(`Only one defineApplicationRole is allowed per application`);let{sharedDependencies:Ae,errors:je}=await me(e);a.push(...je);let Z=s?.defaultRoleUniversalIdentifier??(F.length===1?F[0]:void 0);s&&!Z&&a.push("Application must declare a default role: either pass `defaultRoleUniversalIdentifier` to defineApplication() or mark a role file with defineApplicationRole()"),a.push(...Se({views:w,objects:f,fields:p})),r.t(s)&&r.t(Z)&&a.push(...xe({agents:b,roles:_,objects:f,permissionFlags:g,defaultRoleUniversalIdentifier:Z,systemPermissionFlag:d.o(e)}));let Q=s&&Z?(()=>{let{logoUrl:t,screenshots:n,...a}=s;return{...a,logo:s.logo,galleryImages:s.galleryImages??[],defaultRoleUniversalIdentifier:Z,aboutDescription:i,yarnLockChecksum:null,packageJsonChecksum:``,requiredServerVersionRange:Ce(e),...A.length>=1?{postInstallLogicFunction:A[0]}:{},...j.length>=1?{preInstallLogicFunction:j[0]}:{},...M.length>=1?{uninstallLogicFunction:M[0]}:{},...N.length>=1?{healthCheckLogicFunction:N[0]}:{},...P.length>=1?{settingsFrontComponent:{universalIdentifier:P[0]}}:{},...r.t(Ae)?{frontComponentSharedDependencies:Ae}:{}}})():void 0,$=(e,t)=>e.universalIdentifier.localeCompare(t.universalIdentifier);return{manifest:Q?{application:Q,objects:f.sort($),fields:p.sort($),indexes:h.sort($),permissionFlags:g.sort($),roles:_.sort($),skills:v.sort($),agents:b.sort($),workflows:x.sort($),connectionProviders:S.sort($),messagingProviders:C.sort($),mcpServers:ee.sort($),logicFunctions:te.sort($),frontComponents:ne.sort($),publicAssets:re.sort((e,t)=>e.filePath.localeCompare(t.filePath)),views:w.sort($),viewFields:ie.sort($),navigationMenuItems:T.sort($),pageLayouts:ae.sort($),pageLayoutTabs:E.sort($),pageLayoutWidgets:D.sort($),commandMenuItems:O.sort($),timelineActivityTypes:k.sort($),settingsMenuItems:se.sort($)}:null,filePaths:{application:le,objects:pe,fields:I,indexes:L,permissionFlags:R,roles:z,skills:B,agents:V,workflows:H,connectionProviders:U,messagingProviders:W,mcpServers:G,logicFunctions:K,frontComponents:ge,publicAssets:q,views:_e,viewFields:ve,navigationMenuItems:ye,pageLayouts:be,pageLayoutTabs:De,pageLayoutWidgets:J,commandMenuItems:Y,timelineActivityTypes:X,settingsMenuItems:Oe},errors:a,warnings:o}},J=[i.I.RELATION,i.I.MORPH_RELATION],Y=e=>J.includes(e.type),X=e=>{let t=new Set,n=new Set;for(let r of e)t.has(r)?n.add(r):t.add(r);return Array.from(n)},Oe=({manifest:e,pageLayoutWidgets:t})=>{let n=new Set([e.application.settingsFrontComponent?.universalIdentifier,...e.settingsMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.commandMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.timelineActivityTypes.map(e=>e.frontComponentUniversalIdentifier),...t.map(({configuration:e})=>r.t(e)&&`frontComponentUniversalIdentifier`in e?e.frontComponentUniversalIdentifier:void 0)].filter(r.t));return e.frontComponents.filter(e=>!e.isHeadless&&!r.t(e.widgetAvailability)&&!n.has(e.universalIdentifier)).map(e=>`Front component "${e.name??e.componentName}" declares no widgetAvailability, so it is not offered in any widget picker. Set widgetAvailability to let users add it to record pages or dashboards.`)},ke=e=>{let t=[],n=[...e.pageLayouts.flatMap(({tabs:e})=>e??[]),...e.pageLayoutTabs];for(let e of n){e.layoutMode===i.R.CANVAS&&t.push(`Page layout tab "${e.title}" uses deprecated CANVAS. For a full-height widget, use VERTICAL_LIST and set the widget's heightBehavior to 'TAB_VIEWPORT'. Existing Canvas layouts remain supported and are not converted.`);for(let n of e.widgets??[])n.position?.layoutMode===i.R.VERTICAL_LIST&&t.push(`Page layout widget "${n.title}" uses a deprecated vertical-list position. Order the widgets array by position.index, remove position, and move any position.heightBehavior to heightBehavior. Existing positions remain supported and keep their indices.`),`gridPosition`in n&&r.t(n.gridPosition)&&t.push(`Page layout widget "${n.title}" uses deprecated gridPosition. If position is already set, it takes precedence; remove the ignored gridPosition. Use position with layoutMode: 'GRID' and the same row, column, rowSpan and columnSpan only when position is absent. Existing gridPosition remains supported as a fallback.`)}return t},Ae=[`id`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`deletedAt`,`position`,`searchVector`],je=e=>e.objects.flatMap(t=>{let n=t.labelIdentifierFieldMetadataUniversalIdentifier?.toLowerCase();return r.t(n)?[...(t.fields??[]).map(e=>e.universalIdentifier.toLowerCase()),...e.fields.filter(e=>e.objectUniversalIdentifier.toLowerCase()===t.universalIdentifier.toLowerCase()).map(e=>e.universalIdentifier.toLowerCase()),...Ae.map(n=>o.a({applicationUniversalIdentifier:e.application.universalIdentifier,objectUniversalIdentifier:t.universalIdentifier,name:n}))].includes(n)?[]:[`Object "${t.nameSingular}" references label field ${n}, which is not declared in this app or a recognized generated field. Check the identifier; the server must resolve this reference before applying.`]:[]}),Z=e=>{let t=[],o=X(e.timelineActivityTypes.map(e=>e.name)),s=new Set(e.frontComponents.map(e=>e.universalIdentifier));for(let e of o)t.push(`Timeline activity type name "${e}" is used more than once. Names must be unique within an application.`);for(let o of e.timelineActivityTypes){r.t(o.frontComponentUniversalIdentifier)&&!s.has(o.frontComponentUniversalIdentifier)&&t.push(`Timeline activity type "${o.name}" references front component "${o.frontComponentUniversalIdentifier}", which is not defined by this application.`);let c=o.emit,l=o.replacesTimelineActivityTypeUniversalIdentifier;if(!r.t(c)){r.t(l)&&t.push(`Timeline activity type "${o.name}" declares replacesTimelineActivityTypeUniversalIdentifier without an automatic emit contract.`);continue}let u=c.through,d=u?.triggerFieldUniversalIdentifiers,f=a.p(c.objectUniversalIdentifier);f||t.push(`Timeline activity type "${o.name}" references an invalid object universal identifier "${c.objectUniversalIdentifier}".`),(c.on===`linked`||c.on===`unlinked`)&&!r.t(u)&&t.push(`Timeline activity type "${o.name}" must declare emit.through for a ${c.on} event.`),r.t(d)&&(c.on!==`updated`||!n.n(d)||new Set(d).size!==d.length)&&t.push(`Timeline activity type "${o.name}" trigger fields must be a non-empty list of unique fields on an updated through event.`);let p=f?e.objects.find(e=>e.universalIdentifier===c.objectUniversalIdentifier):void 0;if(!r.t(p)){f&&!r.t(l)&&t.push(`Timeline activity type "${o.name}" targets object "${c.objectUniversalIdentifier}", which is not defined by this application. Types targeting another application's object must declare replacesTimelineActivityTypeUniversalIdentifier.`),r.t(l)&&!a.p(l)&&t.push(`Timeline activity type "${o.name}" references an invalid replacement universal identifier "${l}".`),r.t(u)&&!a.p(u.relationFieldUniversalIdentifier)&&t.push(`Timeline activity type "${o.name}" references an invalid through relation field universal identifier "${u.relationFieldUniversalIdentifier}".`);let e=d?.filter(e=>!a.p(e))??[];e.length>0&&t.push(`Timeline activity type "${o.name}" references invalid trigger field universal identifiers: ${e.join(`, `)}.`);continue}r.t(l)&&t.push(`Timeline activity type "${o.name}" targets an object defined by this application and must not replace another application's type.`);let m=[...p.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===p.universalIdentifier)];if(!r.t(u))continue;let h=m.find(e=>e.universalIdentifier===u.relationFieldUniversalIdentifier);if(r.t(h)?Y(h)&&r.t(h.universalSettings)&&(h.universalSettings.relationType===i.A.MANY_TO_ONE||h.universalSettings.relationType===i.A.ONE_TO_MANY&&(0,M.isNonEmptyString)(h.universalSettings.junctionTargetFieldUniversalIdentifier))||t.push(`Timeline activity type "${o.name}" must route through a MANY_TO_ONE relation or a junction-backed ONE_TO_MANY relation.`):t.push(`Timeline activity type "${o.name}" references relation field "${u.relationFieldUniversalIdentifier}", which is not defined on object "${p.nameSingular}".`),r.t(d)){let e=new Set(m.map(e=>e.universalIdentifier)),n=d.filter(t=>!e.has(t));n.length>0&&t.push(`Timeline activity type "${o.name}" references trigger fields that are not defined on object "${p.nameSingular}": ${n.join(`, `)}.`)}}return t},Q=[i.A.MANY_TO_ONE,i.A.ONE_TO_MANY],$=`aggregateFieldMetadataId`,Me=e=>r.t(e)&&i.T.some(t=>t===e.configurationType),Ne=e=>{let t=[];if(!e)return[];for(let[n,r]of Object.entries(e))n===`universalIdentifier`&&typeof r==`string`&&t.push(r),!(n===`postInstallLogicFunction`||n===`preInstallLogicFunction`||n===`uninstallLogicFunction`||n===`healthCheckLogicFunction`||n===`identifyAccountLogicFunction`||n===`authorizeLogicFunction`||n===`callbackLogicFunction`||n===`onConnectLogicFunction`||n===`onDisconnectLogicFunction`||n===`sendMessageLogicFunction`||n===`connectionProvider`||n===`settingsFrontComponent`||n===`input`||n===`expectedBody`||n===`outputSchema`||n===`expectedOutputSchema`)&&typeof r==`object`&&t.push(...Ne(r));return t},Pe=e=>{let t=[];for(let n of e){if(!Y(n))continue;let e=n.universalSettings;if(!e?.relationType){t.push(`Relation field "${n.name}" is missing relationType. ${n.type} fields must declare a relationType (${Q.join(` or `)}) in universalSettings.`);continue}if(!Q.includes(e.relationType)){t.push(`Relation field "${n.name}" has invalid relationType "${e.relationType}". Expected ${Q.join(` or `)}.`);continue}e.relationType===i.A.MANY_TO_ONE&&!e.joinColumnName&&t.push(`MANY_TO_ONE relation field "${n.name}" is missing joinColumnName. MANY_TO_ONE relations must declare a joinColumnName in universalSettings.`)}return t},Fe=e=>{let t=e.pageLayouts.flatMap(e=>e.tabs?.flatMap(e=>e.widgets??[])??[]),n=e.pageLayoutTabs.flatMap(e=>e.widgets??[]);return[...t,...n,...e.pageLayoutWidgets??[]]},Ie=e=>{let t=[];for(let n of e){let e=n.configuration;if(Me(e)&&!(0,M.isNonEmptyString)(e.aggregateFieldMetadataUniversalIdentifier)){let r=$ in e?` Reference the aggregate field with "aggregateFieldMetadataUniversalIdentifier" (not "${$}").`:``;t.push(`Graph widget "${n.title}" is missing aggregateFieldMetadataUniversalIdentifier.${r}`)}}return t},Le=({pageLayoutTab:e,pageLayoutType:t})=>{let n=a.f({pageLayoutTabManifest:e,pageLayoutType:t});return n.status===`fail`?n.errors:[]},Re=e=>{let t=new Map(e.pageLayouts.map(e=>[e.universalIdentifier,e.type])),n=e.pageLayouts.flatMap(e=>(e.tabs??[]).flatMap(t=>Le({pageLayoutTab:t,pageLayoutType:e.type}))),i=e.pageLayoutTabs.flatMap(e=>Le({pageLayoutTab:e,pageLayoutType:r.t(e.pageLayoutUniversalIdentifier)?t.get(e.pageLayoutUniversalIdentifier):void 0}));return[...n,...i]},ze=e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;if(n.add(r),!x(r)){t.push(`Universal identifier "${r}" is not a valid UUID.`);continue}let e=D(r);a.p(r)||t.push(`Universal identifier "${r}" is UUID version ${e}. Only UUID version 4 or higher is allowed.`)}return t},Be=e=>{let t=[],n=Fe(e),a=[...ke(e),...je(e),...Oe({manifest:e,pageLayoutWidgets:n})],o=Ne(e),s=X(o.map(e=>e.toLowerCase()));s.length>0&&t.push(`Duplicate universal identifiers: ${s.join(`, `)}`);let c=ze(o);c.length>0&&t.push(`Invalid universal identifiers: ${c.join(`, `)}`);let l=[...e.fields,...e.objects.flatMap(e=>e.fields)];for(let e of l)if((e.type===i.I.SELECT||e.type===i.I.MULTI_SELECT||e.type===i.I.RATING)&&r.t(e.options)){e.options.some(({id:e})=>r.t(e)&&!(0,M.isNonEmptyString)(e))&&t.push(`Field "${e.name}" has empty option IDs. Set distinct non-empty IDs on these options.`);let n=X(e.options.map(e=>e.id).filter(r.t).map(e=>e.toLowerCase()));n.length>0&&t.push(`Field "${e.name}" has duplicate option IDs: ${n.join(`, `)}. Set distinct explicit IDs on these options.`)}return t.push(...Pe(l)),t.push(...Re(e)),t.push(...Ie(n)),t.push(...Z(e)),{errors:t,warnings:a,isValid:t.length===0}},Ve={"twenty-sdk":`"twenty-sdk" is listed under "dependencies" in package.json. It is a build-time only tool and should be moved to "devDependencies".`,"twenty-client-sdk":`"twenty-client-sdk" is listed under "dependencies" in package.json. It is provided at runtime by Twenty's injected SDK and should be moved to "devDependencies".`},He=async e=>{let t=y.default.join(e,`package.json`);if(!await s.i(t))return[];let n=await s.o(t);return[`dependencies`,`optionalDependencies`].flatMap(e=>Object.entries(Ve).filter(([t])=>r.t(n[e]?.[t])).map(([,t])=>t.replace(`"dependencies"`,`"${e}"`)))},Ue=async e=>await s.i(e)?(await(0,m.stat)(e)).size===0?[`yarn.lock is empty. Run "yarn install" to regenerate it before building.`]:[]:[`yarn.lock not found. Run "yarn install" to generate it before building.`],We=e=>Ue(y.default.join(e,`yarn.lock`)),Ge=async e=>{let t=await De(e);if(t.errors.length>0||!t.manifest)return{success:!1,errors:t.errors.length>0?t.errors:[`Failed to build manifest.`]};let n=Be(t.manifest);if(!n.isValid)return{success:!1,errors:n.errors};let r=await We(e);if(r.length>0)return{success:!1,errors:r};let i=await He(e);return{success:!0,manifest:t.manifest,filePaths:t.filePaths,warnings:[...t.warnings,...n.warnings,...i]}},Ke=({catalog:e,onCollision:t})=>{let n={},i=new Map;for(let{message:a,context:o,translation:s}of d.n(e)){if(s.length===0)continue;let e=r.t(o)?`${o} ${a}`:a,c=d.r(a,o),l=i.get(c);r.t(l)&&l!==e&&t?.({messageId:c,keptKey:e,droppedKey:l}),i.set(c,e),n[c]=s}return n},qe=async({filePath:e,onWarning:t})=>{let n;try{n=await s.o(e)}catch{return t(`Skipping translation file "${y.default.basename(e)}": it is not valid JSON.`),null}return!r.t(n)||typeof n!=`object`||Array.isArray(n)?(t(`Skipping translation file "${y.default.basename(e)}": expected a JSON object.`),null):n},Je=async({appPath:e,onWarning:t})=>{let n=y.default.join(e,f.t);if(!await s.i(n))return{};let r={};for(let e of(await(0,m.readdir)(n)).filter(e=>e.endsWith(`.json`))){let i=y.default.basename(e,`.json`);if(i===`en`)continue;if(!p.t(i)){t(`Skipping compiled translation file "${e}": "${i}" is not a supported locale.`);continue}let a=await qe({filePath:y.default.join(n,e),onWarning:t});if(a===null)continue;let o=Object.fromEntries(Object.entries(a).filter(e=>typeof e[1]==`string`&&e[1].length>0));Object.keys(o).length>0&&(r[i]=o)}return r},Ye=async({appPath:e,onWarning:t=e=>console.warn(e)})=>{let n=y.default.join(e,f.n);if(!await s.i(n))return;let r=(await(0,m.readdir)(n)).filter(e=>e.endsWith(`.json`)),i={};for(let e of r){let r=y.default.basename(e,`.json`);if(r===`en`)continue;if(!p.t(r)){t(`Skipping translation file "${e}": "${r}" is not a supported locale.`);continue}let a=await qe({filePath:y.default.join(n,e),onWarning:t});if(a===null)continue;let o=Ke({catalog:a,onCollision:({messageId:n,keptKey:r,droppedKey:i})=>t(`Message id collision in "${e}": "${r}" and "${i}" share id "${n}". Keeping "${r}".`)});Object.keys(o).length>0&&(i[r]=o)}for(let[n,r]of Object.entries(await Je({appPath:e,onWarning:t})))i[n]={...r,...i[n]??{}};return i};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ye}});
|