@revoengine/cli 1.0.11 → 1.0.13

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 (81) hide show
  1. package/README.md +275 -479
  2. package/dist/src/cli.js +71 -5
  3. package/dist/src/client.d.ts +28 -12
  4. package/dist/src/client.js +234 -66
  5. package/dist/src/commands/component.d.ts +67 -0
  6. package/dist/src/commands/component.js +299 -27
  7. package/dist/src/commands/database-tables.d.ts +2 -0
  8. package/dist/src/commands/{database-schemas.js → database-tables.js} +21 -40
  9. package/dist/src/commands/database-views.js +21 -18
  10. package/dist/src/commands/endpoints.js +26 -16
  11. package/dist/src/commands/events.js +18 -20
  12. package/dist/src/commands/groups.js +13 -22
  13. package/dist/src/commands/index.d.ts +2 -1
  14. package/dist/src/commands/index.js +2 -1
  15. package/dist/src/commands/job-templates.js +21 -15
  16. package/dist/src/commands/metadata.js +58 -15
  17. package/dist/src/commands/migrate.d.ts +6 -0
  18. package/dist/src/commands/migrate.js +658 -0
  19. package/dist/src/commands/project.js +4 -4
  20. package/dist/src/commands/role-groups.js +14 -25
  21. package/dist/src/commands/schedules.js +19 -20
  22. package/dist/src/commands/terminal-browser.d.ts +16 -0
  23. package/dist/src/commands/terminal-browser.js +92 -0
  24. package/dist/src/commands/terminal-image.d.ts +7 -0
  25. package/dist/src/commands/terminal-image.js +40 -0
  26. package/dist/src/commands/terminal-patch-worker.d.ts +1 -0
  27. package/dist/src/commands/terminal-patch-worker.js +24 -0
  28. package/dist/src/commands/terminal-patch.d.ts +2 -0
  29. package/dist/src/commands/terminal-patch.js +156 -0
  30. package/dist/src/commands/terminal-sandbox.d.ts +8 -0
  31. package/dist/src/commands/terminal-sandbox.js +87 -0
  32. package/dist/src/commands/terminal-service.js +2 -2
  33. package/dist/src/commands/terminal.d.ts +31 -4
  34. package/dist/src/commands/terminal.js +360 -45
  35. package/dist/src/component-lock.d.ts +12 -2
  36. package/dist/src/component-lock.js +60 -1
  37. package/dist/src/diff-details.d.ts +8 -0
  38. package/dist/src/diff-details.js +152 -0
  39. package/dist/src/env-sync.js +8 -6
  40. package/dist/src/http-trace.d.ts +94 -0
  41. package/dist/src/http-trace.js +226 -0
  42. package/dist/src/metadata-backfill.d.ts +5 -4
  43. package/dist/src/metadata-backfill.js +82 -158
  44. package/dist/src/migration.d.ts +141 -0
  45. package/dist/src/migration.js +1632 -0
  46. package/dist/src/resource-inventory.d.ts +28 -0
  47. package/dist/src/resource-inventory.js +85 -0
  48. package/dist/src/resource-syncs/{database-schema-sync.d.ts → database-table-sync.d.ts} +13 -3
  49. package/dist/src/resource-syncs/{database-schema-sync.js → database-table-sync.js} +147 -62
  50. package/dist/src/resource-syncs/database-view-sync.d.ts +24 -2
  51. package/dist/src/resource-syncs/database-view-sync.js +156 -68
  52. package/dist/src/resource-syncs/endpoint-sync.d.ts +27 -0
  53. package/dist/src/resource-syncs/endpoint-sync.js +362 -82
  54. package/dist/src/resource-syncs/event-sync.d.ts +27 -0
  55. package/dist/src/resource-syncs/event-sync.js +123 -26
  56. package/dist/src/resource-syncs/group-sync.d.ts +7 -0
  57. package/dist/src/resource-syncs/group-sync.js +60 -14
  58. package/dist/src/resource-syncs/job-template-sync.d.ts +21 -0
  59. package/dist/src/resource-syncs/job-template-sync.js +91 -30
  60. package/dist/src/resource-syncs/role-group-sync.d.ts +7 -0
  61. package/dist/src/resource-syncs/role-group-sync.js +47 -9
  62. package/dist/src/resource-syncs/schedule-sync.d.ts +30 -1
  63. package/dist/src/resource-syncs/schedule-sync.js +114 -20
  64. package/dist/src/resource-syncs/util.d.ts +3 -0
  65. package/dist/src/resource-syncs/util.js +8 -6
  66. package/dist/src/resource-target.d.ts +11 -0
  67. package/dist/src/resource-target.js +48 -0
  68. package/dist/src/sync-output.d.ts +29 -1
  69. package/dist/src/sync-output.js +139 -2
  70. package/dist/src/tracked-resources.d.ts +1 -1
  71. package/dist/src/tracked-resources.js +8 -6
  72. package/dist/src/types.d.ts +3 -0
  73. package/dist/src/ui.js +18 -9
  74. package/dist/src/utils.d.ts +2 -0
  75. package/dist/src/utils.js +17 -0
  76. package/dist/src/workspace-diff.d.ts +25 -0
  77. package/dist/src/workspace-diff.js +75 -0
  78. package/package.json +9 -6
  79. package/dist/src/commands/database-schemas.d.ts +0 -2
  80. /package/dist/src/{database-schema-artifacts.d.ts → database-table-artifacts.d.ts} +0 -0
  81. /package/dist/src/{database-schema-artifacts.js → database-table-artifacts.js} +0 -0
