twenty-sdk 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/billing/index.cjs +2 -0
  2. package/dist/billing/index.cjs.map +1 -0
  3. package/dist/billing/index.d.ts +10 -0
  4. package/dist/billing/index.mjs +43 -0
  5. package/dist/billing/index.mjs.map +1 -0
  6. package/dist/cli/commands/add.d.ts +3 -1
  7. package/dist/cli/utilities/build/common/plugins/stub-twenty-sdk-define.plugin.d.ts +7 -0
  8. package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +4 -2
  9. package/dist/cli/utilities/entity/entity-page-layout-tab-template.d.ts +3 -0
  10. package/dist/cli/utilities/entity/entity-record-page-layout-template.d.ts +5 -0
  11. package/dist/cli/utilities/entity/entity-view-template.d.ts +9 -3
  12. package/dist/cli.cjs +123 -55
  13. package/dist/cli.mjs +2183 -2020
  14. package/dist/define/index.cjs +13 -13
  15. package/dist/define/index.cjs.map +1 -1
  16. package/dist/define/index.d.ts +29 -4
  17. package/dist/define/index.mjs +995 -978
  18. package/dist/define/index.mjs.map +1 -1
  19. package/dist/front-component/index.cjs +9 -9
  20. package/dist/front-component/index.cjs.map +1 -1
  21. package/dist/front-component/index.d.ts +6 -2
  22. package/dist/front-component/index.mjs +44 -42
  23. package/dist/front-component/index.mjs.map +1 -1
  24. package/dist/{get-function-input-schema-BZ7_XyUh-0e9upvLV.mjs → get-function-input-schema-BZ7_XyUh-CKgoFzji.mjs} +1 -1
  25. package/dist/{get-function-input-schema-BZ7_XyUh-CoN3o7CS.js → get-function-input-schema-BZ7_XyUh-D38OurwZ.js} +1 -1
  26. package/dist/logic-function/index.cjs +2 -0
  27. package/dist/logic-function/index.cjs.map +1 -0
  28. package/dist/logic-function/index.d.ts +215 -0
  29. package/dist/logic-function/index.mjs +2 -0
  30. package/dist/logic-function/index.mjs.map +1 -0
  31. package/dist/operations.cjs +1 -1
  32. package/dist/operations.mjs +2 -2
  33. package/dist/{uninstall-CsGNVq-c.mjs → uninstall-Bw-TK4rL.mjs} +3955 -3701
  34. package/dist/{uninstall-CV3Frzv-.js → uninstall-CYiYoBPe.js} +70 -45
  35. package/package.json +15 -2
  36. package/dist/cli/utilities/build/manifest/utils/generate-default-field-universal-identifier.d.ts +0 -5
@@ -1,5 +1,5 @@
1
1
  import { createSourceFile as p, ScriptTarget as l, SyntaxKind as t } from "typescript";
