twenty-sdk 2.35.1 → 2.38.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 (52) hide show
  1. package/dist/billing/index.cjs +3 -3
  2. package/dist/billing/index.cjs.map +1 -1
  3. package/dist/billing/index.d.ts +25 -4
  4. package/dist/billing/index.mjs +495 -464
  5. package/dist/billing/index.mjs.map +1 -1
  6. package/dist/catalog-sync-DB_oIbry.js +1 -0
  7. package/dist/{catalog-sync-C82Xfr2f.mjs → catalog-sync-TFrxc_Y6.mjs} +4 -4
  8. package/dist/cli/commands/dev/dev-once.d.ts +1 -0
  9. package/dist/cli/commands/dev/dev.d.ts +1 -0
  10. package/dist/cli/operations/dev-once.d.ts +1 -0
  11. package/dist/cli/utilities/api/api-service.d.ts +3 -0
  12. package/dist/cli/utilities/api/application-api.d.ts +1 -0
  13. package/dist/cli/utilities/api/file-api.d.ts +41 -0
  14. package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +1 -0
  15. package/dist/cli/utilities/dev/orchestrator/steps/format-sync-actions-plan.d.ts +8 -1
  16. package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +3 -1
  17. package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +1 -0
  18. package/dist/cli/utilities/entity/entity-view-template.d.ts +1 -1
  19. package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
  20. package/dist/cli/utilities/file/file-uploader.d.ts +13 -4
  21. package/dist/cli/utilities/file/put-file-to-upload-url.d.ts +5 -0
  22. package/dist/cli.cjs +30 -30
  23. package/dist/cli.mjs +5455 -5421
  24. package/dist/define/index.cjs +14 -14
  25. package/dist/define/index.cjs.map +1 -1
  26. package/dist/define/index.d.ts +340 -26
  27. package/dist/define/index.mjs +6104 -5955
  28. package/dist/define/index.mjs.map +1 -1
  29. package/dist/front-component/index.cjs +1 -1
  30. package/dist/front-component/index.cjs.map +1 -1
  31. package/dist/front-component/index.d.ts +23 -6
  32. package/dist/front-component/index.mjs +2 -2
  33. package/dist/front-component/index.mjs.map +1 -1
  34. package/dist/front-component-renderer/build.cjs +1 -1
  35. package/dist/front-component-renderer/build.mjs +1 -1
  36. package/dist/{get-front-component-build-plugins-D9VJQHw7.mjs → get-front-component-build-plugins-Bed7hCGi.mjs} +105 -91
  37. package/dist/{get-front-component-build-plugins-CcV3Cown.js → get-front-component-build-plugins-o8cM1FFZ.js} +8 -8
  38. package/dist/{get-function-input-schema-GNk3NRLJ-Byssjp8I.js → get-function-input-schema-GNk3NRLJ-A3CmF1qq.js} +1 -1
  39. package/dist/{get-function-input-schema-GNk3NRLJ-Dm0Ljlg4.mjs → get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs} +1 -1
  40. package/dist/logic-function/index.cjs +6 -4
  41. package/dist/logic-function/index.cjs.map +1 -1
  42. package/dist/logic-function/index.d.ts +24 -3
  43. package/dist/logic-function/index.mjs +28 -14
  44. package/dist/logic-function/index.mjs.map +1 -1
  45. package/dist/{login-cG7hCrTK.js → login-2yrPIORt.js} +89 -66
  46. package/dist/{login-BsiMC4oB.mjs → login-QYv7vAbh.mjs} +5011 -4705
  47. package/dist/operations.cjs +1 -1
  48. package/dist/operations.mjs +4 -4
  49. package/dist/utils/index.cjs.map +1 -1
  50. package/dist/utils/index.mjs.map +1 -1
  51. package/package.json +2 -2
  52. package/dist/catalog-sync-Bs-X2ChV.js +0 -1
