twenty-sdk 2.22.0 → 2.23.0-alpha.1
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/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{catalog-sync-DoUCfPkC.js → catalog-sync-Cq0X-dtP.js} +1 -1
- package/dist/{catalog-sync-DUkU-swN.mjs → catalog-sync-DMB2-zfb.mjs} +1 -1
- package/dist/cli/utilities/build/manifest/utils/get-default-fields-in-object-fields.d.ts +1 -2
- package/dist/cli.cjs +8 -8
- package/dist/cli.mjs +59 -59
- package/dist/define/index.cjs +18 -18
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +55 -49
- package/dist/define/index.mjs +5572 -5267
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.mjs +1 -1
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-DqaAG8sQ.mjs → get-function-input-schema-GNk3NRLJ-DvySDoB9.mjs} +1 -1
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-DSHFFVyM.mjs → login-CBkilp_U.mjs} +3210 -3005
- package/dist/{login-BCfjgngD.js → login-DiBaFL7M.js} +26 -26
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/cli/utilities/build/manifest/utils/get-default-relation-object-fields.d.ts +0 -9
package/dist/operations.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-DiBaFL7M.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;
|
package/dist/operations.mjs
CHANGED
|
@@ -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-
|
|
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-CBkilp_U.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,
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["e","t","t","n","e","n","t"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-field-universal-identifier.util-CK9_m9RQ.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});\n//#endregion\nexport { n, t as r, r as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { n, r, t as i } from \"./get-field-universal-identifier.util-CK9_m9RQ.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar a = [\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], o = (e) => a.includes(e), s = [\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], c = \"public\", l = \"TWENTY_API_KEY\", u = \"TWENTY_API_URL\", d = \"TWENTY_APP_ACCESS_TOKEN\", f = \"TWENTY_FUNCTIONS_URL\", p = \"generated\", m = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, h = \".twenty/output\", g = \"Standard\", _ = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), v = ({ applicationUniversalIdentifier: e, key: t }) => n({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = \"navigation\", b = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${r ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${y}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, componentName: t }) => n({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, link: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, nameSingular: t }) => n({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: r }) => n({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), F = \"RECORD_PAGE\", I = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${r}` : r,\n\tapplicationUniversalIdentifier: e\n}), L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${F}`,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: r }) => n({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, key: t }) => n({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: r }) => n({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, label: t }) => n({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => n({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: r }) => n({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r }) => n({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r, operand: i, subFieldName: a }) => n({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${r}:${i}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: r }) => n({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r }) => n({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"view\",\n\tvalue: `${r}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => n({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), $ = /* @__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}({}), te = (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}, ne = (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 { a as APPLICATION_CATEGORIES, s as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, c as ASSETS_DIR, l as DEFAULT_API_KEY_NAME, u as DEFAULT_API_URL_NAME, d as DEFAULT_APP_ACCESS_TOKEN_NAME, f as DEFAULT_FUNCTIONS_URL_NAME, p as GENERATED_DIR, m as NODE_ESM_CJS_BANNER, h as OUTPUT_DIR, $ as SyncableEntity, g as TWENTY_STANDARD_APPLICATION_NAME, r as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, n as computeDeterministicUuid, ne as deserializeApplicationVariableValue, _ as getAgentUniversalIdentifier, v as getApplicationVariableUniversalIdentifier, w as getConnectionProviderUniversalIdentifier, T as getFieldPermissionUniversalIdentifier, i as getFieldUniversalIdentifier, Q as getFieldsWidgetViewUniversalIdentifier, k as getFolderNavigationMenuItemUniversalIdentifier, E as getFrontComponentUniversalIdentifier, b as getGlobalCommandMenuItemUniversalIdentifier, x as getGlobalObjectContextCommandMenuItemUniversalIdentifier, D as getIndexUniversalIdentifier, Z as getIndexViewUniversalIdentifier, j as getLinkNavigationMenuItemUniversalIdentifier, O as getLogicFunctionUniversalIdentifier, C as getNavigationCommandUniversalIdentifier, A as getObjectNavigationMenuItemUniversalIdentifier, M as getObjectPermissionUniversalIdentifier, N as getObjectUniversalIdentifier, P as getPageLayoutTabUniversalIdentifier, I as getPageLayoutUniversalIdentifier, R as getPageLayoutWidgetUniversalIdentifier, z as getPermissionFlagUniversalIdentifier, L as getRecordPageLayoutUniversalIdentifier, S as getRecordSelectionCommandMenuItemUniversalIdentifier, B as getRolePermissionFlagUniversalIdentifier, V as getRoleUniversalIdentifier, H as getSearchFieldUniversalIdentifier, U as getSelectOptionUniversalIdentifier, W as getSkillUniversalIdentifier, G as getViewFieldGroupUniversalIdentifier, K as getViewFieldUniversalIdentifier, q as getViewFilterUniversalIdentifier, J as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, Y as getViewSortUniversalIdentifier, X as getViewUniversalIdentifier, o as isKnownApplicationCategory, te 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, 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"}
|
package/dist/utils/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["t","n","e","n","t","t","e"],"sources":["../../../twenty-shared/dist/ViewKey-YV4NySfb.mjs","../../../twenty-shared/dist/get-field-universal-identifier.util-CK9_m9RQ.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});\n//#endregion\nexport { n, t as r, r as t };\n","import { n as e, t } from \"./ViewKey-YV4NySfb.mjs\";\nimport { n, r, t as i } from \"./get-field-universal-identifier.util-CK9_m9RQ.mjs\";\n//#region src/application/applicationCategoryType.ts\nvar a = [\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], o = (e) => a.includes(e), s = [\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], c = \"public\", l = \"TWENTY_API_KEY\", u = \"TWENTY_API_URL\", d = \"TWENTY_APP_ACCESS_TOKEN\", f = \"TWENTY_FUNCTIONS_URL\", p = \"generated\", m = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, h = \".twenty/output\", g = \"Standard\", _ = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), v = ({ applicationUniversalIdentifier: e, key: t }) => n({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), y = \"navigation\", b = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), x = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${r ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${y}`,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: r }) => n({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, componentName: t }) => n({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), ee = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, link: t }) => n({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), N = ({ applicationUniversalIdentifier: e, nameSingular: t }) => n({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), P = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: r }) => n({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), F = \"RECORD_PAGE\", I = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${r}` : r,\n\tapplicationUniversalIdentifier: e\n}), L = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => n({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${F}`,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: r }) => n({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, key: t }) => n({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: r }) => n({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, label: t }) => n({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => n({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: r }) => n({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, name: t }) => n({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r }) => n({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r, operand: i, subFieldName: a }) => n({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${r}:${i}:${a ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: r }) => n({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: r }) => n({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), X = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: r }) => n({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${r}`,\n\tapplicationUniversalIdentifier: e\n}), Z = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: r }) => n({\n\tentityNamespace: \"view\",\n\tvalue: `${r}:${t.INDEX}`,\n\tapplicationUniversalIdentifier: e\n}), Q = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => n({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), $ = /* @__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}({}), te = (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}, ne = (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 { a as APPLICATION_CATEGORIES, s as APPLICATION_VARIABLE_FIELD_METADATA_TYPES, c as ASSETS_DIR, l as DEFAULT_API_KEY_NAME, u as DEFAULT_API_URL_NAME, d as DEFAULT_APP_ACCESS_TOKEN_NAME, f as DEFAULT_FUNCTIONS_URL_NAME, p as GENERATED_DIR, m as NODE_ESM_CJS_BANNER, h as OUTPUT_DIR, $ as SyncableEntity, g as TWENTY_STANDARD_APPLICATION_NAME, r as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, n as computeDeterministicUuid, ne as deserializeApplicationVariableValue, _ as getAgentUniversalIdentifier, v as getApplicationVariableUniversalIdentifier, w as getConnectionProviderUniversalIdentifier, T as getFieldPermissionUniversalIdentifier, i as getFieldUniversalIdentifier, Q as getFieldsWidgetViewUniversalIdentifier, k as getFolderNavigationMenuItemUniversalIdentifier, E as getFrontComponentUniversalIdentifier, b as getGlobalCommandMenuItemUniversalIdentifier, x as getGlobalObjectContextCommandMenuItemUniversalIdentifier, D as getIndexUniversalIdentifier, Z as getIndexViewUniversalIdentifier, j as getLinkNavigationMenuItemUniversalIdentifier, O as getLogicFunctionUniversalIdentifier, C as getNavigationCommandUniversalIdentifier, A as getObjectNavigationMenuItemUniversalIdentifier, M as getObjectPermissionUniversalIdentifier, N as getObjectUniversalIdentifier, P as getPageLayoutTabUniversalIdentifier, I as getPageLayoutUniversalIdentifier, R as getPageLayoutWidgetUniversalIdentifier, z as getPermissionFlagUniversalIdentifier, L as getRecordPageLayoutUniversalIdentifier, S as getRecordSelectionCommandMenuItemUniversalIdentifier, B as getRolePermissionFlagUniversalIdentifier, V as getRoleUniversalIdentifier, H as getSearchFieldUniversalIdentifier, U as getSelectOptionUniversalIdentifier, W as getSkillUniversalIdentifier, G as getViewFieldGroupUniversalIdentifier, K as getViewFieldUniversalIdentifier, q as getViewFilterUniversalIdentifier, J as getViewGroupUniversalIdentifier, ee as getViewNavigationMenuItemUniversalIdentifier, Y as getViewSortUniversalIdentifier, X as getViewUniversalIdentifier, o as isKnownApplicationCategory, te 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, 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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0-alpha.1",
|
|
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.
|
|
86
|
+
"twenty-client-sdk": "2.23.0-alpha.1",
|
|
87
87
|
"typescript": "^5.9.3",
|
|
88
88
|
"uuid": "^13.0.2"
|
|
89
89
|
},
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ObjectConfig } from '../../../../../sdk/define/objects/object-config';
|
|
2
|
-
import { type FieldManifest, type ObjectFieldManifest } from 'twenty-shared/application';
|
|
3
|
-
export declare const getDefaultRelationObjectFields: ({ objectConfig, applicationUniversalIdentifier, }: {
|
|
4
|
-
objectConfig: ObjectConfig;
|
|
5
|
-
applicationUniversalIdentifier: string;
|
|
6
|
-
}) => {
|
|
7
|
-
objectFields: ObjectFieldManifest[];
|
|
8
|
-
fields: FieldManifest[];
|
|
9
|
-
};
|