twenty 2.48.0 → 2.49.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/dist/app-template/yarn.lock +157 -183
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/application-BE-X21OV.cjs +5 -0
- package/dist/chunks/{build-pull-entities-BBNc4zkt.cjs → build-pull-entities-caP3XupC.cjs} +2 -2
- package/dist/chunks/{build-source-manifest-BMjw7BvT.cjs → build-source-manifest-DWRbCMVq.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-BbQlyo_m.cjs → build-source-snapshot-CtgBQfSx.cjs} +813 -154
- package/dist/chunks/cli-version.constant-BBeYll5N.cjs +1 -0
- package/dist/chunks/{collect-translatable-strings-C3TWaO1V.cjs → collect-translatable-strings-GBVXMoaX.cjs} +1 -1
- package/dist/chunks/{collect-watch-inputs-Cexr5YYZ.cjs → collect-watch-inputs-CJVgCTo5.cjs} +1 -1
- package/dist/chunks/compile-application-translations-B4jILjGc.cjs +1 -0
- package/dist/chunks/{constants-Du9J-8Ug-CD8GTrut.cjs → constants-CemcuPi_-D7dbw2cv.cjs} +1 -1
- package/dist/chunks/{convert-to-label-D24GvvpW.cjs → convert-to-label-DH4ArWop.cjs} +1 -1
- package/dist/chunks/{create-http-status-error-Dd3336c8.cjs → create-http-status-error-C6gJS0JS.cjs} +1 -1
- package/dist/chunks/create-metadata-client-BRD2ys8z.cjs +6 -0
- package/dist/chunks/{create-pull-base-write-Cl1jfQ6l.cjs → create-pull-base-write-CX9yftCd.cjs} +1 -1
- package/dist/chunks/{create-rest-client-r3OA3fUu.cjs → create-rest-client-Cc5Cmakp.cjs} +17 -17
- package/dist/chunks/extract-manifest-from-file-mvb6OhWm.cjs +1 -0
- package/dist/chunks/{extract-source-translations-BLQ-XFuN.cjs → extract-source-translations-Bd_030qL.cjs} +1 -1
- package/dist/chunks/{fetch-metadata-inspection-BwJjaHCB.cjs → fetch-metadata-inspection-CAmEp-xl.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-CWFlsW7e.cjs → fetch-signed-in-identity-b_LbRuL-.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-id-DJFdCITG.cjs → fetch-workspace-id-C9kY0s84.cjs} +1 -1
- package/dist/chunks/format-body-BIv-9Sd5.cjs +1 -0
- package/dist/chunks/{format-data-value-C5itQm1i.cjs → format-data-value-C7Njc7Sb.cjs} +1 -1
- package/dist/chunks/{format-metadata-fields-BozY419E.cjs → format-metadata-fields-BOG2kj2h.cjs} +1 -1
- package/dist/chunks/{format-metadata-owner-C6CksDIK.cjs → format-metadata-owner-CyEMvoQr.cjs} +1 -1
- package/dist/chunks/format-progress-line-DgxG_7p2.cjs +1 -0
- package/dist/chunks/{generate-application-client-BApuJWQO.cjs → generate-application-client-BOLnv8nr.cjs} +1 -1
- package/dist/chunks/{get-app-plan-summary-F_MjZOGe.cjs → get-app-plan-summary-D1Dsd34P.cjs} +1 -1
- package/dist/chunks/{get-client-generation-skip-reason-B5f_gcok.cjs → get-client-generation-skip-reason-CUn0Y2Vu.cjs} +1 -1
- package/dist/chunks/{get-function-input-schema-GNk3NRLJ-oQ5Evald.cjs → get-function-input-schema-GNk3NRLJ-CWNFoyKh.cjs} +1 -1
- package/dist/chunks/{global-flags.constant-BPHQAhn7.cjs → global-flags.constant-0k222fHC.cjs} +1 -1
- package/dist/chunks/{is-access-token-expiring-DIimejBr.cjs → is-access-token-expiring-D-YfufId.cjs} +1 -1
- package/dist/chunks/{is-application-not-found-error-D0BAcKyX.cjs → is-application-not-found-error-4vnGlYbm.cjs} +1 -1
- package/dist/chunks/{is-exported-manifest-RF_O2ibz.cjs → is-exported-manifest-dsiWCcjx.cjs} +1 -1
- package/dist/chunks/{is-locale-catalog-Dzj6m_Xt.cjs → is-locale-catalog-CRn-mKHj.cjs} +1 -1
- package/dist/chunks/is-supported-locale-BOZxTj7r.cjs +1 -0
- package/dist/chunks/{locale-catalog-format-BT6ommA1.cjs → locale-catalog-format-rg5FMb7l.cjs} +2 -2
- package/dist/chunks/metadata-Vepr2xeA.cjs +1 -0
- package/dist/chunks/{metadata-page.constant-CnR03vnh.cjs → metadata-page.constant-thBSPIZT.cjs} +1 -1
- package/dist/chunks/{parse-api-url-C9MmGtLY.cjs → parse-api-url-CEfjRyid.cjs} +1 -1
- package/dist/chunks/{parse-app-export-BT6nM7Ki.cjs → parse-app-export-DUZ2dQJ8.cjs} +1 -1
- package/dist/chunks/{parse-extraction-locale-CM7sARBo.cjs → parse-extraction-locale-fg7K8vps.cjs} +1 -1
- package/dist/chunks/{parse-graphql-response-DbYu3YlQ.cjs → parse-graphql-response-DvoRiFPV.cjs} +1 -1
- package/dist/chunks/{parse-json-input-DaXTn_6C.cjs → parse-json-input-DE451WQG.cjs} +1 -1
- package/dist/chunks/{print-typescript-value-BoxeFXca.cjs → print-typescript-value-DaEFmMda.cjs} +1 -1
- package/dist/chunks/{pull-source-DNswr_80.cjs → pull-source-D9QUEAsK.cjs} +1 -1
- package/dist/chunks/{read-app-identity-CtO3wiSx.cjs → read-app-identity-DtEnxiEF.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-B51ax_Q6.cjs → read-application-identifier-DyZcsUV4.cjs} +1 -1
- package/dist/chunks/{read-application-identity-Bx8B9Bel.cjs → read-application-identity-CMJ-W5D8.cjs} +1 -1
- package/dist/chunks/{read-config-LKYhSPOb.cjs → read-config-DdtXhdPp.cjs} +1 -1
- package/dist/chunks/{read-json-object-BONMjSVo.cjs → read-json-object-CgaXuNS0.cjs} +1 -1
- package/dist/chunks/{read-snapshot-file-ClIpemjz.cjs → read-snapshot-file-dvWjVexO.cjs} +1 -1
- package/dist/chunks/{read-source-identity-C4eKC14c.cjs → read-source-identity-Ca7QkuwC.cjs} +1 -1
- package/dist/chunks/{record-pull-base-CdTOndSf.cjs → record-pull-base-Dfqth7Uy.cjs} +1 -1
- package/dist/chunks/{record-typecheck-config-inputs-DcCY-_Z1.cjs → record-typecheck-config-inputs-DZy2PhMY.cjs} +1 -1
- package/dist/chunks/{request-oauth-tokens-CS79pVAp.cjs → request-oauth-tokens-BY5ew3aM.cjs} +1 -1
- package/dist/chunks/{resolve-app-project-BQnFOdLH.cjs → resolve-app-project-dftvbB2P.cjs} +1 -1
- package/dist/chunks/{resolve-command-target-CKYtQQPx.cjs → resolve-command-target-0k6iitOZ.cjs} +1 -1
- package/dist/chunks/{resolve-inside-sdk-Cc_y-RWT.cjs → resolve-inside-sdk-6M8jy9bi.cjs} +1 -1
- package/dist/chunks/{resolve-metadata-object-CRWbF9Ce.cjs → resolve-metadata-object-DzDTQF_T.cjs} +1 -1
- package/dist/chunks/{resolve-project-typescript-CZW_p97L.cjs → resolve-project-typescript-Cw2kvn6E.cjs} +1 -1
- package/dist/chunks/{resolve-request-url-BrqiqInn.cjs → resolve-request-url-Cnuxu_nj.cjs} +1 -1
- package/dist/chunks/{resolve-source-sdk-CGEJC-UH.cjs → resolve-source-sdk-B1Fxlsmt.cjs} +1 -1
- package/dist/chunks/{run-api-graphql-command-KlIMjpOY.cjs → run-api-graphql-command-CzQ4IH4l.cjs} +1 -1
- package/dist/chunks/{run-api-rest-command-W4gCU562.cjs → run-api-rest-command-BtXv11uz.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-C6rIt02R.cjs → run-app-add-command-DsgrCsEl.cjs} +1 -1
- package/dist/chunks/{run-app-apply-command-BckNNni9.cjs → run-app-apply-command-X_XGAwRN.cjs} +1 -1
- package/dist/chunks/{run-app-build-command-DW0r-w2C.cjs → run-app-build-command--t8qRNsn.cjs} +1 -1
- package/dist/chunks/{run-app-dev-command-C3U-3OiV.cjs → run-app-dev-command-Cc-nhH2t.cjs} +1 -1
- package/dist/chunks/{run-app-exec-command-DNeCk5qs.cjs → run-app-exec-command-mdXCYmUn.cjs} +1 -1
- package/dist/chunks/{run-app-generate-client-command-HAgBNVFU.cjs → run-app-generate-client-command-3DMg-WyX.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-dTbY28oS.cjs → run-app-init-command-BfS8IFmY.cjs} +1 -1
- package/dist/chunks/{run-app-install-command-BX30OsrQ.cjs → run-app-install-command-DMbwFvtE.cjs} +1 -1
- package/dist/chunks/{run-app-logs-command-CdAXR-XY.cjs → run-app-logs-command-B7_iDOj1.cjs} +1 -1
- package/dist/chunks/{run-app-operation--X_q0SAn.cjs → run-app-operation-DFCj0sG_.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-Bm1eXl7V.cjs → run-app-plan-command-Dh_DFA7H.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-Cdb3OlI2.cjs → run-app-publish-command-eJcYGb8S.cjs} +1 -1
- package/dist/chunks/{run-app-pull-command-DljZP4Ey.cjs → run-app-pull-command-BV2cMuLU.cjs} +1 -1
- package/dist/chunks/{run-app-translations-extract-command-Cc053lZ6.cjs → run-app-translations-extract-command-CBBbk_vJ.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-B7o20_BR.cjs → run-app-typecheck-command-pAHhuBGo.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-DJsWZtoI.cjs → run-app-uninstall-command-C5um6udQ.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-21pHzpvT.cjs → run-auth-login-command-C4VI44Xu.cjs} +1 -1
- package/dist/chunks/{run-auth-logout-command-DWOafJmL.cjs → run-auth-logout-command-5Tvqclki.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-BBAcouvs.cjs → run-auth-status-command-CLH1bylR.cjs} +1 -1
- package/dist/chunks/{run-cli-D1VWVXar.cjs → run-cli-BA0FsxzB.cjs} +1 -1
- package/dist/chunks/{run-commands-command-6x3V48LL.cjs → run-commands-command-CjzkTcrO.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-DrgvC-zi.cjs → run-data-get-command-DoZIpf8O.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-Cs8GAHbD.cjs → run-data-list-command-DAoplyqj.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-BM4pkNY0.cjs → run-doctor-command-D8cpt7FI.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-describe-command-CrmzNFh8.cjs → run-metadata-field-describe-command-BrZYIhjH.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-B2CbERvZ.cjs → run-metadata-field-list-command-C9-pHXbx.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-PLt5ySLJ.cjs → run-metadata-object-describe-command-WFdGu1Iq.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-BcnWKmgh.cjs → run-metadata-object-list-command-8UKU3cMW.cjs} +1 -1
- package/dist/chunks/{run-open-command-CzMO5wI4.cjs → run-open-command-B1pdHp36.cjs} +1 -1
- package/dist/chunks/{run-remote-list-command-37zf0rSp.cjs → run-remote-list-command-BRPcCOKx.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-B-XUqYBY.cjs → run-remote-remove-command-CS6za2Pm.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-Bmg3nZfB.cjs → run-remote-rename-command-BOqWQUR4.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-r2NUlgWw.cjs → run-remote-use-command-BANiokD-.cjs} +1 -1
- package/dist/chunks/{run-version-command-DfDcA927.cjs → run-version-command-C0xgcPP6.cjs} +1 -1
- package/dist/chunks/{select-target-CEy96CC9.cjs → select-target-CfuNLCQL.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-9cHGpXda.cjs → sign-in-to-remote-again-DYCWIDa9.cjs} +1 -1
- package/dist/chunks/{sign-in-with-browser-StQ_Fkku.cjs → sign-in-with-browser-Ck4tOxtA.cjs} +1 -1
- package/dist/chunks/{to-public-target-T4zHrdLQ.cjs → to-public-target-C0POrVoG.cjs} +1 -1
- package/dist/chunks/{to-worker-output-diagnostics-BeJKIsDG.cjs → to-worker-output-diagnostics-Bt_acI26.cjs} +1 -1
- package/dist/chunks/{typecheck-application-DLdoLIDx.cjs → typecheck-application-DEO1SVdO.cjs} +1 -1
- package/dist/chunks/{update-config-CNOHxgkF.cjs → update-config-FzOzO3wZ.cjs} +1 -1
- package/dist/chunks/{utils-BEfQWzTA-z2Y1wZJq.cjs → utils-ZOESAfF8-ub6jPiZ-.cjs} +1 -1
- package/dist/chunks/{write-config-atomically-gr2Ldzm8.cjs → write-config-atomically-C-YMKq3P.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/package.json +2 -2
- package/dist/chunks/application-VJqniwXy.cjs +0 -5
- package/dist/chunks/cli-version.constant-BJdY4dXs.cjs +0 -1
- package/dist/chunks/compile-application-translations-Dhfvrs__.cjs +0 -1
- package/dist/chunks/create-metadata-client-DEBMHFDo.cjs +0 -6
- package/dist/chunks/extract-manifest-from-file-D3w7Ampa.cjs +0 -1
- package/dist/chunks/format-body-CJyi3Ukr.cjs +0 -1
- package/dist/chunks/format-progress-line-C5nYDVHB.cjs +0 -1
- package/dist/chunks/is-supported-locale-C9iuFQ39.cjs +0 -1
- package/dist/chunks/metadata-BtOyR6x0.cjs +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./utils-ZOESAfF8-ub6jPiZ-.cjs"),n=require("./constants-CemcuPi_-D7dbw2cv.cjs");function r(e){if(!n.mt(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}function i(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var a=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,o=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function s(e,t,a,o,s,c){let l=typeof a==`string`?i(a):a,u=typeof o==`string`?r(o):o;if(typeof o==`string`&&(o=r(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=t(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return n.pt(d)}function c(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function l(e,t){return e<<t|e>>>32-t}function u(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=l(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],u=n[3],d=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=l(i,5)+c(n,a,s,u)+d+t[n]+r[e]>>>0;d=u,u=s,s=l(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+d>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function d(e,t,n,r){return s(80,u,e,t,n,r)}d.DNS=a,d.URL=o;function f(e){if(!n.mt(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}function p(e){return e instanceof Boolean||typeof e==`boolean`}function m(e){return e instanceof String||typeof e==`string`}function ee(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&!Array.isArray(e)}var te=[`choice`,`score`,`boolean`],ne=/^[a-zA-Z0-9_.-]{1,64}$/,re=e=>ne.test(e),h=e.t(),g=function(e){return e.CODE=`CODE`,e.LOGIC_FUNCTION=`LOGIC_FUNCTION`,e.SEND_EMAIL=`SEND_EMAIL`,e.SEND_CHAT_MESSAGE=`SEND_CHAT_MESSAGE`,e.DRAFT_EMAIL=`DRAFT_EMAIL`,e.CREATE_CALENDAR_EVENT=`CREATE_CALENDAR_EVENT`,e.CREATE_RECORD=`CREATE_RECORD`,e.UPDATE_RECORD=`UPDATE_RECORD`,e.DELETE_RECORD=`DELETE_RECORD`,e.UPSERT_RECORD=`UPSERT_RECORD`,e.FIND_RECORDS=`FIND_RECORDS`,e.PICK_RECORD=`PICK_RECORD`,e.FORM=`FORM`,e.FILTER=`FILTER`,e.IF_ELSE=`IF_ELSE`,e.HTTP_REQUEST=`HTTP_REQUEST`,e.AI_AGENT=`AI_AGENT`,e.CLASSIFY=`CLASSIFY`,e.ITERATOR=`ITERATOR`,e.EMPTY=`EMPTY`,e.DELAY=`DELAY`,e.WAIT_FOR_EVENT=`WAIT_FOR_EVENT`,e}({}),_=`trigger`,ie=e=>{let t=[],n=``,r=!1,i=0;for(;i<e.length;){let a=e[i];if(a===`[`&&!r){n.length>0&&(t.push(n),n=``),r=!0,i++;continue}if(a===`]`&&r){t.push(n),n=``,r=!1,i++,i<e.length&&e[i]===`.`&&i++;continue}if(a===`.`&&!r){n.length>0&&(t.push(n),n=``),i++;continue}n+=a,i++}return n.length>0&&t.push(n),t},ae=/{{([^{}]+)}}/g;function*v(e){if((0,h.isString)(e)){for(let[,t]of e.matchAll(ae))n.Vt(t)&&(yield t);return}if((0,h.isObject)(e))for(let t of Object.values(e))yield*v(t)}var oe=e=>[...v(e)],se=(e,t)=>{let n=e.length+1,r=t.length+1,i=Array.from({length:n},()=>Array(r).fill(0));for(let e=0;e<n;e++)i[e][0]=e;for(let e=0;e<r;e++)i[0][e]=e;for(let a=1;a<n;a++){let n=i[a-1],o=i[a];for(let i=1;i<r;i++){let r=e[a-1]===t[i-1]?0:1;o[i]=Math.min(n[i]+1,o[i-1]+1,n[i-1]+r)}}return i[e.length][t.length]},ce=e=>{if(!n.Vt(e)||!ee(e)||Array.isArray(e))return!1;let t=Object.values(e);return t.length===0?!1:t.every(e=>n.Vt(e)&&ee(e)&&p(e.isLeaf))},y=(e,t=[])=>{let n=[];if(!(0,h.isObject)(e))return n;for(let[r,i]of Object.entries(e)){if(!(0,h.isObject)(i))continue;let e=[...t,r];n.push(e.join(`.`)),!i.isLeaf&&(0,h.isObject)(i.value)&&n.push(...y(i.value,e))}return n},le=({schema:e,propertyPath:t})=>{let r=e;for(let e=0;e<t.length;e++){let i=t[e];if(!n.Vt(i))return;if(!(0,h.isObject)(r))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:[]};let a=r[i];if(!n.Vt(a))return{validPrefix:t.slice(0,e),failedSegment:i,availableKeys:Object.keys(r)};if(a.isLeaf){let r=t[e+1];return n.Vt(r)?{validPrefix:t.slice(0,e+1),failedSegment:r,availableKeys:[]}:void 0}r=a.value}},b={found:!1},x=e=>n.p(e)&&p(e.isLeaf),S=e=>n.p(e)&&e._outputSchemaType===`RECORD`&&n.p(e.fields),C=e=>n.p(e)&&!(`_outputSchemaType`in e)&&x(e.first)&&e.first.isLeaf===!1&&S(e.first.value)&&x(e.totalCount),w=e=>({found:!0,type:m(e.type)?e.type:void 0,label:m(e.label)?e.label:void 0}),ue=(e,t)=>t.length===0?w(e):T(e.value,t),de=(e,t)=>{for(let n=1;n<=t.length;n++){let r=e[t.slice(0,n).join(`.`)];if(x(r))return ue(r,t.slice(n))}return b},fe=(e,t)=>{let[n,...r]=t;if(n===`first`)return r.length===0?w(e.first):T(e.first.value,r);if(n===`all`||n===`totalCount`){let t=e[n];return r.length===0&&x(t)?w(t):b}return b},pe=(e,t)=>{let[r,...i]=t;if(!n.Vt(r))return b;let a=e[r];return x(a)?ue(a,i):n.Vt(a)?i.length===0?{found:!0}:n.p(a)?pe(a,i):b:b},T=(e,t)=>t.length===0||!n.p(e)?b:S(e)?de(e.fields,t):C(e)?fe(e,t):pe(e,t),me=({schema:e,propertyPath:t})=>T(e,t),E=e=>{let t=[];for(let[r,i]of Object.entries(e))if(x(i)){if(t.push(r),i.isLeaf)continue;let e=i.value;if(S(e))for(let n of E(e.fields))t.push(`${r}.${n}`);else if(n.p(e))for(let n of E(e))t.push(`${r}.${n}`)}else if(n.Vt(i)&&(t.push(r),n.p(i)))for(let e of E(i))t.push(`${r}.${e}`);return t},D=e=>{if(!n.p(e))return[];if(S(e))return E(e.fields);if(C(e)){let t=[];if(x(e.first)){t.push(`first`);for(let n of D(e.first.value))t.push(`first.${n}`)}return n.Vt(e.all)&&t.push(`all`),t.push(`totalCount`),t}return E(e)},he=3,O=e=>n.p(e)?e._outputSchemaType===`RECORD`?!0:Object.values(e).some(e=>n.p(e)&&O(e.value)):!1,k=(e,t)=>t.map(t=>({candidate:t,distance:se(e,t)})).filter(({candidate:e,distance:t})=>t<=Math.ceil(e.length/2)).sort((e,t)=>e.distance-t.distance).slice(0,he).map(({candidate:e})=>e),ge=({schema:e,propertyPath:t,referencedStepId:r})=>{if(!ce(e)||O(e)){let n=D(e);return k(t.join(`.`),n).map(e=>[r,e].join(`.`))}let i=le({schema:e,propertyPath:t});if(!n.Vt(i))return[];let a=k(i.failedSegment,i.availableKeys).map(e=>[r,...i.validPrefix,e].join(`.`));if((0,h.isNonEmptyArray)(a))return a;let o=y(e);return k(t.join(`.`),o).map(e=>[r,e].join(`.`))},_e=({workflow:e,graph:t,stepsById:r})=>{let i=[],a=new Set(e.steps?.map(e=>e.id)??[]);for(let o of e.steps??[]){let s=oe(o.settings?.input),c=t.ancestorsByStepId.get(o.id)??new Set;for(let t of s){let s=ie(t),l=s[0];if(!n.Vt(l)){i.push({severity:`error`,code:`VARIABLE_INVALID_PATH`,message:`Step "${o.name??o.id}" has a variable "{{${t}}}" with an invalid path. Variable references must start with a step ID, e.g. "{{stepId.property}}".`,stepId:o.id,path:t});continue}let u=l===_;if(!u&&!a.has(l)){i.push({severity:`error`,code:`VARIABLE_UNKNOWN_STEP`,message:`Step "${o.name??o.id}" references variable "{{${t}}}" from an unknown step "${l}".`,stepId:o.id,path:t});continue}let d=l===o.id;if(!u&&!d&&!c.has(l)){let e=r.get(l)?.name??l;i.push({severity:`error`,code:`VARIABLE_NOT_UPSTREAM`,message:`Step "${o.name??o.id}" references variable "{{${t}}}" from step "${e}", which does not run before it. Ensure step "${e}" is an ancestor (connected via nextStepIds chain from the trigger, before this step).`,stepId:o.id,path:t});continue}i.push(...ve({step:o,variable:t,pathSegments:s,referencedStepId:l,isTriggerReference:u,trigger:e.trigger,stepsById:r}))}}return i},ve=({step:e,variable:t,pathSegments:r,referencedStepId:i,isTriggerReference:a,trigger:o,stepsById:s})=>{let c=r.slice(1);if(c.length===0)return[];let l=a?o?.settings?.outputSchema:s.get(i)?.settings?.outputSchema,u=n.Vt(l)&&(0,h.isObject)(l)&&!Array.isArray(l)&&Object.keys(l).length===0;if(!n.Vt(l)||u)return[];if(!me({schema:l,propertyPath:c}).found){let r=ge({schema:l,propertyPath:c,referencedStepId:i}),a=be(l,i),o=(0,h.isNonEmptyArray)(r)?`Did you mean "{{${r[0]}}}"?${r.length>1?` Other options: ${r.slice(1).map(e=>`{{${e}}}`).join(`, `)}.`:``}`:(0,h.isNonEmptyArray)(a)?`Available paths: ${a.map(e=>`{{${e}}}`).join(`, `)}.`:void 0;return[{severity:`error`,code:`VARIABLE_PATH_NOT_FOUND`,message:`Step "${e.name??e.id}" references variable "{{${t}}}" but the path "${c.join(`.`)}" was not found in the output of step "${i}".`,stepId:e.id,path:t,...n.Vt(o)?{hint:o}:{},...(0,h.isNonEmptyArray)(r)?{suggestions:r}:{},...(0,h.isNonEmptyArray)(a)?{availablePaths:a}:{}}]}return[]},ye=20,be=(e,t)=>D(e).slice(0,ye).map(e=>`${t}.${e}`),xe=n.jt({type:n.Dt(`object`),properties:n.Nt(n.Ft(),n.jt({type:n.vt([`string`,`number`,`boolean`]),description:n.Ft().optional()})).refine(e=>Object.keys(e).every(re),{message:`Output field names can only contain letters, numbers, underscores, dots or hyphens (max 64 characters)`}),required:n.xt(n.Ft()).optional(),additionalProperties:n.Dt(!1).optional()}),Se=n.Ct(`type`,[n.jt({type:n.Dt(`text`)}),n.jt({type:n.Dt(`json`),schema:xe})]),A=[1e3,5e3,15e3],j=n.jt({input:n.Ot({}).describe(`Input data for the workflow action. Structure depends on the action type.`),outputSchema:n.Ot({}).describe(`Schema defining the output data structure. This data can be referenced in subsequent steps using {{stepId.fieldName}}.`),errorHandlingOptions:n.jt({retryOnFailure:n.jt({value:n.Mt(e=>typeof e==`boolean`?Number(e):e,n.At().int().min(0).max(A.length).describe(`How many times to retry the action if it fails, between 0 and ${A.length}. 0 disables retries.`))}),continueOnFailure:n.jt({value:n.St().describe(`Whether to continue to the next step if this action fails.`)})})}),Ce={expectedOutputSchema:n.Ot({}).optional().describe(`A sample output value declared by the user for steps whose output structure is only known at runtime.`)},we=j.extend({input:n.jt({url:n.Ft(),method:n.vt([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`]),headers:n.Nt(n.Ft(),n.Ft()).optional(),body:n.Nt(n.Ft(),n.It([n.Ft(),n.At(),n.St(),n.yt(),n.xt(n.It([n.Ft(),n.At(),n.St(),n.yt()]))])).or(n.Ft()).optional()}),...Ce}),Te=/^[a-zA-Z0-9_-]{1,64}$/,Ee=n.jt({id:n.Rt().describe(`Stable identifier for this criterion row.`),name:n.Ft().describe(`Option name for a choice question, or the label of one score level.`),description:n.Ft().optional().describe(`What the model should understand this option to mean.`)}),De=n.jt({id:n.Rt().describe(`Stable identifier for this question row.`),name:n.Ft().regex(Te,`Answer name must be empty or contain 1 to 64 characters using only letters, digits, underscores and dashes`).or(n.Dt(``)).describe(`Answer key for this question, made of letters, digits, underscores and dashes. Downstream steps read {{stepId.answers.<name>}}.`),type:n.vt(te).describe(`choice picks one option, score grades an ordered rubric, boolean estimates the probability that a statement holds.`),instructions:n.Ft().describe(`What the model should decide about the shared state.`),criteria:n.xt(Ee).describe(`Options for a choice question, or ordered levels (lowest first) for a score question. Empty for boolean.`)}),Oe=j.extend({input:n.jt({state:n.Ft().describe(`The shared state every question is asked about. Supports variables.`),questions:n.xt(De)})}),ke=j.extend({input:n.jt({items:n.It([n.xt(n.It([n.Ft(),n.At(),n.St(),n.yt(),n.Nt(n.Ft(),n.bt()),n.bt()])),n.Ft()]).optional(),initialLoopStepIds:n.xt(n.Ft()).optional(),shouldContinueOnIterationFailure:n.St().optional()})}),Ae=j.extend({input:n.jt({delayType:n.vt([`SCHEDULED_DATE`,`DURATION`]),scheduledDateTime:n.Ft().nullable().optional(),duration:n.jt({days:n.It([n.At().min(0),n.Ft()]).optional(),hours:n.It([n.At().min(0),n.Ft()]).optional(),minutes:n.It([n.At().min(0),n.Ft()]).optional(),seconds:n.It([n.At().min(0),n.Ft()]).optional()}).optional()})}),je=j.extend({input:n.jt({eventName:n.Ft().describe(`Event to wait for, in format objectName.action (e.g., "company.updated", "task.created", "person.deleted").`),recordId:n.Ft().nullable().optional().describe(`Only resume for this record. Usually a variable such as {{trigger.properties.after.id}}. Leave empty to resume on any record.`),updatedFields:n.xt(n.Ft()).nullable().optional().describe(`For update events, only resume when one of these fields changed.`),timeout:n.jt({days:n.It([n.At().min(0),n.Ft()]).optional(),hours:n.It([n.At().min(0),n.Ft()]).optional(),minutes:n.It([n.At().min(0),n.Ft()]).optional()}).nullable().optional().describe(`Stop waiting after this duration. The step then succeeds with hasTimedOut set to true.`)})}),Me=j.extend({input:n.jt({})}),M=n.Nt(n.Ft(),n.bt()).describe(`Record data object. Use nested objects for relationships (e.g., "company": {"id": "{{reference}}"}). Common patterns:
|
|
2
|
+
- Person: {"name": {"firstName": "John", "lastName": "Doe"}, "emails": {"primaryEmail": "john@example.com"}, "company": {"id": "{{trigger.properties.after.id}}"}}
|
|
3
|
+
- Company: {"name": "Acme Corp", "domainName": {"primaryLinkUrl": "https://acme.com"}}
|
|
4
|
+
- Task: {"title": "Follow up", "status": "TODO", "assignee": {"id": "{{user.id}}"}}`),Ne=j.extend({input:n.jt({objectName:n.Ft().describe(`The name of the object to create a record in. Must be lowercase (e.g., "person", "company", "task").`),objectRecord:M.describe(`The record data to create.`)})}),Pe=j.extend({input:n.jt({objectName:n.Ft(),objectRecord:M,objectRecordId:n.Ft(),fieldsToUpdate:n.xt(n.Ft())})}),Fe=j.extend({input:n.jt({objectName:n.Ft(),objectRecord:M})}),Ie=j.extend({input:n.jt({objectName:n.Ft(),objectRecordId:n.Ft()})}),N=n.jt({id:n.Ft(),logicalOperator:n.vt(n.M),parentRecordFilterGroupId:n.Ft().nullable().optional(),positionInRecordFilterGroup:n.At().nullable().optional()}),P=n.jt({id:n.Ft().optional(),fieldMetadataId:n.Ft(),operand:n.vt(n.W),value:n.Ft().nullable().optional(),recordFilterGroupId:n.Ft().nullable().optional(),positionInRecordFilterGroup:n.At().nullable().optional(),subFieldName:n.Ft().nullable().optional(),relationTargetFieldMetadataId:n.Ft().nullable().optional()}),F=n.Ft().regex(/^{{[^{}]+}}$/,`Expected a workflow variable reference like {{stepId.path}}`),Le=j.extend({input:n.jt({objectName:n.Ft(),limit:n.It([n.At(),F]).optional(),offset:n.It([n.At().int().nonnegative(),F]).optional(),filter:n.jt({recordFilterGroups:n.xt(N).optional(),recordFilters:n.xt(P).optional()}).optional(),orderBy:n.jt({recordSorts:n.xt(n.bt()).optional(),gqlOperationOrderBy:n.xt(n.Nt(n.Ft(),n.bt())).optional()}).optional()})}),Re=n.jt({id:n.Ft(),name:n.Ft(),label:n.Ft(),type:n.It([n.Dt(n.ot.TEXT),n.Dt(n.ot.NUMBER),n.Dt(n.ot.DATE),n.Dt(n.ot.SELECT),n.Dt(n.ot.MULTI_SELECT),n.Dt(`RECORD`)]),placeholder:n.Ft().optional(),settings:n.Nt(n.Ft(),n.bt()).optional(),value:n.bt().optional()}),ze=j.extend({input:n.xt(Re),instructions:n.Ft().optional()}),I=n.jt({id:n.Ft(),logicalOperator:n.vt(n.P),parentStepFilterGroupId:n.Ft().optional(),positionInStepFilterGroup:n.At().optional()}),L=n.jt({id:n.Ft(),type:n.Ft(),stepOutputKey:n.Ft(),operand:n.vt(n.W).or(n.vt(n.L)),value:n.Ft(),stepFilterGroupId:n.Ft(),positionInStepFilterGroup:n.At().optional(),fieldMetadataId:n.Ft().optional(),compositeFieldSubFieldName:n.Ft().optional()}),Be=j.extend({input:n.jt({stepFilterGroups:n.xt(I),stepFilters:n.xt(L)})}),Ve=n.jt({id:n.Ft(),nextStepIds:n.xt(n.Ft()),filterGroupId:n.Ft().optional()}),He=j.extend({input:n.jt({stepFilterGroups:n.xt(I),stepFilters:n.xt(L),branches:n.xt(Ve)})}),R=n.vt([`RANDOM`,`ROUND_ROBIN`,`LOAD_BALANCED`]);j.extend({input:n.jt({objectName:n.Ft(),strategy:R,recordIds:n.xt(n.Ft()),loadBalance:n.jt({objectNameSingular:n.Ft(),fieldName:n.Ft()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Vt(e.loadBalance)&&t.addIssue({code:n._t.custom,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})});var z=n.jt({name:n.Ft().optional().describe(`Human-readable name for the trigger. Optional but recommended for clarity.`),type:n.vt([`DATABASE_EVENT`,`MANUAL`,`CRON`,`WEBHOOK`]).describe(`Type of trigger. DATABASE_EVENT for record changes, MANUAL for user-initiated, CRON for scheduled, WEBHOOK for external calls.`),position:n.jt({x:n.At(),y:n.At()}).optional().nullable().describe(`Position coordinates for the trigger in the workflow diagram. Use (0, 0) for the trigger step.`),nextStepIds:n.xt(n.Ft()).optional().nullable().describe(`Array of step IDs that the trigger connects to. These are the first steps in the workflow.`)}),Ue=z.extend({type:n.Dt(`CRON`),settings:n.Ct(`type`,[n.jt({type:n.Dt(`DAYS`),schedule:n.jt({day:n.At().min(1),hour:n.At().min(0).max(23),minute:n.At().min(0).max(59)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`HOURS`),schedule:n.jt({hour:n.At().min(1),minute:n.At().min(0).max(59)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`MINUTES`),schedule:n.jt({minute:n.At().min(1).max(60)}),outputSchema:n.Ot({})}),n.jt({type:n.Dt(`CUSTOM`),pattern:n.Ft(),outputSchema:n.Ot({})})])}),We=z.extend({type:n.Dt(`WEBHOOK`),settings:n.Ct(`httpMethod`,[n.jt({outputSchema:n.Ot({}),httpMethod:n.Dt(`GET`),authentication:n.Dt(`API_KEY`).nullable()}),n.jt({outputSchema:n.Ot({}),expectedOutputSchema:n.Ot({}).optional(),httpMethod:n.Dt(`POST`),expectedBody:n.Ot({}),authentication:n.Dt(`API_KEY`).nullable()})])}),Ge=e=>{let t=e.settings?.input;return e.type===g.IF_ELSE&&(0,h.isObject)(t)&&`branches`in t&&Array.isArray(t.branches)},B=e=>{let t=e.settings?.input;return e.type===g.ITERATOR&&(0,h.isObject)(t)&&`initialLoopStepIds`in t&&(0,h.isNonEmptyArray)(t.initialLoopStepIds)},Ke=e=>{let t=e.settings?.input;if(n.Vt(t)&&(0,h.isObject)(t))return t},qe=e=>{let t=new Set(e.nextStepIds??[]);if(Ge(e))for(let n of e.settings.input.branches??[])for(let e of n?.nextStepIds??[])t.add(e);if(B(e))for(let n of e.settings.input.initialLoopStepIds??[])t.add(n);return[...t]},Je=({trigger:e,steps:t})=>{let r=new Map,i=n.Vt(e?.nextStepIds)?e.nextStepIds.filter(n.Vt):[];r.set(_,i);for(let e of t??[])r.set(e.id,qe(e));let a=new Set,o=[_];for(;o.length>0;){let e=o.shift();if(!(!n.Vt(e)||a.has(e))){a.add(e);for(let t of r.get(e)??[])a.has(t)||o.push(t)}}return{childrenByStepId:r,reachableFromTrigger:a,ancestorsByStepId:Ye(r)}},Ye=e=>{let t=new Map;for(let[n,r]of e.entries())for(let e of r){let r=t.get(e)??new Set;r.add(n),t.set(e,r)}let n=new Map;for(let r of e.keys()){if(n.has(r))continue;let e=new Set,i=[...t.get(r)??[]];for(;i.length>0;){let n=i.shift();if(!e.has(n)){e.add(n);for(let r of t.get(n)??[])e.has(r)||i.push(r)}}n.set(r,e)}return n},Xe=({workflow:e,graph:t})=>{let r=[],i=new Set,a=new Set,o=new Map((e.steps??[]).map(e=>[e.id,e])),s=(e,c=[],l)=>{let u=c[c.length-1];if(i.has(e)){if(e!==l&&u===e)return;r.push({severity:`error`,code:`WORKFLOW_CYCLE`,stepId:e,message:`Workflow contains a cycle at step ${e}`});return}let d=o.get(e),f=`${e}:${c.join(`,`)}`;if(!n.Vt(d)||a.has(f))return;i.add(e),B(d)&&(d.settings.input.initialLoopStepIds??[]).forEach(t=>s(t,[...c,e],e));let p=d.type===g.ITERATOR?d.nextStepIds??[]:t.childrenByStepId.get(e)??[];n.Vt(u)&&p.length===0&&r.push({severity:`error`,code:`ITERATOR_MISSING_RETURN`,stepId:e,message:`Loop body step ${e} must return to iterator ${u}`}),p.forEach(t=>s(t,c,e)),i.delete(e),a.add(f)};return e.trigger?.nextStepIds?.forEach(e=>s(e)),r},Ze=({workflow:e,graph:r})=>{let i=[],a=e.steps??[],o=new Set(a.map(e=>e.id)),s=new Set;for(let e of a)s.has(e.id)&&i.push({severity:`error`,code:`DUPLICATE_STEP_ID`,message:`Duplicate step id "${e.id}". Every step id must be unique within the workflow.`,stepId:e.id}),s.add(e.id);let c=(e.trigger?.nextStepIds??[]).filter(n.Vt);t.r(a)&&c.length===0&&i.push({severity:`error`,code:`TRIGGER_HAS_NO_NEXT_STEP`,message:`The trigger is not connected to any step. The trigger must have a "nextStepIds" array pointing to the first step (e.g. nextStepIds: ["${a[0].id}"]). If you used edges, also set trigger.nextStepIds.`});for(let e of c)o.has(e)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`The trigger references a non-existent step "${e}".`});for(let e of a){for(let t of r.childrenByStepId.get(e.id)??[])o.has(t)||i.push({severity:`error`,code:`DANGLING_REFERENCE`,message:`Step "${e.name??e.id}" references a non-existent step "${t}".`,stepId:e.id});i.push(...Qe(e))}for(let e of a)r.reachableFromTrigger.has(e.id)||i.push({severity:`error`,code:`UNREACHABLE_STEP`,message:`Step "${e.name??e.id}" is not reachable from the trigger. Ensure a chain of nextStepIds connects the trigger to this step. Check that the preceding step includes this step's id ("${e.id}") in its nextStepIds array.`,stepId:e.id});return i},Qe=e=>{let t=[],r=Ke(e);if(e.type===g.IF_ELSE){let i=r?.branches,a=Array.isArray(i)?i:[];a.length<2&&t.push({severity:`warning`,code:`IF_ELSE_INSUFFICIENT_BRANCHES`,message:`If/Else step "${e.name??e.id}" should have at least two branches (a condition branch and an else branch).`,stepId:e.id});let o=r?.stepFilterGroups,s=new Set((Array.isArray(o)?o:[]).filter(n.Vt).map(e=>e.id));for(let r of a){let i=r?.nextStepIds;(!Array.isArray(i)||i.length===0)&&t.push({severity:`error`,code:`IF_ELSE_BRANCH_HAS_NO_NEXT_STEP`,message:`A branch of If/Else step "${e.name??e.id}" is not connected to any step.`,stepId:e.id}),n.Vt(r?.filterGroupId)&&!s.has(r.filterGroupId)&&t.push({severity:`error`,code:`INVALID_STEP_PARAMS`,message:`A branch of If/Else step "${e.name??e.id}" references filter group "${r.filterGroupId}", which does not exist.`,stepId:e.id})}}if(e.type===g.ITERATOR){let n=r,i=n?.items,a=typeof i==`string`&&i.length>0||Array.isArray(i)&&i.length>0,o=n?.initialLoopStepIds,s=Array.isArray(o)&&o.length>0;a&&!s&&t.push({severity:`error`,code:`ITERATOR_MISSING_LOOP_BODY`,message:`Iterator step "${e.name??e.id}" has items to iterate over but no steps inside the loop.`,stepId:e.id})}return t},$e=`20202020-64aa-4b6f-b003-9c74b97cee20`,V=({entityNamespace:e,value:t,applicationUniversalIdentifier:n})=>d(`${e}:${t}`,n),et=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n})=>V({entityNamespace:`fieldMetadata`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),H=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n})=>V({entityNamespace:`pageLayout`,value:t?`${t}:${n}`:n,applicationUniversalIdentifier:e}),tt=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutTab`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),nt=({objectMetadataApplicationUniversalIdentifier:e,pageLayoutTabUniversalIdentifier:t,title:n})=>V({entityNamespace:`pageLayoutWidget`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),rt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_PAGE}),it=({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,relationTargetObjectUniversalIdentifier:n})=>V({entityNamespace:`fieldMetadata`,value:`${t}:systemRelation:${n}`,applicationUniversalIdentifier:e}),at=({objectMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,name:n})=>V({entityNamespace:`viewFieldGroup`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),ot=({fieldMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,fieldMetadataUniversalIdentifier:n})=>V({entityNamespace:`viewField`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),st={INDEX:`INDEX`,FIELDS_WIDGET:`FIELDS_WIDGET`},ct=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t,viewKey:n})=>V({entityNamespace:`view`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),U=function(e){return e.OK=`OK`,e.SUCCESS=`SUCCESS`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.NEUTRAL=`NEUTRAL`,e.UNKNOWN=`UNKNOWN`,e}({});Object.values(U).filter(e=>e!==U.OK&&e!==U.UNKNOWN),n.ot.TEXT,n.ot.ARRAY,n.ot.BOOLEAN,n.ot.DATE,n.ot.DATE_TIME,n.ot.NUMBER,n.ot.NUMERIC,n.ot.RAW_JSON,n.ot.RICH_TEXT,n.ot.SELECT,n.ot.MULTI_SELECT,g.SEND_EMAIL,g.DRAFT_EMAIL,g.CREATE_CALENDAR_EVENT;var lt=`public`,ut=`front-component-shared-dependencies.mjs`,dt=`twenty:front-component-shared-dependencies`;n.X.RECORD_PAGE,n.X.DASHBOARD;var ft={js:`import { createRequire as __createRequire } from 'module';
|
|
5
|
+
const require = __createRequire(import.meta.url);`},pt=`.twenty/output`,mt=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,fieldUniversalIdentifier:n})=>V({entityNamespace:`fieldPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),ht=({applicationUniversalIdentifier:e,roleUniversalIdentifier:t,objectUniversalIdentifier:n})=>V({entityNamespace:`objectPermission`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),gt=({objectMetadataApplicationUniversalIdentifier:e,objectUniversalIdentifier:t})=>H({applicationUniversalIdentifier:e,objectUniversalIdentifier:t,name:n.X.RECORD_FORM}),_t=({pageLayoutTabManifest:e,pageLayoutType:r})=>{let i=e.layoutMode??(r===n.X.STANDALONE_PAGE?n.J.VERTICAL_LIST:n.J.GRID),a=e.widgets??[],o=[];if(!Object.values(n.J).some(e=>e===i))return{status:`fail`,errors:[`Page layout tab "${e.title}" defines unsupported layoutMode "${i}". Expected GRID, VERTICAL_LIST or CANVAS.`]};for(let t of a){let r=[t.heightBehavior,n.p(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.Vt);r.length>0&&i!==n.J.VERTICAL_LIST&&o.push(`Page layout widget "${t.title}" defines heightBehavior, but its parent tab "${e.title}" uses ${i}. heightBehavior is only supported for VERTICAL_LIST tabs.`);for(let e of r)Object.values(n.ct).some(t=>t===e)||o.push(`Page layout widget "${t.title}" defines unsupported heightBehavior "${e}". Expected FIT_CONTENT or TAB_VIEWPORT.`)}if(o.length>0)return{status:`fail`,errors:o};let s={...e,layoutMode:i,widgets:a.map(({heightBehavior:e,position:r,gridPosition:a,...o},s)=>{if(n.Vt(r))return{...o,position:r.layoutMode===n.J.VERTICAL_LIST&&n.Vt(e)?{...r,heightBehavior:e}:r};if(n.Vt(a))return{...o,position:{layoutMode:n.J.GRID,...a}};switch(i){case n.J.GRID:return{...o,position:{layoutMode:i,row:0,column:0,rowSpan:n.k.default.h,columnSpan:n.k.default.w}};case n.J.VERTICAL_LIST:return{...o,position:{layoutMode:i,index:s,...n.Vt(e)?{heightBehavior:e}:{}}};case n.J.CANVAS:return{...o,position:{layoutMode:i}};default:return t.o(i)}})};for(let e of s.widgets)e.position.layoutMode!==i&&o.push(`Page layout widget "${e.title}" uses a ${e.position.layoutMode} position, but its parent tab "${s.title}" uses ${i}.`);if(i===n.J.VERTICAL_LIST){let e=s.widgets.filter(({type:e,position:r})=>r.layoutMode===n.J.VERTICAL_LIST&&t.t({widgetType:e,heightBehavior:r.heightBehavior})===n.ct.TAB_VIEWPORT);e.length>1&&o.push(`Page layout tab "${s.title}" can contain only one TAB_VIEWPORT widget.`);let r=e.length===1?e[0]:void 0;n.Vt(r)&&s.widgets.some(e=>e!==r&&e.position.layoutMode===n.J.VERTICAL_LIST&&r.position.layoutMode===n.J.VERTICAL_LIST&&e.position.index>=r.position.index)&&o.push(`Page layout tab "${s.title}" must place its TAB_VIEWPORT widget last.`)}return o.length>0?{status:`fail`,errors:o}:{status:`success`,pageLayoutTab:s}},W=[`canReadObjectRecords`,`canUpdateObjectRecords`,`canSoftDeleteObjectRecords`,`canDestroyObjectRecords`],G={canReadObjectRecords:`canReadAllObjectRecords`,canUpdateObjectRecords:`canUpdateAllObjectRecords`,canSoftDeleteObjectRecords:`canSoftDeleteAllObjectRecords`,canDestroyObjectRecords:`canDestroyAllObjectRecords`},K=({role:e,objectUniversalIdentifier:t})=>{let n=e.objectPermissions?.find(e=>e.objectUniversalIdentifier===t);return{canReadObjectRecords:n?.canReadObjectRecords??e[G.canReadObjectRecords]??!1,canUpdateObjectRecords:n?.canUpdateObjectRecords??e[G.canUpdateObjectRecords]??!1,canSoftDeleteObjectRecords:n?.canSoftDeleteObjectRecords??e[G.canSoftDeleteObjectRecords]??!1,canDestroyObjectRecords:n?.canDestroyObjectRecords??e[G.canDestroyObjectRecords]??!1}},vt=e=>JSON.stringify(e,(e,t)=>n.p(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),yt=({groupsByUniversalIdentifier:e,predicateGroupUniversalIdentifier:t})=>{let r=[],i=new Set,a=t;for(;n.Vt(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.Vt(t))break;r.push(t.logicalOperator),a=t.parentPredicateGroupUniversalIdentifier}return r},q=({role:e,objectUniversalIdentifier:t})=>{let n=new Map((e.rowLevelPermissionPredicateGroups??[]).map(e=>[e.universalIdentifier,e]));return(e.rowLevelPermissionPredicates??[]).filter(e=>e.objectUniversalIdentifier===t).map(e=>vt({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:yt({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},bt=n.x.map(e=>n.S[e]),xt=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),St=({role:e,superset:t})=>[...W.filter(n=>{let r=G[n];return e[r]&&!t[r]}).map(e=>({type:`ALL_OBJECT_RECORDS`,action:e})),...e.canUpdateAllSettings&&!t.canUpdateAllSettings?[{type:`ALL_SETTINGS`}]:[],...e.canAccessAllTools&&!t.canAccessAllTools?[{type:`ALL_TOOLS`}]:[]],Ct=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...bt,...n]),i=new Set(t.permissionFlagUniversalIdentifiers??[]);return[...new Set(e.permissionFlagUniversalIdentifiers??[])].filter(e=>!(r.has(e)?t.canAccessAllTools:t.canUpdateAllSettings)&&!i.has(e)).map(e=>({type:`PERMISSION_FLAG`,permissionFlagUniversalIdentifier:e}))},wt=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=K({role:e,objectUniversalIdentifier:n}),i=K({role:t,objectUniversalIdentifier:n}),a=W.filter(e=>r[e]&&!i[e]).map(e=>({type:`OBJECT_RECORDS`,objectUniversalIdentifier:n,action:e})),o=W.some(e=>r[e]),s=q({role:t,objectUniversalIdentifier:n}),c=q({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!xt({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),Tt=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=K({role:e,objectUniversalIdentifier:n}),a=e.fieldPermissions?.find(e=>e.objectUniversalIdentifier===n&&e.fieldUniversalIdentifier===r),o=t.canReadFieldValue===!1&&i.canReadObjectRecords&&a?.canReadFieldValue!==!1,s=t.canUpdateFieldValue===!1&&i.canUpdateObjectRecords&&a?.canUpdateFieldValue!==!1;return[...o?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canReadFieldValue`}]:[],...s?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canUpdateFieldValue`}]:[]]}),Et=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...St({role:e,superset:t}),...Ct({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...wt({role:e,superset:t}),...Tt({role:e,superset:t})],Dt=e=>n.mt(e)&&f(e)>=4,J={universalIdentifier:n.Rt(),name:n.Ft().min(1),nextStepIds:n.xt(n.Rt()),position:n.jt({x:n.At(),y:n.At()}).optional(),outputSchema:n.Nt(n.Ft(),n.Lt()).optional(),expectedOutputSchema:n.Nt(n.Ft(),n.Lt()).optional(),errorHandlingOptions:j.shape.errorHandlingOptions.optional()},Y=(e,t)=>n.Pt({...J,type:n.Dt(e),input:t}),Ot=n.Ot({fieldMetadataUniversalIdentifier:n.Rt(),fieldMetadataId:n.kt().optional()}),X=L.omit({fieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt().optional()}).strict(),kt=P.omit({fieldMetadataId:!0,relationTargetFieldMetadataId:!0}).extend({fieldMetadataUniversalIdentifier:n.Rt()}).strict(),Z={objectUniversalIdentifier:n.Rt()},At=[n.Pt({...J,type:n.Dt(`LOGIC_FUNCTION`),logicFunctionUniversalIdentifier:n.Rt(),input:n.Nt(n.Ft(),n.Lt())}),Y(`HTTP_REQUEST`,we.shape.input),Y(`CLASSIFY`,Oe.shape.input),Y(`ITERATOR`,ke.shape.input),Y(`DELAY`,Ae.shape.input),Y(`WAIT_FOR_EVENT`,je.shape.input),Y(`EMPTY`,Me.shape.input),Y(`CREATE_RECORD`,Ne.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPDATE_RECORD`,Pe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`UPSERT_RECORD`,Fe.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`DELETE_RECORD`,Ie.shape.input.omit({objectName:!0}).extend(Z).strict()),Y(`FIND_RECORDS`,Le.shape.input.omit({objectName:!0,filter:!0,orderBy:!0}).extend({...Z,filter:n.Pt({recordFilterGroups:n.xt(N).optional(),recordFilters:n.xt(kt).optional()}).optional(),orderBy:n.Pt({recordSorts:n.xt(Ot.extend({direction:n.vt([`ASC`,`DESC`]),subFieldName:n.Ft().nullable().optional()})).optional()}).optional()}).strict()),Y(`PICK_RECORD`,n.Pt({...Z,strategy:R,recordIds:n.xt(n.Ft()),loadBalance:n.Pt({objectUniversalIdentifier:n.Rt(),fieldUniversalIdentifier:n.Rt()}).optional()}).superRefine((e,t)=>{e.strategy===`LOAD_BALANCED`&&!n.Vt(e.loadBalance)&&t.addIssue({code:`custom`,path:[`loadBalance`],message:`loadBalance is required when strategy is LOAD_BALANCED`})})),Y(`FILTER`,Be.shape.input.extend({stepFilters:n.xt(X)})),Y(`IF_ELSE`,He.shape.input.extend({stepFilters:n.xt(X)})),Y(`FORM`,n.xt(ze.shape.input.element.extend({settings:n.Nt(n.Ft(),n.Lt()).optional()}).superRefine((e,t)=>{e.type===`RECORD`&&!n.Rt().safeParse(e.settings?.objectUniversalIdentifier).success&&t.addIssue({code:`custom`,path:[`settings`,`objectUniversalIdentifier`],message:`Record picker fields require an object universal identifier`})}))),Y(`AI_AGENT`,n.Pt({agentUniversalIdentifier:n.Rt(),prompt:n.Ft(),responseFormat:Se.optional()}))],jt=At.map(e=>e.shape.type.value),Mt=n.Ct(`type`,At,{error:e=>e.code===`invalid_union`?`Unsupported step type. Application workflows support: ${jt.join(`, `)}`:void 0}),Nt=[`updated`,`upserted`],Pt=n.Ct(`type`,[n.Pt({type:n.Dt(`GLOBAL`)}),n.Pt({type:n.Dt(`SINGLE_RECORD`),objectUniversalIdentifier:n.Rt()}),n.Pt({type:n.Dt(`BULK_RECORDS`),objectUniversalIdentifier:n.Rt()})]),[Q,Ft,It,Lt]=Ue.shape.settings.options,Rt=n.Ct(`type`,[Q.omit({outputSchema:!0}).extend({schedule:Q.shape.schedule.strict()}).strict(),Ft.omit({outputSchema:!0}).extend({schedule:Ft.shape.schedule.strict()}).strict(),It.omit({outputSchema:!0}).extend({schedule:It.shape.schedule.strict()}).strict(),Lt.omit({outputSchema:!0}).strict()]),[zt,Bt]=We.shape.settings.options,Vt=n.Ct(`httpMethod`,[zt.omit({outputSchema:!0,authentication:!0}).strict(),Bt.omit({outputSchema:!0,expectedOutputSchema:!0,authentication:!0}).strict()]),$=[n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`MANUAL`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({availability:Pt.optional(),icon:n.Ft().optional(),isPinned:n.St().optional()}).superRefine((e,t)=>{!n.Vt(e.availability)&&(n.Vt(e.icon)||n.Vt(e.isPinned))&&t.addIssue({code:`custom`,path:[`availability`],message:`Set an availability for the icon and pin to show in the command menu`})}).optional()}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`CRON`),nextStepIds:n.xt(n.Rt()).min(1),settings:Rt}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`DATABASE_EVENT`),nextStepIds:n.xt(n.Rt()).min(1),settings:n.Pt({objectUniversalIdentifier:n.Rt(),action:n.vt([`created`,`updated`,`deleted`,`upserted`]),fieldUniversalIdentifiers:n.xt(n.Rt()).optional(),filter:n.Pt({stepFilterGroups:n.xt(I),stepFilters:n.xt(X.extend({operand:n.vt(n.W)}))}).optional()}).superRefine((e,r)=>{if(t.r(e.fieldUniversalIdentifiers)&&!Nt.includes(e.action)&&r.addIssue({code:`custom`,path:[`fieldUniversalIdentifiers`],message:`Watched fields only apply to ${Nt.join(` and `)} events`}),!n.Vt(e.filter))return;let i=new Map;e.filter.stepFilterGroups.forEach((e,t)=>{i.has(e.id)&&r.addIssue({code:`custom`,path:[`filter`,`stepFilterGroups`,t,`id`],message:`Filter group ${e.id} is declared more than once`}),i.set(e.id,e.parentStepFilterGroupId)}),e.filter.stepFilterGroups.forEach((e,t)=>{let a=e.parentStepFilterGroupId,o=[`filter`,`stepFilterGroups`,t,`parentStepFilterGroupId`];if(!n.Vt(a))return;if(!i.has(a)){r.addIssue({code:`custom`,path:o,message:`Filter group ${a} is not declared in stepFilterGroups`});return}let s=new Set([e.id]);for(let t=a;n.Vt(t);t=i.get(t)){if(s.has(t)){r.addIssue({code:`custom`,path:o,message:`Filter group ${e.id} is not reachable from a root group`});return}s.add(t)}}),e.filter.stepFilters.forEach((e,t)=>{i.has(e.stepFilterGroupId)||r.addIssue({code:`custom`,path:[`filter`,`stepFilters`,t,`stepFilterGroupId`],message:`Filter group ${e.stepFilterGroupId} is not declared in stepFilterGroups`})})})}),n.Pt({universalIdentifier:n.Rt(),type:n.Dt(`WEBHOOK`),nextStepIds:n.xt(n.Rt()).min(1),settings:Vt})],Ht=$.map(e=>e.shape.type.value),Ut=n.Ct(`type`,$,{error:e=>e.code===`invalid_union`?`Unsupported trigger type. Application workflows support: ${Ht.join(`, `)}`:void 0});n.Pt({universalIdentifier:n.Rt(),name:n.Ft().min(1),version:n.Pt({trigger:Ut,steps:n.xt(Mt).min(1)})}).superRefine((e,t)=>{let{steps:n,trigger:r}=e.version,i=[e.universalIdentifier,r.universalIdentifier,...n.map(e=>e.universalIdentifier)];new Set(i).size!==i.length&&t.addIssue({code:`custom`,message:`Workflow, trigger and steps must have distinct universal identifiers`});let a={trigger:{type:r.type,nextStepIds:r.nextStepIds},steps:n.map(e=>({...e,id:e.universalIdentifier,settings:{input:e.input}}))},o=Je(a);for(let e of[...Ze({workflow:a,graph:o}),...Xe({workflow:a,graph:o}),..._e({workflow:a,graph:o,stepsById:new Map(a.steps.map(e=>[e.id,e]))})])e.severity===`error`&&t.addIssue({code:`custom`,message:e.message})}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ct}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-
|
|
1
|
+
const e=require("./build-CX6FBrbu.cjs"),t=require("./constants-CemcuPi_-D7dbw2cv.cjs"),n=require("./application-BE-X21OV.cjs"),r=require("./metadata-Vepr2xeA.cjs"),i=require("./print-typescript-value-DaEFmMda.cjs"),a=require("./kebab-case-D0usAzG-.cjs");var o=80,s=e=>[{path:[...e,`type`],symbol:`FieldType`,members:t.ot},{path:[...e,`writability`],symbol:`MetadataWritability`,members:t.Z},{path:[...e,`universalSettings`,`relationType`],symbol:`RelationType`,members:t.B},{path:[...e,`universalSettings`,`onDelete`],symbol:`OnDeleteAction`,members:t.N},{path:[...e,`universalSettings`,`dataType`],symbol:`NumberDataType`,members:t.V},{path:[...e,`universalSettings`,`displayFormat`],symbol:`DateDisplayFormat`,members:t.ut}],c=s([]),l=[{path:[`writability`],symbol:`MetadataWritability`,members:t.Z},{path:[`openRecordIn`],symbol:`ObjectOpenRecordIn`,members:t.rt},...s([`fields`,`[]`])],u=[{path:[`indexType`],symbol:`IndexType`,members:t.R}],d=[{path:[`rowLevelPermissionPredicateGroups`,`[]`,`logicalOperator`],symbol:`RowLevelPermissionPredicateGroupLogicalOperator`,members:t.tt},{path:[`rowLevelPermissionPredicates`,`[]`,`operand`],symbol:`RowLevelPermissionPredicateOperand`,members:t.A},{path:[`permissionFlagUniversalIdentifiers`,`[]`],symbol:`SystemPermissionFlag`,members:t.S}],f=e=>({path:e,symbol:`AggregateOperations`,members:t.q}),p=[f([`aggregateOperation`])],m=[{path:[`type`],symbol:`ViewType`,members:t.z},{path:[`visibility`],symbol:`ViewVisibility`,members:t.at},{path:[`openRecordIn`],symbol:`ViewOpenRecordIn`,members:t.K},f([`kanbanAggregateOperation`]),{path:[`calendarLayout`],symbol:`ViewCalendarLayout`,members:t.dt},f([`fields`,`[]`,`aggregateOperation`]),{path:[`filters`,`[]`,`operand`],symbol:`ViewFilterOperand`,members:t.W},{path:[`filterGroups`,`[]`,`logicalOperator`],symbol:`ViewFilterGroupLogicalOperator`,members:t.j},{path:[`sorts`,`[]`,`direction`],symbol:`ViewSortDirection`,members:t.F}],h=e=>[{path:[...e,`type`],symbol:`WidgetType`,members:t.H},{path:[...e,`position`,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.J},f([...e,`configuration`,`aggregateOperation`]),...[`dateGranularity`,`primaryAxisDateGranularity`,`secondaryAxisGroupByDateGranularity`].map(n=>({path:[...e,`configuration`,n],symbol:`ObjectRecordGroupByDateGranularity`,members:t.Q}))],g=e=>[{path:[...e,`layoutMode`],symbol:`PageLayoutTabLayoutMode`,members:t.J},...h([...e,`widgets`,`[]`])],_=h([]),v=g([]),y=[{path:[`type`],symbol:`NavigationMenuItemType`,members:t.it}],b=[{path:[`type`],symbol:`PageLayoutType`,members:t.X},...g([`tabs`,`[]`])],x=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),S=({definer:e,config:n,enumBindings:r=[]})=>{let a=new Set,s=i.t({value:n,resolveEnumSymbol:({path:e,value:n})=>{let i=r.find(t=>x(t.path,e));if(!t.Vt(i))return;let o=Object.keys(i.members).find(e=>i.members[e]===n);if(t.Vt(o))return a.add(i.symbol),`${i.symbol}.${o}`}}),c=[e,...[...a].sort()],l=`import { ${c.join(`, `)} } from 'twenty-sdk/define';`;return{content:`${l.length<=o?l:`import {\n${c.map(e=>` ${e},`).join(`
|
|
2
2
|
`)}\n} from 'twenty-sdk/define';`}
|
|
3
3
|
|
|
4
4
|
export default ${e}(${s});
|
|
5
|
-
`,requiredSdkExports:c}},C=e.t(),w=80,T=new Map(Object.entries(r.i).flatMap(([e,t])=>Object.entries(t).map(([t,{universalIdentifier:n}])=>[n,{objectName:e,fieldName:t}]))),E=e=>(0,C.isNonEmptyString)(e)&&(0,C.isNonEmptyString)(a.t(e).replace(/-+/g,``)),D=e=>e.slice(0,w).replace(/-+$/g,``),O=({segments:e,universalIdentifier:n})=>{let r=D(e.filter(t.Vt).map(a.t).join(`-`).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``));return(0,C.isNonEmptyString)(r)?r:n.slice(0,8)},k=({indexManifest:e,objectName:t,fieldLocationByUniversalIdentifier:n})=>O({segments:[t,...e.fields.map(({fieldUniversalIdentifier:e})=>n.get(e)?.fieldName??null)],universalIdentifier:e.universalIdentifier}),A=({viewFieldManifest:e,fieldLocationByUniversalIdentifier:n})=>{let r=n.get(e.fieldMetadataUniversalIdentifier)??T.get(e.fieldMetadataUniversalIdentifier);return O({segments:t.Vt(r)?[r.objectName,r.fieldName]:[],universalIdentifier:e.universalIdentifier})},j=`__typename`,M=e=>Array.isArray(e)?e.map(M):typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==j).map(([e,t])=>[e,M(t)])),N=new Set([`packageJsonChecksum`,`yarnLockChecksum`,`requiredServerVersionRange`,`aboutDescription`,`postInstallLogicFunction`,`preInstallLogicFunction`,`uninstallLogicFunction`,`healthCheckLogicFunction`,`settingsFrontComponent`,`settingsCustomTabFrontComponentUniversalIdentifier`,`frontComponentSharedDependencies`,`logoUrl`,`screenshots`]),P=`public/cover.generated.png`,F=e=>(e.roles??[]).some(({universalIdentifier:t})=>t===e.application.defaultRoleUniversalIdentifier),I=e=>{let t=Object.fromEntries(Object.entries(e.application).filter(([t])=>!N.has(t)&&!(t===`defaultRoleUniversalIdentifier`&&F(e)))),{galleryImages:n}=t;if(!Array.isArray(n)||n.length===0||n.every(e=>e===P)){let{galleryImages:e,...n}=t;return n}return t},L=({permissions:e,getDerivedUniversalIdentifier:t})=>e.map(({universalIdentifier:e,...n})=>e===t(n)?n:{universalIdentifier:e,...n}),R=({roleManifest:e,applicationUniversalIdentifier:r})=>{let{universalIdentifier:i,objectPermissions:a,fieldPermissions:o}=e;return{...e,...t.Vt(a)?{objectPermissions:L({permissions:a,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>n.t({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.Vt(o)?{fieldPermissions:L({permissions:o,getDerivedUniversalIdentifier:({fieldUniversalIdentifier:e})=>n.
|
|
5
|
+
`,requiredSdkExports:c}},C=e.t(),w=80,T=new Map(Object.entries(r.i).flatMap(([e,t])=>Object.entries(t).map(([t,{universalIdentifier:n}])=>[n,{objectName:e,fieldName:t}]))),E=e=>(0,C.isNonEmptyString)(e)&&(0,C.isNonEmptyString)(a.t(e).replace(/-+/g,``)),D=e=>e.slice(0,w).replace(/-+$/g,``),O=({segments:e,universalIdentifier:n})=>{let r=D(e.filter(t.Vt).map(a.t).join(`-`).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``));return(0,C.isNonEmptyString)(r)?r:n.slice(0,8)},k=({indexManifest:e,objectName:t,fieldLocationByUniversalIdentifier:n})=>O({segments:[t,...e.fields.map(({fieldUniversalIdentifier:e})=>n.get(e)?.fieldName??null)],universalIdentifier:e.universalIdentifier}),A=({viewFieldManifest:e,fieldLocationByUniversalIdentifier:n})=>{let r=n.get(e.fieldMetadataUniversalIdentifier)??T.get(e.fieldMetadataUniversalIdentifier);return O({segments:t.Vt(r)?[r.objectName,r.fieldName]:[],universalIdentifier:e.universalIdentifier})},j=`__typename`,M=e=>Array.isArray(e)?e.map(M):typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==j).map(([e,t])=>[e,M(t)])),N=new Set([`packageJsonChecksum`,`yarnLockChecksum`,`requiredServerVersionRange`,`aboutDescription`,`postInstallLogicFunction`,`preInstallLogicFunction`,`uninstallLogicFunction`,`healthCheckLogicFunction`,`settingsFrontComponent`,`settingsCustomTabFrontComponentUniversalIdentifier`,`frontComponentSharedDependencies`,`logoUrl`,`screenshots`]),P=`public/cover.generated.png`,F=e=>(e.roles??[]).some(({universalIdentifier:t})=>t===e.application.defaultRoleUniversalIdentifier),I=e=>{let t=Object.fromEntries(Object.entries(e.application).filter(([t])=>!N.has(t)&&!(t===`defaultRoleUniversalIdentifier`&&F(e)))),{galleryImages:n}=t;if(!Array.isArray(n)||n.length===0||n.every(e=>e===P)){let{galleryImages:e,...n}=t;return n}return t},L=({permissions:e,getDerivedUniversalIdentifier:t})=>e.map(({universalIdentifier:e,...n})=>e===t(n)?n:{universalIdentifier:e,...n}),R=({roleManifest:e,applicationUniversalIdentifier:r})=>{let{universalIdentifier:i,objectPermissions:a,fieldPermissions:o}=e;return{...e,...t.Vt(a)?{objectPermissions:L({permissions:a,getDerivedUniversalIdentifier:({objectUniversalIdentifier:e})=>n.t({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,objectUniversalIdentifier:e})})}:{},...t.Vt(o)?{fieldPermissions:L({permissions:o,getDerivedUniversalIdentifier:({fieldUniversalIdentifier:e})=>n.d({applicationUniversalIdentifier:r,roleUniversalIdentifier:i,fieldUniversalIdentifier:e})})}:{}}},z=({objectName:e,fieldName:t,fieldUniversalIdentifier:n})=>O({segments:[e,t],universalIdentifier:n}),B=new Map(Object.entries(r.t).map(([e,t])=>[t,e])),V=({objectUniversalIdentifier:e,manifest:t})=>(t.objects??[]).find(t=>t.universalIdentifier===e)?.nameSingular??B.get(e)??null,H=new Map(Object.entries(r.r).map(([e,{universalIdentifier:t}])=>[t,e])),U=({pageLayoutUniversalIdentifier:e,manifest:r})=>{let i=r.pageLayouts?.find(t=>t.universalIdentifier===e);if(t.Vt(i))return i.name;let a=H.get(e);if(t.Vt(a))return a;let o=r.application.universalIdentifier;for(let t of r.objects??[]){let r={objectMetadataApplicationUniversalIdentifier:o,objectUniversalIdentifier:t.universalIdentifier};if(n.f(r)===e)return`${t.nameSingular}RecordPage`;if(n.n(r)===e)return`${t.nameSingular}RecordForm`}return null},W=({viewUniversalIdentifier:e,manifest:r})=>{let i=r.views?.find(t=>t.universalIdentifier===e);if(t.Vt(i))return i.name;let a=r.application.universalIdentifier;for(let t of r.objects??[])if(n.y({objectMetadataApplicationUniversalIdentifier:a,objectUniversalIdentifier:t.universalIdentifier,viewKey:n.m.INDEX})===e)return`${t.nameSingular}IndexView`;return null},G=({navigationMenuItemManifest:e,manifest:n})=>{let{type:r,name:i,targetObjectUniversalIdentifier:a,viewUniversalIdentifier:o,pageLayoutUniversalIdentifier:s}=e;return E(i)?i:r===t.it.OBJECT&&t.Vt(a)?V({objectUniversalIdentifier:a,manifest:n}):r===t.it.VIEW&&t.Vt(o)?W({viewUniversalIdentifier:o,manifest:n}):r===t.it.PAGE_LAYOUT&&t.Vt(s)?U({pageLayoutUniversalIdentifier:s,manifest:n}):null},K=({navigationMenuItemManifest:e,manifest:t})=>O({segments:[G({navigationMenuItemManifest:e,manifest:t})],universalIdentifier:e.universalIdentifier}),q=({folderUniversalIdentifier:e,manifest:t})=>{let n=t.navigationMenuItems?.find(t=>t.universalIdentifier===e)?.name;return E(n)?n:null},J=[`application`,`object`,`field`,`index`,`permissionFlag`,`role`,`view`,`viewField`,`pageLayout`,`pageLayoutTab`,`navigationMenuItem`,`pageLayoutWidget`],Y=(e,n=new Map)=>{let r=e.application.universalIdentifier,i=[],o=[];i.push({kind:`application`,universalIdentifier:r,definer:`defineApplication`,config:I(e),enumBindings:[],defaultFolder:`src`,fileSuffix:`.config.ts`,fileBaseName:`application`,parentName:null});let s=new Set,f=new Map,h=[...e.fields??[]];for(let t of e.objects??[]){let e=[];for(let r of t.fields??[])f.set(r.universalIdentifier,{objectName:t.nameSingular,fieldName:r.name}),n.get(r.universalIdentifier.toLowerCase())?.entityKey===`fields`?h.push({...r,objectUniversalIdentifier:t.universalIdentifier}):e.push(r);s.add(t.universalIdentifier),i.push({kind:`object`,universalIdentifier:t.universalIdentifier,definer:`defineObject`,config:{...t,fields:e},enumBindings:l,defaultFolder:`src/objects`,fileSuffix:`.object.ts`,fileBaseName:a.t(t.nameSingular),parentName:null})}for(let t of h){let n=V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});f.set(t.universalIdentifier,{objectName:n,fieldName:t.name}),i.push({kind:`field`,universalIdentifier:t.universalIdentifier,definer:`defineField`,config:t,enumBindings:c,defaultFolder:`src/fields`,fileSuffix:`.field.ts`,fileBaseName:z({objectName:n,fieldName:t.name,fieldUniversalIdentifier:t.universalIdentifier}),parentName:n})}for(let t of e.indexes??[]){if(!s.has(t.objectUniversalIdentifier)){o.push({kind:`index`,universalIdentifier:t.universalIdentifier,reason:`its object is not part of the written source`});continue}let n=V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e});i.push({kind:`index`,universalIdentifier:t.universalIdentifier,definer:`defineIndex`,config:t,enumBindings:u,defaultFolder:`src/indexes`,fileSuffix:`.index.ts`,fileBaseName:k({indexManifest:t,objectName:n,fieldLocationByUniversalIdentifier:f}),parentName:n})}for(let t of e.permissionFlags??[])i.push({kind:`permissionFlag`,universalIdentifier:t.universalIdentifier,definer:`definePermissionFlag`,config:t,enumBindings:[],defaultFolder:`src/permission-flags`,fileSuffix:`.permission-flag.ts`,fileBaseName:O({segments:[t.key],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.roles??[])i.push({kind:`role`,universalIdentifier:t.universalIdentifier,definer:t.universalIdentifier===e.application.defaultRoleUniversalIdentifier?`defineApplicationRole`:`defineRole`,config:R({roleManifest:t,applicationUniversalIdentifier:r}),enumBindings:d,defaultFolder:`src/roles`,fileSuffix:`.role.ts`,fileBaseName:O({segments:[t.label],universalIdentifier:t.universalIdentifier}),parentName:null});for(let t of e.views??[])i.push({kind:`view`,universalIdentifier:t.universalIdentifier,definer:`defineView`,config:t,enumBindings:m,defaultFolder:`src/views`,fileSuffix:`.view.ts`,fileBaseName:O({segments:[t.name],universalIdentifier:t.universalIdentifier}),parentName:V({objectUniversalIdentifier:t.objectUniversalIdentifier,manifest:e})});for(let t of e.viewFields??[])i.push({kind:`viewField`,universalIdentifier:t.universalIdentifier,definer:`defineViewField`,config:t,enumBindings:p,defaultFolder:`src/view-fields`,fileSuffix:`.view-field.ts`,fileBaseName:A({viewFieldManifest:t,fieldLocationByUniversalIdentifier:f}),parentName:null});for(let n of e.pageLayouts??[])i.push({kind:`pageLayout`,universalIdentifier:n.universalIdentifier,definer:`definePageLayout`,config:M(n),enumBindings:b,defaultFolder:`src/page-layouts`,fileSuffix:`.page-layout.ts`,fileBaseName:O({segments:[n.name],universalIdentifier:n.universalIdentifier}),parentName:t.Vt(n.objectUniversalIdentifier)?V({objectUniversalIdentifier:n.objectUniversalIdentifier,manifest:e}):null});for(let n of e.pageLayoutTabs??[]){let{pageLayoutUniversalIdentifier:r}=n;if(!t.Vt(r)){o.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,reason:`it does not name the page layout it belongs to`});continue}i.push({kind:`pageLayoutTab`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutTab`,config:M(n),enumBindings:v,defaultFolder:`src/page-layout-tabs`,fileSuffix:`.page-layout-tab.ts`,fileBaseName:O({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:U({pageLayoutUniversalIdentifier:r,manifest:e})})}for(let n of e.navigationMenuItems??[]){let{folderUniversalIdentifier:r}=n;i.push({kind:`navigationMenuItem`,universalIdentifier:n.universalIdentifier,definer:`defineNavigationMenuItem`,config:n,enumBindings:y,defaultFolder:`src/navigation-menu-items`,fileSuffix:`.navigation-menu-item.ts`,fileBaseName:K({navigationMenuItemManifest:n,manifest:e}),parentName:t.Vt(r)?q({folderUniversalIdentifier:r,manifest:e}):null})}for(let n of e.pageLayoutWidgets??[]){let{objectUniversalIdentifier:r}=n;i.push({kind:`pageLayoutWidget`,universalIdentifier:n.universalIdentifier,definer:`definePageLayoutWidget`,config:M(n),enumBindings:_,defaultFolder:`src/page-layout-widgets`,fileSuffix:`.page-layout-widget.ts`,fileBaseName:O({segments:[n.title],universalIdentifier:n.universalIdentifier}),parentName:t.Vt(r)?V({objectUniversalIdentifier:r,manifest:e}):null})}return{entities:i,skipped:o}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return J}});
|
package/dist/chunks/{build-source-manifest-BMjw7BvT.cjs → build-source-manifest-DWRbCMVq.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./cli-error-CSsayo0u.cjs"),t=require("./get-tooling-error-context-C69TBSej.cjs"),n=require("./compile-application-translations-
|
|
1
|
+
const e=require("./cli-error-CSsayo0u.cjs"),t=require("./get-tooling-error-context-C69TBSej.cjs"),n=require("./compile-application-translations-B4jILjGc.cjs"),r=require("./resolve-source-sdk-B1Fxlsmt.cjs");let i=require("esbuild");var a=async({appPath:a,signal:o})=>{let s=[],c=e=>{s.push({severity:`warning`,code:`BUILD_WARNING`,message:e})};try{o.throwIfAborted(),await r.t({appPath:a});let e=await n.r(a);if(o.throwIfAborted(),!e.success)return{success:!1,error:{code:`MANIFEST_BUILD_FAILED`,message:e.errors.join(`
|
|
2
2
|
`)},diagnostics:e.errors.map(e=>({severity:`error`,code:`MANIFEST_BUILD_FAILED`,message:e}))};e.warnings.forEach(c);let t=await n.t({appPath:a,onWarning:c});return o.throwIfAborted(),{success:!0,data:{manifest:{...e.manifest,translations:t},filePaths:e.filePaths},diagnostics:s}}catch(n){return{success:!1,error:{code:o.aborted?`CANCELLED`:n instanceof e.t?n.code:`MANIFEST_BUILD_FAILED`,message:n instanceof Error?n.message:String(n),...t.t(n)},diagnostics:s}}finally{await(0,i.stop)()}};exports.buildSourceManifest=a;
|