@@ -0,0 +1 @@
1
+ const e=require("./get-front-component-build-plugins-o8cM1FFZ.js"),t=require("./login-2yrPIORt.js");let n=require("chalk");n=e.Mt(n);var r=class{async execute(e){e.remote&&t.K.setActiveRemote(e.remote);let r=t.K.getActiveRemote();console.log(n.default.blue(`Syncing marketplace catalog on ${r}...`));let i=await new t.H().syncMarketplaceCatalog();i.success||(console.error(n.default.red(`Catalog sync failed: ${i.error instanceof Error?i.error.message:String(i.error)}`)),process.exit(1)),console.log(n.default.green(`✓ Marketplace catalog synced successfully`))}};exports.CatalogSyncCommand=r;
@@ -2,15 +2,15 @@ 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 { U as r, z as i } from "./login-BsiMC4oB.mjs";
5
+ import { H as r, K as i } from "./login-QYv7vAbh.mjs";
6
6
  import a from "chalk";
7
7
  //#region src/cli/commands/dev/catalog-sync.ts
8
8
  var o = class {
9
9
  async execute(e) {
10
- e.remote && r.setActiveRemote(e.remote);
11
- let t = r.getActiveRemote();
10
+ e.remote && i.setActiveRemote(e.remote);
11
+ let t = i.getActiveRemote();
12
12
  console.log(a.blue(`Syncing marketplace catalog on ${t}...`));
13
- let n = await new i().syncMarketplaceCatalog();
13
+ let n = await new r().syncMarketplaceCatalog();
14
14
  n.success || (console.error(a.red(`Catalog sync failed: ${n.error instanceof Error ? n.error.message : String(n.error)}`)), process.exit(1)), console.log(a.green("✓ Marketplace catalog synced successfully"));
15
15
  }
16
16
  };
@@ -3,6 +3,7 @@ export type AppDevOnceCommandOptions = {
3
3
  verbose?: boolean;
4
4
  apply?: boolean;
5
5
  force?: boolean;
6
+ inferDeletionFromMissingEntities?: boolean;
6
7
  };
