twenty-sdk 2.23.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/billing/index.cjs.map +1 -1
  2. package/dist/billing/index.mjs.map +1 -1
  3. package/dist/{catalog-sync-C8IFp0pB.js → catalog-sync-BQ4qqj5b.js} +1 -1
  4. package/dist/{catalog-sync-DEkMSrGS.mjs → catalog-sync-Bd0XMuNL.mjs} +1 -1
  5. package/dist/cli/commands/dev/exec.d.ts +2 -1
  6. package/dist/cli/operations/execute.d.ts +2 -0
  7. package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +2 -0
  8. package/dist/cli.cjs +116 -116
  9. package/dist/cli.mjs +5216 -5201
  10. package/dist/define/index.cjs +3 -3
  11. package/dist/define/index.cjs.map +1 -1
  12. package/dist/define/index.d.ts +103 -14
  13. package/dist/define/index.mjs +2751 -2714
  14. package/dist/define/index.mjs.map +1 -1
  15. package/dist/front-component/index.cjs +1 -1
  16. package/dist/front-component/index.cjs.map +1 -1
  17. package/dist/front-component/index.d.ts +2 -1
  18. package/dist/front-component/index.mjs +3 -3
  19. package/dist/front-component/index.mjs.map +1 -1
  20. package/dist/{get-function-input-schema-GNk3NRLJ-CmJrBznd.mjs → get-function-input-schema-GNk3NRLJ-DmwN8d1n.mjs} +1 -1
  21. package/dist/logic-function/index.cjs +21 -1
  22. package/dist/logic-function/index.cjs.map +1 -1
  23. package/dist/logic-function/index.d.ts +28 -4
  24. package/dist/logic-function/index.mjs +36 -2
  25. package/dist/logic-function/index.mjs.map +1 -1
  26. package/dist/{login-DHQ1DFVF.js → login-C1meSrEJ.js} +53 -53
  27. package/dist/{login-DdR4uqe9.mjs → login-CjlKXuH6.mjs} +3932 -3888
  28. package/dist/operations.cjs +1 -1
  29. package/dist/operations.mjs +1 -1
  30. package/dist/utils/index.cjs.map +1 -1
  31. package/dist/utils/index.mjs.map +1 -1
  32. package/package.json +2 -2
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-DHQ1DFVF.js");var t=async t=>(t?.remote&&e.U.setActiveRemote(t.remote),await new e.U().clearConfig(),{success:!0,data:void 0}),n=n=>e.X(()=>t(n),e.q.AUTH_FAILED),r=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjQ4OTE0NDk2MDAsImp0aSI6IjIwMjAyMDIwLWY0MDEtNGQ4YS1hNzMxLTY0ZDAwN2MyN2JhZCJ9.bfQjfyN0NEtTCLE_xPyNcwonDzlSXFoP8kdCQTdnuDc`,i=`http://localhost:2020`;exports.APP_ERROR_CODES=e.K,exports.AUTH_ERROR_CODES=e.q,exports.ConfigService=e.U,exports.DEV_API_KEY=r,exports.DEV_API_URL=i,exports.FUNCTION_ERROR_CODES=e.J,exports.SERVER_ERROR_CODES=e.Y,exports.appBuild=e.G,exports.appDeploy=e.R,exports.appDevOnce=e.a,exports.appInstall=e.N,exports.appPublish=e.L,exports.appUninstall=e.v,exports.authLogin=e.t,exports.authLoginOAuth=e.H,exports.authLogout=n,exports.checkDockerRunning=e.T,exports.containerExists=e.E,exports.detectLocalServer=e.m,exports.functionExecute=e._,exports.getContainerDigest=e.D,exports.getEngineVersionRange=e.et,exports.getImageDigest=e.A,exports.getImageForVersion=e.j,exports.resolveHighestEngineVersion=e.r,exports.serverStart=e.n,exports.serverUpgrade=e.i;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-C1meSrEJ.js");var t=async t=>(t?.remote&&e.U.setActiveRemote(t.remote),await new e.U().clearConfig(),{success:!0,data:void 0}),n=n=>e.X(()=>t(n),e.q.AUTH_FAILED),r=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjQ4OTE0NDk2MDAsImp0aSI6IjIwMjAyMDIwLWY0MDEtNGQ4YS1hNzMxLTY0ZDAwN2MyN2JhZCJ9.bfQjfyN0NEtTCLE_xPyNcwonDzlSXFoP8kdCQTdnuDc`,i=`http://localhost:2020`;exports.APP_ERROR_CODES=e.K,exports.AUTH_ERROR_CODES=e.q,exports.ConfigService=e.U,exports.DEV_API_KEY=r,exports.DEV_API_URL=i,exports.FUNCTION_ERROR_CODES=e.J,exports.SERVER_ERROR_CODES=e.Y,exports.appBuild=e.G,exports.appDeploy=e.R,exports.appDevOnce=e.a,exports.appInstall=e.N,exports.appPublish=e.L,exports.appUninstall=e.v,exports.authLogin=e.t,exports.authLoginOAuth=e.H,exports.authLogout=n,exports.checkDockerRunning=e.T,exports.containerExists=e.E,exports.detectLocalServer=e.m,exports.functionExecute=e._,exports.getContainerDigest=e.D,exports.getEngineVersionRange=e.et,exports.getImageDigest=e.A,exports.getImageForVersion=e.j,exports.resolveHighestEngineVersion=e.r,exports.serverStart=e.n,exports.serverUpgrade=e.i;
@@ -2,7 +2,7 @@ import { createRequire as e } from "node:module";
2
2
  import { fileURLToPath as t } from "node:url";
3
3
  import { dirname as n } from "node:path";
4
4
  e(import.meta.url), n(t(import.meta.url));
5
- import { A as r, D as i, E as a, G as o, H as s, J as c, K as l, L as u, N as d, R as f, T as p, U as m, X as h, Y as g, _, a as v, et as y, i as b, j as x, m as S, n as C, q as w, r as T, t as E, v as D } from "./login-DdR4uqe9.mjs";
5
+ import { A as r, D as i, E as a, G as o, H as s, J as c, K as l, L as u, N as d, R as f, T as p, U as m, X as h, Y as g, _, a as v, et as y, i as b, j as x, m as S, n as C, q as w, r as T, t as E, v as D } from "./login-CjlKXuH6.mjs";
6
6
  //#region src/cli/operations/logout.ts
