@revoengine/cli 1.0.10 → 1.0.11
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/README.md +312 -33
- package/dist/src/cli.js +58 -7
- package/dist/src/client.d.ts +356 -5
- package/dist/src/client.js +803 -19
- package/dist/src/commands/auth.js +4 -2
- package/dist/src/commands/component.js +260 -141
- package/dist/src/commands/database-schemas.d.ts +2 -0
- package/dist/src/commands/database-schemas.js +188 -0
- package/dist/src/commands/database-views.d.ts +2 -0
- package/dist/src/commands/database-views.js +123 -0
- package/dist/src/commands/endpoints.js +114 -0
- package/dist/src/commands/env.js +44 -24
- package/dist/src/commands/events.d.ts +2 -0
- package/dist/src/commands/events.js +146 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/groups.js +169 -0
- package/dist/src/commands/index.d.ts +8 -0
- package/dist/src/commands/index.js +8 -0
- package/dist/src/commands/job-templates.d.ts +2 -0
- package/dist/src/commands/job-templates.js +101 -0
- package/dist/src/commands/metadata.js +29 -7
- package/dist/src/commands/project.js +10 -3
- package/dist/src/commands/role-groups.d.ts +2 -0
- package/dist/src/commands/role-groups.js +152 -0
- package/dist/src/commands/schedules.d.ts +2 -0
- package/dist/src/commands/schedules.js +141 -0
- package/dist/src/commands/terminal-service.d.ts +38 -0
- package/dist/src/commands/terminal-service.js +210 -0
- package/dist/src/commands/terminal.d.ts +22 -0
- package/dist/src/commands/terminal.js +511 -0
- package/dist/src/component-lock.d.ts +100 -2
- package/dist/src/component-lock.js +304 -15
- package/dist/src/config.d.ts +10 -2
- package/dist/src/config.js +49 -14
- package/dist/src/database-schema-artifacts.d.ts +7 -0
- package/dist/src/database-schema-artifacts.js +8 -0
- package/dist/src/env-sync.d.ts +0 -3
- package/dist/src/env-sync.js +3 -19
- package/dist/src/metadata-backfill.d.ts +16 -6
- package/dist/src/metadata-backfill.js +1069 -18
- package/dist/src/project.d.ts +2 -0
- package/dist/src/project.js +4 -17
- package/dist/src/prompt.js +10 -18
- package/dist/src/resource-metadata.d.ts +1 -0
- package/dist/src/resource-metadata.js +3 -0
- package/dist/src/resource-syncs/database-schema-sync.d.ts +117 -0
- package/dist/src/resource-syncs/database-schema-sync.js +2289 -0
- package/dist/src/resource-syncs/database-view-sync.d.ts +124 -0
- package/dist/src/resource-syncs/database-view-sync.js +1317 -0
- package/dist/src/resource-syncs/endpoint-sync.d.ts +96 -0
- package/dist/src/resource-syncs/endpoint-sync.js +1283 -0
- package/dist/src/resource-syncs/event-sync.d.ts +99 -0
- package/dist/src/resource-syncs/event-sync.js +949 -0
- package/dist/src/resource-syncs/group-sync.d.ts +86 -0
- package/dist/src/resource-syncs/group-sync.js +882 -0
- package/dist/src/resource-syncs/job-template-sync.d.ts +85 -0
- package/dist/src/resource-syncs/job-template-sync.js +782 -0
- package/dist/src/resource-syncs/role-group-sync.d.ts +83 -0
- package/dist/src/resource-syncs/role-group-sync.js +597 -0
- package/dist/src/resource-syncs/schedule-sync.d.ts +111 -0
- package/dist/src/resource-syncs/schedule-sync.js +1302 -0
- package/dist/src/resource-syncs/util.d.ts +19 -0
- package/dist/src/resource-syncs/util.js +116 -0
- package/dist/src/runtime-view.d.ts +1 -0
- package/dist/src/runtime-view.js +6 -1
- package/dist/src/sync-output.d.ts +38 -0
- package/dist/src/sync-output.js +131 -0
- package/dist/src/tracked-resources.d.ts +1 -1
- package/dist/src/tracked-resources.js +26 -2
- package/dist/src/types.d.ts +224 -0
- package/dist/src/ui.d.ts +3 -0
- package/dist/src/ui.js +67 -18
- package/dist/src/utils.d.ts +2 -0
- package/dist/src/utils.js +64 -0
- package/dist/src/workspace-component.d.ts +2 -0
- package/dist/src/workspace-component.js +34 -0
- package/dist/src/workspace-resource.d.ts +2 -0
- package/dist/src/workspace-resource.js +52 -0
- package/package.json +8 -3
package/dist/src/project.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export type ProjectSyncInput = {
|
|
|
52
52
|
libVersion: string;
|
|
53
53
|
hash: string;
|
|
54
54
|
lastSyncAt: string;
|
|
55
|
+
authProfile?: string;
|
|
55
56
|
componentIdentity?: ComponentIdentityConfig;
|
|
56
57
|
trackedResources?: TrackedResource[];
|
|
57
58
|
};
|
|
@@ -80,6 +81,7 @@ export declare function buildProjectMetadata(input: {
|
|
|
80
81
|
baseUrl: string;
|
|
81
82
|
bundle: EditorTypesBundle;
|
|
82
83
|
now?: Date;
|
|
84
|
+
authProfile?: string;
|
|
83
85
|
}): {
|
|
84
86
|
schemaVersion: 1;
|
|
85
87
|
endpoint: string;
|
package/dist/src/project.js
CHANGED
|
@@ -220,13 +220,7 @@ export function resolveProjectInvocation(args) {
|
|
|
220
220
|
const trackedResourceArgs = readResourceSelectionArgs(args);
|
|
221
221
|
const trackedResources = trackedResourceArgs ? normalizeTrackedResources(trackedResourceArgs) : undefined;
|
|
222
222
|
if (!first) {
|
|
223
|
-
|
|
224
|
-
action: 'init',
|
|
225
|
-
extraArgs: [],
|
|
226
|
-
identityMode,
|
|
227
|
-
stableKeyName,
|
|
228
|
-
...(trackedResources ? { trackedResources } : {}),
|
|
229
|
-
};
|
|
223
|
+
throw new Error('Missing project action. Use `revo project init [path]` or `revo project update [path]`.');
|
|
230
224
|
}
|
|
231
225
|
if (first === 'init' || first === 'update') {
|
|
232
226
|
return {
|
|
@@ -241,14 +235,7 @@ export function resolveProjectInvocation(args) {
|
|
|
241
235
|
if (first === 'switch') {
|
|
242
236
|
throw new Error('`revo project switch` was removed because credentials are no longer instance-scoped.');
|
|
243
237
|
}
|
|
244
|
-
|
|
245
|
-
action: 'init',
|
|
246
|
-
targetArg: first,
|
|
247
|
-
extraArgs: second ? [second, ...rest] : rest,
|
|
248
|
-
identityMode,
|
|
249
|
-
stableKeyName,
|
|
250
|
-
...(trackedResources ? { trackedResources } : {}),
|
|
251
|
-
};
|
|
238
|
+
throw new Error(`Unknown project action "${first}". Use \`revo project init [path]\` or \`revo project update [path]\`.`);
|
|
252
239
|
}
|
|
253
240
|
function normalizeWorkspaceDirectory(projectRoot, workspaceRoot) {
|
|
254
241
|
const relative = path.relative(projectRoot, workspaceRoot).split(path.sep).join('/');
|
|
@@ -361,7 +348,7 @@ export function buildProjectMetadata(input) {
|
|
|
361
348
|
return {
|
|
362
349
|
schemaVersion: 1,
|
|
363
350
|
endpoint: bundle.endpoint || buildEditorEndpoint(baseUrl),
|
|
364
|
-
authProfile: 'default',
|
|
351
|
+
authProfile: input.authProfile || 'default',
|
|
365
352
|
apiVersion: getRequiredMetadataValue(bundle, 'apiVersion'),
|
|
366
353
|
libVersion: getRequiredMetadataValue(bundle, 'libVersion'),
|
|
367
354
|
hash: getRequiredMetadataValue(bundle, 'hash'),
|
|
@@ -510,7 +497,7 @@ export function syncProjectFiles(layoutOrTargetDir, input) {
|
|
|
510
497
|
writeJsonFile(metadataFile, {
|
|
511
498
|
schemaVersion: 1,
|
|
512
499
|
endpoint: input.endpoint,
|
|
513
|
-
authProfile: 'default',
|
|
500
|
+
authProfile: input.authProfile || 'default',
|
|
514
501
|
apiVersion: input.apiVersion,
|
|
515
502
|
libVersion: input.libVersion,
|
|
516
503
|
hash: input.hash,
|
package/dist/src/prompt.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import readline from 'node:readline/promises';
|
|
2
|
+
import { Writable } from 'node:stream';
|
|
2
3
|
export function isInteractiveTerminal() {
|
|
3
4
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
4
5
|
}
|
|
@@ -23,32 +24,23 @@ export async function promptSecret(message) {
|
|
|
23
24
|
if (!isInteractiveTerminal()) {
|
|
24
25
|
return '';
|
|
25
26
|
}
|
|
27
|
+
const mutedOutput = new Writable({
|
|
28
|
+
write(_chunk, _encoding, callback) {
|
|
29
|
+
callback();
|
|
30
|
+
},
|
|
31
|
+
});
|
|
26
32
|
const rl = readline.createInterface({
|
|
27
33
|
input: process.stdin,
|
|
28
|
-
output:
|
|
34
|
+
output: mutedOutput,
|
|
29
35
|
terminal: true,
|
|
30
36
|
});
|
|
31
|
-
let muted = true;
|
|
32
|
-
const originalWriteToOutput = rl._writeToOutput.bind(rl);
|
|
33
|
-
rl._writeToOutput = (value) => {
|
|
34
|
-
if (!muted) {
|
|
35
|
-
originalWriteToOutput(value);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (value.startsWith(`${message}: `)) {
|
|
39
|
-
originalWriteToOutput(value);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
// Preserve terminal editing/paste behavior while masking visible content.
|
|
43
|
-
originalWriteToOutput('*');
|
|
44
|
-
};
|
|
45
37
|
try {
|
|
46
|
-
|
|
47
|
-
return
|
|
38
|
+
process.stdout.write(`${message}: `);
|
|
39
|
+
return await rl.question('');
|
|
48
40
|
}
|
|
49
41
|
finally {
|
|
50
|
-
muted = false;
|
|
51
42
|
rl.close();
|
|
43
|
+
process.stdout.write('\n');
|
|
52
44
|
}
|
|
53
45
|
}
|
|
54
46
|
export async function promptConfirm(message, defaultValue = false) {
|
|
@@ -8,6 +8,7 @@ export type ComponentIdentityConfig = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const COMPONENT_IDENTITY_BY_ID: ComponentIdentityConfig;
|
|
10
10
|
export declare const DEFAULT_COMPONENT_IDENTITY: ComponentIdentityConfig;
|
|
11
|
+
export declare function normalizeStableKeyValue(value: string): string;
|
|
11
12
|
export declare function normalizeStableKeyName(value: string | null | undefined): string;
|
|
12
13
|
export declare function normalizeComponentIdentityMode(value: string | null | undefined): ComponentIdentityMode;
|
|
13
14
|
export declare function normalizeComponentIdentityConfig(value: Partial<ComponentIdentityConfig> | null | undefined, fallback?: ComponentIdentityConfig): ComponentIdentityConfig;
|
|
@@ -16,6 +16,9 @@ function readString(value) {
|
|
|
16
16
|
function normalizeKeyPart(value) {
|
|
17
17
|
return (value ?? '').trim().replace(/\s+/g, ' ').toLowerCase();
|
|
18
18
|
}
|
|
19
|
+
export function normalizeStableKeyValue(value) {
|
|
20
|
+
return normalizeKeyPart(value);
|
|
21
|
+
}
|
|
19
22
|
export function normalizeStableKeyName(value) {
|
|
20
23
|
const normalized = (value || DEFAULT_STABLE_KEY_NAME).trim();
|
|
21
24
|
if (!normalized) {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { DatabaseSchemaStatsRecord, RevoClient } from '../client.ts';
|
|
2
|
+
export declare const DATABASE_SCHEMAS_DIRECTORY = "DatabaseSchemas";
|
|
3
|
+
export declare const DATABASE_SCHEMA_MANIFEST_FILE = "database-schema.json";
|
|
4
|
+
type PortableDefinition = Record<string, unknown>;
|
|
5
|
+
export type DatabaseSchemaManifest = {
|
|
6
|
+
kind: 'database-schema' | 'database-partition';
|
|
7
|
+
stableKey: string;
|
|
8
|
+
name: string;
|
|
9
|
+
category?: string | null;
|
|
10
|
+
description?: string;
|
|
11
|
+
metadata: Record<string, unknown>;
|
|
12
|
+
type?: string;
|
|
13
|
+
definition?: PortableDefinition[];
|
|
14
|
+
partition?: Record<string, unknown>;
|
|
15
|
+
parentStableKey?: string;
|
|
16
|
+
migration?: {
|
|
17
|
+
foreignReferences: 'manual';
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type DatabaseSchemaPullResult = {
|
|
21
|
+
pulled: Array<{
|
|
22
|
+
manifest: DatabaseSchemaManifest;
|
|
23
|
+
targetPath: string;
|
|
24
|
+
}>;
|
|
25
|
+
pruned: Array<{
|
|
26
|
+
stableKey: string;
|
|
27
|
+
targetPath: string;
|
|
28
|
+
}>;
|
|
29
|
+
skipped: Array<{
|
|
30
|
+
targetPath: string;
|
|
31
|
+
reason: string;
|
|
32
|
+
}>;
|
|
33
|
+
diagnostics: Array<{
|
|
34
|
+
stableKey: string;
|
|
35
|
+
audit?: unknown;
|
|
36
|
+
acl?: unknown;
|
|
37
|
+
tags?: unknown;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
export type DatabaseSchemaPlanStatus = 'clean' | 'create' | 'safe-update' | 'remote-changed' | 'conflict' | 'missing-lock' | 'orphan-root' | 'orphan-partition' | 'delete-partition' | 'previously-deleted-partition' | 'replacement-requires-two-phases' | 'unmanaged' | 'collision' | 'reconciled' | 'manual-schema-migration-required' | 'access-policy-required';
|
|
41
|
+
export type DatabaseSchemaChange = {
|
|
42
|
+
kind: 'field-changed' | 'immutable-field' | 'column-added' | 'column-removed' | 'column-changed' | 'column-renamed' | 'column-stable-key-missing' | 'database-view-dependency' | 'column-order' | 'foreign-reference' | 'audit-trigger-rebuild';
|
|
43
|
+
field: string;
|
|
44
|
+
risk: 'safe' | 'manual' | 'operational';
|
|
45
|
+
before?: unknown;
|
|
46
|
+
after?: unknown;
|
|
47
|
+
column?: string;
|
|
48
|
+
hint: string;
|
|
49
|
+
};
|
|
50
|
+
export type DatabaseSchemaPlanItem = {
|
|
51
|
+
status: DatabaseSchemaPlanStatus;
|
|
52
|
+
stableKey?: string;
|
|
53
|
+
name: string;
|
|
54
|
+
kind?: DatabaseSchemaManifest['kind'];
|
|
55
|
+
parentStableKey?: string;
|
|
56
|
+
reason?: string;
|
|
57
|
+
changedFields?: string[];
|
|
58
|
+
changes?: DatabaseSchemaChange[];
|
|
59
|
+
hints: string[];
|
|
60
|
+
desiredHash?: string;
|
|
61
|
+
currentHash?: string;
|
|
62
|
+
baselineHash?: string;
|
|
63
|
+
stats?: DatabaseSchemaStatsRecord['size'];
|
|
64
|
+
};
|
|
65
|
+
export type DatabaseSchemasPlan = {
|
|
66
|
+
resourceType: 'database-schema';
|
|
67
|
+
env: string;
|
|
68
|
+
withStats: boolean;
|
|
69
|
+
skipPartitions: boolean;
|
|
70
|
+
counts: Record<DatabaseSchemaPlanStatus, number>;
|
|
71
|
+
blockers: string[];
|
|
72
|
+
warnings: string[];
|
|
73
|
+
exclusions: string[];
|
|
74
|
+
items: DatabaseSchemaPlanItem[];
|
|
75
|
+
};
|
|
76
|
+
export type DatabaseSchemaPushResult = {
|
|
77
|
+
stableKey: string;
|
|
78
|
+
action: 'create' | 'update' | 'reconcile' | 'delete' | 'skipped';
|
|
79
|
+
status: 'deployed' | 'skipped' | 'failed' | 'write-unverified';
|
|
80
|
+
targetPath: string;
|
|
81
|
+
reason?: string;
|
|
82
|
+
error?: string;
|
|
83
|
+
};
|
|
84
|
+
export declare function hashPortableDatabaseSchema(manifest: DatabaseSchemaManifest): string;
|
|
85
|
+
export declare function buildDatabaseSchemasPlan(input: {
|
|
86
|
+
client: RevoClient;
|
|
87
|
+
cwd: string;
|
|
88
|
+
envName: string;
|
|
89
|
+
stableKeyName: string;
|
|
90
|
+
withStats?: boolean;
|
|
91
|
+
skipPartitions?: boolean;
|
|
92
|
+
}): Promise<DatabaseSchemasPlan>;
|
|
93
|
+
export declare function pullDatabaseSchemasToWorkspace(input: {
|
|
94
|
+
client: RevoClient;
|
|
95
|
+
cwd: string;
|
|
96
|
+
envName: string;
|
|
97
|
+
stableKeyName: string;
|
|
98
|
+
force?: boolean;
|
|
99
|
+
strict?: boolean;
|
|
100
|
+
pruneOrphans?: boolean;
|
|
101
|
+
}): Promise<DatabaseSchemaPullResult>;
|
|
102
|
+
export declare function pushDatabaseSchemas(input: {
|
|
103
|
+
client: RevoClient;
|
|
104
|
+
cwd: string;
|
|
105
|
+
envName: string;
|
|
106
|
+
stableKeyName: string;
|
|
107
|
+
stableKey?: string;
|
|
108
|
+
force?: boolean;
|
|
109
|
+
prunePartitions?: boolean;
|
|
110
|
+
prunePartitionsConfirmed?: boolean;
|
|
111
|
+
pruneOrphans?: boolean;
|
|
112
|
+
pruneOrphansConfirmed?: boolean;
|
|
113
|
+
}): Promise<{
|
|
114
|
+
plan: DatabaseSchemasPlan;
|
|
115
|
+
results: DatabaseSchemaPushResult[];
|
|
116
|
+
}>;
|
|
117
|
+
export {};
|