twenty 2.46.0 → 2.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +25 -17
- package/dist/app-template/yarn.lock +24 -24
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/application-VJqniwXy.cjs +5 -0
- package/dist/chunks/build-pull-entities-BBNc4zkt.cjs +5 -0
- package/dist/chunks/{build-source-manifest-CLKH5vzc.cjs → build-source-manifest-BMjw7BvT.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-CbGsy1-v.cjs → build-source-snapshot-BbQlyo_m.cjs} +7 -7
- package/dist/chunks/{check-node-requirement-mqwNPktb.cjs → check-node-requirement-CGBKvEqH.cjs} +1 -1
- package/dist/chunks/cli-node-version-range.constant-D7fE8edk.cjs +1 -0
- package/dist/chunks/cli-version.constant-BJdY4dXs.cjs +1 -0
- package/dist/chunks/collect-translatable-strings-C3TWaO1V.cjs +1 -0
- package/dist/chunks/{collect-watch-inputs-B9jWG4W0.cjs → collect-watch-inputs-Cexr5YYZ.cjs} +1 -1
- package/dist/chunks/compile-application-translations-Dhfvrs__.cjs +1 -0
- package/dist/chunks/{constants-CL6mrTMT-B748cNNG.cjs → constants-Du9J-8Ug-CD8GTrut.cjs} +1 -1
- package/dist/chunks/{convert-to-label-BPBLtc_O.cjs → convert-to-label-D24GvvpW.cjs} +1 -1
- package/dist/chunks/create-app-not-installed-error-DY-iuPPx.cjs +1 -0
- package/dist/chunks/{create-http-status-error-D3gy3DzB.cjs → create-http-status-error-Dd3336c8.cjs} +1 -1
- package/dist/chunks/create-metadata-client-DEBMHFDo.cjs +6 -0
- package/dist/chunks/create-pull-base-write-Cl1jfQ6l.cjs +1 -0
- package/dist/chunks/{create-rest-client-eAfOFfDA.cjs → create-rest-client-r3OA3fUu.cjs} +16 -14
- package/dist/chunks/create-tooling-failure-B2FmNwR2.cjs +1 -0
- package/dist/chunks/{extract-manifest-from-file-j-Y9wNas.cjs → extract-manifest-from-file-D3w7Ampa.cjs} +1 -1
- package/dist/chunks/extract-source-translations-BLQ-XFuN.cjs +1 -0
- package/dist/chunks/{fetch-metadata-inspection-Dp034TpK.cjs → fetch-metadata-inspection-BwJjaHCB.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-BhvaL3zp.cjs → fetch-signed-in-identity-CWFlsW7e.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-id-DJStmf_V.cjs → fetch-workspace-id-DJFdCITG.cjs} +1 -1
- package/dist/chunks/format-body-CJyi3Ukr.cjs +1 -0
- package/dist/chunks/{format-data-value-B6rIbpJv.cjs → format-data-value-C5itQm1i.cjs} +1 -1
- package/dist/chunks/format-display-path-gEepVJDg.cjs +1 -0
- package/dist/chunks/{format-metadata-fields-DJnTg1R9.cjs → format-metadata-fields-BozY419E.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-yUeocnwY.cjs → format-metadata-owner-C6CksDIK.cjs} +1 -1
- package/dist/chunks/format-progress-line-C5nYDVHB.cjs +1 -0
- package/dist/chunks/generate-application-client-BApuJWQO.cjs +1 -0
- package/dist/chunks/{get-app-plan-summary-B0uwHXbO.cjs → get-app-plan-summary-F_MjZOGe.cjs} +2 -2
- package/dist/chunks/get-client-generation-skip-reason-B5f_gcok.cjs +1 -0
- package/dist/chunks/get-client-sdk-package-path-2U3kDCRq.cjs +1 -0
- package/dist/chunks/{get-function-input-schema-GNk3NRLJ-Bfph1o9z.cjs → get-function-input-schema-GNk3NRLJ-oQ5Evald.cjs} +1 -1
- package/dist/chunks/global-flags.constant-BPHQAhn7.cjs +1 -0
- package/dist/chunks/is-access-token-expiring-DIimejBr.cjs +1 -0
- package/dist/chunks/{is-application-not-found-error-mNeGbxmT.cjs → is-application-not-found-error-D0BAcKyX.cjs} +1 -1
- package/dist/chunks/is-exported-manifest-RF_O2ibz.cjs +1 -0
- package/dist/chunks/is-inside-directory-DHVCQE5C.cjs +1 -0
- package/dist/chunks/{is-interaction-allowed-ycbAFMIj.cjs → is-interaction-allowed-CF-ko1KI.cjs} +1 -1
- package/dist/chunks/is-locale-catalog-Dzj6m_Xt.cjs +1 -0
- package/dist/chunks/is-supported-locale-C9iuFQ39.cjs +1 -0
- package/dist/chunks/{is-supported-locale-BAjnKnKj.cjs → locale-catalog-format-BT6ommA1.cjs} +5 -5
- package/dist/chunks/metadata-BtOyR6x0.cjs +1 -0
- package/dist/chunks/{metadata-page.constant-BkG4ndrO.cjs → metadata-page.constant-CnR03vnh.cjs} +1 -1
- package/dist/chunks/{parse-api-url-BllxRdpE.cjs → parse-api-url-C9MmGtLY.cjs} +1 -1
- package/dist/chunks/{parse-app-export-BkfflyUY.cjs → parse-app-export-BT6nM7Ki.cjs} +1 -1
- package/dist/chunks/parse-extraction-locale-CM7sARBo.cjs +1 -0
- package/dist/chunks/{parse-graphql-response-CtP9KTS2.cjs → parse-graphql-response-DbYu3YlQ.cjs} +1 -1
- package/dist/chunks/{parse-json-input-CvMTKAWw.cjs → parse-json-input-DaXTn_6C.cjs} +1 -1
- package/dist/chunks/{print-typescript-value-DhElcFzI.cjs → print-typescript-value-BoxeFXca.cjs} +1 -1
- package/dist/chunks/pull-source-DNswr_80.cjs +1 -0
- package/dist/chunks/read-app-identity-CtO3wiSx.cjs +1 -0
- package/dist/chunks/read-application-identifier-B51ax_Q6.cjs +1 -0
- package/dist/chunks/{read-application-identity-BFg_p84F.cjs → read-application-identity-Bx8B9Bel.cjs} +1 -1
- package/dist/chunks/{read-config-DUJ27809.cjs → read-config-LKYhSPOb.cjs} +1 -1
- package/dist/chunks/read-json-object-BONMjSVo.cjs +1 -0
- package/dist/chunks/read-snapshot-file-ClIpemjz.cjs +1 -0
- package/dist/chunks/{read-source-identity-C8LG1v6U.cjs → read-source-identity-C4eKC14c.cjs} +1 -1
- package/dist/chunks/record-pull-base-CdTOndSf.cjs +1 -0
- package/dist/chunks/{record-typecheck-config-inputs-BDqkKCrj.cjs → record-typecheck-config-inputs-DcCY-_Z1.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-C4KKlTQT.cjs → request-oauth-tokens-CS79pVAp.cjs} +1 -1
- package/dist/chunks/require-approval-D0FfoHhF.cjs +1 -0
- package/dist/chunks/resolve-app-project-BQnFOdLH.cjs +1 -0
- package/dist/chunks/resolve-command-target-CKYtQQPx.cjs +1 -0
- package/dist/chunks/resolve-inside-sdk-Cc_y-RWT.cjs +1 -0
- package/dist/chunks/{resolve-metadata-object-QoDi-Aik.cjs → resolve-metadata-object-CRWbF9Ce.cjs} +1 -1
- package/dist/chunks/resolve-project-typescript-CZW_p97L.cjs +1 -0
- package/dist/chunks/{resolve-request-url-jC5kYwkn.cjs → resolve-request-url-BrqiqInn.cjs} +1 -1
- package/dist/chunks/resolve-source-sdk-CGEJC-UH.cjs +1 -0
- package/dist/chunks/{run-api-graphql-command-Biy0WqXa.cjs → run-api-graphql-command-KlIMjpOY.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-D9kdQceV.cjs → run-api-rest-command-W4gCU562.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-DcTQg7Si.cjs → run-app-add-command-C6rIt02R.cjs} +5 -5
- package/dist/chunks/run-app-apply-command-BckNNni9.cjs +2 -0
- package/dist/chunks/{run-app-build-command-BRYb0one.cjs → run-app-build-command-DW0r-w2C.cjs} +1 -1
- package/dist/chunks/run-app-dev-command-C3U-3OiV.cjs +2 -0
- package/dist/chunks/run-app-exec-command-DNeCk5qs.cjs +3 -0
- package/dist/chunks/run-app-generate-client-command-HAgBNVFU.cjs +2 -0
- package/dist/chunks/run-app-init-command-dTbY28oS.cjs +2 -0
- package/dist/chunks/run-app-install-command-BX30OsrQ.cjs +1 -0
- package/dist/chunks/run-app-logs-command-CdAXR-XY.cjs +9 -0
- package/dist/chunks/run-app-operation--X_q0SAn.cjs +1 -0
- package/dist/chunks/run-app-plan-command-Bm1eXl7V.cjs +1 -0
- package/dist/chunks/run-app-publish-command-Cdb3OlI2.cjs +3 -0
- package/dist/chunks/run-app-pull-command-DljZP4Ey.cjs +3 -0
- package/dist/chunks/run-app-translations-extract-command-Cc053lZ6.cjs +2 -0
- package/dist/chunks/{run-app-typecheck-command-C8LqpOej.cjs → run-app-typecheck-command-B7o20_BR.cjs} +1 -1
- package/dist/chunks/run-app-uninstall-command-DJsWZtoI.cjs +2 -0
- package/dist/chunks/{run-auth-login-command-_zDgRcth.cjs → run-auth-login-command-21pHzpvT.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-BO6O7GVi.cjs → run-auth-logout-command-DWOafJmL.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-Cj-vqoHg.cjs → run-auth-status-command-BBAcouvs.cjs} +1 -1
- package/dist/chunks/{run-cli-c9TOR0zj.cjs → run-cli-D1VWVXar.cjs} +8 -8
- package/dist/chunks/{run-commands-command-C6gvMpQ_.cjs → run-commands-command-6x3V48LL.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-jDEU4EG1.cjs → run-data-get-command-DrgvC-zi.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-EnCdbuzc.cjs → run-data-list-command-Cs8GAHbD.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-DnJ6io-m.cjs → run-doctor-command-BM4pkNY0.cjs} +2 -2
- package/dist/chunks/{run-metadata-field-describe-command-vJngpw2S.cjs → run-metadata-field-describe-command-CrmzNFh8.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-CR4w7fI6.cjs → run-metadata-field-list-command-B2CbERvZ.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-CHP8K-W2.cjs → run-metadata-object-describe-command-PLt5ySLJ.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-BqXMcAp6.cjs → run-metadata-object-list-command-BcnWKmgh.cjs} +1 -1
- package/dist/chunks/{run-open-command-DKl8acw0.cjs → run-open-command-CzMO5wI4.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-DeAzr5Mn.cjs → run-remote-list-command-37zf0rSp.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-D0C5sWjP.cjs → run-remote-remove-command-B-XUqYBY.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-Byq9WRHd.cjs → run-remote-rename-command-Bmg3nZfB.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-B6VVDlMG.cjs → run-remote-use-command-r2NUlgWw.cjs} +1 -1
- package/dist/chunks/{run-version-command-BmSk8PUV.cjs → run-version-command-DfDcA927.cjs} +1 -1
- package/dist/chunks/{select-target-C1VZjf-A.cjs → select-target-CEy96CC9.cjs} +1 -1
- package/dist/chunks/sign-in-to-remote-again-9cHGpXda.cjs +1 -0
- package/dist/chunks/sign-in-with-browser-StQ_Fkku.cjs +1 -0
- package/dist/chunks/to-public-target-T4zHrdLQ.cjs +1 -0
- package/dist/chunks/{to-worker-output-diagnostics-lprh9b0l.cjs → to-worker-output-diagnostics-BeJKIsDG.cjs} +1 -1
- package/dist/chunks/{typecheck-application-DGrovgX9.cjs → typecheck-application-DLdoLIDx.cjs} +2 -2
- package/dist/chunks/{update-config-BkKBEfAp.cjs → update-config-CNOHxgkF.cjs} +1 -1
- package/dist/chunks/utils-BEfQWzTA-z2Y1wZJq.cjs +35 -0
- package/dist/chunks/with-phase-details-Dof8Ao9R.cjs +1 -0
- package/dist/chunks/{write-config-atomically-DRWTukU-.cjs → write-config-atomically-gr2Ldzm8.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +93 -5
- package/package.json +6 -6
- package/src/app/source/README.md +1 -1
- package/dist/chunks/application-DuIJE2qG.cjs +0 -5
- package/dist/chunks/build-pull-entities-zwArrVMk.cjs +0 -5
- package/dist/chunks/cli-version.constant-aSp8WZDh.cjs +0 -1
- package/dist/chunks/compile-application-translations-B59jYVWc.cjs +0 -1
- package/dist/chunks/create-app-not-installed-error-Cc8YZqI7.cjs +0 -1
- package/dist/chunks/create-metadata-client-ChjDalSi.cjs +0 -6
- package/dist/chunks/create-pull-base-write-rxjcKtD-.cjs +0 -1
- package/dist/chunks/create-tooling-failure-DLI5FlQP.cjs +0 -1
- package/dist/chunks/format-body-VcKL4WXt.cjs +0 -1
- package/dist/chunks/generate-application-client-CCVLjxTj.cjs +0 -1
- package/dist/chunks/global-flags.constant-8GfW0sNU.cjs +0 -1
- package/dist/chunks/is-access-token-expiring-gICPXsbO.cjs +0 -1
- package/dist/chunks/is-exported-manifest-CriNOWvx.cjs +0 -1
- package/dist/chunks/is-inside-directory-t3ixLQDr.cjs +0 -1
- package/dist/chunks/metadata-D9sQOTRK.cjs +0 -1
- package/dist/chunks/package-CdYv4LEx.cjs +0 -1
- package/dist/chunks/pull-source-eoiJwFb9.cjs +0 -1
- package/dist/chunks/read-app-identity-SeleQ_D6.cjs +0 -1
- package/dist/chunks/record-pull-base-BbxvlnU8.cjs +0 -1
- package/dist/chunks/require-approval-fhegB1ap.cjs +0 -1
- package/dist/chunks/resolve-app-project-D5ZXIpsG.cjs +0 -1
- package/dist/chunks/resolve-inside-sdk-p-16gKb4.cjs +0 -1
- package/dist/chunks/resolve-project-typescript-CDY8BbmP.cjs +0 -1
- package/dist/chunks/resolve-source-sdk-mK-f4q55.cjs +0 -1
- package/dist/chunks/run-app-apply-command-DwLPPJ-Y.cjs +0 -2
- package/dist/chunks/run-app-dev-command-CVeh9Gab.cjs +0 -2
- package/dist/chunks/run-app-exec-command-DKLNLbL5.cjs +0 -3
- package/dist/chunks/run-app-init-command-CJj8_spC.cjs +0 -2
- package/dist/chunks/run-app-logs-command-Dusb8K-W.cjs +0 -9
- package/dist/chunks/run-app-operation-BWrY9YZK.cjs +0 -1
- package/dist/chunks/run-app-plan-command-C0_3e332.cjs +0 -1
- package/dist/chunks/run-app-pull-command-DcZqs8gR.cjs +0 -3
- package/dist/chunks/run-app-uninstall-command-ncWS_k-p.cjs +0 -2
- package/dist/chunks/sign-in-to-remote-again-CW8HPSTP.cjs +0 -1
- package/dist/chunks/sign-in-with-browser-C3kC6uP2.cjs +0 -1
- package/dist/chunks/to-public-target-CIAwoOKL.cjs +0 -1
- package/dist/chunks/utils-B8EXJeaX-DK3gCslL.cjs +0 -33
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./cli-error-CSsayo0u.cjs"),t=require("./create-cancelled-error-DgrNfOv2.cjs");var n=({error:n,diagnostics:r,sdkVersion:i,operation:a=`build`})=>{if(n.code===`CANCELLED`)return t.t();let o=r.filter(e=>e.severity===`error`).length,s=o===1?`error`:`errors`,c={...n.details,toolingErrorCode:n.code,sdkVersion:i,diagnostics:r};switch(n.code){case`INVALID_INPUT`:case`APP_PATH_UNAVAILABLE`:case`SDK_SOURCE_UNSUPPORTED`:case`TYPESCRIPT_NOT_INSTALLED`:case`TOOLING_UNSUPPORTED`:case`NODE_VERSION_UNSUPPORTED`:return new e.t({code:n.code,message:n.message,hint:n.hint,details:c})}return n.code===`TYPECHECK_FAILED`?new e.t({code:`TYPECHECK_FAILED`,message:o>0?`Typecheck failed with ${o} ${s}.`:`Typecheck failed: ${n.message}`,hint:n.hint,details:c}):new e.t({code:a===`generateClient`?`CLIENT_GENERATION_FAILED`:`BUILD_FAILED`,message:a===`generateClient`?n.message:`The build failed: ${n.message}`,hint:n.hint,details:c})};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./collect-watch-inputs-Cexr5YYZ.cjs"),r=require("./cli-error-CSsayo0u.cjs"),i=require("./fs-utils-Bl1fQcaJ.cjs");let a=require("node:crypto"),o=require("node:fs/promises");o=e.i(o);let s=require("node:path");s=e.i(s);let c=require("node:module"),l=require("esbuild");l=e.i(l);let u=require("typescript");u=e.i(u);let d=require("node:vm");d=e.i(d);var f={defineApplication:`application`,defineApplicationRole:`roles`,defineField:`fields`,defineIndex:`indexes`,defineLogicFunction:`logicFunctions`,definePostInstallLogicFunction:`logicFunctions`,definePreInstallLogicFunction:`logicFunctions`,defineUninstallLogicFunction:`logicFunctions`,defineHealthCheck:`logicFunctions`,defineObject:`objects`,definePermissionFlag:`permissionFlags`,defineRole:`roles`,defineSkill:`skills`,defineAgent:`agents`,defineConnectionProvider:`connectionProviders`,defineFrontComponent:`frontComponents`,defineSettingsFrontComponent:`frontComponents`,defineView:`views`,defineViewField:`viewFields`,defineNavigationMenuItem:`navigationMenuItems`,definePageLayout:`pageLayouts`,definePageLayoutTab:`pageLayoutTabs`,definePageLayoutWidget:`pageLayoutWidgets`,defineCommandMenuItem:`commandMenuItems`,defineTimelineActivityType:`timelineActivityTypes`,defineSettingsMenuItem:`settingsMenuItems`},p=e=>Object.hasOwn(f,e),m=e=>{let t=u.createSourceFile(`temp.ts`,e,u.ScriptTarget.Latest,!0);for(let e of t.statements){if(!u.isExportAssignment(e))continue;if(e.isExportEquals)return;let t=e.expression;if(u.isCallExpression(t)&&u.isIdentifier(t.expression)&&p(t.expression.text))return t.expression.text}},h=e.t(),g=[[/\bfavoriteRecordIds\.length\b/g,`arrayLength(favoriteRecordIds)`],[/\bselectedRecords\.length\b/g,`arrayLength(selectedRecords)`]],_=e=>g.reduce((e,[t,n])=>e.replace(t,n),e.replace(/!==/g,`!=`).replace(/===/g,`==`).replace(/&&/g,`and`).replace(/\|\|/g,`or`).replace(/!(?!=)/g,`not `).replace(/,(\s*\))/g,`$1`)),v=/(conditionalAvailabilityExpression\s*:\s*)(?!['"`])((?:[^,}()]|\([^()]*\))+)/g,y=e=>e.replace(v,(e,t,n)=>t+JSON.stringify(_(n.trim()))),b={name:`conditional-availability-transform`,setup:e=>{e.onLoad({filter:/\.tsx?$/,namespace:`file`},async e=>{let t=await o.readFile(e.path,`utf8`);if(!t.includes(`conditionalAvailabilityExpression`))return null;let n=y(t);return n===t?null:{contents:n,loader:e.path.endsWith(`.tsx`)?`tsx`:`ts`}})}},x=new Map,S=(e,n)=>{let r=(0,a.createHash)(`sha1`).update(e).digest(`hex`),i=x.get(n);if(t.Vt(i)&&i.outputHash===r)return i.wrapper;let o=d.default.compileFunction(e,[`exports`,`require`,`module`,`__filename`,`__dirname`],{filename:n});return x.set(n,{outputHash:r,wrapper:o}),o},C=[`twenty-ui`,`twenty-client-sdk/core`,`twenty-client-sdk/metadata`],w=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),T={name:`manifest-mock`,setup:e=>{let t=C.map(w),n=RegExp(`^(${t.join(`|`)})(/.*)?$`);e.onResolve({filter:n},({path:e})=>e.endsWith(`.css`)?null:{path:e,namespace:`manifest-mock`}),e.onLoad({filter:/.*/,namespace:`manifest-mock`},()=>({contents:`module.exports = new Proxy({}, { get: () => () => {} });`,loader:`js`}))}},E=async({filePath:e,appPath:t})=>O(await D({filePath:e,appPath:t}),e),D=async({filePath:e,appPath:t})=>{let r=s.default.join(t,`tsconfig.json`),a=await i.i(r),o=(0,c.createRequire)(s.default.join(t,`package.json`)),u,d;try{u=s.default.dirname(o.resolve(`react/package.json`)),d=s.default.dirname(o.resolve(`react-dom/package.json`))}catch{}let f=(await l.build({entryPoints:[e],bundle:!0,write:!1,format:`cjs`,platform:`node`,target:`node18`,jsx:`automatic`,tsconfig:a?r:void 0,loader:{".css":`empty`},alias:{...u&&{react:u},...d&&{"react-dom":d}},plugins:[...n.n(),b,T],logLevel:`silent`})).outputFiles[0].text,p=S(f,e),m={exports:{}};return p(m.exports,o,m,e,s.default.dirname(e)),m.exports},O=(e,n)=>{let i=e.default;if(t.p(i)&&(0,h.isBoolean)(i.success)&&t.p(i.config)&&(0,h.isArray)(i.errors)&&i.errors.every(h.isString)&&(!t.Vt(i.warnings)||(0,h.isArray)(i.warnings)&&i.warnings.every(h.isString)))return{success:i.success,config:i.config,errors:i.errors,...t.Vt(i.warnings)?{warnings:i.warnings}:{}};throw new r.t({code:`SDK_SOURCE_UNSUPPORTED`,message:`The definition in ${n} must export a twenty-sdk ValidationResult with success, config and errors.`,hint:`Use the SDK define functions, rename local helpers with the same names, or install a compatible twenty-sdk version.`})};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./cli-error-CSsayo0u.cjs"),r=require("./fs-utils-Bl1fQcaJ.cjs"),i=require("./get-tooling-error-context-C69TBSej.cjs"),a=require("./locale-catalog-format-BT6ommA1.cjs"),o=require("./constants-Cf5-CwMu.cjs"),s=require("./build-source-manifest-BMjw7BvT.cjs"),c=require("./assert-pull-paths-BuQ1ZRvQ.cjs"),l=require("./collect-translatable-strings-C3TWaO1V.cjs"),u=require("./is-locale-catalog-Dzj6m_Xt.cjs"),d=require("./parse-extraction-locale-CM7sARBo.cjs");let f=require("node:fs/promises"),p=require("node:path");var m=e.t(),h=e=>t.p(e)&&Object.values(e).every(e=>(0,m.isString)(e)||u.t(e)),g=async e=>{try{let t=await r.o(e);if(h(t))return t}catch(t){throw new n.t({code:`INVALID_INPUT`,message:`Cannot read translation catalog ${e}. No catalogs were updated.`,cause:t})}throw new n.t({code:`INVALID_INPUT`,message:`Invalid translation catalog ${e}. Expected messages or context groups with string translations. No catalogs were updated.`})},_=async({appPath:e,manifest:n,frontComponentSourcePaths:i=[],scaffoldLocale:s,signal:u})=>{u.throwIfAborted();let d=[...new Map([...l.t(n),...await l.n(i)].map(e=>[l.r(e.message,e.context),e])).values()],m=(0,p.join)(e,o.n);await c.t({appPath:e,relativePaths:[o.n]});let h=new Set((await r.i(m)?await(0,f.readdir)(m):[]).filter(e=>e.endsWith(`.json`)&&e!==`en.json`));t.Vt(s)&&h.add(`${s}.json`);let _=new Map([[`en.json`,a.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:e})))]]);await c.t({appPath:e,relativePaths:[..._.keys(),...h].map(e=>(0,p.join)(o.n,e))});for(let e of[...h].sort()){let t=(0,p.join)(m,e),n=await r.i(t)?await g(t):{},i=new Map(a.n(n).map(e=>[l.r(e.message,e.context),e.translation]));_.set(e,a.t(d.map(({message:e,context:t})=>({message:e,context:t,translation:i.get(l.r(e,t))??``}))))}u.throwIfAborted();let v=(0,p.join)(`.twenty`,`cli`);await c.t({appPath:e,relativePaths:[v]}),await r.r(m),await r.r((0,p.join)(e,v));let y=await(0,f.mkdtemp)((0,p.join)(e,v,`extract-`));try{for(let[e,t]of _)u.throwIfAborted(),await r.c((0,p.join)(y,e),t);for(let e of _.keys())u.throwIfAborted(),await(0,f.rename)((0,p.join)(y,e),(0,p.join)(m,e))}finally{await(0,f.rm)(y,{recursive:!0,force:!0})}return{sourceCount:d.length,updatedLocaleFiles:[..._.keys()].map(e=>(0,p.join)(o.n,e))}},v=async({appPath:e,locale:t,signal:r})=>{let a=d.t(t),o=await s.buildSourceManifest({appPath:e,signal:r});if(!o.success)return o;try{return{success:!0,data:await _({appPath:e,manifest:o.data.manifest,frontComponentSourcePaths:o.data.filePaths.frontComponents.map(t=>(0,p.join)(e,t)),scaffoldLocale:a,signal:r}),diagnostics:o.diagnostics}}catch(e){if(!(e instanceof n.t)&&!(e instanceof c.n))throw e;return{success:!1,error:{code:e instanceof n.t?e.code:`APP_PATH_UNAVAILABLE`,message:e.message,...i.t(e)},diagnostics:o.diagnostics}}};exports.extractSourceTranslations=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./create-metadata-client-
|
|
1
|
+
const e=require("./create-metadata-client-DEBMHFDo.cjs"),t=require("./metadata-page.constant-CnR03vnh.cjs"),n=require("./resolve-metadata-object-CRWbF9Ce.cjs"),r=require("./format-metadata-owner-C6CksDIK.cjs");var i={type:!0,sourceObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},targetObjectMetadata:{id:!0,nameSingular:!0,namePlural:!0},sourceFieldMetadata:{id:!0,name:!0},targetFieldMetadata:{id:!0,name:!0}},a=async({objectName:a,target:o,signal:s,output:c})=>{let l=e.t({target:o,signal:s}),u=await n.t({client:l,name:a}),[d,{currentWorkspace:f},{applications:p,areOwnersNamed:m}]=await Promise.all([t.n(async e=>{let{fields:n}=await l.query({fields:{__args:{paging:{first:t.t,after:e},filter:{objectMetadataId:{eq:u.id}}},pageInfo:{hasNextPage:!0,endCursor:!0},edges:{node:{id:!0,universalIdentifier:!0,objectMetadataId:!0,name:!0,label:!0,description:!0,type:!0,isActive:!0,isSystem:!0,isNullable:!0,isUnique:!0,defaultValue:!0,options:!0,settings:!0,applicationId:!0,relation:i,morphRelations:i}}}});return n}),l.query({currentWorkspace:{workspaceCustomApplicationId:!0}}),r.r(l)]);m||c.warn({code:`OWNERS_UNAVAILABLE`,message:`Owners other than Custom show as unknown: listing apps needs the Applications permission.`});let h=r.n({applications:p,workspaceCustomApplicationId:f.workspaceCustomApplicationId}),{applicationId:g,..._}=u;return{object:{..._,owner:h(g)},fields:d.map(({applicationId:e,...t})=>({...t,owner:h(e)})).sort((e,t)=>e.name.localeCompare(t.name))}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
package/dist/chunks/{fetch-signed-in-identity-BhvaL3zp.cjs → fetch-signed-in-identity-CWFlsW7e.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./create-metadata-client-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./create-metadata-client-DEBMHFDo.cjs");var n=e.r({fetchSignedInIdentity:()=>r}),r=async({target:e,signal:n})=>{let r=t.t({target:e,signal:n});if(e.credentialKind===`apiKey`){let{currentWorkspace:e}=await r.query({currentWorkspace:{displayName:!0}});return{workspaceName:e.displayName??null,email:null}}let{currentWorkspace:i,currentUser:a}=await r.query({currentWorkspace:{displayName:!0},currentUser:{email:!0}});return{workspaceName:i.displayName??null,email:a.email}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-BEfQWzTA-z2Y1wZJq.cjs"),n=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),r=require("./cli-error-CSsayo0u.cjs"),i=require("./parse-app-export-BT6nM7Ki.cjs"),a=require("./is-application-not-found-error-D0BAcKyX.cjs"),o=require("./create-metadata-client-DEBMHFDo.cjs"),s=require("./create-app-not-installed-error-DY-iuPPx.cjs");var c=e.t(),l=new Set([`APPLICATION_NOT_EXPORTABLE`,`STANDARD_APPLICATION_NOT_EXPORTABLE`]),u=e=>{if(!(e instanceof r.t)||e.code!==`GRAPHQL_ERROR`)return!1;let t=e.details?.errors;if(!(0,c.isArray)(t)||t.length!==1)return!1;let i=t[0];return n.p(i)&&(i.code===`GRAPHQL_VALIDATION_FAILED`||(0,c.isNull)(i.code)&&e.details?.status===400)&&(0,c.isNull)(i.path)&&(0,c.isString)(i.message)&&i.message.startsWith(`Cannot query field "exportApplication" on type "Query".`)},d=e=>{if(!(e instanceof r.t)||e.code!==`GRAPHQL_ERROR`)return!1;let t=e.details?.errors;if(!(0,c.isArray)(t)||t.length!==1)return!1;let i=t[0];return n.p(i)&&(0,c.isString)(i.subCode)&&l.has(i.subCode)},f=async({universalIdentifier:e,target:t,signal:n})=>i.t({value:(await o.t({target:t,signal:n}).query({__name:`ExportApplication`,exportApplication:{__args:{universalIdentifier:e},application:{universalIdentifier:!0,displayName:!0,sourceType:!0},manifest:!0,coverage:{metadataName:!0,universalIdentifier:!0,status:!0,reason:!0},files:{folder:!0,path:!0,content:!0}}}).catch(n=>{throw a.t({error:n,field:`exportApplication`})?s.t({universalIdentifier:e,apiUrl:t.apiUrl}):u(n)?new r.t({code:`APP_EXPORT_UNSUPPORTED`,message:`This server does not support application export.`}):d(n)?new r.t({code:`APP_NOT_EXPORTABLE`,message:n.message,hint:`Only apps developed locally can be pulled: not the standard app, and not apps installed from a package.`,details:{universalIdentifier:e}}):n}))?.exportApplication,universalIdentifier:e}),p=async({target:e,signal:i})=>{let a=(await o.t({target:e,signal:i}).query({currentWorkspace:{id:!0}}))?.currentWorkspace;if(!n.p(a)||!(0,c.isNonEmptyString)(a.id)||!t.d(a.id))throw new r.t({code:`INVALID_RESPONSE`,message:`${e.apiUrl} did not say which workspace these credentials belong to.`});return a.id};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs");var n=e.t(),r=e=>t.Vt(e)?(0,n.isString)(e)?e:JSON.stringify(e,null,2):``;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs");var n=e.t(),r=[`name`,`title`,`subject`],i=3,a=e=>t.p(e)&&(0,n.isNonEmptyString)(e.id),o=e=>r.map(t=>e[t]).find(t.Vt),s=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,c=e=>{if(e.length===0)return`-`;if(e.every(a)){let t=e.slice(0,i).map(e=>l(o(e)??e.id)),n=e.length>i?`, …`:``;return`${e.length} ${e.length===1?`record`:`records`} returned · ${t.join(`, `)}${n}`}return e.some(e=>t.p(e)||(0,n.isArray)(e))?JSON.stringify(e):e.map(l).join(`, `)},l=e=>{if(!t.Vt(e))return`-`;if((0,n.isString)(e))return/[\x00-\x1f\x7f-\x9f]/.test(e)?JSON.stringify(e).replace(/[\x7f-\x9f]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`):e;if((0,n.isArray)(e))return c(e);if(t.p(e)){if((0,n.isNonEmptyString)(e.firstName)||(0,n.isNonEmptyString)(e.lastName))return l([e.firstName,e.lastName].filter(n.isNonEmptyString).join(` `));if((0,n.isNonEmptyString)(e.primaryEmail))return l(e.primaryEmail);if((0,n.isNonEmptyString)(e.primaryLinkUrl))return l(e.primaryLinkUrl);let r=a(e)?o(e):void 0;if(t.Vt(r))return`${l(r)} (${l(e.id)})`}return JSON.stringify(e)},u=e=>s(l(e),60),d=e=>s(l(e),120);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./is-inside-directory-DHVCQE5C.cjs");let t=require("node:path");var n=({workingDirectory:n,targetPath:r})=>{let i=(0,t.relative)(n,r);return i===``?`.`:e.t({filePath:r,directory:n})?i:r};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dist/chunks/{format-metadata-fields-DJnTg1R9.cjs → format-metadata-fields-BozY419E.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./style-BR52fK4V.cjs"),r=require("./format-table-4drtI5sP.cjs"),i=require("./format-metadata-owner-C6CksDIK.cjs");var a=e.t(),o=e=>{let n=e.options;return(0,a.isArray)(n)?n.filter(t.p):[]},s=e=>(t.Vt(e.relation)?[e.relation]:(e.morphRelations??[]).filter(t=>t.sourceFieldMetadata.id===e.id)).map(e=>`${e.type.toLowerCase().replaceAll(`_`,`-`)} · ${e.targetObjectMetadata.namePlural}.${e.targetFieldMetadata.name}`).join(` · `),c=e=>[e.isActive===!1?`inactive`:``,e.isNullable===!1?`required`:``,e.isUnique===!0?`unique`:``,s(e),...o(e).map(e=>String(e.label??e.value??``))].filter(a.isNonEmptyString).join(` · `),l=({fields:e,hiddenSystemFieldCount:t,labelIdentifierFieldMetadataId:o})=>[r.t({rows:e,columns:[{header:`FIELD`,value:e=>e.name},{header:`LABEL`,value:e=>e.label},{header:`TYPE`,value:e=>e.type},{header:`OWNER`,value:e=>i.t(e.owner)},{header:`DETAILS`,value:e=>[e.id===o?`label field`:``,c(e)].filter(a.isNonEmptyString).join(` · `)}]}),n.i(t>0?`${e.length} fields · ${t} system fields hidden, show them with --all`:`${e.length} fields`)].join(`
|
|
2
2
|
`);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/dist/chunks/{format-metadata-owner-yUeocnwY.cjs → format-metadata-owner-C6CksDIK.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./constants-
|
|
1
|
+
const e=require("./constants-Du9J-8Ug-CD8GTrut.cjs");require("./application-VJqniwXy.cjs");const t=require("./cli-error-CSsayo0u.cjs"),n=require("./style-BR52fK4V.cjs");var r=async e=>{try{let{findManyApplications:t}=await e.query({findManyApplications:{id:!0,name:!0,universalIdentifier:!0}});return{applications:t,areOwnersNamed:!0}}catch(e){if(!(e instanceof t.t)||e.code!==`PERMISSION_DENIED`)throw e;return{applications:[],areOwnersNamed:!1}}},i=({applications:t,workspaceCustomApplicationId:n})=>{let r=new Map(t.map(e=>[e.id,e]));return t=>{let i=r.get(t);return t===n?{kind:`custom`,applicationId:t,name:null}:e.Vt(i)?i.universalIdentifier===`20202020-64aa-4b6f-b003-9c74b97cee20`?{kind:`standard`,applicationId:t,name:null}:{kind:`application`,applicationId:t,name:i.name}:{kind:`unknown`,applicationId:t,name:null}}},a=e=>{switch(e.kind){case`standard`:return`Standard`;case`custom`:return n.n(`cyan`,`Custom`);case`application`:return n.n(`magenta`,e.name??`Unknown app`);case`unknown`:return n.n(`yellow`,`Unknown`)}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./constants-Du9J-8Ug-CD8GTrut.cjs");var t=({message:t,percentage:n})=>e.Vt(n)?`${t} ${n}%`:t;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./get-client-sdk-package-path-2U3kDCRq.cjs"),r=require("./read-json-object-BONMjSVo.cjs"),i=require("./resolve-inside-sdk-Cc_y-RWT.cjs"),a=require("./validate-app-path-Dau-PC0a.cjs");let o=require("node:fs/promises"),s=require("node:path"),c=require("node:module");var l=e.t(),u=async({appPath:e,schema:u,signal:d})=>{let f=await a.t(e);if(!f.success)return f;try{if(d?.throwIfAborted(),!(0,l.isNonEmptyString)(u))throw Error(`schema must be a non-empty GraphQL schema string.`);let a=n.t({appPath:e});if((await r.t((0,s.join)(a,`package.json`)))?.name!==`twenty-client-sdk`)throw Error(`Expected twenty-client-sdk in the app node_modules directory.`);let f=(0,c.createRequire)((0,s.join)(a,`package.json`)),p=i.t({resolveFromApp:f.resolve,specifier:`twenty-client-sdk/generate`,sdkPath:await(0,o.realpath)(a)});if(!t.Vt(p))throw Error(`The app's twenty-client-sdk does not provide its own generate entry point. Install a compatible twenty-client-sdk version in this app.`);d?.throwIfAborted();let m=f(p);if(!t.p(m)||!(0,l.isFunction)(m.replaceCoreClient))throw Error(`The app's twenty-client-sdk/generate must export replaceCoreClient.`);return d?.throwIfAborted(),await m.replaceCoreClient({packageRoot:a,schema:u}),d?.throwIfAborted(),{success:!0,data:null,diagnostics:[]}}catch(e){return{success:!1,error:{code:d?.aborted&&Object.is(e,d.reason)?`CANCELLED`:`CLIENT_GENERATION_FAILED`,message:e instanceof Error?e.message:String(e)},diagnostics:[]}}};exports.generateApplicationClient=u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./cli-error-CSsayo0u.cjs"),r=require("./is-same-universal-identifier-BCBib3RP.cjs"),i=require("./style-BR52fK4V.cjs"),a=require("./is-application-not-found-error-D0BAcKyX.cjs"),o=require("./result-item-limit.constant-CDrOhiWD.cjs"),s=require("./create-metadata-client-DEBMHFDo.cjs"),c=require("./format-data-value-C5itQm1i.cjs");var l=e.t(),u=e=>t.p(e)&&(e.type===`create`||e.type===`update`||e.type===`delete`)&&(0,l.isNonEmptyString)(e.metadataName)&&(e.type===`create`&&(0,l.isUndefined)(e.universalIdentifier)||(0,l.isNonEmptyString)(e.universalIdentifier))&&((0,l.isUndefined)(e.flatEntity)||t.p(e.flatEntity))&&((0,l.isUndefined)(e.diff)||t.p(e.diff)&&Object.values(e.diff).every(t.p)),d=e=>e.metadataName===`applicationVariable`?{...e,...t.Vt(e.flatEntity)&&`value`in e.flatEntity?{flatEntity:{...e.flatEntity,value:`(redacted)`}}:{},...t.Vt(e.diff)&&`value`in e.diff?{diff:{...e.diff,value:{before:`(redacted)`,after:`(redacted)`}}}:{}}:e,f=({value:e,applicationUniversalIdentifier:i})=>{if(!t.p(e)||!r.t({value:e.applicationUniversalIdentifier,universalIdentifier:i})||!(0,l.isArray)(e.actions)||!e.actions.every(u))throw new n.t({code:`INVALID_RESPONSE`,message:`The server returned an invalid application plan.`});if(e.actions.length>1e4)throw new n.t({code:`RESPONSE_LIMIT_EXCEEDED`,message:`The application plan exceeds ${o.t} actions.`,hint:`Reduce the app changes before requesting another plan.`});return e.actions.map(d)},p=async({build:e,inferDeletionFromMissingEntities:r,target:i,signal:o})=>{if(e.manifestFormat!==`twenty-application`||!t.p(e.manifest.application)||e.manifest.application.universalIdentifier!==e.application.universalIdentifier)throw new n.t({code:`TOOLING_UNSUPPORTED`,message:`The app build produced a manifest that this CLI cannot plan.`});try{return f({value:(await s.t({target:i,signal:o}).mutation({__name:`PreviewApplication`,syncApplication:{__args:{manifest:e.manifest,dryRun:!0,inferDeletionFromMissingEntities:r},applicationUniversalIdentifier:!0,actions:!0}}))?.syncApplication,applicationUniversalIdentifier:e.application.universalIdentifier})}catch(r){throw r instanceof n.t&&a.t({error:r,field:`syncApplication`})?new n.t({code:`PLAN_UNAVAILABLE`,message:`This app must be registered in this workspace before its changes can be planned. Nothing was registered, uploaded or synchronized.`,hint:`Run twenty app apply --create to register it and install it in this workspace.`,details:{...r.details,body:void 0,data:null,applicationUniversalIdentifier:e.application.universalIdentifier,plan:!0}}):r instanceof n.t&&t.p(r.details)?new n.t({code:r.code,exitCode:r.exitCode,message:r.message,hint:r.hint,details:{...r.details,body:void 0,data:null}}):r}},m=e=>e.type===`delete`&&(e.metadataName===`objectMetadata`||e.metadataName===`fieldMetadata`),h=80,g=`(secret)`,_=`Entities missing from your source are destroyed by default. Re-run with --no-delete to keep them.`,v=new Set([`id`,`createdAt`,`updatedAt`,`deletedAt`,`universalIdentifier`,`__typename`]),y={create:0,update:1,delete:2},b={create:`+`,update:`~`,delete:`-`},x={create:`green`,update:`yellow`,delete:`red`},S={create:`will be created`,update:`will be updated in-place`,delete:`will be destroyed`},C=e=>{if(!t.Vt(e))return`null`;if((0,l.isBoolean)(e)||(0,l.isNumber)(e))return String(e);let n=(JSON.stringify(e)??String(e)).replace(/[\x7f-\x9f]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`);return n.length>h?`${n.slice(0,h-1)}…`:n},w=e=>{let t=e.flatEntity?.isSecret;if((0,l.isBoolean)(t))return t;let n=e.diff?.isSecret?.after;return(0,l.isBoolean)(n)?n:void 0},T=(e,t)=>e.metadataName===`applicationVariable`&&t===`value`&&w(e)!==!1,E=e=>Object.entries(e??{}).filter(([e,n])=>!v.has(e)&&!e.endsWith(`Id`)&&t.Vt(n)).sort(([e],[t])=>e.localeCompare(t)),D=e=>[e.flatEntity?.name,e.flatEntity?.nameSingular,e.flatEntity?.universalIdentifier].find(l.isString)??(e.type===`create`?`unknown`:e.universalIdentifier??`unknown`),O=e=>{let t=new Map;return e.forEach((e,n)=>{t.has(e.metadataName)||t.set(e.metadataName,n)}),[...e].sort((e,n)=>(t.get(e.metadataName)??0)-(t.get(n.metadataName)??0)||y[e.type]-y[n.type]||D(e).localeCompare(D(n)))},k=(e,t)=>i.t(` # ${c.r(e.metadataName)} ${C(D(e))} ${S[e.type]}`,t),A=(e,t)=>{let n=E(e.flatEntity),r=x[e.type];if(n.length===0)return[e.type===`delete`?i.n(r,` - name = ${C(D(e))}`,t):i.n(r,` + (no attributes to display)`,t)];let a=Math.max(...n.map(([e])=>e.length));return n.map(([n,o])=>i.n(r,` ${b[e.type]} ${n.padEnd(a)} = ${T(e,n)?g:C(o)}`,t))},j=(e,t)=>{let n=Object.keys(e.diff??{}).sort((e,t)=>e.localeCompare(t));if(n.length===0)return[];let r=Math.max(...n.map(e=>e.length));return n.map(n=>{let a=e.diff?.[n],o=T(e,n),s=o?g:C(a?.before),c=o?g:C(a?.after);return` ${i.n(`yellow`,`~`,t)} ${i.n(`yellow`,n.padEnd(r),t)} = ${i.n(`red`,s,t)} ${i.i(`->`,t)} ${i.n(`green`,c,t)}`})},M=(e,t)=>{let n=e.type===`update`?j(e,t):A(e,t);return e.type===`update`&&n.length===0?void 0:[k(e,t),...n].join(`
|
|
2
2
|
`)},N=(e,t)=>{let n=e.filter(m);return[i.t(i.n(`red`,`Warning: ${n.length} destructive change(s) will permanently delete data.`,t),t),...n.map(e=>i.n(`red`,` - ${c.r(e.metadataName)} ${C(D(e))}: ${e.metadataName===`objectMetadata`?`drops the table and all its rows`:`drops the column and its data`}`,t)),i.n(`red`,`Destroys are irreversible. Review carefully before applying.`,t)].join(`
|
|
3
|
-
`)},P=({actions:e,summary:n,inferDeletionFromMissingEntities:r,stream:a=process.stdout})=>{if(e.length===0)return`No changes. Twenty metadata matches your manifest.`;let o=O(e).map(e=>M(e,a)).filter(t.
|
|
3
|
+
`)},P=({actions:e,summary:n,inferDeletionFromMissingEntities:r,stream:a=process.stdout})=>{if(e.length===0)return`No changes. Twenty metadata matches your manifest.`;let o=O(e).map(e=>M(e,a)).filter(t.Vt);return[i.t(`Twenty will perform the following actions:`,a),``,o.join(`
|
|
4
4
|
|
|
5
5
|
`),``,`Plan: ${i.n(`green`,`${n.create} to add`,a)}, ${i.n(`yellow`,`${n.update} to change`,a)}, ${i.n(`red`,`${n.delete} to destroy`,a)}.`,...r&&n.delete>0?[i.i(_,a)]:[],...n.destructive>0?[``,N(e,a)]:[]].join(`
|
|
6
6
|
`)},F=({applicationName:e,apiUrl:t,actions:n,summary:r,inferDeletionFromMissingEntities:i})=>[`Plan for ${c.r(e)} on ${t}`,P({actions:n,summary:r,inferDeletionFromMissingEntities:i}),`Use --json for complete action details.`,`Nothing was registered, uploaded or synchronized. The server may return different actions when you apply.`].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./get-client-sdk-package-path-2U3kDCRq.cjs"),n=require("./cli-error-CSsayo0u.cjs"),r=require("./to-worker-output-diagnostics-BeJKIsDG.cjs"),i=require("./create-metadata-client-DEBMHFDo.cjs"),a=require("./create-tooling-failure-B2FmNwR2.cjs");let o=require("node:fs/promises");var s=e.t(),c=async({applicationUniversalIdentifier:e,context:{target:t,signal:r,output:a}})=>{a.progress({message:`Fetching the application schema…`});let o=(await i.t({target:t,signal:r}).query({__name:`ApplicationCoreGraphqlSchema`,applicationCoreGraphqlSchema:{__args:{applicationUniversalIdentifier:e}}}))?.applicationCoreGraphqlSchema;if(!(0,s.isNonEmptyString)(o)||o.trim().length===0)throw new n.t({code:`INVALID_RESPONSE`,message:`The server did not return an application GraphQL schema.`});return o},l=async({appPath:e,schema:t,sdk:n,context:{signal:i,output:o,outputMode:s}})=>{o.progress({message:`Generating the typed API client…`});let c=await r.n({request:{type:`generateSourceClient`,appPath:e,schema:t},signal:i}),l=r.o({value:c.result,parseData:r.a}),u=[...l.diagnostics,...r.t(c.output)];if(s===`human`)for(let e of u)o.progress({message:r.s(e)});if(!l.success)throw a.t({error:l.error,diagnostics:u,sdkVersion:n.version,operation:`generateClient`});return i.throwIfAborted(),u},u=async e=>l({...e,schema:await c(e)}),d=async({appPath:e})=>{if(await(0,o.lstat)(t.t({appPath:e})).then(()=>!1,e=>n.r(e,`ENOENT`)))return`twenty-client-sdk is not installed in the app's own node_modules.`};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("node:path");var t=({appPath:t})=>(0,e.join)(t,`node_modules`,`twenty-client-sdk`);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./constants-
|
|
1
|
+
const e=require("./constants-Du9J-8Ug-CD8GTrut.cjs");let t=require("typescript");var n=`TwentyRecord`,r=n=>{let r=n.typeArguments?.[0];if(e.Vt(r)&&r.kind===t.SyntaxKind.LiteralType&&r.literal.kind===t.SyntaxKind.StringLiteral)return r.literal.text},i=e=>e.type===`record`?{type:`records`,objectUniversalIdentifier:e.objectUniversalIdentifier}:{type:`array`,items:e},a=o=>{switch(o.kind){case t.SyntaxKind.NumberKeyword:return{type:`number`};case t.SyntaxKind.StringKeyword:return{type:`string`};case t.SyntaxKind.BooleanKeyword:return{type:`boolean`};case t.SyntaxKind.ArrayType:return i(a(o.elementType));case t.SyntaxKind.TypeReference:{let s=o,c=s.typeName.kind===t.SyntaxKind.Identifier?s.typeName.text:void 0;if(c===`Array`||c===`ReadonlyArray`){let t=s.typeArguments?.[0];return i(e.Vt(t)?a(t):{})}if(c===n){let t=r(s);if(e.Vt(t))return{type:`record`,objectUniversalIdentifier:t}}return{}}case t.SyntaxKind.ObjectKeyword:return{type:`object`};case t.SyntaxKind.TypeLiteral:{let t={};return o.members.forEach(n=>{if(e.Vt(n.name)&&e.Vt(n.type)){let e=n.name.text;t[e]=a(n.type)}}),{type:`object`,properties:t}}case t.SyntaxKind.UnionType:{let e=o,n=[],r=!0;return e.types.forEach(e=>{if(e.kind===t.SyntaxKind.LiteralType){let i=e.literal;i.kind===t.SyntaxKind.StringLiteral?n.push(i.text):r=!1}else r=!1}),r?{type:`string`,enum:n}:{}}default:return{}}},o=(t,n)=>t.parameters.reduce((t,n)=>{let r=n.type;return e.Vt(r)?[...t,a(r)]:[...t,{}]},n),s=n=>n.kind===t.SyntaxKind.FunctionDeclaration?[n]:n.kind===t.SyntaxKind.VariableStatement?n.declarationList.declarations.filter(n=>e.Vt(n.initializer)&&n.initializer.kind===t.SyntaxKind.ArrowFunction).map(e=>e.initializer):[],c=e=>{let n=(0,t.createSourceFile)(`temp.ts`,e,t.ScriptTarget.ESNext,!0),r=[];return n.forEachChild(e=>{(e.kind===t.SyntaxKind.FunctionDeclaration||e.kind===t.SyntaxKind.VariableStatement)&&s(e).forEach(e=>{r=o(e,r)})}),r};exports.getFunctionInputSchema=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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-BX30OsrQ.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-Cdb3OlI2.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:`--no-delete`,description:`Keep remote entities missing from the app source`},{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-delete`,`twenty app dev --format ndjson --no-delete`],outputModes:[`human`,`ndjson`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-dev-command-C3U-3OiV.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-C6rIt02R.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-DNeCk5qs.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-HAgBNVFU.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-CdAXR-XY.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:`--no-delete`,description:`Keep remote entities missing from the app source`},{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-delete`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`,`UPLOAD_FILE`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-apply-command-BckNNni9.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-DW0r-w2C.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-dTbY28oS.cjs"))).runAppInitCommand},u={path:[`app`,`pull`],description:`Pull workspace metadata into an existing app project`,options:[{flags:`--path <directory>`,description:`App directory (default: the app containing the current folder)`},{flags:`--universal-identifier <uuid>`,description:`Application to pull when this project has no application definition`},{flags:`--verbose`,description:`List coverage details`}],examples:[`twenty app pull --remote dev`,`twenty app pull --path ./apps/billing --json`],outputModes:[`human`,`json`],writes:!0,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-pull-command-DljZP4Ey.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:`--no-delete`,description:`Keep remote entities missing from the app source`}],examples:[`twenty app plan --remote dev`,`twenty app plan --path ./apps/billing --no-delete --json`],outputModes:[`human`,`json`],writes:!1,needsProject:!0,needsTarget:!0,requiredPermissions:[`APPLICATIONS`],load:async()=>(await Promise.resolve().then(()=>require("./run-app-plan-command-Bm1eXl7V.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-Cc053lZ6.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-B7o20_BR.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-DJsWZtoI.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`,`printf '%s' "$TWENTY_API_KEY" | twenty auth login --with-token --url https://acme.twenty.com --name prod`,`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-21pHzpvT.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-DWOafJmL.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-BBAcouvs.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-KlIMjpOY.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-W4gCU562.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-6x3V48LL.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-DrgvC-zi.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-Cs8GAHbD.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-BM4pkNY0.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-PLt5ySLJ.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-B2CbERvZ.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-CrmzNFh8.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-BcnWKmgh.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-CzMO5wI4.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-37zf0rSp.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-B-XUqYBY.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-Bmg3nZfB.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-r2NUlgWw.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-DfDcA927.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,"r",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return R}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./oauth-timing.constant-BClMQcKn.cjs");var r=e.t(),i=e=>{try{let n=JSON.parse(Buffer.from(e.split(`.`)[1]??``,`base64url`).toString());return t.p(n)&&(0,r.isNumber)(n.exp)?n.exp*1e3:void 0}catch{return}},a=e=>{let r=i(e);return t.Vt(r)&&r-n.t.REFRESH_MARGIN_MILLISECONDS<Date.now()};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./cli-error-CSsayo0u.cjs");var r=e.t(),i=({error:e,field:i})=>{if(!(e instanceof n.t)||e.code!==`GRAPHQL_ERROR`)return!1;let a=e.details?.errors;if(!(0,r.isArray)(a)||a.length!==1)return!1;let o=a[0];return t.p(o)&&o.code===`NOT_FOUND`&&o.subCode===`APPLICATION_NOT_FOUND`&&((0,r.isNull)(o.path)||(0,r.isArray)(o.path)&&o.path[0]===i)};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-Du9J-8Ug-CD8GTrut.cjs"),n=require("./is-locale-catalog-Dzj6m_Xt.cjs");var r=e.t(),i={application:`application`,object:`objects`,field:`fields`,index:`indexes`,permissionFlag:`permissionFlags`,role:`roles`,view:`views`,viewField:`viewFields`,pageLayout:`pageLayouts`,pageLayoutTab:`pageLayoutTabs`,navigationMenuItem:`navigationMenuItems`,pageLayoutWidget:`pageLayoutWidgets`},a=(e,n=[])=>!t.Vt(e)||(0,r.isArray)(e)&&e.every(e=>t.p(e)&&(0,r.isString)(e.universalIdentifier)&&n.every(t=>a(e[t],t===`tabs`?[`widgets`]:[]))),o=e=>t.p(e)&&t.p(e.application)&&(0,r.isString)(e.application.universalIdentifier)&&(!t.Vt(e.translations)||t.p(e.translations)&&Object.values(e.translations).every(n.t))&&Object.values(i).filter(e=>e!==`application`).every(t=>a(e[t],t===`objects`||t===`views`?[`fields`]:t===`pageLayouts`?[`tabs`]:t===`pageLayoutTabs`?[`widgets`]:[]))&&(!(0,r.isArray)(e.objects)||e.objects.every(e=>t.p(e)&&(0,r.isString)(e.nameSingular)));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs");let t=require("node:path");var n=e.t(),r=({filePath:e,directory:r})=>{let i=(0,t.relative)(r,e);return(0,n.isNonEmptyString)(i)&&i!==`..`&&!i.startsWith(`..${t.sep}`)&&!(0,t.isAbsolute)(i)};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
package/dist/chunks/{is-interaction-allowed-ycbAFMIj.cjs → is-interaction-allowed-CF-ko1KI.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("./build-CX6FBrbu.cjs").t(),t=new Set([`0`,`false`]),n=()=>{let n=process.env.CI;return(0,e.isNonEmptyString)(n)&&!t.has(n.toLowerCase())},r=({options:e,outputMode:t})=>e.input!==!1&&t===`human`&&process.stdin.isTTY===!0&&!n();Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
1
|
+
var e=require("./build-CX6FBrbu.cjs").t(),t=new Set([`0`,`false`]),n=()=>{let n=process.env.CI;return(0,e.isNonEmptyString)(n)&&!t.has(n.toLowerCase())},r=({options:e,outputMode:t})=>e.input!==!1&&t===`human`&&process.stdin.isTTY===!0&&!n();Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./constants-Du9J-8Ug-CD8GTrut.cjs");var t=t=>e.Vt(t)&&typeof t==`object`&&!Array.isArray(t)&&Object.values(t).every(e=>typeof e==`string`);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./utils-BEfQWzTA-z2Y1wZJq.cjs");var t=t=>Object.prototype.hasOwnProperty.call(e.u,t);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
require("./utils-BEfQWzTA-z2Y1wZJq.cjs");const e=require("./constants-Du9J-8Ug-CD8GTrut.cjs");var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=t(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.moo=n()})(e,function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=typeof RegExp().sticky==`boolean`;function r(e){return e&&t.call(e)===`[object RegExp]`}function i(e){return e&&typeof e==`object`&&!r(e)&&!Array.isArray(e)}function a(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function o(e){return RegExp(`|`+e).exec(``).length-1}function s(e){return`(`+e+`)`}function c(e){return e.length?`(?:`+e.map(function(e){return`(?:`+e+`)`}).join(`|`)+`)`:`(?!)`}function l(e){if(typeof e==`string`)return`(?:`+a(e)+`)`;if(r(e)){if(e.ignoreCase)throw Error(`RegExp /i flag not allowed`);if(e.global)throw Error(`RegExp /g flag is implied`);if(e.sticky)throw Error(`RegExp /y flag is implied`);if(e.multiline)throw Error(`RegExp /m flag is implied`);return e.source}else throw Error(`Not a pattern: `+e)}function u(e,t){return e.length>t?e:Array(t-e.length+1).join(` `)+e}function d(e,t){for(var n=e.length,r=0;;){var i=e.lastIndexOf(`
|
|
2
2
|
`,n-1);if(i===-1||(r++,n=i,r===t)||n===0)break}var a=r<t?0:n+1;return e.substring(a).split(`
|
|
3
3
|
`)}function f(e){for(var t=Object.getOwnPropertyNames(e),n=[],r=0;r<t.length;r++){var a=t[r],o=e[a],s=[].concat(o);if(a===`include`){for(var c=0;c<s.length;c++)n.push({include:s[c]});continue}var l=[];s.forEach(function(e){i(e)?(l.length&&n.push(m(a,l)),n.push(m(a,e)),l=[]):l.push(e)}),l.length&&n.push(m(a,l))}return n}function p(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.include){for(var i=[].concat(r.include),a=0;a<i.length;a++)t.push({include:i[a]});continue}if(!r.type)throw Error(`Rule has no type: `+JSON.stringify(r));t.push(m(r.type,r))}return t}function m(t,n){if(i(n)||(n={match:n}),n.include)throw Error(`Matching rules cannot also include states`);var a={defaultType:t,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var o in n)e.call(n,o)&&(a[o]=n[o]);if(typeof a.type==`string`&&t!==a.type)throw Error(`Type transform cannot be a string (type '`+a.type+`' for token '`+t+`')`);var s=a.match;return a.match=Array.isArray(s)?s:s?[s]:[],a.match.sort(function(e,t){return r(e)&&r(t)?0:r(t)?-1:r(e)?1:t.length-e.length}),a}function h(e){return Array.isArray(e)?p(e):f(e)}var g=m(`error`,{lineBreaks:!0,shouldThrow:!0});function _(e,t){for(var i=null,a=Object.create(null),u=!0,d=null,f=[],p=[],m=0;m<e.length;m++)e[m].fallback&&(u=!1);for(var m=0;m<e.length;m++){var h=e[m];if(h.include)throw Error(`Inheritance is not allowed in stateless lexers`);if(h.error||h.fallback){if(i)throw!h.fallback==!i.fallback?Error(`Multiple `+(h.fallback?`fallback`:`error`)+` rules not allowed (for token '`+h.defaultType+`')`):Error(`fallback and error are mutually exclusive (for token '`+h.defaultType+`')`);i=h}var _=h.match.slice();if(u)for(;_.length&&typeof _[0]==`string`&&_[0].length===1;){var v=_.shift();a[v.charCodeAt(0)]=h}if(h.pop||h.push||h.next){if(!t)throw Error(`State-switching options are not allowed in stateless lexers (for token '`+h.defaultType+`')`);if(h.fallback)throw Error(`State-switching options are not allowed on fallback tokens (for token '`+h.defaultType+`')`)}if(_.length!==0){u=!1,f.push(h);for(var y=0;y<_.length;y++){var b=_[y];if(r(b)){if(d===null)d=b.unicode;else if(d!==b.unicode&&h.fallback===!1)throw Error(`If one rule is /u then all must be`)}}var x=c(_.map(l)),S=new RegExp(x);if(S.test(``))throw Error(`RegExp matches empty string: `+S);if(o(x)>0)throw Error(`RegExp has capture groups: `+S+`
|
|
4
4
|
Use (?: … ) instead`);if(!h.lineBreaks&&S.test(`
|
|
5
5
|
`))throw Error(`Rule should declare lineBreaks: `+S);p.push(s(x))}}var C=i&&i.fallback,w=n&&!C?`ym`:`gm`,T=n||C?``:`|`;return d===!0&&(w+=`u`),{regexp:new RegExp(c(p)+T,w),groups:f,fast:a,error:i||g}}function v(e){return new S({start:_(h(e))},`start`)}function y(e,t,n){var r=e&&(e.push||e.next);if(r&&!n[r])throw Error(`Missing state '`+r+`' (in token '`+e.defaultType+`' of state '`+t+`')`);if(e&&e.pop&&+e.pop!=1)throw Error(`pop must be 1 (in token '`+e.defaultType+`' of state '`+t+`')`)}function b(e,t){var n=e.$all?h(e.$all):[];delete e.$all;var r=Object.getOwnPropertyNames(e);t||=r[0];for(var i=Object.create(null),a=0;a<r.length;a++){var o=r[a];i[o]=h(e[o]).concat(n)}for(var a=0;a<r.length;a++)for(var o=r[a],s=i[o],c=Object.create(null),l=0;l<s.length;l++){var u=s[l];if(u.include){var d=[l,1];if(u.include!==o&&!c[u.include]){c[u.include]=!0;var f=i[u.include];if(!f)throw Error(`Cannot include nonexistent state '`+u.include+`' (in state '`+o+`')`);for(var p=0;p<f.length;p++){var m=f[p];s.indexOf(m)===-1&&d.push(m)}}s.splice.apply(s,d),l--}}for(var g=Object.create(null),a=0;a<r.length;a++){var o=r[a];g[o]=_(i[o],!0)}for(var a=0;a<r.length;a++){for(var v=r[a],b=g[v],x=b.groups,l=0;l<x.length;l++)y(x[l],v,g);for(var C=Object.getOwnPropertyNames(b.fast),l=0;l<C.length;l++)y(b.fast[C[l]],v,g)}return new S(g,t)}function x(e){for(var t=typeof Map<`u`,n=t?new Map:Object.create(null),r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var a=r[i],o=e[a];(Array.isArray(o)?o:[o]).forEach(function(e){if(typeof e!=`string`)throw Error(`keyword must be string (in keyword '`+a+`')`);t?n.set(e,a):n[e]=a})}return function(e){return t?n.get(e):n[e]}}var S=function(e,t){this.startState=t,this.states=e,this.buffer=``,this.stack=[],this.reset()};S.prototype.reset=function(e,t){return this.buffer=e||``,this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedText=t?t.queuedText:``,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},S.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},S.prototype.setState=function(e){if(!(!e||this.state===e)){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},S.prototype.popState=function(){this.setState(this.stack.pop())},S.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var C=n?function(e,t){return e.exec(t)}:function(e,t){var n=e.exec(t);return n[0].length===0?null:n};S.prototype._getGroup=function(e){for(var t=this.groups.length,n=0;n<t;n++)if(e[n+1]!==void 0)return this.groups[n];throw Error(`Cannot find token type for matched text`)};function w(){return this.value}if(S.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText=``,t}var n=this.buffer;if(e!==n.length){var r=this.fast[n.charCodeAt(e)];if(r)return this._token(r,n.charAt(e),e);var i=this.re;i.lastIndex=e;var a=C(i,n),o=this.error;if(a==null)return this._token(o,n.slice(e,n.length),e);var r=this._getGroup(a),s=a[0];return o.fallback&&a.index!==e?(this.queuedGroup=r,this.queuedText=s,this._token(o,n.slice(e,a.index),e)):this._token(r,s,e)}},S.prototype._token=function(e,t,n){var r=0;if(e.lineBreaks){var i=/\n/g,a=1;if(t===`
|
|
6
6
|
`)r=1;else for(;i.exec(t);)r++,a=i.lastIndex}var o={type:typeof e.type==`function`&&e.type(t)||e.defaultType,value:typeof e.value==`function`?e.value(t):t,text:t,toString:w,offset:n,lineBreaks:r,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=r,r===0?this.col+=s:this.col=s-a+1,e.shouldThrow)throw Error(this.formatError(o,`invalid syntax`));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),o},typeof Symbol<`u`&&Symbol.iterator){var T=function(e){this.lexer=e};T.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},T.prototype[Symbol.iterator]=function(){return this},S.prototype[Symbol.iterator]=function(){return new T(this)}}return S.prototype.formatError=function(e,t){if(e==null)var n=this.buffer.slice(this.index),e={text:n,offset:this.index,lineBreaks:n.indexOf(`
|
|
7
7
|
`)===-1?0:1,line:this.line,col:this.col};var r=2,i=Math.max(e.line-r,1),a=e.line+r,o=String(a).length,s=d(this.buffer,this.line-e.line+r+1).slice(0,5),c=[];c.push(t+` at line `+e.line+` col `+e.col+`:`),c.push(``);for(var l=0;l<s.length;l++){var f=s[l],p=i+l;c.push(u(String(p),o)+` `+f),p===e.line&&c.push(u(``,o+e.col+1)+`^`)}return c.join(`
|
|
8
|
-
`)},S.prototype.clone=function(){return new S(this.states,this.state)},S.prototype.has=function(e){return!0},{compile:v,states:b,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:x}})})),i=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.lexer=e.states=void 0;var n=t(r());e.states={body:{doubleapos:{match:`''`,value:()=>`'`},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:e=>e.slice(1,-1).replace(/''/g,`'`)},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:`arg`,value:e=>e.substring(1).trim()},octothorpe:`#`,end:{match:`}`,pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:`select`,value:e=>e.split(`,`)[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:`body`,value:e=>e.split(`,`)[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:e=>e.substring(1).trim()},end:{match:`}`,pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:e=>e.split(`:`)[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:`body`,value:e=>e.substring(0,e.indexOf(`{`)).trim()},end:{match:/\s*\}/u,pop:1}}},e.lexer=n.default.states(e.states)})),a=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ParseError=void 0,e.parse=u;var t=i(),n=e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),r=e=>e===`plural`||e===`select`||e===`selectordinal`;function a(e,t){let n=``,r=``;for(let i of t){let t=i.ctx.text;switch(r+=t,i.type){case`content`:n+=i.value;break;case`argument`:case`function`:case`octothorpe`:n+=t;break;default:throw new c(e,`Unsupported part in strict mode function arg style: ${t}`)}}return[{type:`content`,value:n.trim(),ctx:Object.assign({},t[0].ctx,{text:r})}]}var o=[`number`,`date`,`time`,`spellout`,`ordinal`,`duration`],s=[`zero`,`one`,`two`,`few`,`many`,`other`],c=class extends Error{constructor(e,n){super(t.lexer.formatError(e,n))}};e.ParseError=c;var l=class{constructor(e,n){this.lexer=t.lexer.reset(e),this.cardinalKeys=n?.cardinal??s,this.ordinalKeys=n?.ordinal??s,this.strict=n?.strict??!1,this.strictPluralKeys=n?.strictPluralKeys??!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,t,n){if(n[0]===`=`){if(t===`select`)throw new c(e,`The case ${n} is not valid with select`)}else if(t!==`select`){let r=t===`plural`?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&r.length>0&&!r.includes(n))throw new c(e,`The ${t} case ${n} is not valid in this locale`)}}parseSelect({value:e},t,r,i){let a={type:i,arg:e,cases:[],ctx:r};i===`plural`||i===`selectordinal`?t=!0:this.strict&&(t=!1);for(let e of this.lexer)switch(e.type){case`offset`:if(i===`select`)throw new c(e,`Unexpected plural offset for select`);if(a.cases.length>0)throw new c(e,`Plural offset must be set before cases`);a.pluralOffset=Number(e.value),r.text+=e.text,r.lineBreaks+=e.lineBreaks;break;case`case`:this.checkSelectKey(e,i,e.value),a.cases.push({key:e.value,tokens:this.parseBody(t),ctx:n(e)});break;case`end`:return a;default:throw new c(e,`Unexpected lexer token: ${e.type}`)}throw new c(null,`Unexpected message end`)}parseArgToken(e,t){let i=n(e),s=this.lexer.next();if(!s)throw new c(null,`Unexpected message end`);if(i.text+=s.text,i.lineBreaks+=s.lineBreaks,this.strict&&(s.type===`func-simple`||s.type===`func-args`)&&!o.includes(s.value))throw new c(e,`Invalid strict mode function arg type: ${s.value}`);switch(s.type){case`end`:return{type:`argument`,arg:e.value,ctx:i};case`func-simple`:{let t=this.lexer.next();if(!t)throw new c(null,`Unexpected message end`);if(t.type!==`end`)throw new c(t,`Unexpected lexer token: ${t.type}`);if(i.text+=t.text,r(s.value.toLowerCase()))throw new c(s,`Invalid type identifier: ${s.value}`);return{type:`function`,arg:e.value,key:s.value,ctx:i}}case`func-args`:{if(r(s.value.toLowerCase()))throw new c(s,`Invalid type identifier: ${s.value}`);let n=this.parseBody(this.strict?!1:t);return this.strict&&n.length>0&&(n=a(e,n)),{type:`function`,arg:e.value,key:s.value,param:n,ctx:i}}case`select`:if(r(s.value))return this.parseSelect(e,t,i,s.value);throw new c(s,`Unexpected select type ${s.value}`);default:throw new c(s,`Unexpected lexer token: ${s.type}`)}}parseBody(e,t){let r=[],i=null;for(let a of this.lexer)if(a.type===`argument`)i&&=null,r.push(this.parseArgToken(a,e));else if(a.type===`octothorpe`&&e)i&&=null,r.push({type:`octothorpe`,ctx:n(a)});else if(a.type===`end`&&!t)return r;else{let t=a.value;if(!e&&a.type===`quoted`&&t[0]===`#`){if(t.includes(`{`))throw new c(a,`Unsupported escape pattern: ${t}`);t=a.text}i?(i.value+=t,i.ctx.text+=a.text,i.ctx.lineBreaks+=a.lineBreaks):(i={type:`content`,value:t,ctx:n(a)},r.push(i))}if(t)return r;throw new c(null,`Unexpected message end`)}};function u(e,t={}){return new l(e,t).parse()}}))(),o=class extends Error{constructor(e,t,n){super(e),this.token=t,this.type=n||`error`}},s=e=>e<4?`short`:e===4?`long`:`narrow`,c=e=>e%2==0?`2-digit`:`numeric`;function l(e,t){switch(e.char){case`y`:return{year:c(e.width)};case`r`:return{calendar:`gregory`,year:`numeric`};default:return t(`${e.desc} is not supported; falling back to year:numeric`,o.WARNING),{year:`numeric`}}}function u(e,t){switch(e.width){case 1:return`numeric`;case 2:return`2-digit`;case 3:return`short`;case 4:return`long`;case 5:return`narrow`;default:t(`${e.desc} is not supported with width ${e.width}`);return}}function d(e,t){let{char:n,desc:r,width:i}=e;if(n===`d`)return c(i);t(`${r} is not supported`)}function f(e,t){let{char:n,desc:r,width:i}=e;return(n===`c`||n===`e`)&&i<3&&t(`Numeric value is not supported for ${r}; falling back to weekday:short`,o.WARNING),s(i)}function p(e){let t=c(e.width),n;switch(e.char){case`h`:n=`h12`;break;case`H`:n=`h23`;break;case`k`:n=`h24`;break;case`K`:n=`h11`;break}return n?{hour:t,hourCycle:n}:{hour:t}}function m(e,t){let{char:n,desc:r,width:i}=e;switch(n){case`v`:case`z`:return i===4?`long`:`short`;case`V`:if(i===4)return`long`;t(`${r} is not supported with width ${i}`);return;case`X`:t(`${r} is not supported`);return}return`short`}function h(e,t){switch(e.field){case`era`:return{era:s(e.width)};case`year`:return l(e,t);case`month`:return{month:u(e,t)};case`day`:return{day:d(e,t)};case`weekday`:return{weekday:f(e,t)};case`period`:return;case`hour`:return p(e);case`min`:return{minute:c(e.width)};case`sec`:return{second:c(e.width)};case`tz`:return{timeZoneName:m(e,t)};case`quarter`:case`week`:case`sec-frac`:case`ms`:t(`${e.desc} is not supported`)}}function g(e,t,n=e=>{throw e}){let r={timeZone:t},i=[];for(let t of e){let{error:e,field:a,str:s}=t;if(e){let r=new o(e.message,t);r.stack=e.stack,n(r)}s&&n(new o(`Ignoring string part: ${s}`,t,o.WARNING)),a&&(i.indexOf(a)===-1?i.push(a):n(new o(`Duplicate ${a} token`,t)));let c=h(t,(e,r)=>n(new o(e,t,r)));c&&Object.assign(r,c)}return r}var _={G:{field:`era`,desc:`Era`},y:{field:`year`,desc:`Year`},Y:{field:`year`,desc:`Year of "Week of Year"`},u:{field:`year`,desc:`Extended year`},U:{field:`year`,desc:`Cyclic year name`},r:{field:`year`,desc:`Related Gregorian year`},Q:{field:`quarter`,desc:`Quarter`},q:{field:`quarter`,desc:`Stand-alone quarter`},M:{field:`month`,desc:`Month in year`},L:{field:`month`,desc:`Stand-alone month in year`},w:{field:`week`,desc:`Week of year`},W:{field:`week`,desc:`Week of month`},d:{field:`day`,desc:`Day in month`},D:{field:`day`,desc:`Day of year`},F:{field:`day`,desc:`Day of week in month`},g:{field:`day`,desc:`Modified julian day`},E:{field:`weekday`,desc:`Day of week`},e:{field:`weekday`,desc:`Local day of week`},c:{field:`weekday`,desc:`Stand-alone local day of week`},a:{field:`period`,desc:`AM/PM marker`},b:{field:`period`,desc:`AM/PM/noon/midnight marker`},B:{field:`period`,desc:`Flexible day period`},h:{field:`hour`,desc:`Hour in AM/PM (1~12)`},H:{field:`hour`,desc:`Hour in day (0~23)`},k:{field:`hour`,desc:`Hour in day (1~24)`},K:{field:`hour`,desc:`Hour in AM/PM (0~11)`},j:{field:`hour`,desc:`Hour in preferred cycle`},J:{field:`hour`,desc:`Hour in preferred cycle without marker`},C:{field:`hour`,desc:`Hour in preferred cycle with flexible marker`},m:{field:`min`,desc:`Minute in hour`},s:{field:`sec`,desc:`Second in minute`},S:{field:`sec-frac`,desc:`Fractional second`},A:{field:`ms`,desc:`Milliseconds in day`},z:{field:`tz`,desc:`Time Zone: specific non-location`},Z:{field:`tz`,desc:`Time Zone`},O:{field:`tz`,desc:`Time Zone: localized`},v:{field:`tz`,desc:`Time Zone: generic non-location`},V:{field:`tz`,desc:`Time Zone: ID`},X:{field:`tz`,desc:`Time Zone: ISO8601 with Z`},x:{field:`tz`,desc:`Time Zone: ISO8601`}},v=e=>e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`;function y(e,t){let n=e[t],r=1;for(;e[++t]===n;)++r;let i=_[n];if(!i){let e=`The letter ${n} is not a valid field identifier`;return{char:n,error:Error(e),width:r}}return{char:n,field:i.field,desc:i.desc,width:r}}function b(e,t){let n=e[++t],r=2;if(n===`'`)return{char:`'`,str:n,width:r};for(;;){let i=e[++t];if(++r,i===void 0){let t=`Unterminated quoted literal in pattern: ${n||e}`;return{char:`'`,error:Error(t),str:n,width:r}}else if(i===`'`){if(e[++t]!==`'`)return{char:`'`,str:n,width:r};++r}n+=i}}function x(e,t){let n=e[t];if(!n)return null;if(v(n))return y(e,t);if(n===`'`)return b(e,t);let r=n,i=1;for(;;){let a=e[++t];if(!a||v(a)||a===`'`)return{char:n,str:r,width:i};r+=a,i+=1}}function S(e){let t=[],n=0;for(;;){let r=x(e,n);if(!r)return t;t.push(r),n+=r.width}}function C(e,t){return e.filter(e=>e.type!==`content`).length?e.map(e=>{if(e.type===`content`)return t(e.value);if(e.type===`octothorpe`)return`#`;if(e.type===`argument`)return[e.arg];if(e.type===`function`){let t=e?.param?.[0];if(e.key===`date`&&t){let n=w(t.value.trim(),e=>{throw Error(`Unable to compile date expression: ${e.message}`)});return[e.arg,e.key,n]}return t?[e.arg,e.key,t.value.trim()]:[e.arg,e.key]}let n=e.pluralOffset,r={};return e.cases.forEach(({key:e,tokens:n})=>{let i=e[0]===`=`?e.slice(1):e;r[i]=C(n,t)}),[e.arg,e.type,{offset:n,...r}]}):e.map(e=>t(e.value))}function w(e,t){return/^::/.test(e)?g(S(e.substring(2)),void 0,t):e}function T(e,t=e=>e){return C((0,a.parse)(e),t)}function ee(e,t=e=>e){try{return T(e,t)}catch(t){return console.error(`${t.message}
|
|
8
|
+
`)},S.prototype.clone=function(){return new S(this.states,this.state)},S.prototype.has=function(e){return!0},{compile:v,states:b,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:x}})})),r=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.lexer=e.states=void 0;var r=t(n());e.states={body:{doubleapos:{match:`''`,value:()=>`'`},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:e=>e.slice(1,-1).replace(/''/g,`'`)},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:`arg`,value:e=>e.substring(1).trim()},octothorpe:`#`,end:{match:`}`,pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:`select`,value:e=>e.split(`,`)[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:`body`,value:e=>e.split(`,`)[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:e=>e.substring(1).trim()},end:{match:`}`,pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:e=>e.split(`:`)[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:`body`,value:e=>e.substring(0,e.indexOf(`{`)).trim()},end:{match:/\s*\}/u,pop:1}}},e.lexer=r.default.states(e.states)})),i=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ParseError=void 0,e.parse=u;var t=r(),n=e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),i=e=>e===`plural`||e===`select`||e===`selectordinal`;function a(e,t){let n=``,r=``;for(let i of t){let t=i.ctx.text;switch(r+=t,i.type){case`content`:n+=i.value;break;case`argument`:case`function`:case`octothorpe`:n+=t;break;default:throw new c(e,`Unsupported part in strict mode function arg style: ${t}`)}}return[{type:`content`,value:n.trim(),ctx:Object.assign({},t[0].ctx,{text:r})}]}var o=[`number`,`date`,`time`,`spellout`,`ordinal`,`duration`],s=[`zero`,`one`,`two`,`few`,`many`,`other`],c=class extends Error{constructor(e,n){super(t.lexer.formatError(e,n))}};e.ParseError=c;var l=class{constructor(e,n){this.lexer=t.lexer.reset(e),this.cardinalKeys=n?.cardinal??s,this.ordinalKeys=n?.ordinal??s,this.strict=n?.strict??!1,this.strictPluralKeys=n?.strictPluralKeys??!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,t,n){if(n[0]===`=`){if(t===`select`)throw new c(e,`The case ${n} is not valid with select`)}else if(t!==`select`){let r=t===`plural`?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&r.length>0&&!r.includes(n))throw new c(e,`The ${t} case ${n} is not valid in this locale`)}}parseSelect({value:e},t,r,i){let a={type:i,arg:e,cases:[],ctx:r};i===`plural`||i===`selectordinal`?t=!0:this.strict&&(t=!1);for(let e of this.lexer)switch(e.type){case`offset`:if(i===`select`)throw new c(e,`Unexpected plural offset for select`);if(a.cases.length>0)throw new c(e,`Plural offset must be set before cases`);a.pluralOffset=Number(e.value),r.text+=e.text,r.lineBreaks+=e.lineBreaks;break;case`case`:this.checkSelectKey(e,i,e.value),a.cases.push({key:e.value,tokens:this.parseBody(t),ctx:n(e)});break;case`end`:return a;default:throw new c(e,`Unexpected lexer token: ${e.type}`)}throw new c(null,`Unexpected message end`)}parseArgToken(e,t){let r=n(e),s=this.lexer.next();if(!s)throw new c(null,`Unexpected message end`);if(r.text+=s.text,r.lineBreaks+=s.lineBreaks,this.strict&&(s.type===`func-simple`||s.type===`func-args`)&&!o.includes(s.value))throw new c(e,`Invalid strict mode function arg type: ${s.value}`);switch(s.type){case`end`:return{type:`argument`,arg:e.value,ctx:r};case`func-simple`:{let t=this.lexer.next();if(!t)throw new c(null,`Unexpected message end`);if(t.type!==`end`)throw new c(t,`Unexpected lexer token: ${t.type}`);if(r.text+=t.text,i(s.value.toLowerCase()))throw new c(s,`Invalid type identifier: ${s.value}`);return{type:`function`,arg:e.value,key:s.value,ctx:r}}case`func-args`:{if(i(s.value.toLowerCase()))throw new c(s,`Invalid type identifier: ${s.value}`);let n=this.parseBody(this.strict?!1:t);return this.strict&&n.length>0&&(n=a(e,n)),{type:`function`,arg:e.value,key:s.value,param:n,ctx:r}}case`select`:if(i(s.value))return this.parseSelect(e,t,r,s.value);throw new c(s,`Unexpected select type ${s.value}`);default:throw new c(s,`Unexpected lexer token: ${s.type}`)}}parseBody(e,t){let r=[],i=null;for(let a of this.lexer)if(a.type===`argument`)i&&=null,r.push(this.parseArgToken(a,e));else if(a.type===`octothorpe`&&e)i&&=null,r.push({type:`octothorpe`,ctx:n(a)});else if(a.type===`end`&&!t)return r;else{let t=a.value;if(!e&&a.type===`quoted`&&t[0]===`#`){if(t.includes(`{`))throw new c(a,`Unsupported escape pattern: ${t}`);t=a.text}i?(i.value+=t,i.ctx.text+=a.text,i.ctx.lineBreaks+=a.lineBreaks):(i={type:`content`,value:t,ctx:n(a)},r.push(i))}if(t)return r;throw new c(null,`Unexpected message end`)}};function u(e,t={}){return new l(e,t).parse()}}))(),a=class extends Error{constructor(e,t,n){super(e),this.token=t,this.type=n||`error`}},o=e=>e<4?`short`:e===4?`long`:`narrow`,s=e=>e%2==0?`2-digit`:`numeric`;function c(e,t){switch(e.char){case`y`:return{year:s(e.width)};case`r`:return{calendar:`gregory`,year:`numeric`};default:return t(`${e.desc} is not supported; falling back to year:numeric`,a.WARNING),{year:`numeric`}}}function l(e,t){switch(e.width){case 1:return`numeric`;case 2:return`2-digit`;case 3:return`short`;case 4:return`long`;case 5:return`narrow`;default:t(`${e.desc} is not supported with width ${e.width}`);return}}function u(e,t){let{char:n,desc:r,width:i}=e;if(n===`d`)return s(i);t(`${r} is not supported`)}function d(e,t){let{char:n,desc:r,width:i}=e;return(n===`c`||n===`e`)&&i<3&&t(`Numeric value is not supported for ${r}; falling back to weekday:short`,a.WARNING),o(i)}function f(e){let t=s(e.width),n;switch(e.char){case`h`:n=`h12`;break;case`H`:n=`h23`;break;case`k`:n=`h24`;break;case`K`:n=`h11`;break}return n?{hour:t,hourCycle:n}:{hour:t}}function p(e,t){let{char:n,desc:r,width:i}=e;switch(n){case`v`:case`z`:return i===4?`long`:`short`;case`V`:if(i===4)return`long`;t(`${r} is not supported with width ${i}`);return;case`X`:t(`${r} is not supported`);return}return`short`}function m(e,t){switch(e.field){case`era`:return{era:o(e.width)};case`year`:return c(e,t);case`month`:return{month:l(e,t)};case`day`:return{day:u(e,t)};case`weekday`:return{weekday:d(e,t)};case`period`:return;case`hour`:return f(e);case`min`:return{minute:s(e.width)};case`sec`:return{second:s(e.width)};case`tz`:return{timeZoneName:p(e,t)};case`quarter`:case`week`:case`sec-frac`:case`ms`:t(`${e.desc} is not supported`)}}function h(e,t,n=e=>{throw e}){let r={timeZone:t},i=[];for(let t of e){let{error:e,field:o,str:s}=t;if(e){let r=new a(e.message,t);r.stack=e.stack,n(r)}s&&n(new a(`Ignoring string part: ${s}`,t,a.WARNING)),o&&(i.indexOf(o)===-1?i.push(o):n(new a(`Duplicate ${o} token`,t)));let c=m(t,(e,r)=>n(new a(e,t,r)));c&&Object.assign(r,c)}return r}var g={G:{field:`era`,desc:`Era`},y:{field:`year`,desc:`Year`},Y:{field:`year`,desc:`Year of "Week of Year"`},u:{field:`year`,desc:`Extended year`},U:{field:`year`,desc:`Cyclic year name`},r:{field:`year`,desc:`Related Gregorian year`},Q:{field:`quarter`,desc:`Quarter`},q:{field:`quarter`,desc:`Stand-alone quarter`},M:{field:`month`,desc:`Month in year`},L:{field:`month`,desc:`Stand-alone month in year`},w:{field:`week`,desc:`Week of year`},W:{field:`week`,desc:`Week of month`},d:{field:`day`,desc:`Day in month`},D:{field:`day`,desc:`Day of year`},F:{field:`day`,desc:`Day of week in month`},g:{field:`day`,desc:`Modified julian day`},E:{field:`weekday`,desc:`Day of week`},e:{field:`weekday`,desc:`Local day of week`},c:{field:`weekday`,desc:`Stand-alone local day of week`},a:{field:`period`,desc:`AM/PM marker`},b:{field:`period`,desc:`AM/PM/noon/midnight marker`},B:{field:`period`,desc:`Flexible day period`},h:{field:`hour`,desc:`Hour in AM/PM (1~12)`},H:{field:`hour`,desc:`Hour in day (0~23)`},k:{field:`hour`,desc:`Hour in day (1~24)`},K:{field:`hour`,desc:`Hour in AM/PM (0~11)`},j:{field:`hour`,desc:`Hour in preferred cycle`},J:{field:`hour`,desc:`Hour in preferred cycle without marker`},C:{field:`hour`,desc:`Hour in preferred cycle with flexible marker`},m:{field:`min`,desc:`Minute in hour`},s:{field:`sec`,desc:`Second in minute`},S:{field:`sec-frac`,desc:`Fractional second`},A:{field:`ms`,desc:`Milliseconds in day`},z:{field:`tz`,desc:`Time Zone: specific non-location`},Z:{field:`tz`,desc:`Time Zone`},O:{field:`tz`,desc:`Time Zone: localized`},v:{field:`tz`,desc:`Time Zone: generic non-location`},V:{field:`tz`,desc:`Time Zone: ID`},X:{field:`tz`,desc:`Time Zone: ISO8601 with Z`},x:{field:`tz`,desc:`Time Zone: ISO8601`}},_=e=>e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`;function v(e,t){let n=e[t],r=1;for(;e[++t]===n;)++r;let i=g[n];if(!i){let e=`The letter ${n} is not a valid field identifier`;return{char:n,error:Error(e),width:r}}return{char:n,field:i.field,desc:i.desc,width:r}}function y(e,t){let n=e[++t],r=2;if(n===`'`)return{char:`'`,str:n,width:r};for(;;){let i=e[++t];if(++r,i===void 0){let t=`Unterminated quoted literal in pattern: ${n||e}`;return{char:`'`,error:Error(t),str:n,width:r}}else if(i===`'`){if(e[++t]!==`'`)return{char:`'`,str:n,width:r};++r}n+=i}}function b(e,t){let n=e[t];if(!n)return null;if(_(n))return v(e,t);if(n===`'`)return y(e,t);let r=n,i=1;for(;;){let a=e[++t];if(!a||_(a)||a===`'`)return{char:n,str:r,width:i};r+=a,i+=1}}function x(e){let t=[],n=0;for(;;){let r=b(e,n);if(!r)return t;t.push(r),n+=r.width}}function S(e,t){return e.filter(e=>e.type!==`content`).length?e.map(e=>{if(e.type===`content`)return t(e.value);if(e.type===`octothorpe`)return`#`;if(e.type===`argument`)return[e.arg];if(e.type===`function`){let t=e?.param?.[0];if(e.key===`date`&&t){let n=C(t.value.trim(),e=>{throw Error(`Unable to compile date expression: ${e.message}`)});return[e.arg,e.key,n]}return t?[e.arg,e.key,t.value.trim()]:[e.arg,e.key]}let n=e.pluralOffset,r={};return e.cases.forEach(({key:e,tokens:n})=>{let i=e[0]===`=`?e.slice(1):e;r[i]=S(n,t)}),[e.arg,e.type,{offset:n,...r}]}):e.map(e=>t(e.value))}function C(e,t){return/^::/.test(e)?h(x(e.substring(2)),void 0,t):e}function w(e,t=e=>e){return S((0,i.parse)(e),t)}function T(e,t=e=>e){try{return w(e,t)}catch(t){return console.error(`${t.message}
|
|
9
9
|
|
|
10
|
-
Message: ${e}`),[e]}}var E=e=>typeof e==`string`,
|
|
10
|
+
Message: ${e}`),[e]}}var E=e=>typeof e==`string`,D=e=>typeof e==`function`,O=new Map,k=`en`;function A(e){return[...Array.isArray(e)?e:[e],k]}function j(e,t,n){let r=A(e);n||=`default`;let i;if(typeof n==`string`)switch(i={day:`numeric`,month:`short`,year:`numeric`},n){case`full`:i.weekday=`long`;case`long`:i.month=`long`;break;case`short`:i.month=`numeric`;break}else i=n;return P(()=>F(`date`,r,n),()=>new Intl.DateTimeFormat(r,i)).format(E(t)?new Date(t):t)}function ee(e,t,n){let r;if(n||=`default`,typeof n==`string`)switch(r={second:`numeric`,minute:`numeric`,hour:`numeric`},n){case`full`:case`long`:r.timeZoneName=`short`;break;case`short`:delete r.second}else r=n;return j(e,t,r)}function M(e,t,n){let r=A(e);return P(()=>F(`number`,r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function N(e,t,n,{offset:r=0,...i}){let a=A(e),o=t?P(()=>F(`plural-ordinal`,a),()=>new Intl.PluralRules(a,{type:`ordinal`})):P(()=>F(`plural-cardinal`,a),()=>new Intl.PluralRules(a,{type:`cardinal`}));return i[n]??i[o.select(n-r)]??i.other}function P(e,t){let n=e(),r=O.get(n);return r||(r=t(),O.set(n,r)),r}function F(e,t,n){return`${e}-${t.join(`-`)}-${JSON.stringify(n)}`}var I=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,L=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return String.fromCharCode(e)}else{let e=parseInt(n,16);return String.fromCharCode(e)}}),R=`%__lingui_octothorpe__%`,z=(e,t,n={})=>{let r=t||e,i=e=>typeof e==`object`?e:n[e],a=(e,t)=>{let a=M(r,e,Object.keys(n).length?i(`number`):void 0);return t.replace(new RegExp(R,`g`),a)};return{plural:(e,t)=>{let{offset:n=0}=t,i=N(r,!1,e,t);return a(e-n,i)},selectordinal:(e,t)=>{let{offset:n=0}=t,i=N(r,!0,e,t);return a(e-n,i)},select:te,number:(e,t)=>M(r,e,i(t)||{style:t}),date:(e,t)=>j(r,e,i(t)||t),time:(e,t)=>ee(r,e,i(t)||t)}},te=(e,t)=>t[e]??t.other;function ne(e,t,n){return(r={},i)=>{let a=z(t,n,i),o=(e,t=!1)=>Array.isArray(e)?e.reduce((e,n)=>{if(n===`#`&&t)return e+R;if(E(n))return e+n;let[i,s,c]=n,l={};s===`plural`||s===`selectordinal`||s===`select`?Object.entries(c).forEach(([e,t])=>{l[e]=o(t,s===`plural`||s===`selectordinal`)}):l=c;let u;if(s){let e=a[s];u=e(r[i],l)}else u=r[i];return u==null?e:e+u},``):e,s=o(e);return E(s)&&I.test(s)?L(s):E(s)?s:s?String(s):``}}var re=Object.defineProperty,ie=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t,n)=>(ie(e,typeof t==`symbol`?t:t+``,n),n),oe=class{constructor(){ae(this,`_events`,{})}on(e,t){var n;return(n=this._events)[e]??(n[e]=[]),this._events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){let n=this._getListeners(e);if(!n)return;let r=n.indexOf(t);~r&&n.splice(r,1)}emit(e,...t){let n=this._getListeners(e);n&&n.map(e=>e.apply(this,t))}_getListeners(e){let t=this._events[e];return Array.isArray(t)?t:!1}},se=Object.defineProperty,ce=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B=(e,t,n)=>(ce(e,typeof t==`symbol`?t:t+``,n),n),le=class extends oe{constructor(e){super(),B(this,`_locale`,``),B(this,`_locales`),B(this,`_localeData`,{}),B(this,`_messages`,{}),B(this,`_missing`),B(this,`_messageCompiler`),B(this,`t`,this._.bind(this)),process.env.NODE_ENV!==`production`&&this.setMessagesCompiler(T),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale==`string`||e.locales)&&this.activate(e.locale??k,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,t){let n=this._localeData[e];n?Object.assign(n,t):this._localeData[e]=t}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,t){typeof e==`string`?this._loadLocaleData(e,t):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit(`change`)}_load(e,t){let n=this._messages[e];n?Object.assign(n,t):this._messages[e]=t}load(e,t){typeof e==`string`&&typeof t==`object`?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit(`change`)}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit(`change`)}activate(e,t){process.env.NODE_ENV!==`production`&&(this._messages[e]||console.warn(`Messages for locale "${e}" not loaded.`)),this._locale=e,this._locales=t,this.emit(`change`)}_(e,t,n){if(!this.locale)throw Error(`Lingui: Attempted to call a translation function without setting a locale.
|
|
11
11
|
Make sure to call \`i18n.activate(locale)\` before using Lingui functions.
|
|
12
|
-
This issue may also occur due to a race condition in your initialization logic.`);let r=n?.message;e||=``,E(e)||(t=e.values||t,r=e.message,e=e.id);let i=this.messages[e],a=i===void 0,o=this._missing;if(o&&a)return
|
|
12
|
+
This issue may also occur due to a race condition in your initialization logic.`);let r=n?.message;e||=``,E(e)||(t=e.values||t,r=e.message,e=e.id);let i=this.messages[e],a=i===void 0,o=this._missing;if(o&&a)return D(o)?o(this._locale,e):o;a&&this.emit(`missing`,{id:e,locale:this._locale});let s=i||r||e;return E(s)&&(this._messageCompiler?s=this._messageCompiler(s):console.warn(`Uncompiled message detected! Message:
|
|
13
13
|
|
|
14
14
|
> ${s}
|
|
15
15
|
|
|
@@ -17,4 +17,4 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
17
17
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
18
18
|
|
|
19
19
|
Please compile your catalog first.
|
|
20
|
-
`)),E(s)&&I.test(s)?L(s):E(s)?s:
|
|
20
|
+
`)),E(s)&&I.test(s)?L(s):E(s)?s:ne(s,this._locale,this._locales)(t,n?.formats)}date(e,t){return j(this._locales||this._locale,e,t)}number(e,t){return M(this._locales||this._locale,e,t)}};function V(e={}){return new le(e)}V();function H(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function U(e,...t){if(!H(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function W(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function ue(e,t){U(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function G(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function K(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function q(e,t){return e<<32-t|e>>>t}function J(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function Y(e){return typeof e==`string`&&(e=J(e)),U(e),e}var de=class{};function fe(e){let t=t=>e().update(Y(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function pe(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function me(e,t,n){return e&t^~e&n}function he(e,t,n){return e&t^e&n^t&n}var ge=class extends de{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=K(this.buffer)}update(e){W(this),e=Y(e),U(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=K(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){W(this),ue(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,G(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;pe(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=K(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},X=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_e=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Z=new Uint32Array(64),ve=class extends ge{constructor(e=32){super(64,e,8,!1),this.A=X[0]|0,this.B=X[1]|0,this.C=X[2]|0,this.D=X[3]|0,this.E=X[4]|0,this.F=X[5]|0,this.G=X[6]|0,this.H=X[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Z[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Z[e-15],n=Z[e-2],r=q(t,7)^q(t,18)^t>>>3;Z[e]=(q(n,17)^q(n,19)^n>>>10)+Z[e-7]+r+Z[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=q(o,6)^q(o,11)^q(o,25),u=l+t+me(o,s,c)+_e[e]+Z[e]|0,d=(q(n,2)^q(n,13)^q(n,22))+he(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){G(Z)}destroy(){this.set(0,0,0,0,0,0,0,0),G(this.buffer)}},ye=fe(()=>new ve),be=``,xe=5e4,Q=new Map,Se=e=>typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(String.fromCharCode(...e)),Ce=(t,n=``)=>{let r=t+be+(n||``),i=Q.get(r);if(e.Vt(i))return i;let a=Se(ye(J(r))).slice(0,6);return Q.size>=xe&&Q.clear(),Q.set(r,a),a},$=(e,t)=>`${e}.${t}`,we=[`objectLabel`,`objectLabelSingular`,`objectLabelPlural`,`objectIcon`],Te=e=>`{${e}}`;Object.fromEntries(we.map(e=>[e,Te(e)]));var Ee={objectMetadata:[`labelSingular`,`labelPlural`,`description`],fieldMetadata:[`label`,`description`],view:[`name`],viewFieldGroup:[`name`],pageLayout:[`name`],pageLayoutTab:[`title`],pageLayoutWidget:[`title`],commandMenuItem:[`label`,`shortLabel`],navigationMenuItem:[`name`],timelineActivityType:[`label`],settingsMenuItem:[`title`],skill:[`label`,`description`]},De=t=>{let n=[];for(let[r,i]of Object.entries(t)){if(typeof i==`string`){n.push({message:r,translation:i});continue}if(e.Vt(i)&&typeof i==`object`)for(let[e,t]of Object.entries(i))typeof t==`string`&&n.push({message:e,context:r,translation:t})}return n},Oe=t=>{let n=Object.create(null),r=[...t].sort((e,t)=>(e.context??``).localeCompare(t.context??``)||e.message.localeCompare(t.message));for(let{message:t,context:i,translation:a}of r){if(!e.Vt(i)){n[t]=a;continue}let r=n[i];typeof r==`object`&&e.Vt(r)?Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]={[t]:a}}return n};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Oe}});
|