7
7
  var O = async (e) => (e?.remote && m.setActiveRemote(e.remote), await new m().clearConfig(), {
8
8
  success: !0,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["e","t","t","n","e","i","t"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/FieldMetadataType.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.ACTOR = \"ACTOR\", e.ADDRESS = \"ADDRESS\", e.ARRAY = \"ARRAY\", e.BOOLEAN = \"BOOLEAN\", e.CURRENCY = \"CURRENCY\", e.DATE = \"DATE\", e.DATE_TIME = \"DATE_TIME\", e.EMAILS = \"EMAILS\", e.FILES = \"FILES\", e.FULL_NAME = \"FULL_NAME\", e.LINKS = \"LINKS\", e.MORPH_RELATION = \"MORPH_RELATION\", e.MULTI_SELECT = \"MULTI_SELECT\", e.NUMBER = \"NUMBER\", e.NUMERIC = \"NUMERIC\", e.PHONES = \"PHONES\", e.POSITION = \"POSITION\", e.RATING = \"RATING\", e.RAW_JSON = \"RAW_JSON\", e.RELATION = \"RELATION\", e.RICH_TEXT = \"RICH_TEXT\", e.SELECT = \"SELECT\", e.TEXT = \"TEXT\", e.TS_VECTOR = \"TS_VECTOR\", e.UUID = \"UUID\", e;\n}({}), t = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as n, t };\n","import { v5 as e } from \"uuid\";\n//#region src/application/constants/TwentyStandardApplicationUniversalIdentifier.ts\nvar t = \"20202020-64aa-4b6f-b003-9c74b97cee20\", n = ({ entityNamespace: t, value: n, applicationUniversalIdentifier: r }) => e(`${t}:${n}`, r), r = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), i = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, relationTargetObjectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:systemRelation:${r}`,\n\tapplicationUniversalIdentifier: e\n});\n//#endregion\nexport { t as i, r as n, n as r, i as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { i as n, n as r, r as i, t as a } from \"./get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar o = [\n\t\"Communication\",\n\t\"Productivity\",\n\t\"Product management\",\n\t\"Sales\",\n\t\"Marketing\",\n\t\"Enrichment\",\n\t\"Data\",\n\t\"Search\",\n\t\"Other\"\n], s = (e) => o.includes(e), c = [\n\te.TEXT,\n\te.ARRAY,\n\te.BOOLEAN,\n\te.DATE,\n\te.DATE_TIME,\n\te.NUMBER,\n\te.NUMERIC,\n\te.RAW_JSON,\n\te.RICH_TEXT,\n\te.SELECT,\n\te.MULTI_SELECT\n], l = \"public\", u = \"TWENTY_API_KEY\", d = \"TWENTY_API_URL\", f = \"TWENTY_APP_ACCESS_TOKEN\", p = \"TWENTY_FUNCTIONS_URL\", m = \"generated\", h = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, g = \".twenty/output\", _ = \"Standard\", v = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), b = \"navigation\", x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${b}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => i({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, componentName: t }) => i({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, link: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, nameSingular: t }) => i({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), I = \"RECORD_PAGE\", L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${I}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => i({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, label: t }) => i({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => i({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => i({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: a }) => i({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => i({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), $ = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => i({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), te = /* @__PURE__ */ function(e) {\n\treturn e.Object = \"object\", e.Field = \"field\", e.LogicFunction = \"logicFunction\", e.FrontComponent = \"frontComponent\", e.Role = \"role\", e.Skill = \"skill\", e.Agent = \"agent\", e.ConnectionProvider = \"connectionProvider\", e.View = \"view\", e.ViewField = \"viewField\", e.NavigationMenuItem = \"navigationMenuItem\", e.PageLayout = \"pageLayout\", e.PageLayoutTab = \"pageLayoutTab\", e.CommandMenuItem = \"commandMenuItem\", e;\n}({}), ne = (t, n = e.TEXT) => {\n\tif (t == null) return \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return String(t) === \"true\" ? \"true\" : \"false\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: return String(t);\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT:\n\t\t\tif (Array.isArray(t)) return JSON.stringify(t);\n\t\t\tif (typeof t == \"string\") {\n\t\t\t\ttry {\n\t\t\t\t\tlet e = JSON.parse(t);\n\t\t\t\t\tif (Array.isArray(e)) return t;\n\t\t\t\t} catch {}\n\t\t\t\treturn JSON.stringify([t]);\n\t\t\t}\n\t\t\treturn JSON.stringify(t);\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: return typeof t == \"string\" ? t : JSON.stringify(t);\n\t\tdefault: return typeof t == \"string\" ? t : String(t);\n\t}\n}, re = (t, n = e.TEXT) => {\n\tif (t === \"\") return n === e.ARRAY || n === e.MULTI_SELECT ? [] : \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return t === \"true\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: {\n\t\t\tlet e = Number(t);\n\t\t\treturn Number.isNaN(e) ? t : e;\n\t\t}\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT: try {\n\t\t\tlet e = JSON.parse(t);\n\t\t\treturn Array.isArray(e) ? e : [];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: try {\n\t\t\treturn JSON.parse(t);\n\t\t} catch {\n\t\t\treturn t;\n\t\t}\n\t\tdefault: return t;\n\t}\n};\n//#endregion\nexport { o as APPLICATION_CATEGORIES, c as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, l as ASSETS_DIR, u as DEFAULT_API_KEY_NAME, d as DEFAULT_API_URL_NAME, f as DEFAULT_APP_ACCESS_TOKEN_NAME, p as DEFAULT_FUNCTIONS_URL_NAME, m as GENERATED_DIR, h as NODE_ESM_CJS_BANNER, g as OUTPUT_DIR, te as SyncableEntity, _ as TWENTY_STANDARD_APPLICATION_NAME, n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, i as computeDeterministicUuid, re as deserializeApplicationVariableValue, v as getAgentUniversalIdentifier, y as getApplicationVariableUniversalIdentifier, T as getConnectionProviderUniversalIdentifier, E as getFieldPermissionUniversalIdentifier, r as getFieldUniversalIdentifier, $ as getFieldsWidgetViewUniversalIdentifier, A as getFolderNavigationMenuItemUniversalIdentifier, D as getFrontComponentUniversalIdentifier, x as getGlobalCommandMenuItemUniversalIdentifier, S as getGlobalObjectContextCommandMenuItemUniversalIdentifier, O as getIndexUniversalIdentifier, Q as getIndexViewUniversalIdentifier, M as getLinkNavigationMenuItemUniversalIdentifier, k as getLogicFunctionUniversalIdentifier, w as getNavigationCommandUniversalIdentifier, j as getObjectNavigationMenuItemUniversalIdentifier, N as getObjectPermissionUniversalIdentifier, P as getObjectUniversalIdentifier, F as getPageLayoutTabUniversalIdentifier, L as getPageLayoutUniversalIdentifier, z as getPageLayoutWidgetUniversalIdentifier, B as getPermissionFlagUniversalIdentifier, R as getRecordPageLayoutUniversalIdentifier, C as getRecordSelectionCommandMenuItemUniversalIdentifier, V as getRolePermissionFlagUniversalIdentifier, H as getRoleUniversalIdentifier, U as getSearchFieldUniversalIdentifier, W as getSelectOptionUniversalIdentifier, G as getSkillUniversalIdentifier, a as getSystemRelationFieldUniversalIdentifier, K as getViewFieldGroupUniversalIdentifier, q as getViewFieldUniversalIdentifier, J as getViewFilterUniversalIdentifier, Y as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, X as getViewSortUniversalIdentifier, Z as getViewUniversalIdentifier, s as isKnownApplicationCategory, ne as serializeApplicationVariableValue };\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst decodeTokenPayload = (\n token: string,\n): { workspaceId: string; applicationId: string } => {\n const payload = JSON.parse(atob(token.split('.')[1]));\n\n return {\n workspaceId: payload.workspaceId,\n applicationId: payload.applicationId,\n };\n};\n\n// Returns the public URL for a file in the app's public/ directory.\n// Works in both logic functions and front components.\n// The path is relative to the public/ folder (e.g. \"images/logo.png\").\nexport const getPublicAssetUrl = (path: string): string => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n throw new Error(\n 'getPublicAssetUrl can only be called from within a logic function or front component',\n );\n }\n\n const { workspaceId, applicationId } = decodeTokenPayload(token);\n const withoutLeadingSlash = path.startsWith('/') ? path.slice(1) : path;\n const withPublicPrefix = withoutLeadingSlash.startsWith('public/')\n ? withoutLeadingSlash\n : `public/${withoutLeadingSlash}`;\n\n const encodedPath = withPublicPrefix\n .split('/')\n .map(encodeURIComponent)\n .join('/');\n\n return `${apiUrl}/public-assets/${workspaceId}/${applicationId}/${encodedPath}`;\n};\n","import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n"],"mappings":"mHACA,IAAIA,EAAoB,SAAS,EAAG,CACnC,MAAO,GAAE,MAAQ,QAAS,EAAE,QAAU,UAAW,EAAE,MAAQ,QAAS,EAAE,QAAU,UAAW,EAAE,SAAW,WAAY,EAAE,KAAO,OAAQ,EAAE,UAAY,YAAa,EAAE,OAAS,SAAU,EAAE,MAAQ,QAAS,EAAE,UAAY,YAAa,EAAE,MAAQ,QAAS,EAAE,eAAiB,iBAAkB,EAAE,aAAe,eAAgB,EAAE,OAAS,SAAU,EAAE,QAAU,UAAW,EAAE,OAAS,SAAU,EAAE,SAAW,WAAY,EAAE,OAAS,SAAU,EAAE,SAAW,WAAY,EAAE,SAAW,WAAY,EAAE,UAAY,YAAa,EAAE,OAAS,SAAU,EAAE,KAAO,OAAQ,EAAE,UAAY,YAAa,EAAE,KAAO,OAAQ,CAC3kB,EAAE,CAAC,CAAC,EEWHI,EAAE,KACFA,EAAE,MACFA,EAAE,QACFA,EAAE,KACFA,EAAE,UACFA,EAAE,OACFA,EAAE,QACFA,EAAE,SACFA,EAAE,UACFA,EAAE,OACFA,EAAE,aArBH,IAsBuC,EAAI,iBAAkB,EAAI,0BCpB3D,EACJ,GACmD,CACnD,IAAM,EAAU,KAAK,MAAM,KAAK,EAAM,MAAM,GAAG,EAAE,EAAE,CAAC,EAEpD,MAAO,CACL,YAAa,EAAQ,YACrB,cAAe,EAAQ,aACzB,CACF,EAKa,EAAqB,GAAyB,CACzD,IAAM,EAAS,QAAQ,IAAI,GACrB,EAAQ,QAAQ,IAAI,GAE1B,GAAI,CAAC,GAAU,CAAC,EACd,MAAU,MACR,sFACF,EAGF,GAAM,CAAE,cAAa,iBAAkB,EAAmB,CAAK,EACzD,EAAsB,EAAK,WAAW,GAAG,EAAI,EAAK,MAAM,CAAC,EAAI,EAUnE,MAAO,GAAG,EAAO,iBAAiB,EAAY,GAAG,EAAc,IATtC,EAAoB,WAAW,SAAS,EAC7D,EACA,UAAU,KAGX,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAE0D,GACpE,ECvCI,EAAK,GAAM,EAAA,EAAA,EAAA,aAAG,CAAC,GAAK,EAAA,EAAA,EAAA,QAAG,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["e","t","t","n","e","i","t"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/FieldMetadataType.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.ACTOR = \"ACTOR\", e.ADDRESS = \"ADDRESS\", e.ARRAY = \"ARRAY\", e.BOOLEAN = \"BOOLEAN\", e.CURRENCY = \"CURRENCY\", e.DATE = \"DATE\", e.DATE_TIME = \"DATE_TIME\", e.EMAILS = \"EMAILS\", e.FILES = \"FILES\", e.FULL_NAME = \"FULL_NAME\", e.LINKS = \"LINKS\", e.MORPH_RELATION = \"MORPH_RELATION\", e.MULTI_SELECT = \"MULTI_SELECT\", e.NUMBER = \"NUMBER\", e.NUMERIC = \"NUMERIC\", e.PHONES = \"PHONES\", e.POSITION = \"POSITION\", e.RATING = \"RATING\", e.RAW_JSON = \"RAW_JSON\", e.RELATION = \"RELATION\", e.RICH_TEXT = \"RICH_TEXT\", e.SELECT = \"SELECT\", e.TEXT = \"TEXT\", e.TS_VECTOR = \"TS_VECTOR\", e.UUID = \"UUID\", e;\n}({}), t = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as n, t };\n","import { v5 as e } from \"uuid\";\n//#region src/application/constants/TwentyStandardApplicationUniversalIdentifier.ts\nvar t = \"20202020-64aa-4b6f-b003-9c74b97cee20\", n = ({ entityNamespace: t, value: n, applicationUniversalIdentifier: r }) => e(`${t}:${n}`, r), r = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), i = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, relationTargetObjectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:systemRelation:${r}`,\n\tapplicationUniversalIdentifier: e\n});\n//#endregion\nexport { t as i, r as n, n as r, i as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { i as n, n as r, r as i, t as a } from \"./get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar o = [\n\t\"Communication\",\n\t\"Productivity\",\n\t\"Product management\",\n\t\"Sales\",\n\t\"Marketing\",\n\t\"Enrichment\",\n\t\"Data\",\n\t\"Search\",\n\t\"Other\"\n], s = (e) => o.includes(e), c = [\n\te.TEXT,\n\te.ARRAY,\n\te.BOOLEAN,\n\te.DATE,\n\te.DATE_TIME,\n\te.NUMBER,\n\te.NUMERIC,\n\te.RAW_JSON,\n\te.RICH_TEXT,\n\te.SELECT,\n\te.MULTI_SELECT\n], l = \"public\", u = \"TWENTY_API_KEY\", d = \"TWENTY_API_URL\", f = \"TWENTY_APP_ACCESS_TOKEN\", p = \"TWENTY_FUNCTIONS_URL\", m = \"generated\", h = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, g = \".twenty/output\", _ = \"Standard\", v = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), b = \"navigation\", x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${b}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => i({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, componentName: t }) => i({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, link: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, nameSingular: t }) => i({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), I = \"RECORD_PAGE\", L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${I}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => i({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, agentUniversalIdentifier: t }) => i({\n\tentityNamespace: \"roleTarget\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, label: t }) => i({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => i({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => i({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: a }) => i({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => i({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), $ = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), te = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => i({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), ne = /* @__PURE__ */ function(e) {\n\treturn e.Object = \"object\", e.Field = \"field\", e.LogicFunction = \"logicFunction\", e.FrontComponent = \"frontComponent\", e.Role = \"role\", e.Skill = \"skill\", e.Agent = \"agent\", e.ConnectionProvider = \"connectionProvider\", e.View = \"view\", e.ViewField = \"viewField\", e.NavigationMenuItem = \"navigationMenuItem\", e.PageLayout = \"pageLayout\", e.PageLayoutTab = \"pageLayoutTab\", e.CommandMenuItem = \"commandMenuItem\", e;\n}({}), re = (t, n = e.TEXT) => {\n\tif (t == null) return \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return String(t) === \"true\" ? \"true\" : \"false\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: return String(t);\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT:\n\t\t\tif (Array.isArray(t)) return JSON.stringify(t);\n\t\t\tif (typeof t == \"string\") {\n\t\t\t\ttry {\n\t\t\t\t\tlet e = JSON.parse(t);\n\t\t\t\t\tif (Array.isArray(e)) return t;\n\t\t\t\t} catch {}\n\t\t\t\treturn JSON.stringify([t]);\n\t\t\t}\n\t\t\treturn JSON.stringify(t);\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: return typeof t == \"string\" ? t : JSON.stringify(t);\n\t\tdefault: return typeof t == \"string\" ? t : String(t);\n\t}\n}, ie = (t, n = e.TEXT) => {\n\tif (t === \"\") return n === e.ARRAY || n === e.MULTI_SELECT ? [] : \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return t === \"true\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: {\n\t\t\tlet e = Number(t);\n\t\t\treturn Number.isNaN(e) ? t : e;\n\t\t}\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT: try {\n\t\t\tlet e = JSON.parse(t);\n\t\t\treturn Array.isArray(e) ? e : [];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: try {\n\t\t\treturn JSON.parse(t);\n\t\t} catch {\n\t\t\treturn t;\n\t\t}\n\t\tdefault: return t;\n\t}\n};\n//#endregion\nexport { o as APPLICATION_CATEGORIES, c as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, l as ASSETS_DIR, u as DEFAULT_API_KEY_NAME, d as DEFAULT_API_URL_NAME, f as DEFAULT_APP_ACCESS_TOKEN_NAME, p as DEFAULT_FUNCTIONS_URL_NAME, m as GENERATED_DIR, h as NODE_ESM_CJS_BANNER, g as OUTPUT_DIR, ne as SyncableEntity, _ as TWENTY_STANDARD_APPLICATION_NAME, n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, i as computeDeterministicUuid, ie as deserializeApplicationVariableValue, v as getAgentUniversalIdentifier, y as getApplicationVariableUniversalIdentifier, T as getConnectionProviderUniversalIdentifier, E as getFieldPermissionUniversalIdentifier, r as getFieldUniversalIdentifier, te as getFieldsWidgetViewUniversalIdentifier, A as getFolderNavigationMenuItemUniversalIdentifier, D as getFrontComponentUniversalIdentifier, x as getGlobalCommandMenuItemUniversalIdentifier, S as getGlobalObjectContextCommandMenuItemUniversalIdentifier, O as getIndexUniversalIdentifier, $ as getIndexViewUniversalIdentifier, M as getLinkNavigationMenuItemUniversalIdentifier, k as getLogicFunctionUniversalIdentifier, w as getNavigationCommandUniversalIdentifier, j as getObjectNavigationMenuItemUniversalIdentifier, N as getObjectPermissionUniversalIdentifier, P as getObjectUniversalIdentifier, F as getPageLayoutTabUniversalIdentifier, L as getPageLayoutUniversalIdentifier, z as getPageLayoutWidgetUniversalIdentifier, B as getPermissionFlagUniversalIdentifier, R as getRecordPageLayoutUniversalIdentifier, C as getRecordSelectionCommandMenuItemUniversalIdentifier, V as getRolePermissionFlagUniversalIdentifier, H as getRoleTargetUniversalIdentifier, U as getRoleUniversalIdentifier, W as getSearchFieldUniversalIdentifier, G as getSelectOptionUniversalIdentifier, K as getSkillUniversalIdentifier, a as getSystemRelationFieldUniversalIdentifier, q as getViewFieldGroupUniversalIdentifier, J as getViewFieldUniversalIdentifier, Y as getViewFilterUniversalIdentifier, X as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, Z as getViewSortUniversalIdentifier, Q as getViewUniversalIdentifier, s as isKnownApplicationCategory, re as serializeApplicationVariableValue };\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst decodeTokenPayload = (\n token: string,\n): { workspaceId: string; applicationId: string } => {\n const payload = JSON.parse(atob(token.split('.')[1]));\n\n return {\n workspaceId: payload.workspaceId,\n applicationId: payload.applicationId,\n };\n};\n\n// Returns the public URL for a file in the app's public/ directory.\n// Works in both logic functions and front components.\n// The path is relative to the public/ folder (e.g. \"images/logo.png\").\nexport const getPublicAssetUrl = (path: string): string => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n throw new Error(\n 'getPublicAssetUrl can only be called from within a logic function or front component',\n );\n }\n\n const { workspaceId, applicationId } = decodeTokenPayload(token);\n const withoutLeadingSlash = path.startsWith('/') ? path.slice(1) : path;\n const withPublicPrefix = withoutLeadingSlash.startsWith('public/')\n ? withoutLeadingSlash\n : `public/${withoutLeadingSlash}`;\n\n const encodedPath = withPublicPrefix\n .split('/')\n .map(encodeURIComponent)\n .join('/');\n\n return `${apiUrl}/public-assets/${workspaceId}/${applicationId}/${encodedPath}`;\n};\n","import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n"],"mappings":"mHACA,IAAIA,EAAoB,SAAS,EAAG,CACnC,MAAO,GAAE,MAAQ,QAAS,EAAE,QAAU,UAAW,EAAE,MAAQ,QAAS,EAAE,QAAU,UAAW,EAAE,SAAW,WAAY,EAAE,KAAO,OAAQ,EAAE,UAAY,YAAa,EAAE,OAAS,SAAU,EAAE,MAAQ,QAAS,EAAE,UAAY,YAAa,EAAE,MAAQ,QAAS,EAAE,eAAiB,iBAAkB,EAAE,aAAe,eAAgB,EAAE,OAAS,SAAU,EAAE,QAAU,UAAW,EAAE,OAAS,SAAU,EAAE,SAAW,WAAY,EAAE,OAAS,SAAU,EAAE,SAAW,WAAY,EAAE,SAAW,WAAY,EAAE,UAAY,YAAa,EAAE,OAAS,SAAU,EAAE,KAAO,OAAQ,EAAE,UAAY,YAAa,EAAE,KAAO,OAAQ,CAC3kB,EAAE,CAAC,CAAC,EEWHI,EAAE,KACFA,EAAE,MACFA,EAAE,QACFA,EAAE,KACFA,EAAE,UACFA,EAAE,OACFA,EAAE,QACFA,EAAE,SACFA,EAAE,UACFA,EAAE,OACFA,EAAE,aArBH,IAsBuC,EAAI,iBAAkB,EAAI,0BCpB3D,EACJ,GACmD,CACnD,IAAM,EAAU,KAAK,MAAM,KAAK,EAAM,MAAM,GAAG,EAAE,EAAE,CAAC,EAEpD,MAAO,CACL,YAAa,EAAQ,YACrB,cAAe,EAAQ,aACzB,CACF,EAKa,EAAqB,GAAyB,CACzD,IAAM,EAAS,QAAQ,IAAI,GACrB,EAAQ,QAAQ,IAAI,GAE1B,GAAI,CAAC,GAAU,CAAC,EACd,MAAU,MACR,sFACF,EAGF,GAAM,CAAE,cAAa,iBAAkB,EAAmB,CAAK,EACzD,EAAsB,EAAK,WAAW,GAAG,EAAI,EAAK,MAAM,CAAC,EAAI,EAUnE,MAAO,GAAG,EAAO,iBAAiB,EAAY,GAAG,EAAc,IATtC,EAAoB,WAAW,SAAS,EAC7D,EACA,UAAU,KAGX,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAE0D,GACpE,ECvCI,EAAK,GAAM,EAAA,EAAA,EAAA,aAAG,CAAC,GAAK,EAAA,EAAA,EAAA,QAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["t","n","e","i","t","t","e"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/FieldMetadataType.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.ACTOR = \"ACTOR\", e.ADDRESS = \"ADDRESS\", e.ARRAY = \"ARRAY\", e.BOOLEAN = \"BOOLEAN\", e.CURRENCY = \"CURRENCY\", e.DATE = \"DATE\", e.DATE_TIME = \"DATE_TIME\", e.EMAILS = \"EMAILS\", e.FILES = \"FILES\", e.FULL_NAME = \"FULL_NAME\", e.LINKS = \"LINKS\", e.MORPH_RELATION = \"MORPH_RELATION\", e.MULTI_SELECT = \"MULTI_SELECT\", e.NUMBER = \"NUMBER\", e.NUMERIC = \"NUMERIC\", e.PHONES = \"PHONES\", e.POSITION = \"POSITION\", e.RATING = \"RATING\", e.RAW_JSON = \"RAW_JSON\", e.RELATION = \"RELATION\", e.RICH_TEXT = \"RICH_TEXT\", e.SELECT = \"SELECT\", e.TEXT = \"TEXT\", e.TS_VECTOR = \"TS_VECTOR\", e.UUID = \"UUID\", e;\n}({}), t = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as n, t };\n","import { v5 as e } from \"uuid\";\n//#region src/application/constants/TwentyStandardApplicationUniversalIdentifier.ts\nvar t = \"20202020-64aa-4b6f-b003-9c74b97cee20\", n = ({ entityNamespace: t, value: n, applicationUniversalIdentifier: r }) => e(`${t}:${n}`, r), r = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), i = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, relationTargetObjectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:systemRelation:${r}`,\n\tapplicationUniversalIdentifier: e\n});\n//#endregion\nexport { t as i, r as n, n as r, i as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { i as n, n as r, r as i, t as a } from \"./get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar o = [\n\t\"Communication\",\n\t\"Productivity\",\n\t\"Product management\",\n\t\"Sales\",\n\t\"Marketing\",\n\t\"Enrichment\",\n\t\"Data\",\n\t\"Search\",\n\t\"Other\"\n], s = (e) => o.includes(e), c = [\n\te.TEXT,\n\te.ARRAY,\n\te.BOOLEAN,\n\te.DATE,\n\te.DATE_TIME,\n\te.NUMBER,\n\te.NUMERIC,\n\te.RAW_JSON,\n\te.RICH_TEXT,\n\te.SELECT,\n\te.MULTI_SELECT\n], l = \"public\", u = \"TWENTY_API_KEY\", d = \"TWENTY_API_URL\", f = \"TWENTY_APP_ACCESS_TOKEN\", p = \"TWENTY_FUNCTIONS_URL\", m = \"generated\", h = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, g = \".twenty/output\", _ = \"Standard\", v = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), b = \"navigation\", x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${b}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => i({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, componentName: t }) => i({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, link: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, nameSingular: t }) => i({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), I = \"RECORD_PAGE\", L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${I}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => i({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, label: t }) => i({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => i({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => i({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: a }) => i({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => i({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), $ = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => i({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), te = /* @__PURE__ */ function(e) {\n\treturn e.Object = \"object\", e.Field = \"field\", e.LogicFunction = \"logicFunction\", e.FrontComponent = \"frontComponent\", e.Role = \"role\", e.Skill = \"skill\", e.Agent = \"agent\", e.ConnectionProvider = \"connectionProvider\", e.View = \"view\", e.ViewField = \"viewField\", e.NavigationMenuItem = \"navigationMenuItem\", e.PageLayout = \"pageLayout\", e.PageLayoutTab = \"pageLayoutTab\", e.CommandMenuItem = \"commandMenuItem\", e;\n}({}), ne = (t, n = e.TEXT) => {\n\tif (t == null) return \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return String(t) === \"true\" ? \"true\" : \"false\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: return String(t);\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT:\n\t\t\tif (Array.isArray(t)) return JSON.stringify(t);\n\t\t\tif (typeof t == \"string\") {\n\t\t\t\ttry {\n\t\t\t\t\tlet e = JSON.parse(t);\n\t\t\t\t\tif (Array.isArray(e)) return t;\n\t\t\t\t} catch {}\n\t\t\t\treturn JSON.stringify([t]);\n\t\t\t}\n\t\t\treturn JSON.stringify(t);\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: return typeof t == \"string\" ? t : JSON.stringify(t);\n\t\tdefault: return typeof t == \"string\" ? t : String(t);\n\t}\n}, re = (t, n = e.TEXT) => {\n\tif (t === \"\") return n === e.ARRAY || n === e.MULTI_SELECT ? [] : \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return t === \"true\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: {\n\t\t\tlet e = Number(t);\n\t\t\treturn Number.isNaN(e) ? t : e;\n\t\t}\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT: try {\n\t\t\tlet e = JSON.parse(t);\n\t\t\treturn Array.isArray(e) ? e : [];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: try {\n\t\t\treturn JSON.parse(t);\n\t\t} catch {\n\t\t\treturn t;\n\t\t}\n\t\tdefault: return t;\n\t}\n};\n//#endregion\nexport { o as APPLICATION_CATEGORIES, c as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, l as ASSETS_DIR, u as DEFAULT_API_KEY_NAME, d as DEFAULT_API_URL_NAME, f as DEFAULT_APP_ACCESS_TOKEN_NAME, p as DEFAULT_FUNCTIONS_URL_NAME, m as GENERATED_DIR, h as NODE_ESM_CJS_BANNER, g as OUTPUT_DIR, te as SyncableEntity, _ as TWENTY_STANDARD_APPLICATION_NAME, n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, i as computeDeterministicUuid, re as deserializeApplicationVariableValue, v as getAgentUniversalIdentifier, y as getApplicationVariableUniversalIdentifier, T as getConnectionProviderUniversalIdentifier, E as getFieldPermissionUniversalIdentifier, r as getFieldUniversalIdentifier, $ as getFieldsWidgetViewUniversalIdentifier, A as getFolderNavigationMenuItemUniversalIdentifier, D as getFrontComponentUniversalIdentifier, x as getGlobalCommandMenuItemUniversalIdentifier, S as getGlobalObjectContextCommandMenuItemUniversalIdentifier, O as getIndexUniversalIdentifier, Q as getIndexViewUniversalIdentifier, M as getLinkNavigationMenuItemUniversalIdentifier, k as getLogicFunctionUniversalIdentifier, w as getNavigationCommandUniversalIdentifier, j as getObjectNavigationMenuItemUniversalIdentifier, N as getObjectPermissionUniversalIdentifier, P as getObjectUniversalIdentifier, F as getPageLayoutTabUniversalIdentifier, L as getPageLayoutUniversalIdentifier, z as getPageLayoutWidgetUniversalIdentifier, B as getPermissionFlagUniversalIdentifier, R as getRecordPageLayoutUniversalIdentifier, C as getRecordSelectionCommandMenuItemUniversalIdentifier, V as getRolePermissionFlagUniversalIdentifier, H as getRoleUniversalIdentifier, U as getSearchFieldUniversalIdentifier, W as getSelectOptionUniversalIdentifier, G as getSkillUniversalIdentifier, a as getSystemRelationFieldUniversalIdentifier, K as getViewFieldGroupUniversalIdentifier, q as getViewFieldUniversalIdentifier, J as getViewFilterUniversalIdentifier, Y as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, X as getViewSortUniversalIdentifier, Z as getViewUniversalIdentifier, s as isKnownApplicationCategory, ne as serializeApplicationVariableValue };\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst decodeTokenPayload = (\n token: string,\n): { workspaceId: string; applicationId: string } => {\n const payload = JSON.parse(atob(token.split('.')[1]));\n\n return {\n workspaceId: payload.workspaceId,\n applicationId: payload.applicationId,\n };\n};\n\n// Returns the public URL for a file in the app's public/ directory.\n// Works in both logic functions and front components.\n// The path is relative to the public/ folder (e.g. \"images/logo.png\").\nexport const getPublicAssetUrl = (path: string): string => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n throw new Error(\n 'getPublicAssetUrl can only be called from within a logic function or front component',\n );\n }\n\n const { workspaceId, applicationId } = decodeTokenPayload(token);\n const withoutLeadingSlash = path.startsWith('/') ? path.slice(1) : path;\n const withPublicPrefix = withoutLeadingSlash.startsWith('public/')\n ? withoutLeadingSlash\n : `public/${withoutLeadingSlash}`;\n\n const encodedPath = withPublicPrefix\n .split('/')\n .map(encodeURIComponent)\n .join('/');\n\n return `${apiUrl}/public-assets/${workspaceId}/${applicationId}/${encodedPath}`;\n};\n","import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n"],"mappings":";;;AACA,IAAI,IAAoB,yBAAS,GAAG;CACnC,OAAO,EAAE,QAAQ,SAAS,EAAE,UAAU,WAAW,EAAE,QAAQ,SAAS,EAAE,UAAU,WAAW,EAAE,WAAW,YAAY,EAAE,OAAO,QAAQ,EAAE,YAAY,aAAa,EAAE,SAAS,UAAU,EAAE,QAAQ,SAAS,EAAE,YAAY,aAAa,EAAE,QAAQ,SAAS,EAAE,iBAAiB,kBAAkB,EAAE,eAAe,gBAAgB,EAAE,SAAS,UAAU,EAAE,UAAU,WAAW,EAAE,SAAS,UAAU,EAAE,WAAW,YAAY,EAAE,SAAS,UAAU,EAAE,WAAW,YAAY,EAAE,WAAW,YAAY,EAAE,YAAY,aAAa,EAAE,SAAS,UAAU,EAAE,OAAO,QAAQ,EAAE,YAAY,aAAa,EAAE,OAAO,QAAQ;AAC3kB,EAAE,CAAC,CAAC;AEWH,EAAE,MACF,EAAE,OACF,EAAE,SACF,EAAE,MACF,EAAE,WACF,EAAE,QACF,EAAE,SACF,EAAE,UACF,EAAE,WACF,EAAE,QACF,EAAE;;;AArBH,IAsBuC,IAAI,kBAAkB,IAAI,2BCpB3D,KACJ,MACmD;CACnD,IAAM,IAAU,KAAK,MAAM,KAAK,EAAM,MAAM,GAAG,EAAE,EAAE,CAAC;CAEpD,OAAO;EACL,aAAa,EAAQ;EACrB,eAAe,EAAQ;CACzB;AACF,GAKa,KAAqB,MAAyB;CACzD,IAAM,IAAS,QAAQ,IAAI,IACrB,IAAQ,QAAQ,IAAI;CAE1B,IAAI,CAAC,KAAU,CAAC,GACd,MAAU,MACR,sFACF;CAGF,IAAM,EAAE,gBAAa,qBAAkB,EAAmB,CAAK,GACzD,IAAsB,EAAK,WAAW,GAAG,IAAI,EAAK,MAAM,CAAC,IAAI;CAUnE,OAAO,GAAG,EAAO,iBAAiB,EAAY,GAAG,EAAc,IATtC,EAAoB,WAAW,SAAS,IAC7D,IACA,UAAU,KAGX,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAE0D;AACpE,GCvCI,KAAK,MAAM,CAACK,EAAE,CAAC,KAAK,CAACC,EAAE,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["t","n","e","i","t","t","e"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/FieldMetadataType.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.ACTOR = \"ACTOR\", e.ADDRESS = \"ADDRESS\", e.ARRAY = \"ARRAY\", e.BOOLEAN = \"BOOLEAN\", e.CURRENCY = \"CURRENCY\", e.DATE = \"DATE\", e.DATE_TIME = \"DATE_TIME\", e.EMAILS = \"EMAILS\", e.FILES = \"FILES\", e.FULL_NAME = \"FULL_NAME\", e.LINKS = \"LINKS\", e.MORPH_RELATION = \"MORPH_RELATION\", e.MULTI_SELECT = \"MULTI_SELECT\", e.NUMBER = \"NUMBER\", e.NUMERIC = \"NUMERIC\", e.PHONES = \"PHONES\", e.POSITION = \"POSITION\", e.RATING = \"RATING\", e.RAW_JSON = \"RAW_JSON\", e.RELATION = \"RELATION\", e.RICH_TEXT = \"RICH_TEXT\", e.SELECT = \"SELECT\", e.TEXT = \"TEXT\", e.TS_VECTOR = \"TS_VECTOR\", e.UUID = \"UUID\", e;\n}({}), t = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as n, t };\n","import { v5 as e } from \"uuid\";\n//#region src/application/constants/TwentyStandardApplicationUniversalIdentifier.ts\nvar t = \"20202020-64aa-4b6f-b003-9c74b97cee20\", n = ({ entityNamespace: t, value: n, applicationUniversalIdentifier: r }) => e(`${t}:${n}`, r), r = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), i = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, relationTargetObjectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:systemRelation:${r}`,\n\tapplicationUniversalIdentifier: e\n});\n//#endregion\nexport { t as i, r as n, n as r, i as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { i as n, n as r, r as i, t as a } from \"./get-system-relation-field-universal-identifier.util-DGoOUfu_.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar o = [\n\t\"Communication\",\n\t\"Productivity\",\n\t\"Product management\",\n\t\"Sales\",\n\t\"Marketing\",\n\t\"Enrichment\",\n\t\"Data\",\n\t\"Search\",\n\t\"Other\"\n], s = (e) => o.includes(e), c = [\n\te.TEXT,\n\te.ARRAY,\n\te.BOOLEAN,\n\te.DATE,\n\te.DATE_TIME,\n\te.NUMBER,\n\te.NUMERIC,\n\te.RAW_JSON,\n\te.RICH_TEXT,\n\te.SELECT,\n\te.MULTI_SELECT\n], l = \"public\", u = \"TWENTY_API_KEY\", d = \"TWENTY_API_URL\", f = \"TWENTY_APP_ACCESS_TOKEN\", p = \"TWENTY_FUNCTIONS_URL\", m = \"generated\", h = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, g = \".twenty/output\", _ = \"Standard\", v = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), b = \"navigation\", x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${b}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => i({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, componentName: t }) => i({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, link: t }) => i({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, nameSingular: t }) => i({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), I = \"RECORD_PAGE\", L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => i({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${I}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => i({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, key: t }) => i({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => i({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, agentUniversalIdentifier: t }) => i({\n\tentityNamespace: \"roleTarget\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, label: t }) => i({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => i({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => i({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, name: t }) => i({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: a }) => i({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => i({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => i({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), $ = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: n }) => i({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), te = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => i({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), ne = /* @__PURE__ */ function(e) {\n\treturn e.Object = \"object\", e.Field = \"field\", e.LogicFunction = \"logicFunction\", e.FrontComponent = \"frontComponent\", e.Role = \"role\", e.Skill = \"skill\", e.Agent = \"agent\", e.ConnectionProvider = \"connectionProvider\", e.View = \"view\", e.ViewField = \"viewField\", e.NavigationMenuItem = \"navigationMenuItem\", e.PageLayout = \"pageLayout\", e.PageLayoutTab = \"pageLayoutTab\", e.CommandMenuItem = \"commandMenuItem\", e;\n}({}), re = (t, n = e.TEXT) => {\n\tif (t == null) return \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return String(t) === \"true\" ? \"true\" : \"false\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: return String(t);\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT:\n\t\t\tif (Array.isArray(t)) return JSON.stringify(t);\n\t\t\tif (typeof t == \"string\") {\n\t\t\t\ttry {\n\t\t\t\t\tlet e = JSON.parse(t);\n\t\t\t\t\tif (Array.isArray(e)) return t;\n\t\t\t\t} catch {}\n\t\t\t\treturn JSON.stringify([t]);\n\t\t\t}\n\t\t\treturn JSON.stringify(t);\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: return typeof t == \"string\" ? t : JSON.stringify(t);\n\t\tdefault: return typeof t == \"string\" ? t : String(t);\n\t}\n}, ie = (t, n = e.TEXT) => {\n\tif (t === \"\") return n === e.ARRAY || n === e.MULTI_SELECT ? [] : \"\";\n\tswitch (n) {\n\t\tcase e.BOOLEAN: return t === \"true\";\n\t\tcase e.NUMBER:\n\t\tcase e.NUMERIC: {\n\t\t\tlet e = Number(t);\n\t\t\treturn Number.isNaN(e) ? t : e;\n\t\t}\n\t\tcase e.ARRAY:\n\t\tcase e.MULTI_SELECT: try {\n\t\t\tlet e = JSON.parse(t);\n\t\t\treturn Array.isArray(e) ? e : [];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tcase e.RAW_JSON:\n\t\tcase e.RICH_TEXT: try {\n\t\t\treturn JSON.parse(t);\n\t\t} catch {\n\t\t\treturn t;\n\t\t}\n\t\tdefault: return t;\n\t}\n};\n//#endregion\nexport { o as APPLICATION_CATEGORIES, c as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, l as ASSETS_DIR, u as DEFAULT_API_KEY_NAME, d as DEFAULT_API_URL_NAME, f as DEFAULT_APP_ACCESS_TOKEN_NAME, p as DEFAULT_FUNCTIONS_URL_NAME, m as GENERATED_DIR, h as NODE_ESM_CJS_BANNER, g as OUTPUT_DIR, ne as SyncableEntity, _ as TWENTY_STANDARD_APPLICATION_NAME, n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, i as computeDeterministicUuid, ie as deserializeApplicationVariableValue, v as getAgentUniversalIdentifier, y as getApplicationVariableUniversalIdentifier, T as getConnectionProviderUniversalIdentifier, E as getFieldPermissionUniversalIdentifier, r as getFieldUniversalIdentifier, te as getFieldsWidgetViewUniversalIdentifier, A as getFolderNavigationMenuItemUniversalIdentifier, D as getFrontComponentUniversalIdentifier, x as getGlobalCommandMenuItemUniversalIdentifier, S as getGlobalObjectContextCommandMenuItemUniversalIdentifier, O as getIndexUniversalIdentifier, $ as getIndexViewUniversalIdentifier, M as getLinkNavigationMenuItemUniversalIdentifier, k as getLogicFunctionUniversalIdentifier, w as getNavigationCommandUniversalIdentifier, j as getObjectNavigationMenuItemUniversalIdentifier, N as getObjectPermissionUniversalIdentifier, P as getObjectUniversalIdentifier, F as getPageLayoutTabUniversalIdentifier, L as getPageLayoutUniversalIdentifier, z as getPageLayoutWidgetUniversalIdentifier, B as getPermissionFlagUniversalIdentifier, R as getRecordPageLayoutUniversalIdentifier, C as getRecordSelectionCommandMenuItemUniversalIdentifier, V as getRolePermissionFlagUniversalIdentifier, H as getRoleTargetUniversalIdentifier, U as getRoleUniversalIdentifier, W as getSearchFieldUniversalIdentifier, G as getSelectOptionUniversalIdentifier, K as getSkillUniversalIdentifier, a as getSystemRelationFieldUniversalIdentifier, q as getViewFieldGroupUniversalIdentifier, J as getViewFieldUniversalIdentifier, Y as getViewFilterUniversalIdentifier, X as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, Z as getViewSortUniversalIdentifier, Q as getViewUniversalIdentifier, s as isKnownApplicationCategory, re as serializeApplicationVariableValue };\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst decodeTokenPayload = (\n token: string,\n): { workspaceId: string; applicationId: string } => {\n const payload = JSON.parse(atob(token.split('.')[1]));\n\n return {\n workspaceId: payload.workspaceId,\n applicationId: payload.applicationId,\n };\n};\n\n// Returns the public URL for a file in the app's public/ directory.\n// Works in both logic functions and front components.\n// The path is relative to the public/ folder (e.g. \"images/logo.png\").\nexport const getPublicAssetUrl = (path: string): string => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n throw new Error(\n 'getPublicAssetUrl can only be called from within a logic function or front component',\n );\n }\n\n const { workspaceId, applicationId } = decodeTokenPayload(token);\n const withoutLeadingSlash = path.startsWith('/') ? path.slice(1) : path;\n const withPublicPrefix = withoutLeadingSlash.startsWith('public/')\n ? withoutLeadingSlash\n : `public/${withoutLeadingSlash}`;\n\n const encodedPath = withPublicPrefix\n .split('/')\n .map(encodeURIComponent)\n .join('/');\n\n return `${apiUrl}/public-assets/${workspaceId}/${applicationId}/${encodedPath}`;\n};\n","import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n"],"mappings":";;;AACA,IAAI,IAAoB,yBAAS,GAAG;CACnC,OAAO,EAAE,QAAQ,SAAS,EAAE,UAAU,WAAW,EAAE,QAAQ,SAAS,EAAE,UAAU,WAAW,EAAE,WAAW,YAAY,EAAE,OAAO,QAAQ,EAAE,YAAY,aAAa,EAAE,SAAS,UAAU,EAAE,QAAQ,SAAS,EAAE,YAAY,aAAa,EAAE,QAAQ,SAAS,EAAE,iBAAiB,kBAAkB,EAAE,eAAe,gBAAgB,EAAE,SAAS,UAAU,EAAE,UAAU,WAAW,EAAE,SAAS,UAAU,EAAE,WAAW,YAAY,EAAE,SAAS,UAAU,EAAE,WAAW,YAAY,EAAE,WAAW,YAAY,EAAE,YAAY,aAAa,EAAE,SAAS,UAAU,EAAE,OAAO,QAAQ,EAAE,YAAY,aAAa,EAAE,OAAO,QAAQ;AAC3kB,EAAE,CAAC,CAAC;AEWH,EAAE,MACF,EAAE,OACF,EAAE,SACF,EAAE,MACF,EAAE,WACF,EAAE,QACF,EAAE,SACF,EAAE,UACF,EAAE,WACF,EAAE,QACF,EAAE;;;AArBH,IAsBuC,IAAI,kBAAkB,IAAI,2BCpB3D,KACJ,MACmD;CACnD,IAAM,IAAU,KAAK,MAAM,KAAK,EAAM,MAAM,GAAG,EAAE,EAAE,CAAC;CAEpD,OAAO;EACL,aAAa,EAAQ;EACrB,eAAe,EAAQ;CACzB;AACF,GAKa,KAAqB,MAAyB;CACzD,IAAM,IAAS,QAAQ,IAAI,IACrB,IAAQ,QAAQ,IAAI;CAE1B,IAAI,CAAC,KAAU,CAAC,GACd,MAAU,MACR,sFACF;CAGF,IAAM,EAAE,gBAAa,qBAAkB,EAAmB,CAAK,GACzD,IAAsB,EAAK,WAAW,GAAG,IAAI,EAAK,MAAM,CAAC,IAAI;CAUnE,OAAO,GAAG,EAAO,iBAAiB,EAAY,GAAG,EAAc,IATtC,EAAoB,WAAW,SAAS,IAC7D,IACA,UAAU,KAGX,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAE0D;AACpE,GCvCI,KAAK,MAAM,CAACK,EAAE,CAAC,KAAK,CAACC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twenty-sdk",
3
- "version": "2.23.0",
3
+ "version": "2.25.0",
4
4
  "sideEffects": false,
5
5
  "bin": {
6
6
  "twenty": "dist/cli.cjs"
@@ -83,7 +83,7 @@
83
83
  "semver": "7.6.3",
84
84
  "sharp": "^0.34.5",
85
85
  "tinyglobby": "^0.2.15",
86
- "twenty-client-sdk": "2.23.0",
86
+ "twenty-client-sdk": "2.25.0",
87
87
  "typescript": "^5.9.3",
88
88
  "uuid": "^13.0.2"
89
89
  },