7
8
  export declare class AppDevOnceCommand {
8
9
  execute(options: AppDevOnceCommandOptions): Promise<void>;
@@ -5,6 +5,7 @@ export type AppDevOptions = {
5
5
  verbose?: boolean;
6
6
  debounceMs?: number;
7
7
  force?: boolean;
8
+ inferDeletionFromMissingEntities?: boolean;
8
9
  };
9
10
  export declare class AppDevCommand {
10
11
  private orchestrator;
@@ -4,6 +4,7 @@ export type AppDevOnceOptions = {
4
4
  verbose?: boolean;
5
5
  apply?: boolean;
6
6
  force?: boolean;
7
+ inferDeletionFromMissingEntities?: boolean;
7
8
  onProgress?: (message: string) => void;
8
9
  onPlan?: (text: string) => void;
9
10
  confirmApply?: (deleteCount: number) => Promise<boolean>;
@@ -56,6 +56,7 @@ export declare class ApiService {
56
56
  }>>;
57
57
  syncApplication(manifest: Manifest, options?: {
58
58
  dryRun?: boolean;
59
+ inferDeletionFromMissingEntities?: boolean;
59
60
  }): Promise<ApiResponse<{
60
61
  applicationUniversalIdentifier: string;
61
62
  actions: SyncAction[];
@@ -93,5 +94,7 @@ export declare class ApiService {
93
94
  }>>;
94
95
  installTarballApp(...args: Parameters<FileApi['installTarballApp']>): Promise<ApiResponse<boolean, MetadataValidationErrorResponse>>;
95
96
  uploadFile(...args: Parameters<FileApi['uploadFile']>): Promise<ApiResponse<boolean>>;
97
+ createApplicationFileUploads(...args: Parameters<FileApi['createApplicationFileUploads']>): Promise<ApiResponse<import("../../../cli/utilities/api/file-api").CreateApplicationFileUploadsResult>>;
98
+ completeApplicationFileUploads(...args: Parameters<FileApi['completeApplicationFileUploads']>): Promise<ApiResponse<import("../../../cli/utilities/api/file-api").CompleteApplicationFileUploadsResult>>;
96
99
  }
97
100
  export {};
@@ -45,6 +45,7 @@ export declare class ApplicationApi {
45
45
  }>>;
46
46
  syncApplication(manifest: Manifest, options?: {
47
47
  dryRun?: boolean;
48
+ inferDeletionFromMissingEntities?: boolean;
48
49
  }): Promise<ApiResponse<{
49
50
  applicationUniversalIdentifier: string;
50
51
  actions: SyncAction[];
@@ -2,6 +2,38 @@ import { type ApiResponse } from '../../../cli/utilities/api/api-response-type';
2
2
  import { type AxiosInstance } from 'axios';
3
3
  import { type MetadataValidationErrorResponse } from 'twenty-shared/metadata';
4
4
  import { type FileFolder } from 'twenty-shared/types';
5
+ export type ApplicationFileUploadRequest = {
6
+ fileFolder: FileFolder;
7
+ filePath: string;
8
+ size: number;
9
+ };
10
+ export type ApplicationFileUploadTarget = {
11
+ fileId: string;
12
+ filePath: string;
13
+ uploadUrl: string;
14
+ contentType: string;
15
+ expiresAt: string;
16
+ };
17
+ export type ApplicationFileUploadError = {
18
+ fileFolder: string;
19
+ filePath: string;
20
+ message: string;
21
+ };
22
+ export type CreateApplicationFileUploadsResult = {
23
+ targets: ApplicationFileUploadTarget[];
24
+ errors: ApplicationFileUploadError[];
25
+ };
26
+ export type ApplicationFileCompletionError = {
27
+ fileId: string;
28
+ message: string;
29
+ };
30
+ export type CompleteApplicationFileUploadsResult = {
31
+ files: {
32
+ id: string;
33
+ path: string;
34
+ }[];
35
+ errors: ApplicationFileCompletionError[];
36
+ };
5
37
  export declare class FileApi {
6
38
  private readonly client;
7
39
  constructor(client: AxiosInstance);
@@ -22,4 +54,13 @@ export declare class FileApi {
22
54
  fileFolder: FileFolder;
23
55
  applicationUniversalIdentifier: string;
24
56
  }): Promise<ApiResponse<boolean>>;
57
+ createApplicationFileUploads({ applicationUniversalIdentifier, files }: {
58
+ applicationUniversalIdentifier: string;
59
+ files: ApplicationFileUploadRequest[];
60
+ }): Promise<ApiResponse<CreateApplicationFileUploadsResult>>;
61
+ completeApplicationFileUploads({ applicationUniversalIdentifier, fileIds }: {
62
+ applicationUniversalIdentifier: string;
63
+ fileIds: string[];
64
+ }): Promise<ApiResponse<CompleteApplicationFileUploadsResult>>;
65
+ private runMetadataMutation;
25
66
  }
@@ -4,6 +4,7 @@ export type DevModeOrchestratorOptions = {
4
4
  debounceMs?: number;
5
5
  verbose?: boolean;
6
6
  force?: boolean;
7
+ inferDeletionFromMissingEntities?: boolean;
7
8
  interactive?: boolean;
8
9
  onExit?: (params: {
9
10
  code: number;
@@ -8,4 +8,11 @@ export declare const selectEntityAttributes: (flatEntity: {
8
8
  nameSingular?: string | null | undefined;
9
9
  universalIdentifier?: string | null | undefined;
10
10
  } | undefined) => [string, unknown][];
11
- export declare const formatSyncActionsPlan: (actions: SyncAction[] | undefined) => string;
11
+ export declare const NO_DELETE_HINT = "Entities missing from your source are destroyed by default. Re-run with --no-delete to keep them.";
12
+ export declare const shouldShowNoDeleteHint: ({ actions, inferDeletionFromMissingEntities, }: {
13
+ actions: SyncAction[] | undefined;
14
+ inferDeletionFromMissingEntities: boolean;
15
+ }) => boolean;
16
+ export declare const formatSyncActionsPlan: (actions: SyncAction[] | undefined, options?: {
17
+ showNoDeleteHint?: boolean | undefined;
18
+ } | undefined) => string;
@@ -11,14 +11,16 @@ export declare class SyncApplicationOrchestratorStep {
11
11
  private notify;
12
12
  private verbose;
13
13
  private force;
14
+ private inferDeletionFromMissingEntities;
14
15
  private interactive;
15
16
  private onExit?;
16
- constructor({ apiService, state, notify, verbose, force, interactive, onExit }: {
17
+ constructor({ apiService, state, notify, verbose, force, inferDeletionFromMissingEntities, interactive, onExit }: {
17
18
  apiService: ApiService;
18
19
  state: OrchestratorState;
19
20
  notify: () => void;
20
21
  verbose?: boolean;
21
22
  force?: boolean;
23
+ inferDeletionFromMissingEntities?: boolean;
22
24
  interactive?: boolean;
23
25
  onExit?: (params: {
24
26
  code: number;
@@ -28,4 +28,5 @@ export declare class UploadFilesOrchestratorStep {
28
28
  private logUploadSummary;
29
29
  private resetCounters;
30
30
  private uploadPendingFiles;
31
+ private queueUploads;
31
32
  }
@@ -1,4 +1,4 @@
1
- import { type ViewType } from 'twenty-shared/types';
1
+ import { ViewType } from 'twenty-shared/types';
2
2
  type ViewFieldTemplateBase = {
3
3
  universalIdentifier?: string;
4
4
  position: number;
@@ -1,5 +1,6 @@
1
1
  export declare const getGraphQLErrorCode: (error: unknown) => string | undefined;
2
2
  export declare const getGraphQLErrorSubCode: (error: unknown) => string | undefined;
3
+ export declare const getGraphQLErrorMessage: (error: unknown) => string | undefined;
3
4
  export declare const hasGraphQLErrorSubCode: (error: unknown, subCode: string) => boolean;
4
5
  export declare const isGraphQLNotFoundError: (error: unknown) => boolean;
5
6
  export declare const getOAuthError: (body: unknown) => string | undefined;
@@ -1,4 +1,12 @@
1
1
  import { type FileFolder } from 'twenty-shared/types';
2
+ export type FileToUpload = {
3
+ builtPath: string;
4
+ fileFolder: FileFolder;
5
+ };
6
+ export type FileUploadFailure = {
7
+ builtPath: string;
8
+ error: string;
9
+ };
2
10
  export declare class FileUploader {
3
11
  private apiService;
4
12
  private applicationUniversalIdentifier;
@@ -7,8 +15,9 @@ export declare class FileUploader {
7
15
  applicationUniversalIdentifier: string;
8
16
  appPath: string;
9
17
  });
10
- uploadFile({ builtPath, fileFolder }: {
11
- builtPath: string;
12
- fileFolder: FileFolder;
13
- }): Promise<import("../api/api-response-type").ApiResponse<boolean>>;
18
+ uploadFiles(files: FileToUpload[]): Promise<FileUploadFailure[]>;
19
+ private uploadBatch;
20
+ private uploadBatchWithMultipartMutation;
21
+ private failWholeBatch;
22
+ private runWithConcurrency;
14
23
  }
@@ -0,0 +1,5 @@
1
+ export declare const putFileToUploadUrl: ({ absolutePath, uploadUrl, contentType, }: {
2
+ absolutePath: string;
3
+ uploadUrl: string;
4
+ contentType: string;
5
+ }) => Promise<void>;