2
- import { o } from "./uninstall-CsGNVq-c.mjs";
2
+ import { o } from "./uninstall-Bw-TK4rL.mjs";
3
3
  const c = (r) => {
4
4
  switch (r.kind) {
5
5
  case t.NumberKeyword:
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("typescript"),o=require("./uninstall-CV3Frzv-.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{}}},s=(n,i)=>n.parameters.reduce((t,r)=>{const a=r.type;return o.o(a)?[...t,c(a)]:[...t,{}]},i),d=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)&&d(r).forEach(a=>{t=s(a,t)})}),t};exports.getFunctionInputSchema=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("typescript"),o=require("./uninstall-CYiYoBPe.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{}}},s=(n,i)=>n.parameters.reduce((t,r)=>{const a=r.type;return o.o(a)?[...t,c(a)]:[...t,{}]},i),d=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)&&d(r).forEach(a=>{t=s(a,t)})}),t};exports.getFunctionInputSchema=l;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,215 @@
1
+ type SyncableEntityOptions = {
2
+ universalIdentifier: string;
3
+ };
4
+
5
+ declare enum HTTPMethod {
6
+ GET = "GET",
7
+ POST = "POST",
8
+ PUT = "PUT",
9
+ PATCH = "PATCH",
10
+ DELETE = "DELETE"
11
+ }
12
+
13
+ /**
14
+ * AWS HTTP API v2 compatible request format for logic functions
15
+ * @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
16
+ *
17
+ * @typeParam TBody - The type of the request body. Defaults to `object` for parsed JSON bodies.
18
+ */
19
+ type LogicFunctionEvent<TBody = object> = {
20
+ /** HTTP headers (filtered by forwardedRequestHeaders in route trigger) */
21
+ headers: Record<string, string | undefined>;
22
+ /** Query string parameters (multiple values are joined with commas, e.g., "1,2,3") */
23
+ queryStringParameters: Record<string, string | undefined>;
24
+ /** Path parameters extracted from the route pattern (e.g., /users/:id → { id: '123' }). Multiple values are joined with commas. */
25
+ pathParameters: Record<string, string | undefined>;
26
+ /** Request body */
27
+ body: TBody | null;
28
+ /** Whether the body is base64 encoded */
29
+ isBase64Encoded: boolean;
30
+ /** Request context containing HTTP method, path, and other metadata */
31
+ requestContext: {
32
+ http: {
33
+ /** HTTP method (GET, POST, PUT, PATCH, DELETE) */
34
+ method: string;
35
+ /** Raw request path (e.g., /users/123) */
36
+ path: string;
37
+ };
38
+ };
39
+ };
40
+
41
+ type InputJsonSchema = {
42
+ type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'integer' | 'null';
43
+ description?: string;
44
+ enum?: unknown[];
45
+ items?: InputJsonSchema;
46
+ properties?: Record<string, InputJsonSchema>;
47
+ required?: string[];
48
+ additionalProperties?: boolean | InputJsonSchema;
49
+ minimum?: number;
50
+ maximum?: number;
51
+ };
52
+
53
+ type LogicFunctionManifest = SyncableEntityOptions & {
54
+ name?: string;
55
+ description?: string;
56
+ timeoutSeconds?: number;
57
+ cronTriggerSettings?: CronTriggerSettings;
58
+ databaseEventTriggerSettings?: DatabaseEventTriggerSettings;
59
+ httpRouteTriggerSettings?: HttpRouteTriggerSettings;
60
+ sourceHandlerPath: string;
61
+ builtHandlerPath: string;
62
+ builtHandlerChecksum: string;
63
+ handlerName: string;
64
+ toolInputSchema: InputJsonSchema;
65
+ isTool?: boolean;
66
+ };
67
+ type CronTriggerSettings = {
68
+ pattern: string;
69
+ };
70
+ type DatabaseEventTriggerSettings = {
71
+ eventName: string;
72
+ updatedFields?: string[];
73
+ };
74
+ type HttpRouteTriggerSettings = {
75
+ path: string;
76
+ httpMethod: HTTPMethod | `${HTTPMethod}`;
77
+ isAuthRequired: boolean;
78
+ forwardedRequestHeaders?: string[];
79
+ };
80
+
81
+ type LogicFunctionHandler = (...args: any[]) => any | Promise<any>;
82
+ type LogicFunctionConfig = Omit<LogicFunctionManifest, 'sourceHandlerPath' | 'builtHandlerPath' | 'builtHandlerChecksum' | 'handlerName' | 'toolInputSchema'> & {
83
+ handler: LogicFunctionHandler;
84
+ toolInputSchema?: InputJsonSchema;
85
+ };
86
+
87
+ type InstallPayload = {
88
+ previousVersion?: string;
89
+ newVersion: string;
90
+ };
91
+ type InstallHandler = (payload: InstallPayload) => any | Promise<any>;
92
+
93
+ type CronPayload = Record<string, never>;
94
+
95
+ type ObjectRecordDiff<T> = {
96
+ [K in keyof T]: {
97
+ before: T[K];
98
+ after: T[K];
99
+ };
100
+ };
101
+
102
+ type Properties<T> = {
103
+ updatedFields?: string[];
104
+ before?: T;
105
+ after?: T;
106
+ diff?: Partial<ObjectRecordDiff<T>>;
107
+ };
108
+ declare class ObjectRecordBaseEvent<T = object> {
109
+ recordId: string;
110
+ userId?: string;
111
+ userWorkspaceId?: string;
112
+ workspaceMemberId?: string;
113
+ properties: Properties<T>;
114
+ }
115
+
116
+ declare class ObjectRecordDeleteEvent<T = object> extends ObjectRecordBaseEvent<T> {
117
+ properties: {
118
+ before: T;
119
+ after: T;
120
+ updatedFields: string[];
121
+ diff: Partial<ObjectRecordDiff<T>>;
122
+ };
123
+ }
124
+
125
+ declare class ObjectRecordUpdateEvent<T = object> extends ObjectRecordBaseEvent<T> {
126
+ properties: {
127
+ updatedFields: string[];
128
+ diff: Partial<ObjectRecordDiff<T>>;
129
+ before: T;
130
+ after: T;
131
+ };
132
+ }
133
+
134
+ declare class ObjectRecordCreateEvent<T = object> extends ObjectRecordBaseEvent<T> {
135
+ properties: {
136
+ after: T;
137
+ };
138
+ }
139
+
140
+ declare class ObjectRecordDestroyEvent<T = object> extends ObjectRecordBaseEvent<T> {
141
+ properties: {
142
+ before: T;
143
+ };
144
+ }
145
+
146
+ declare class ObjectRecordRestoreEvent<T = object> extends ObjectRecordCreateEvent<T> {
147
+ properties: {
148
+ before: T;
149
+ after: T;
150
+ updatedFields: string[];
151
+ diff: Partial<ObjectRecordDiff<T>>;
152
+ };
153
+ }
154
+
155
+ declare class ObjectRecordUpsertEvent<T = object> extends ObjectRecordBaseEvent<T> {
156
+ properties: {
157
+ before?: T;
158
+ after: T;
159
+ diff?: Partial<ObjectRecordDiff<T>>;
160
+ updatedFields?: string[];
161
+ };
162
+ }
163
+
164
+ type ObjectRecordEvent<T = object> = ObjectRecordUpdateEvent<T> | ObjectRecordDeleteEvent<T> | ObjectRecordCreateEvent<T> | ObjectRecordDestroyEvent<T> | ObjectRecordRestoreEvent<T> | ObjectRecordUpsertEvent<T>;
165
+
166
+ type SimplifiedFlatObjectMetadata = {
167
+ id: string;
168
+ nameSingular: string;
169
+ namePlural: string;
170
+ labelSingular: string;
171
+ labelPlural: string;
172
+ description: string | null;
173
+ icon: string | null;
174
+ universalIdentifier: string;
175
+ applicationId: string | null;
176
+ dataSourceId: string | null;
177
+ standardOverrides: null;
178
+ isCustom: boolean;
179
+ isRemote: boolean;
180
+ isActive: boolean;
181
+ isSystem: boolean;
182
+ isUIReadOnly: boolean;
183
+ isAuditLogged: boolean;
184
+ isSearchable: boolean;
185
+ duplicateCriteria: string[] | null;
186
+ shortcut: string | null;
187
+ labelIdentifierFieldMetadataId: string;
188
+ imageIdentifierFieldMetadataId: string | null;
189
+ isLabelSyncedWithName: boolean;
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ fieldIds: string[];
193
+ indexMetadataIds: string[];
194
+ viewIds: string[];
195
+ applicationUniversalIdentifier: string | null;
196
+ labelIdentifierFieldMetadataUniversalIdentifier: string;
197
+ imageIdentifierFieldMetadataUniversalIdentifier: string | null;
198
+ fieldUniversalIdentifiers: string[];
199
+ indexMetadataUniversalIdentifiers: string[];
200
+ viewUniversalIdentifiers: string[];
201
+ };
202
+ type WorkspaceEventBatch<WorkspaceEvent> = {
203
+ name: string;
204
+ workspaceId: string;
205
+ objectMetadata: SimplifiedFlatObjectMetadata;
206
+ userId: string;
207
+ userWorkspaceId: string;
208
+ workspaceMemberId: string;
209
+ recordId: string;
210
+ events: WorkspaceEvent[];
211
+ };
212
+ type DatabaseEventPayload<T = ObjectRecordEvent> = Omit<WorkspaceEventBatch<T>, 'events'> & T;
213
+
214
+ export { ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent };
215
+ export type { CronPayload, DatabaseEventPayload, InputJsonSchema, InstallHandler, InstallPayload, LogicFunctionConfig, LogicFunctionHandler, ObjectRecordEvent, LogicFunctionEvent as RoutePayload };
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./uninstall-CV3Frzv-.js"),a=async t=>(t?.remote&&e.ConfigService.setActiveRemote(t.remote),await new e.ConfigService().clearConfig(),{success:!0,data:void 0}),n=t=>e.runSafe(()=>a(t),e.AUTH_ERROR_CODES.AUTH_FAILED);exports.APP_ERROR_CODES=e.APP_ERROR_CODES;exports.AUTH_ERROR_CODES=e.AUTH_ERROR_CODES;exports.ConfigService=e.ConfigService;exports.FUNCTION_ERROR_CODES=e.FUNCTION_ERROR_CODES;exports.SERVER_ERROR_CODES=e.SERVER_ERROR_CODES;exports.appBuild=e.appBuild;exports.appDeploy=e.appDeploy;exports.appDevOnce=e.appDevOnce;exports.appInstall=e.appInstall;exports.appPublish=e.appPublish;exports.appUninstall=e.appUninstall;exports.authLogin=e.authLogin;exports.authLoginOAuth=e.authLoginOAuth;exports.detectLocalServer=e.detectLocalServer;exports.functionExecute=e.functionExecute;exports.serverStart=e.serverStart;exports.authLogout=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./uninstall-CYiYoBPe.js"),a=async t=>(t?.remote&&e.ConfigService.setActiveRemote(t.remote),await new e.ConfigService().clearConfig(),{success:!0,data:void 0}),n=t=>e.runSafe(()=>a(t),e.AUTH_ERROR_CODES.AUTH_FAILED);exports.APP_ERROR_CODES=e.APP_ERROR_CODES;exports.AUTH_ERROR_CODES=e.AUTH_ERROR_CODES;exports.ConfigService=e.ConfigService;exports.FUNCTION_ERROR_CODES=e.FUNCTION_ERROR_CODES;exports.SERVER_ERROR_CODES=e.SERVER_ERROR_CODES;exports.appBuild=e.appBuild;exports.appDeploy=e.appDeploy;exports.appDevOnce=e.appDevOnce;exports.appInstall=e.appInstall;exports.appPublish=e.appPublish;exports.appUninstall=e.appUninstall;exports.authLogin=e.authLogin;exports.authLoginOAuth=e.authLoginOAuth;exports.detectLocalServer=e.detectLocalServer;exports.functionExecute=e.functionExecute;exports.serverStart=e.serverStart;exports.authLogout=n;
@@ -1,5 +1,5 @@
1
- import { r as s, A as t, C as e } from "./uninstall-CsGNVq-c.mjs";
2
- import { a as u, F as R, S as E, b as S, c as O, d as f, e as g, f as l, g as _, h as v, i as A, j as C, k as h, s as D } from "./uninstall-CsGNVq-c.mjs";
1
+ import { r as s, A as t, C as e } from "./uninstall-Bw-TK4rL.mjs";
2
+ import { a as u, F as R, S as E, b as S, c as O, d as f, e as g, f as l, g as _, h as v, i as A, j as C, k as h, s as D } from "./uninstall-Bw-TK4rL.mjs";
3
3
  const o = async (a) => (a?.remote && e.setActiveRemote(a.remote), await new e().clearConfig(), { success: !0, data: void 0 }), c = (a) => s(() => o(a), t.AUTH_FAILED);
4
4
  export {
5
5
  u as APP_ERROR_CODES,