twenty-sdk 2.38.0 → 2.39.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 (47) hide show
  1. package/dist/billing/index.cjs.map +1 -1
  2. package/dist/billing/index.mjs.map +1 -1
  3. package/dist/catalog-sync-DjzVoO-K.js +1 -0
  4. package/dist/{catalog-sync-TFrxc_Y6.mjs → catalog-sync-PfHIDnN1.mjs} +1 -1
  5. package/dist/cli/commands/dev/pull.d.ts +8 -0
  6. package/dist/cli/operations/index.d.ts +2 -0
  7. package/dist/cli/operations/pull.d.ts +22 -0
  8. package/dist/cli/types.d.ts +1 -0
  9. package/dist/cli/utilities/api/api-service.d.ts +2 -0
  10. package/dist/cli/utilities/api/application-api.d.ts +2 -0
  11. package/dist/cli/utilities/pull/application-export-type.d.ts +24 -0
  12. package/dist/cli/utilities/pull/apply-pull-writes.d.ts +6 -0
  13. package/dist/cli/utilities/pull/build-pull-entities.d.ts +24 -0
  14. package/dist/cli/utilities/pull/format-pull-report.d.ts +13 -0
  15. package/dist/cli/utilities/pull/plan-pull-writes.d.ts +27 -0
  16. package/dist/cli/utilities/pull/print-typescript-value.d.ts +10 -0
  17. package/dist/cli/utilities/pull/pull-base-file.d.ts +10 -0
  18. package/dist/cli/utilities/pull/scan-project-define-files.d.ts +8 -0
  19. package/dist/cli/utilities/pull/write-define-file.d.ts +13 -0
  20. package/dist/cli.cjs +75 -71
  21. package/dist/cli.mjs +4963 -4878
  22. package/dist/define/index.cjs +14 -14
  23. package/dist/define/index.cjs.map +1 -1
  24. package/dist/define/index.d.ts +56 -2
  25. package/dist/define/index.mjs +2718 -2684
  26. package/dist/define/index.mjs.map +1 -1
  27. package/dist/front-component/index.cjs +1 -1
  28. package/dist/front-component/index.cjs.map +1 -1
  29. package/dist/front-component/index.d.ts +2 -0
  30. package/dist/front-component/index.mjs +2 -2
  31. package/dist/front-component/index.mjs.map +1 -1
  32. package/dist/front-component-renderer/build.cjs +1 -1
  33. package/dist/front-component-renderer/build.mjs +1 -1
  34. package/dist/{get-front-component-build-plugins-o8cM1FFZ.js → get-front-component-build-plugins-BR8EOlIe.js} +8 -8
  35. package/dist/{get-front-component-build-plugins-Bed7hCGi.mjs → get-front-component-build-plugins-BvcwEryG.mjs} +71 -69
  36. package/dist/{get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs → get-function-input-schema-GNk3NRLJ-BzSsW_zF.mjs} +1 -1
  37. package/dist/{get-function-input-schema-GNk3NRLJ-A3CmF1qq.js → get-function-input-schema-GNk3NRLJ-PouV48BW.js} +1 -1
  38. package/dist/logic-function/index.cjs.map +1 -1
  39. package/dist/logic-function/index.mjs.map +1 -1
  40. package/dist/{login-QYv7vAbh.mjs → login-CWJ1uQtK.mjs} +5836 -5270
  41. package/dist/{login-2yrPIORt.js → login-CXs7z3of.js} +97 -59
  42. package/dist/operations.cjs +1 -1
  43. package/dist/operations.mjs +4 -4
  44. package/dist/utils/index.cjs.map +1 -1
  45. package/dist/utils/index.mjs.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/catalog-sync-DB_oIbry.js +0 -1