@@ -55,22 +55,65 @@ function printPlanText(context, plan) {
55
55
  if (plan.skipPartitions) {
56
56
  println('Scope: root database schemas only (partitions skipped).');
57
57
  }
58
- for (const item of plan.items) {
59
- const reservedMetadataNotice = item.resourceType === 'group'
60
- && item.reason.includes('backend-reserved metadata keys excluded')
61
- ? ` (${item.reason})`
62
- : '';
63
- if (item.action === 'skip') {
64
- println(`${paint('= assigned', ANSI.dim + ANSI.yellow)} ${item.resourceType} ${item.name} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey}${reservedMetadataNotice}`);
65
- continue;
58
+ const sortedItems = [...plan.items].sort((left, right) => [
59
+ left.resourceType,
60
+ left.category || '',
61
+ left.name,
62
+ left.resourceId,
63
+ left.metadataField,
64
+ left.columnName || '',
65
+ ].join('\0').localeCompare([
66
+ right.resourceType,
67
+ right.category || '',
68
+ right.name,
69
+ right.resourceId,
70
+ right.metadataField,
71
+ right.columnName || '',
72
+ ].join('\0')));
73
+ const assignedItems = sortedItems.filter((item) => item.action === 'skip' && item.stableKey);
74
+ const excludedItems = sortedItems.filter((item) => item.action === 'skip' && !item.stableKey);
75
+ const updateItems = sortedItems.filter((item) => item.action === 'update');
76
+ const blockedItems = sortedItems.filter((item) => item.action === 'blocked');
77
+ const printItems = (items) => {
78
+ for (const item of items) {
79
+ const reservedMetadataNotice = item.resourceType === 'group'
80
+ && item.reason.includes('backend-reserved metadata keys excluded')
81
+ ? ` (${item.reason})`
82
+ : '';
83
+ const resourceLabel = item.resourceKind === 'database-partition'
84
+ ? `${item.resourceType} partition ${item.name}${item.parentName ? ` (parent: ${item.parentName})` : ''}`
85
+ : item.resourceKind === 'database-column'
86
+ ? `${item.resourceType} column ${item.name}`
87
+ : `${item.resourceType} ${item.name}`;
88
+ if (item.action === 'skip') {
89
+ if (item.stableKey) {
90
+ println(`${paint('= assigned', ANSI.dim + ANSI.yellow)} ${resourceLabel} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey}${reservedMetadataNotice}`);
91
+ }
92
+ else {
93
+ println(`${paint('- excluded', ANSI.dim + ANSI.yellow)} ${resourceLabel} (${item.reason})`);
94
+ }
95
+ continue;
96
+ }
97
+ if (item.action === 'blocked') {
98
+ println(`${paint('! blocked', ANSI.bold + ANSI.red)} ${resourceLabel} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey} (${item.reason})`);
99
+ continue;
100
+ }
101
+ println(`${paint('+ update', ANSI.bold + ANSI.green)} ${resourceLabel} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey}${reservedMetadataNotice}`);
66
102
  }
67
- if (item.action === 'blocked') {
68
- println(`${paint('! blocked', ANSI.bold + ANSI.red)} ${item.resourceType} ${item.name} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey} (${item.reason})`);
69
- continue;
70
- }
71
- println(`${paint('+ update', ANSI.bold + ANSI.green)} ${item.resourceType} ${item.name} -> ${item.metadataField}.${item.stableKeyName}=${item.stableKey}${reservedMetadataNotice}`);
72
- }
73
- println(`Plan: ${plan.counts.update} to update, ${plan.counts.skip} already populated, ${plan.counts.blocked} blocked.`);
103
+ };
104
+ println(`Assigned Stable Keys (${assignedItems.length})`);
105
+ printItems(assignedItems);
106
+ println(`Stable Keys to update (${updateItems.length})`);
107
+ printItems(updateItems);
108
+ if (excludedItems.length > 0) {
109
+ println(`Excluded resources (${excludedItems.length})`);
110
+ printItems(excludedItems);
111
+ }
112
+ if (blockedItems.length > 0) {
113
+ println(`Blocked Stable Keys (${blockedItems.length})`);
114
+ printItems(blockedItems);
115
+ }
116
+ println(`Plan: ${updateItems.length} to update, ${assignedItems.length} assigned, ${excludedItems.length} excluded, ${blockedItems.length} blocked.`);
74
117
  }
75
118
  function assertNoPlanBlockers(plan) {
76
119
  if (plan.blockers.length > 0) {
@@ -0,0 +1,6 @@
1
+ import type { CommandContext } from '../types.ts';
2
+ export declare function handleDiffCommand(context: CommandContext): Promise<void>;
3
+ export declare function handlePlanCommand(context: CommandContext): Promise<void>;
4
+ export declare function handlePullCommand(context: CommandContext): Promise<void>;
5
+ export declare function handleDeployCommand(context: CommandContext): Promise<void>;
6
+ export declare function handleMigrateCommand(context: CommandContext): Promise<void>;