twenty-sdk 2.9.0 → 2.10.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/CHANGELOG.md +25 -0
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs.map +1 -1
- package/dist/catalog-sync-BHD2q_KA.mjs +18 -0
- package/dist/catalog-sync-Dp2RKu2c.js +1 -0
- package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +2 -0
- package/dist/cli/utilities/build/manifest/utils/validate-conditional-availability-usage.d.ts +1 -0
- package/dist/cli/utilities/build/manifest/utils/validate-package-json-dependencies.d.ts +1 -0
- package/dist/cli/utilities/entity/entity-view-field-template.d.ts +3 -0
- package/dist/cli.cjs +93 -77
- package/dist/cli.mjs +1868 -1830
- package/dist/define/index.cjs +38 -16
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +871 -52
- package/dist/define/index.mjs +13655 -3526
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +37 -15
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +1 -135
- package/dist/front-component/index.mjs +12833 -3490
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/get-function-input-schema-DTlcRJz3-BweFaTLz.mjs +73 -0
- package/dist/get-function-input-schema-DTlcRJz3-DWdkAlue.js +1 -0
- package/dist/logic-function/index.cjs +37 -1
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +33 -2
- package/dist/logic-function/index.mjs +97 -28
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-oauth-DSC3zo9c.mjs → login-oauth-BPSmh2dn.mjs} +15214 -4936
- package/dist/login-oauth-DnF6U1Ak.js +340 -0
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +2 -2
- package/dist/ui/index.cjs +48 -26
- package/dist/ui/index.mjs +20941 -11460
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +11 -9
- package/dist/catalog-sync-CanLpG9v.js +0 -1
- package/dist/catalog-sync-DyCidT5d.mjs +0 -16
- package/dist/get-function-input-schema-BZ7_XyUh-COeGJwHh.js +0 -1
- package/dist/get-function-input-schema-BZ7_XyUh-Dql7-b-j.mjs +0 -62
- package/dist/login-oauth-BESuSxoP.js +0 -298
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\",
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", N = \"generated\", t = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", I = \"Standard\", P = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar o = /* @__PURE__ */ ((e) => (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))(o || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n r as DEFAULT_APP_ACCESS_TOKEN_NAME,\n N as GENERATED_DIR,\n t as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n o as SyncableEntity,\n I as TWENTY_STANDARD_APPLICATION_NAME,\n P as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\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"],"names":["T","r","decodeTokenPayload","token","payload","getPublicAssetUrl","path","apiUrl","DEFAULT_API_URL_NAME","DEFAULT_APP_ACCESS_TOKEN_NAME","workspaceId","applicationId","withoutLeadingSlash","encodedPath"],"mappings":"gFAAK,MAAqCA,EAAI,iBAAkBC,EAAI,0BCK9DC,EACJC,GACmD,CACnD,MAAMC,EAAU,KAAK,MAAM,KAAKD,EAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAEpD,MAAO,CACL,YAAaC,EAAQ,YACrB,cAAeA,EAAQ,aAAA,CAE3B,EAKaC,EAAqBC,GAAyB,CACzD,MAAMC,EAAS,QAAQ,IAAIC,CAAoB,EACzCL,EAAQ,QAAQ,IAAIM,CAA6B,EAEvD,GAAI,CAACF,GAAU,CAACJ,EACd,MAAM,IAAI,MACR,sFAAA,EAIJ,KAAM,CAAE,YAAAO,EAAa,cAAAC,GAAkBT,EAAmBC,CAAK,EACzDS,EAAsBN,EAAK,WAAW,GAAG,EAAIA,EAAK,MAAM,CAAC,EAAIA,EAK7DO,GAJmBD,EAAoB,WAAW,SAAS,EAC7DA,EACA,UAAUA,CAAmB,IAG9B,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAAG,EAEX,MAAO,GAAGL,CAAM,kBAAkBG,CAAW,IAAIC,CAAa,IAAIE,CAAW,EAC/E"}
|
package/dist/utils/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\",
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/utils/get-public-asset-url.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", N = \"generated\", t = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", I = \"Standard\", P = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar o = /* @__PURE__ */ ((e) => (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))(o || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n r as DEFAULT_APP_ACCESS_TOKEN_NAME,\n N as GENERATED_DIR,\n t as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n o as SyncableEntity,\n I as TWENTY_STANDARD_APPLICATION_NAME,\n P as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\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"],"names":["T","r","decodeTokenPayload","token","payload","getPublicAssetUrl","path","apiUrl","DEFAULT_API_URL_NAME","DEFAULT_APP_ACCESS_TOKEN_NAME","workspaceId","applicationId","withoutLeadingSlash","encodedPath"],"mappings":"AAAK,MAAqCA,IAAI,kBAAkBC,IAAI,2BCK9DC,IAAqB,CACzBC,MACmD;AACnD,QAAMC,IAAU,KAAK,MAAM,KAAKD,EAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;AAEpD,SAAO;AAAA,IACL,aAAaC,EAAQ;AAAA,IACrB,eAAeA,EAAQ;AAAA,EAAA;AAE3B,GAKaC,IAAoB,CAACC,MAAyB;AACzD,QAAMC,IAAS,QAAQ,IAAIC,CAAoB,GACzCL,IAAQ,QAAQ,IAAIM,CAA6B;AAEvD,MAAI,CAACF,KAAU,CAACJ;AACd,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAIJ,QAAM,EAAE,aAAAO,GAAa,eAAAC,MAAkBT,EAAmBC,CAAK,GACzDS,IAAsBN,EAAK,WAAW,GAAG,IAAIA,EAAK,MAAM,CAAC,IAAIA,GAK7DO,KAJmBD,EAAoB,WAAW,SAAS,IAC7DA,IACA,UAAUA,CAAmB,IAG9B,MAAM,GAAG,EACT,IAAI,kBAAkB,EACtB,KAAK,GAAG;AAEX,SAAO,GAAGL,CAAM,kBAAkBG,CAAW,IAAIC,CAAa,IAAIE,CAAW;AAC/E;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"twenty": "dist/cli.cjs"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"README.md",
|
|
11
|
+
"CHANGELOG.md",
|
|
11
12
|
"package.json"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
@@ -70,14 +71,12 @@
|
|
|
70
71
|
},
|
|
71
72
|
"license": "AGPL-3.0",
|
|
72
73
|
"dependencies": {
|
|
73
|
-
"@genql/cli": "^3.0.3",
|
|
74
74
|
"@genql/runtime": "^2.10.0",
|
|
75
75
|
"@sniptt/guards": "^0.2.0",
|
|
76
76
|
"axios": "^1.13.5",
|
|
77
77
|
"chalk": "^5.3.0",
|
|
78
78
|
"chokidar": "^4.0.0",
|
|
79
79
|
"commander": "^12.0.0",
|
|
80
|
-
"dotenv": "^16.4.0",
|
|
81
80
|
"esbuild": "^0.25.0",
|
|
82
81
|
"graphql": "^16.8.1",
|
|
83
82
|
"graphql-sse": "^2.5.4",
|
|
@@ -88,14 +87,12 @@
|
|
|
88
87
|
"react": "^19.0.0",
|
|
89
88
|
"react-dom": "^19.0.0",
|
|
90
89
|
"tinyglobby": "^0.2.15",
|
|
91
|
-
"twenty-client-sdk": "2.
|
|
92
|
-
"typescript": "^5.9.
|
|
93
|
-
"uuid": "^13.0.0"
|
|
94
|
-
"vite": "^7.0.0",
|
|
95
|
-
"vite-tsconfig-paths": "^4.2.1",
|
|
96
|
-
"zod": "^4.1.11"
|
|
90
|
+
"twenty-client-sdk": "2.10.0",
|
|
91
|
+
"typescript": "^5.9.3",
|
|
92
|
+
"uuid": "^13.0.0"
|
|
97
93
|
},
|
|
98
94
|
"devDependencies": {
|
|
95
|
+
"@genql/cli": "^3.0.3",
|
|
99
96
|
"@prettier/sync": "^0.5.2",
|
|
100
97
|
"@types/inquirer": "^9.0.0",
|
|
101
98
|
"@types/node": "^24.0.0",
|
|
@@ -110,7 +107,9 @@
|
|
|
110
107
|
"tsx": "^4.7.0",
|
|
111
108
|
"twenty-shared": "0.0.0",
|
|
112
109
|
"twenty-ui": "0.0.0",
|
|
110
|
+
"vite": "^7.0.0",
|
|
113
111
|
"vite-plugin-dts": "^4.5.4",
|
|
112
|
+
"vite-tsconfig-paths": "^4.2.1",
|
|
114
113
|
"wait-on": "^7.2.0"
|
|
115
114
|
},
|
|
116
115
|
"engines": {
|
|
@@ -119,6 +118,9 @@
|
|
|
119
118
|
},
|
|
120
119
|
"typesVersions": {
|
|
121
120
|
"*": {
|
|
121
|
+
"billing": [
|
|
122
|
+
"dist/billing/index.d.ts"
|
|
123
|
+
],
|
|
122
124
|
"define": [
|
|
123
125
|
"dist/define/index.d.ts"
|
|
124
126
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./login-oauth-BESuSxoP.js"),r=require("chalk"),l=e=>e&&e.__esModule?e:{default:e},t=l(r);class s{async execute(c){c.remote&&o.ConfigService.setActiveRemote(c.remote),console.log(t.default.blue("Syncing marketplace catalog..."));const a=await new o.ApiService().syncMarketplaceCatalog();a.success||(console.error(t.default.red(`Catalog sync failed: ${a.error instanceof Error?a.error.message:String(a.error)}`)),process.exit(1)),console.log(t.default.green("✓ Marketplace catalog synced successfully"))}}exports.CatalogSyncCommand=s;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { C as o, A as a } from "./login-oauth-DSC3zo9c.mjs";
|
|
2
|
-
import r from "chalk";
|
|
3
|
-
class n {
|
|
4
|
-
async execute(c) {
|
|
5
|
-
c.remote && o.setActiveRemote(c.remote), console.log(r.blue("Syncing marketplace catalog..."));
|
|
6
|
-
const e = await new a().syncMarketplaceCatalog();
|
|
7
|
-
e.success || (console.error(
|
|
8
|
-
r.red(
|
|
9
|
-
`Catalog sync failed: ${e.error instanceof Error ? e.error.message : String(e.error)}`
|
|
10
|
-
)
|
|
11
|
-
), process.exit(1)), console.log(r.green("✓ Marketplace catalog synced successfully"));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
n as CatalogSyncCommand
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("typescript"),o=require("./login-oauth-BESuSxoP.js"),c=n=>{switch(n.kind){case e.SyntaxKind.NumberKeyword:return{type:"number"};case e.SyntaxKind.StringKeyword:return{type:"string"};case e.SyntaxKind.BooleanKeyword:return{type:"boolean"};case e.SyntaxKind.ArrayType:return{type:"array",items:c(n.elementType)};case e.SyntaxKind.ObjectKeyword:return{type:"object"};case e.SyntaxKind.TypeLiteral:{const i={};return n.members.forEach(t=>{if(o.o(t.name)&&o.o(t.type)){const r=t.name.text;i[r]=c(t.type)}}),{type:"object",properties:i}}case e.SyntaxKind.UnionType:{const i=n,t=[];let r=!0;return i.types.forEach(a=>{if(a.kind===e.SyntaxKind.LiteralType){const y=a.literal;y.kind===e.SyntaxKind.StringLiteral?t.push(y.text):r=!1}else r=!1}),r?{type:"string",enum:t}:{}}default:return{}}},d=(n,i)=>n.parameters.reduce((t,r)=>{const a=r.type;return o.o(a)?[...t,c(a)]:[...t,{}]},i),s=n=>n.kind===e.SyntaxKind.FunctionDeclaration?[n]:n.kind===e.SyntaxKind.VariableStatement?n.declarationList.declarations.filter(i=>o.o(i.initializer)&&i.initializer.kind===e.SyntaxKind.ArrowFunction).map(i=>i.initializer):[],l=n=>{const i=e.createSourceFile("temp.ts",n,e.ScriptTarget.ESNext,!0);let t=[];return i.forEachChild(r=>{(r.kind===e.SyntaxKind.FunctionDeclaration||r.kind===e.SyntaxKind.VariableStatement)&&s(r).forEach(a=>{t=d(a,t)})}),t};exports.getFunctionInputSchema=l;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { createSourceFile as p, ScriptTarget as l, SyntaxKind as t } from "typescript";
|
|
2
|
-
import { o } from "./login-oauth-DSC3zo9c.mjs";
|
|
3
|
-
const c = (r) => {
|
|
4
|
-
switch (r.kind) {
|
|
5
|
-
case t.NumberKeyword:
|
|
6
|
-
return { type: "number" };
|
|
7
|
-
case t.StringKeyword:
|
|
8
|
-
return { type: "string" };
|
|
9
|
-
case t.BooleanKeyword:
|
|
10
|
-
return { type: "boolean" };
|
|
11
|
-
case t.ArrayType:
|
|
12
|
-
return {
|
|
13
|
-
type: "array",
|
|
14
|
-
items: c(r.elementType)
|
|
15
|
-
};
|
|
16
|
-
case t.ObjectKeyword:
|
|
17
|
-
return { type: "object" };
|
|
18
|
-
case t.TypeLiteral: {
|
|
19
|
-
const n = {};
|
|
20
|
-
return r.members.forEach((e) => {
|
|
21
|
-
if (o(e.name) && o(e.type)) {
|
|
22
|
-
const i = e.name.text;
|
|
23
|
-
n[i] = c(e.type);
|
|
24
|
-
}
|
|
25
|
-
}), { type: "object", properties: n };
|
|
26
|
-
}
|
|
27
|
-
case t.UnionType: {
|
|
28
|
-
const n = r, e = [];
|
|
29
|
-
let i = !0;
|
|
30
|
-
return n.types.forEach((a) => {
|
|
31
|
-
if (a.kind === t.LiteralType) {
|
|
32
|
-
const s = a.literal;
|
|
33
|
-
s.kind === t.StringLiteral ? e.push(s.text) : i = !1;
|
|
34
|
-
} else
|
|
35
|
-
i = !1;
|
|
36
|
-
}), i ? { type: "string", enum: e } : {};
|
|
37
|
-
}
|
|
38
|
-
default:
|
|
39
|
-
return {};
|
|
40
|
-
}
|
|
41
|
-
}, u = (r, n) => r.parameters.reduce((e, i) => {
|
|
42
|
-
const a = i.type;
|
|
43
|
-
return o(a) ? [...e, c(a)] : [...e, {}];
|
|
44
|
-
}, n), y = (r) => r.kind === t.FunctionDeclaration ? [r] : r.kind === t.VariableStatement ? r.declarationList.declarations.filter(
|
|
45
|
-
(n) => o(n.initializer) && n.initializer.kind === t.ArrowFunction
|
|
46
|
-
).map((n) => n.initializer) : [], f = (r) => {
|
|
47
|
-
const n = p(
|
|
48
|
-
"temp.ts",
|
|
49
|
-
r,
|
|
50
|
-
l.ESNext,
|
|
51
|
-
!0
|
|
52
|
-
);
|
|
53
|
-
let e = [];
|
|
54
|
-
return n.forEachChild((i) => {
|
|
55
|
-
(i.kind === t.FunctionDeclaration || i.kind === t.VariableStatement) && y(i).forEach((a) => {
|
|
56
|
-
e = u(a, e);
|
|
57
|
-
});
|
|
58
|
-
}), e;
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
f as getFunctionInputSchema
|
|
62
|
-
};
|