@@ -0,0 +1 @@
1
+ const e=require("./get-front-component-build-plugins-BR8EOlIe.js"),t=require("./login-CXs7z3of.js");let n=require("chalk");n=e.Nt(n);var r=class{async execute(e){e.remote&&t.Y.setActiveRemote(e.remote);let r=t.Y.getActiveRemote();console.log(n.default.blue(`Syncing marketplace catalog on ${r}...`));let i=await new t.G().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,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 { H as r, K as i } from "./login-QYv7vAbh.mjs";
5
+ import { G as r, Y as i } from "./login-CWJ1uQtK.mjs";
6
6
  import a from "chalk";
7
7
  //#region src/cli/commands/dev/catalog-sync.ts
8
8
  var o = class {
@@ -0,0 +1,8 @@
1
+ export type AppPullCommandOptions = {
2
+ appPath?: string;
3
+ universalIdentifier?: string;
4
+ verbose?: boolean;
5
+ };
6
+ export declare class AppPullCommand {
7
+ execute(options: AppPullCommandOptions): Promise<void>;
8
+ }
@@ -13,6 +13,8 @@ export type { AppDevOnceOptions, AppDevOnceResult } from './dev-once';
13
13
  export { appInstall } from './install';
14
14
  export type { AppInstallOptions } from './install';
15
15
  export { appPublish } from './publish';
16
+ export { appPull } from './pull';
17
+ export type { AppPullOptions, AppPullResult } from './pull';
16
18
  export type { AppPublishOptions, AppPublishResult } from './publish';
17
19
  export { appUninstall } from './uninstall';
18
20
  export type { AppUninstallOptions } from './uninstall';
@@ -0,0 +1,22 @@
1
+ import { type CommandResult } from '../../cli/types';
2
+ import { type ApplicationExportCoverageEntry } from '../../cli/utilities/pull/application-export-type';
3
+ import { type SkippedPullEntity } from '../../cli/utilities/pull/build-pull-entities';
4
+ import { type PullDeletion, type PullWrite } from '../../cli/utilities/pull/plan-pull-writes';
5
+ export type AppPullOptions = {
6
+ appPath: string;
7
+ universalIdentifier?: string;
8
+ onProgress?: (message: string) => void;
9
+ };
10
+ export type AppPullResult = {
11
+ applicationDisplayName: string;
12
+ applicationUniversalIdentifier: string;
13
+ writes: PullWrite[];
14
+ deletions: PullDeletion[];
15
+ unchangedCount: number;
16
+ localOnlyRelativePaths: string[];
17
+ skipped: SkippedPullEntity[];
18
+ coverage: ApplicationExportCoverageEntry[];
19
+ unreadableRelativePaths: string[];
20
+ hadBase: boolean;
21
+ };
22
+ export declare const appPull: (options: AppPullOptions) => Promise<CommandResult<AppPullResult>>;
@@ -27,6 +27,7 @@ export declare const APP_ERROR_CODES: {
27
27
  readonly APPLY_ABORTED: "APPLY_ABORTED";
28
28
  readonly TYPECHECK_FAILED: "TYPECHECK_FAILED";
29
29
  readonly DEPLOY_FAILED: "DEPLOY_FAILED";
30
+ readonly PULL_FAILED: "PULL_FAILED";
30
31
  };
31
32
  export declare const SERVER_ERROR_CODES: {
32
33
  readonly DOCKER_NOT_INSTALLED: "DOCKER_NOT_INSTALLED";
@@ -2,6 +2,7 @@ import { type ApiResponse } from '../../../cli/utilities/api/api-response-type';
2
2
  import { ApplicationApi } from '../../../cli/utilities/api/application-api';
3
3
  import { FileApi } from '../../../cli/utilities/api/file-api';
4
4
  import { LogicFunctionApi } from '../../../cli/utilities/api/logic-function-api';
5
+ import { type ApplicationExport } from '../../../cli/utilities/pull/application-export-type';
5
6
  import { type Manifest } from 'twenty-shared/application';
6
7
  import { type MetadataValidationErrorResponse, type SyncAction } from 'twenty-shared/metadata';
7
8
  type ApiServiceOptions = {
@@ -61,6 +62,7 @@ export declare class ApiService {
61
62
  applicationUniversalIdentifier: string;
62
63
  actions: SyncAction[];
63
64
  }, MetadataValidationErrorResponse>>;
65
+ exportApplication(universalIdentifier: string): Promise<ApiResponse<ApplicationExport>>;
64
66
  uninstallApplication(universalIdentifier: string): Promise<ApiResponse>;
65
67
  syncMarketplaceCatalog(): Promise<ApiResponse<boolean>>;
66
68
  getSchema(options?: {
@@ -1,4 +1,5 @@
1
1
  import { type ApiResponse } from '../../../cli/utilities/api/api-response-type';
2
+ import { type ApplicationExport } from '../../../cli/utilities/pull/application-export-type';
2
3
  import { type AxiosInstance } from 'axios';
3
4
  import { type Manifest } from 'twenty-shared/application';
4
5
  import { type MetadataValidationErrorResponse, type SyncAction } from 'twenty-shared/metadata';
@@ -12,6 +13,7 @@ export declare class ApplicationApi {
12
13
  name: string;
13
14
  oAuthClientId: string;
14
15
  } | null>>;
16
+ exportApplication(universalIdentifier: string): Promise<ApiResponse<ApplicationExport>>;
15
17
  createApplicationRegistration(input: {
16
18
  name: string;
17
19
  universalIdentifier: string;
@@ -0,0 +1,24 @@
1
+ import { type Manifest } from 'twenty-shared/application';
2
+ export declare const APPLICATION_EXPORT_COVERAGE_STATUSES: readonly ["EXPORTED", "ENGINE_DERIVED", "EXCLUDED", "UNSUPPORTED", "FOREIGN_OWNED"];
3
+ export type ApplicationExportCoverageStatus = (typeof APPLICATION_EXPORT_COVERAGE_STATUSES)[number];
4
+ export type ApplicationExportCoverageEntry = {
5
+ metadataName: string;
6
+ universalIdentifier: string;
7
+ status: ApplicationExportCoverageStatus;
8
+ reason: string | null;
9
+ };
10
+ export type ApplicationExportFile = {
11
+ folder: string;
12
+ path: string;
13
+ content: string;
14
+ };
15
+ export type ApplicationExport = {
16
+ application: {
17
+ universalIdentifier: string;
18
+ displayName: string;
19
+ sourceType: string;
20
+ };
21
+ manifest: Manifest;
22
+ coverage: ApplicationExportCoverageEntry[];
23
+ files: ApplicationExportFile[];
24
+ };
@@ -0,0 +1,6 @@
1
+ import { type PullDeletion, type PullWrite } from '../../../cli/utilities/pull/plan-pull-writes';
2
+ export declare const applyPullWrites: ({ appPath, writes, deletions, }: {
3
+ appPath: string;
4
+ writes: PullWrite[];
5
+ deletions: PullDeletion[];
6
+ }) => Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { type EnumBinding } from '../../../cli/utilities/pull/write-define-file';
2
+ import { type Manifest } from 'twenty-shared/application';
3
+ export declare const PULL_ENTITY_KINDS: readonly ["application", "object", "field", "index"];
4
+ export type PullEntityKind = (typeof PULL_ENTITY_KINDS)[number];
5
+ export type PullEntity = {
6
+ kind: PullEntityKind;
7
+ universalIdentifier: string;
8
+ definer: string;
9
+ config: unknown;
10
+ enumBindings: EnumBinding[];
11
+ defaultFolder: string;
12
+ fileSuffix: string;
13
+ fileBaseName: string;
14
+ parentName: string | null;
15
+ };
16
+ export type SkippedPullEntity = {
17
+ kind: PullEntityKind;
18
+ universalIdentifier: string;
19
+ reason: string;
20
+ };
21
+ export declare const buildPullEntities: (manifest: Manifest) => {
22
+ entities: PullEntity[];
23
+ skipped: SkippedPullEntity[];
24
+ };
@@ -0,0 +1,13 @@
1
+ import { type ApplicationExportCoverageEntry } from '../../../cli/utilities/pull/application-export-type';
2
+ import { type SkippedPullEntity } from '../../../cli/utilities/pull/build-pull-entities';
3
+ import { type PullDeletion, type PullWrite } from '../../../cli/utilities/pull/plan-pull-writes';
4
+ export declare const formatPullReport: ({ writes, deletions, unchangedCount, skipped, coverage, localOnlyRelativePaths, unreadableRelativePaths, verbose, }: {
5
+ writes: PullWrite[];
6
+ deletions: PullDeletion[];
7
+ unchangedCount: number;
8
+ skipped: SkippedPullEntity[];
9
+ coverage: ApplicationExportCoverageEntry[];
10
+ localOnlyRelativePaths: string[];
11
+ unreadableRelativePaths?: string[] | undefined;
12
+ verbose?: boolean | undefined;
13
+ }) => string;
@@ -0,0 +1,27 @@
1
+ import { type PullEntity, type PullEntityKind } from '../../../cli/utilities/pull/build-pull-entities';
2
+ import { type ScannedDefineFile } from '../../../cli/utilities/pull/scan-project-define-files';
3
+ import { type Manifest } from 'twenty-shared/application';
4
+ export type PullWrite = {
5
+ kind: PullEntityKind;
6
+ universalIdentifier: string;
7
+ relativePath: string;
8
+ content: string;
9
+ isRegeneration: boolean;
10
+ };
11
+ export type PullDeletion = {
12
+ universalIdentifier: string;
13
+ relativePath: string;
14
+ };
15
+ export type PullWritePlan = {
16
+ writes: PullWrite[];
17
+ unchanged: PullEntity[];
18
+ deletions: PullDeletion[];
19
+ localOnlyRelativePaths: string[];
20
+ };
21
+ export declare const planPullWrites: ({ manifest, baseManifest, scannedFiles, }: {
22
+ manifest: Manifest;
23
+ baseManifest: Manifest | null;
24
+ scannedFiles: ScannedDefineFile[];
25
+ }) => PullWritePlan & {
26
+ skipped: import("../../../cli/utilities/pull/build-pull-entities").SkippedPullEntity[];
27
+ };
@@ -0,0 +1,10 @@
1
+ export type EnumSymbolResolver = (params: {
2
+ path: string[];
3
+ value: string;
4
+ }) => string | undefined;
5
+ export declare const printTypescriptValue: ({ value, depth, path, resolveEnumSymbol, }: {
6
+ value: unknown;
7
+ depth?: number | undefined;
8
+ path?: string[] | undefined;
9
+ resolveEnumSymbol?: EnumSymbolResolver | undefined;
10
+ }) => string;
@@ -0,0 +1,10 @@
1
+ import { type Manifest } from 'twenty-shared/application';
2
+ export declare const PULL_BASE_FILE_PATH = ".twenty/pull-base.json";
3
+ export declare const readPullBaseManifest: ({ appPath, applicationUniversalIdentifier, }: {
4
+ appPath: string;
5
+ applicationUniversalIdentifier: string;
6
+ }) => Promise<Manifest | null>;
7
+ export declare const writePullBaseManifest: ({ appPath, manifest, }: {
8
+ appPath: string;
9
+ manifest: Manifest;
10
+ }) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { type ManifestEntityKey } from '../../../cli/utilities/build/manifest/manifest-extract-config';
2
+ export type ScannedDefineFile = {
3
+ relativePath: string;
4
+ entityKey: ManifestEntityKey | null;
5
+ universalIdentifier: string | null;
6
+ isReadable: boolean;
7
+ };
8
+ export declare const scanProjectDefineFiles: (appPath: string) => Promise<ScannedDefineFile[]>;
@@ -0,0 +1,13 @@
1
+ export type EnumBinding = {
2
+ path: string[];
3
+ symbol: string;
4
+ members: Record<string, string>;
5
+ };
6
+ export declare const FIELD_ENUM_BINDINGS: EnumBinding[];
7
+ export declare const OBJECT_ENUM_BINDINGS: EnumBinding[];
8
+ export declare const INDEX_ENUM_BINDINGS: EnumBinding[];
9
+ export declare const writeDefineFile: ({ definer, config, enumBindings, }: {
10
+ definer: string;
11
+ config: unknown;
12
+ enumBindings?: EnumBinding[] | undefined;
13
+ }) => string;