twenty-sdk 2.15.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/halftone-backdrop.png +0 -0
- package/dist/billing/index.cjs +1 -1
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs +2 -1
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{catalog-sync-C5Bb1KSh.js → catalog-sync-CgKswjsE.js} +1 -1
- package/dist/{catalog-sync-DcpUieU5.mjs → catalog-sync-YxvEEHz5.mjs} +1 -1
- package/dist/cli/commands/dev/i18n-extract.d.ts +7 -0
- package/dist/cli/utilities/build/common/build-application.d.ts +2 -0
- package/dist/cli/utilities/build/common/front-component-build/css-injection-plugin.d.ts +2 -0
- package/dist/cli/utilities/build/cover/apply-generated-cover.d.ts +9 -0
- package/dist/cli/utilities/build/cover/assets/twenty-logo-mark-path.d.ts +1 -0
- package/dist/cli/utilities/build/cover/generate-cover-image.d.ts +5 -0
- package/dist/cli/utilities/build/cover/generated-asset.type.d.ts +4 -0
- package/dist/cli/utilities/build/cover/generated-cover-path.d.ts +1 -0
- package/dist/cli/utilities/i18n/collect-translatable-strings.d.ts +2 -0
- package/dist/cli/utilities/i18n/compile-application-translations.d.ts +1 -0
- package/dist/cli/utilities/i18n/constants.d.ts +1 -0
- package/dist/cli/utilities/i18n/extract-application-translations.d.ts +10 -0
- package/dist/cli/utilities/i18n/generate-message-id.d.ts +1 -0
- package/dist/cli.cjs +35 -33
- package/dist/cli.mjs +896 -836
- package/dist/define/index.cjs +19 -19
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +30 -15
- package/dist/define/index.mjs +2293 -1036
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +43 -12
- package/dist/front-component/index.mjs +134 -143
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +1 -1
- package/dist/front-component-renderer/build.mjs +1 -1
- package/dist/front-component-renderer.cjs +1 -1
- package/dist/{get-front-component-build-plugins-DBupR4cF.js → get-front-component-build-plugins-Dqpyup2W.js} +9 -5
- package/dist/get-front-component-build-plugins-taotEFOp.mjs +126 -0
- package/dist/{get-function-input-schema-GNk3NRLJ-oMYSgib9.mjs → get-function-input-schema-GNk3NRLJ-CfeAvjEl.mjs} +1 -1
- package/dist/get-function-input-schema-GNk3NRLJ-D8x7FINz.js +1 -0
- package/dist/isDefined-Dtu5EYqP-Dp026Ry1.js +1 -0
- package/dist/logic-function/index.cjs +1 -1
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +15 -9
- package/dist/logic-function/index.mjs +1 -0
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/login-BOrzi4Z0.js +345 -0
- package/dist/{login-Cm5IBGFm.mjs → login-Dg4Ap-uo.mjs} +6932 -5552
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +4 -12
- package/dist/AllIcons-DEGfvqso-DwtvkCyL.js +0 -1
- package/dist/AllIcons-DEGfvqso-PUvdkUZm.mjs +0 -66238
- package/dist/get-front-component-build-plugins-BuE2QdIr.mjs +0 -113
- package/dist/get-function-input-schema-GNk3NRLJ-DMgchWCN.js +0 -1
- package/dist/icon-BSeT8K5G-Cuhg-Bz6.js +0 -1
- package/dist/icon-BSeT8K5G-WVhoiRKN.mjs +0 -10144
- package/dist/login-LjERatsq.js +0 -345
- package/dist/ui/index.cjs +0 -34
- package/dist/ui/index.d.ts +0 -18
- package/dist/ui/index.mjs +0 -20678
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-BOrzi4Z0.js");var t=async t=>(t?.remote&&e.V.setActiveRemote(t.remote),await new e.V().clearConfig(),{success:!0,data:void 0}),n=n=>e.J(()=>t(n),e.G.AUTH_FAILED),r=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjQ4OTE0NDk2MDAsImp0aSI6IjIwMjAyMDIwLWY0MDEtNGQ4YS1hNzMxLTY0ZDAwN2MyN2JhZCJ9.bfQjfyN0NEtTCLE_xPyNcwonDzlSXFoP8kdCQTdnuDc`,i=`http://localhost:2020`;exports.APP_ERROR_CODES=e.W,exports.AUTH_ERROR_CODES=e.G,exports.ConfigService=e.V,exports.DEV_API_KEY=r,exports.DEV_API_URL=i,exports.FUNCTION_ERROR_CODES=e.K,exports.SERVER_ERROR_CODES=e.q,exports.appBuild=e.U,exports.appDeploy=e.I,exports.appDevOnce=e.o,exports.appInstall=e.j,exports.appPublish=e.F,exports.appUninstall=e.g,exports.authLogin=e.t,exports.authLoginOAuth=e.B,exports.authLogout=n,exports.checkDockerRunning=e.C,exports.containerExists=e.w,exports.detectLocalServer=e.p,exports.functionExecute=e.h,exports.getContainerDigest=e.T,exports.getEngineVersionRange=e.i,exports.getImageDigest=e.O,exports.getImageForVersion=e.k,exports.resolveHighestEngineVersion=e.r,exports.serverStart=e.n,exports.serverUpgrade=e.a;
|
package/dist/operations.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as e, C as t, F as n, G as r, I as i, J as a, K as o, O as s, T as c, U as l, V as u, W as d, a as f, g as p, h as m, i as h, j as g, k as _, n as v, o as y, p as b, q as x, r as S, t as C, w } from "./login-
|
|
1
|
+
import { B as e, C as t, F as n, G as r, I as i, J as a, K as o, O as s, T as c, U as l, V as u, W as d, a as f, g as p, h as m, i as h, j as g, k as _, n as v, o as y, p as b, q as x, r as S, t as C, w } from "./login-Dg4Ap-uo.mjs";
|
|
2
2
|
//#region src/cli/operations/logout.ts
|
|
3
3
|
var T = async (e) => (e?.remote && u.setActiveRemote(e.remote), await new u().clearConfig(), {
|
|
4
4
|
success: !0,
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@sniptt/guards");var t=`TWENTY_API_URL`,n=`TWENTY_APP_ACCESS_TOKEN`,r=e=>{let t=JSON.parse(atob(e.split(`.`)[1]));return{workspaceId:t.workspaceId,applicationId:t.applicationId}},i=e=>{let i=process.env[t],a=process.env[n];if(!i||!a)throw Error(`getPublicAssetUrl can only be called from within a logic function or front component`);let{workspaceId:o,applicationId:s}=r(a),c=e.startsWith(`/`)?e.slice(1):e;return`${i}/public-assets/${o}/${s}/${(c.startsWith(`public/`)?c:`public/${c}`).split(`/`).map(encodeURIComponent).join(`/`)}`},a=t=>!(0,e.isUndefined)(t)&&!(0,e.isNull)(t);exports.getPublicAssetUrl=i,exports.isDefined=a;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("uuid");let e=require("@sniptt/guards");var t=`TWENTY_API_URL`,n=`TWENTY_APP_ACCESS_TOKEN`,r=e=>{let t=JSON.parse(atob(e.split(`.`)[1]));return{workspaceId:t.workspaceId,applicationId:t.applicationId}},i=e=>{let i=process.env[t],a=process.env[n];if(!i||!a)throw Error(`getPublicAssetUrl can only be called from within a logic function or front component`);let{workspaceId:o,applicationId:s}=r(a),c=e.startsWith(`/`)?e.slice(1):e;return`${i}/public-assets/${o}/${s}/${(c.startsWith(`public/`)?c:`public/${c}`).split(`/`).map(encodeURIComponent).join(`/`)}`},a=t=>!(0,e.isUndefined)(t)&&!(0,e.isNull)(t);exports.getPublicAssetUrl=i,exports.isDefined=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["e","t","n"],"sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/application/constants/AssetDirectory.ts\nvar e = \"public\", t = \"TWENTY_API_KEY\", n = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", i = \"generated\", a = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, o = \".twenty/output\", s = \"Standard\", c = \"20202020-64aa-4b6f-b003-9c74b97cee20\", l = /* @__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}({});\n//#endregion\nexport { e as ASSETS_DIR, t as DEFAULT_API_KEY_NAME, n as DEFAULT_API_URL_NAME, r as DEFAULT_APP_ACCESS_TOKEN_NAME, i as GENERATED_DIR, a as NODE_ESM_CJS_BANNER, o as OUTPUT_DIR, l as SyncableEntity, s as TWENTY_STANDARD_APPLICATION_NAME, c as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER };\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":"mGACA,IAAwCE,EAAI,iBAAkB,EAAI,0BCI5D,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","n","e"],"sources":["../../../twenty-shared/dist/ViewKey-Dib-Wyry.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/ViewKey.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as t };\n","import { t as e } from \"./ViewKey-Dib-Wyry.mjs\";\nimport { v5 as t } from \"uuid\";\n//#region src/application/constants/AssetDirectory.ts\nvar n = \"public\", r = \"TWENTY_API_KEY\", i = \"TWENTY_API_URL\", a = \"TWENTY_APP_ACCESS_TOKEN\", o = \"TWENTY_FUNCTIONS_URL\", s = \"generated\", c = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, l = \".twenty/output\", u = \"Standard\", d = \"20202020-64aa-4b6f-b003-9c74b97cee20\", f = ({ entityNamespace: e, value: n, applicationUniversalIdentifier: r }) => t(`${e}:${n}`, r), p = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), m = ({ applicationUniversalIdentifier: e, key: t }) => f({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), h = \"navigation\", g = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), _ = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), v = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${h}`,\n\tapplicationUniversalIdentifier: e\n}), b = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), x = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => f({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, componentName: t }) => f({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, link: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, nameSingular: t }) => f({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => f({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), N = \"RECORD_PAGE\", P = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${N}`,\n\tapplicationUniversalIdentifier: e\n}), I = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => f({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), L = ({ applicationUniversalIdentifier: e, key: t }) => f({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => f({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, label: t }) => f({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => f({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => f({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => f({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: i }) => f({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${i ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => f({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => f({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${e.INDEX}`,\n\tapplicationUniversalIdentifier: t\n}), X = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => f({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), Z = /* @__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}({});\n//#endregion\nexport { n as ASSETS_DIR, r as DEFAULT_API_KEY_NAME, i as DEFAULT_API_URL_NAME, a as DEFAULT_APP_ACCESS_TOKEN_NAME, o as DEFAULT_FUNCTIONS_URL_NAME, s as GENERATED_DIR, c as NODE_ESM_CJS_BANNER, l as OUTPUT_DIR, Z as SyncableEntity, u as TWENTY_STANDARD_APPLICATION_NAME, d as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, f as computeDeterministicUuid, p as getAgentUniversalIdentifier, m as getApplicationVariableUniversalIdentifier, b as getConnectionProviderUniversalIdentifier, x as getFieldPermissionUniversalIdentifier, S as getFieldUniversalIdentifier, X as getFieldsWidgetViewUniversalIdentifier, E as getFolderNavigationMenuItemUniversalIdentifier, C as getFrontComponentUniversalIdentifier, g as getGlobalCommandMenuItemUniversalIdentifier, _ as getGlobalObjectContextCommandMenuItemUniversalIdentifier, w as getIndexUniversalIdentifier, Y as getIndexViewUniversalIdentifier, k as getLinkNavigationMenuItemUniversalIdentifier, T as getLogicFunctionUniversalIdentifier, y as getNavigationCommandUniversalIdentifier, D as getObjectNavigationMenuItemUniversalIdentifier, A as getObjectPermissionUniversalIdentifier, j as getObjectUniversalIdentifier, M as getPageLayoutTabUniversalIdentifier, P as getPageLayoutUniversalIdentifier, I as getPageLayoutWidgetUniversalIdentifier, L as getPermissionFlagUniversalIdentifier, F as getRecordPageLayoutUniversalIdentifier, v as getRecordSelectionCommandMenuItemUniversalIdentifier, R as getRolePermissionFlagUniversalIdentifier, z as getRoleUniversalIdentifier, B as getSearchFieldUniversalIdentifier, V as getSelectOptionUniversalIdentifier, H as getSkillUniversalIdentifier, U as getViewFieldGroupUniversalIdentifier, W as getViewFieldUniversalIdentifier, G as getViewFilterUniversalIdentifier, K as getViewGroupUniversalIdentifier, O as getViewNavigationMenuItemUniversalIdentifier, q as getViewSortUniversalIdentifier, J as getViewUniversalIdentifier };\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,ICEwC,EAAI,iBAAkB,EAAI,0BCE5D,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
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import "uuid";
|
|
1
2
|
import { isNull as e, isUndefined as t } from "@sniptt/guards";
|
|
2
|
-
//#region ../twenty-shared/dist/
|
|
3
|
+
//#region ../twenty-shared/dist/ViewKey-Dib-Wyry.mjs
|
|
3
4
|
var n = "TWENTY_API_URL", r = "TWENTY_APP_ACCESS_TOKEN", i = (e) => {
|
|
4
5
|
let t = JSON.parse(atob(e.split(".")[1]));
|
|
5
6
|
return {
|
package/dist/utils/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["n","t","e"],"sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/application/constants/AssetDirectory.ts\nvar e = \"public\", t = \"TWENTY_API_KEY\", n = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", i = \"generated\", a = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, o = \".twenty/output\", s = \"Standard\", c = \"20202020-64aa-4b6f-b003-9c74b97cee20\", l = /* @__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}({});\n//#endregion\nexport { e as ASSETS_DIR, t as DEFAULT_API_KEY_NAME, n as DEFAULT_API_URL_NAME, r as DEFAULT_APP_ACCESS_TOKEN_NAME, i as GENERATED_DIR, a as NODE_ESM_CJS_BANNER, o as OUTPUT_DIR, l as SyncableEntity, s as TWENTY_STANDARD_APPLICATION_NAME, c as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER };\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,IAAwCA,IAAI,kBAAkB,IAAI,2BCI5D,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,CAACC,EAAE,CAAC,KAAK,CAACC,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["n","t","t","e"],"sources":["../../../twenty-shared/dist/ViewKey-Dib-Wyry.mjs","../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts","../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs"],"sourcesContent":["//#region src/types/ViewKey.ts\nvar e = /* @__PURE__ */ function(e) {\n\treturn e.INDEX = \"INDEX\", e;\n}({});\n//#endregion\nexport { e as t };\n","import { t as e } from \"./ViewKey-Dib-Wyry.mjs\";\nimport { v5 as t } from \"uuid\";\n//#region src/application/constants/AssetDirectory.ts\nvar n = \"public\", r = \"TWENTY_API_KEY\", i = \"TWENTY_API_URL\", a = \"TWENTY_APP_ACCESS_TOKEN\", o = \"TWENTY_FUNCTIONS_URL\", s = \"generated\", c = { js: \"import { createRequire as __createRequire } from 'module';\\nconst require = __createRequire(import.meta.url);\" }, l = \".twenty/output\", u = \"Standard\", d = \"20202020-64aa-4b6f-b003-9c74b97cee20\", f = ({ entityNamespace: e, value: n, applicationUniversalIdentifier: r }) => t(`${e}:${n}`, r), p = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"agent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), m = ({ applicationUniversalIdentifier: e, key: t }) => f({\n\tentityNamespace: \"applicationVariable\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), h = \"navigation\", g = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL:${t}`,\n\tapplicationUniversalIdentifier: e\n}), _ = ({ applicationUniversalIdentifier: e, engineComponentKey: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `GLOBAL_OBJECT_CONTEXT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), v = ({ applicationUniversalIdentifier: e, engineComponentKey: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `RECORD_SELECTION:${t}:${n ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), y = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"commandMenuItem\",\n\tvalue: `${t}:${h}`,\n\tapplicationUniversalIdentifier: e\n}), b = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"connectionProvider\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), x = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, fieldUniversalIdentifier: n }) => f({\n\tentityNamespace: \"fieldPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), S = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"fieldMetadata\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), C = ({ applicationUniversalIdentifier: e, componentName: t }) => f({\n\tentityNamespace: \"frontComponent\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), w = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"index\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), T = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"logicFunction\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), E = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `FOLDER:${t}`,\n\tapplicationUniversalIdentifier: e\n}), D = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `OBJECT:${t}`,\n\tapplicationUniversalIdentifier: e\n}), O = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `VIEW:${t}`,\n\tapplicationUniversalIdentifier: e\n}), k = ({ applicationUniversalIdentifier: e, link: t }) => f({\n\tentityNamespace: \"navigationMenuItem\",\n\tvalue: `LINK:${t}`,\n\tapplicationUniversalIdentifier: e\n}), A = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"objectPermission\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), j = ({ applicationUniversalIdentifier: e, nameSingular: t }) => f({\n\tentityNamespace: \"objectMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), M = ({ applicationUniversalIdentifier: e, pageLayoutUniversalIdentifier: t, title: n }) => f({\n\tentityNamespace: \"pageLayoutTab\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), N = \"RECORD_PAGE\", P = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"pageLayout\",\n\tvalue: t ? `${t}:${n}` : n,\n\tapplicationUniversalIdentifier: e\n}), F = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t }) => f({\n\tentityNamespace: \"pageLayout\",\n\tvalue: `${t}:${N}`,\n\tapplicationUniversalIdentifier: e\n}), I = ({ applicationUniversalIdentifier: e, pageLayoutTabUniversalIdentifier: t, title: n }) => f({\n\tentityNamespace: \"pageLayoutWidget\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), L = ({ applicationUniversalIdentifier: e, key: t }) => f({\n\tentityNamespace: \"permissionFlag\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), R = ({ applicationUniversalIdentifier: e, roleUniversalIdentifier: t, permissionFlagUniversalIdentifier: n }) => f({\n\tentityNamespace: \"rolePermissionFlag\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), z = ({ applicationUniversalIdentifier: e, label: t }) => f({\n\tentityNamespace: \"role\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), B = ({ applicationUniversalIdentifier: e, fieldMetadataUniversalIdentifier: t }) => f({\n\tentityNamespace: \"searchFieldMetadata\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), V = ({ applicationUniversalIdentifier: e, fieldUniversalIdentifier: t, value: n }) => f({\n\tentityNamespace: \"selectOption\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), H = ({ applicationUniversalIdentifier: e, name: t }) => f({\n\tentityNamespace: \"skill\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), U = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"viewFieldGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), W = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => f({\n\tentityNamespace: \"viewField\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), G = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n, operand: r, subFieldName: i }) => f({\n\tentityNamespace: \"viewFilter\",\n\tvalue: `${t}:${n}:${r}:${i ?? \"\"}`,\n\tapplicationUniversalIdentifier: e\n}), K = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldValue: n }) => f({\n\tentityNamespace: \"viewGroup\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), q = ({ applicationUniversalIdentifier: e, viewUniversalIdentifier: t, fieldMetadataUniversalIdentifier: n }) => f({\n\tentityNamespace: \"viewSort\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), J = ({ applicationUniversalIdentifier: e, objectUniversalIdentifier: t, name: n }) => f({\n\tentityNamespace: \"view\",\n\tvalue: `${t}:${n}`,\n\tapplicationUniversalIdentifier: e\n}), Y = ({ applicationUniversalIdentifier: t, objectUniversalIdentifier: n }) => f({\n\tentityNamespace: \"view\",\n\tvalue: `${n}:${e.INDEX}`,\n\tapplicationUniversalIdentifier: t\n}), X = ({ applicationUniversalIdentifier: e, pageLayoutWidgetUniversalIdentifier: t }) => f({\n\tentityNamespace: \"view\",\n\tvalue: t,\n\tapplicationUniversalIdentifier: e\n}), Z = /* @__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}({});\n//#endregion\nexport { n as ASSETS_DIR, r as DEFAULT_API_KEY_NAME, i as DEFAULT_API_URL_NAME, a as DEFAULT_APP_ACCESS_TOKEN_NAME, o as DEFAULT_FUNCTIONS_URL_NAME, s as GENERATED_DIR, c as NODE_ESM_CJS_BANNER, l as OUTPUT_DIR, Z as SyncableEntity, u as TWENTY_STANDARD_APPLICATION_NAME, d as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER, f as computeDeterministicUuid, p as getAgentUniversalIdentifier, m as getApplicationVariableUniversalIdentifier, b as getConnectionProviderUniversalIdentifier, x as getFieldPermissionUniversalIdentifier, S as getFieldUniversalIdentifier, X as getFieldsWidgetViewUniversalIdentifier, E as getFolderNavigationMenuItemUniversalIdentifier, C as getFrontComponentUniversalIdentifier, g as getGlobalCommandMenuItemUniversalIdentifier, _ as getGlobalObjectContextCommandMenuItemUniversalIdentifier, w as getIndexUniversalIdentifier, Y as getIndexViewUniversalIdentifier, k as getLinkNavigationMenuItemUniversalIdentifier, T as getLogicFunctionUniversalIdentifier, y as getNavigationCommandUniversalIdentifier, D as getObjectNavigationMenuItemUniversalIdentifier, A as getObjectPermissionUniversalIdentifier, j as getObjectUniversalIdentifier, M as getPageLayoutTabUniversalIdentifier, P as getPageLayoutUniversalIdentifier, I as getPageLayoutWidgetUniversalIdentifier, L as getPermissionFlagUniversalIdentifier, F as getRecordPageLayoutUniversalIdentifier, v as getRecordSelectionCommandMenuItemUniversalIdentifier, R as getRolePermissionFlagUniversalIdentifier, z as getRoleUniversalIdentifier, B as getSearchFieldUniversalIdentifier, V as getSelectOptionUniversalIdentifier, H as getSkillUniversalIdentifier, U as getViewFieldGroupUniversalIdentifier, W as getViewFieldUniversalIdentifier, G as getViewFilterUniversalIdentifier, K as getViewGroupUniversalIdentifier, O as getViewNavigationMenuItemUniversalIdentifier, q as getViewSortUniversalIdentifier, J as getViewUniversalIdentifier };\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,ICEwC,IAAI,kBAAkB,IAAI,2BCE5D,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,CAACE,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.18.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"twenty": "dist/cli.cjs"
|
|
@@ -48,11 +48,6 @@
|
|
|
48
48
|
"import": "./dist/utils/index.mjs",
|
|
49
49
|
"require": "./dist/utils/index.cjs"
|
|
50
50
|
},
|
|
51
|
-
"./ui": {
|
|
52
|
-
"types": "./dist/ui/index.d.ts",
|
|
53
|
-
"import": "./dist/ui/index.mjs",
|
|
54
|
-
"require": "./dist/ui/index.cjs"
|
|
55
|
-
},
|
|
56
51
|
"./cli": {
|
|
57
52
|
"types": "./dist/cli/operations/index.d.ts",
|
|
58
53
|
"import": "./dist/operations.mjs",
|
|
@@ -86,8 +81,9 @@
|
|
|
86
81
|
"react": "^19.2.0",
|
|
87
82
|
"react-dom": "^19.2.0",
|
|
88
83
|
"semver": "7.6.3",
|
|
84
|
+
"sharp": "^0.34.5",
|
|
89
85
|
"tinyglobby": "^0.2.15",
|
|
90
|
-
"twenty-client-sdk": "2.
|
|
86
|
+
"twenty-client-sdk": "2.18.0",
|
|
91
87
|
"typescript": "^5.9.3",
|
|
92
88
|
"uuid": "^13.0.2"
|
|
93
89
|
},
|
|
@@ -105,10 +101,9 @@
|
|
|
105
101
|
"tsc-alias": "^1.8.16",
|
|
106
102
|
"tsx": "^4.7.0",
|
|
107
103
|
"twenty-shared": "0.0.0",
|
|
108
|
-
"twenty-ui": "0.1
|
|
104
|
+
"twenty-ui": "1.0.0-alpha.1",
|
|
109
105
|
"vite": "^8.0.0",
|
|
110
106
|
"vite-plugin-dts": "^4.5.4",
|
|
111
|
-
"vite-tsconfig-paths": "^4.2.1",
|
|
112
107
|
"wait-on": "^9.0.10"
|
|
113
108
|
},
|
|
114
109
|
"engines": {
|
|
@@ -135,9 +130,6 @@
|
|
|
135
130
|
"cli": [
|
|
136
131
|
"dist/cli/operations/index.d.ts"
|
|
137
132
|
],
|
|
138
|
-
"ui": [
|
|
139
|
-
"dist/ui/index.d.ts"
|
|
140
|
-
],
|
|
141
133
|
"front-component-renderer": [
|
|
142
134
|
"dist/front-component-renderer/index.d.ts"
|
|
143
135
|
],
|