twenty-sdk 2.37.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.
- package/dist/billing/index.cjs +3 -3
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.d.ts +25 -4
- package/dist/billing/index.mjs +495 -464
- package/dist/billing/index.mjs.map +1 -1
- package/dist/catalog-sync-DjzVoO-K.js +1 -0
- package/dist/{catalog-sync-mAO3vmdp.mjs → catalog-sync-PfHIDnN1.mjs} +4 -4
- package/dist/cli/commands/dev/dev-once.d.ts +1 -0
- package/dist/cli/commands/dev/dev.d.ts +1 -0
- package/dist/cli/commands/dev/pull.d.ts +8 -0
- package/dist/cli/operations/dev-once.d.ts +1 -0
- package/dist/cli/operations/index.d.ts +2 -0
- package/dist/cli/operations/pull.d.ts +22 -0
- package/dist/cli/types.d.ts +1 -0
- package/dist/cli/utilities/api/api-service.d.ts +3 -0
- package/dist/cli/utilities/api/application-api.d.ts +3 -0
- package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +1 -0
- package/dist/cli/utilities/dev/orchestrator/steps/format-sync-actions-plan.d.ts +8 -1
- package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +3 -1
- package/dist/cli/utilities/entity/entity-view-template.d.ts +1 -1
- package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
- package/dist/cli/utilities/pull/application-export-type.d.ts +24 -0
- package/dist/cli/utilities/pull/apply-pull-writes.d.ts +6 -0
- package/dist/cli/utilities/pull/build-pull-entities.d.ts +24 -0
- package/dist/cli/utilities/pull/format-pull-report.d.ts +13 -0
- package/dist/cli/utilities/pull/plan-pull-writes.d.ts +27 -0
- package/dist/cli/utilities/pull/print-typescript-value.d.ts +10 -0
- package/dist/cli/utilities/pull/pull-base-file.d.ts +10 -0
- package/dist/cli/utilities/pull/scan-project-define-files.d.ts +8 -0
- package/dist/cli/utilities/pull/write-define-file.d.ts +13 -0
- package/dist/cli.cjs +82 -78
- package/dist/cli.mjs +8007 -7902
- package/dist/define/index.cjs +14 -14
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +138 -16
- package/dist/define/index.mjs +5784 -5723
- 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 +25 -6
- package/dist/front-component/index.mjs +2 -2
- 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/{get-front-component-build-plugins-DZIleilT.js → get-front-component-build-plugins-BR8EOlIe.js} +8 -8
- package/dist/{get-front-component-build-plugins-WU9ATS3e.mjs → get-front-component-build-plugins-BvcwEryG.mjs} +78 -68
- package/dist/{get-function-input-schema-GNk3NRLJ-H7iWzfXn.mjs → get-function-input-schema-GNk3NRLJ-BzSsW_zF.mjs} +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-DKoJBhuO.js → get-function-input-schema-GNk3NRLJ-PouV48BW.js} +1 -1
- package/dist/logic-function/index.cjs +4 -4
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +23 -3
- package/dist/logic-function/index.mjs +26 -12
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-CNByz3vi.mjs → login-CWJ1uQtK.mjs} +6043 -5432
- package/dist/{login-4PI5lTOa.js → login-CXs7z3of.js} +99 -68
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +4 -4
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/catalog-sync-Szx_4267.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,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 {
|
|
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 {
|
|
9
9
|
async execute(e) {
|
|
10
|
-
e.remote &&
|
|
11
|
-
let t =
|
|
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
|
|
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
|
};
|
|
@@ -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>;
|
|
@@ -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>>;
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -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 = {
|
|
@@ -56,10 +57,12 @@ export declare class ApiService {
|
|
|
56
57
|
}>>;
|
|
57
58
|
syncApplication(manifest: Manifest, options?: {
|
|
58
59
|
dryRun?: boolean;
|
|
60
|
+
inferDeletionFromMissingEntities?: boolean;
|
|
59
61
|
}): Promise<ApiResponse<{
|
|
60
62
|
applicationUniversalIdentifier: string;
|
|
61
63
|
actions: SyncAction[];
|
|
62
64
|
}, MetadataValidationErrorResponse>>;
|
|
65
|
+
exportApplication(universalIdentifier: string): Promise<ApiResponse<ApplicationExport>>;
|
|
63
66
|
uninstallApplication(universalIdentifier: string): Promise<ApiResponse>;
|
|
64
67
|
syncMarketplaceCatalog(): Promise<ApiResponse<boolean>>;
|
|
65
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;
|
|
@@ -45,6 +47,7 @@ export declare class ApplicationApi {
|
|
|
45
47
|
}>>;
|
|
46
48
|
syncApplication(manifest: Manifest, options?: {
|
|
47
49
|
dryRun?: boolean;
|
|
50
|
+
inferDeletionFromMissingEntities?: boolean;
|
|
48
51
|
}): Promise<ApiResponse<{
|
|
49
52
|
applicationUniversalIdentifier: string;
|
|
50
53
|
actions: SyncAction[];
|
|
@@ -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
|
|
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;
|
|
@@ -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;
|
|
@@ -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,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;
|