@chaim-tools/chaim 0.1.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/LICENSE +201 -0
- package/README.md +211 -0
- package/dist/commands/apps/link.d.ts +26 -0
- package/dist/commands/apps/link.d.ts.map +1 -0
- package/dist/commands/apps/link.js +49 -0
- package/dist/commands/apps/link.js.map +1 -0
- package/dist/commands/apps/list.d.ts +25 -0
- package/dist/commands/apps/list.d.ts.map +1 -0
- package/dist/commands/apps/list.js +46 -0
- package/dist/commands/apps/list.js.map +1 -0
- package/dist/commands/auth/login.d.ts +29 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +51 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +26 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +49 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/refresh.d.ts +27 -0
- package/dist/commands/auth/refresh.d.ts.map +1 -0
- package/dist/commands/auth/refresh.js +47 -0
- package/dist/commands/auth/refresh.js.map +1 -0
- package/dist/commands/auth/whoami.d.ts +28 -0
- package/dist/commands/auth/whoami.d.ts.map +1 -0
- package/dist/commands/auth/whoami.js +48 -0
- package/dist/commands/auth/whoami.js.map +1 -0
- package/dist/commands/clean.d.ts +25 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +345 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/config/show.d.ts +25 -0
- package/dist/commands/config/show.d.ts.map +1 -0
- package/dist/commands/config/show.js +49 -0
- package/dist/commands/config/show.js.map +1 -0
- package/dist/commands/configure.d.ts +26 -0
- package/dist/commands/configure.d.ts.map +1 -0
- package/dist/commands/configure.js +53 -0
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +96 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/generate.d.ts +11 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +395 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +302 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +58 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/types.d.ts +138 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +48 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/planned-commands.d.ts +51 -0
- package/dist/planned-commands.d.ts.map +1 -0
- package/dist/planned-commands.js +199 -0
- package/dist/planned-commands.js.map +1 -0
- package/dist/services/os-cache-paths.d.ts +15 -0
- package/dist/services/os-cache-paths.d.ts.map +1 -0
- package/dist/services/os-cache-paths.js +57 -0
- package/dist/services/os-cache-paths.js.map +1 -0
- package/dist/services/snapshot-discovery.d.ts +111 -0
- package/dist/services/snapshot-discovery.d.ts.map +1 -0
- package/dist/services/snapshot-discovery.js +249 -0
- package/dist/services/snapshot-discovery.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/snapshot-payload.d.ts +205 -0
- package/dist/types/snapshot-payload.d.ts.map +1 -0
- package/dist/types/snapshot-payload.js +9 -0
- package/dist/types/snapshot-payload.js.map +1 -0
- package/package.json +65 -0
- package/shared/scripts/setup.sh +47 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const generate_1 = require("./commands/generate");
|
|
9
|
+
const validate_1 = require("./commands/validate");
|
|
10
|
+
const doctor_1 = require("./commands/doctor");
|
|
11
|
+
const init_1 = require("./commands/init");
|
|
12
|
+
const clean_1 = require("./commands/clean");
|
|
13
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
14
|
+
/**
|
|
15
|
+
* ==========================
|
|
16
|
+
* Planned Commands (Roadmap)
|
|
17
|
+
* ==========================
|
|
18
|
+
* These are intentionally commented out until implemented.
|
|
19
|
+
* See docs/CLI_ROADMAP.md and src/planned-commands.ts.
|
|
20
|
+
*
|
|
21
|
+
* To enable a command:
|
|
22
|
+
* 1. Uncomment the import statement
|
|
23
|
+
* 2. Uncomment the registration call below
|
|
24
|
+
* 3. Implement the command logic in the stub file
|
|
25
|
+
* 4. Update status in planned-commands.ts and CLI_ROADMAP.md
|
|
26
|
+
*/
|
|
27
|
+
// ─── TIER 0: Must Have ───────────────────────────────────────────────────────
|
|
28
|
+
// import { registerAuthLoginCommand } from './commands/auth/login';
|
|
29
|
+
// import { registerAuthWhoamiCommand } from './commands/auth/whoami';
|
|
30
|
+
// import { registerAuthLogoutCommand } from './commands/auth/logout';
|
|
31
|
+
// ─── TIER 1: Core Productivity ───────────────────────────────────────────────
|
|
32
|
+
// import { registerConfigureCommand } from './commands/configure';
|
|
33
|
+
// import { registerAppsLinkCommand } from './commands/apps/link';
|
|
34
|
+
// ─── TIER 3: Nice to Have ────────────────────────────────────────────────────
|
|
35
|
+
// import { registerAuthRefreshCommand } from './commands/auth/refresh';
|
|
36
|
+
// import { registerAppsListCommand } from './commands/apps/list';
|
|
37
|
+
// import { registerConfigShowCommand } from './commands/config/show';
|
|
38
|
+
const program = new commander_1.Command();
|
|
39
|
+
program
|
|
40
|
+
.name('chaim')
|
|
41
|
+
.description('Schema-driven code generation tool for DynamoDB')
|
|
42
|
+
.version('0.1.0');
|
|
43
|
+
program
|
|
44
|
+
.command('generate')
|
|
45
|
+
.description('Generate SDK code from LOCAL snapshot (reads from OS cache)')
|
|
46
|
+
.requiredOption('--package <packageName>', 'Package name (e.g., com.mycompany.myapp.model for Java)')
|
|
47
|
+
.option('-l, --language <language>', 'Target language for code generation (default: java)')
|
|
48
|
+
.option('--output <outputDir>', 'Output directory', './src/main/java')
|
|
49
|
+
.option('--stack <stackName>', 'Filter by CDK stack name (optional)')
|
|
50
|
+
.option('--snapshot-dir <path>', 'Override snapshot directory (default: OS cache)')
|
|
51
|
+
.option('--skip-checks', 'Skip environment and schema validation checks')
|
|
52
|
+
.action(generate_1.generateCommand);
|
|
53
|
+
program
|
|
54
|
+
.command('validate')
|
|
55
|
+
.description('Validate a .bprint schema file')
|
|
56
|
+
.argument('<schemaFile>', 'Schema file to validate')
|
|
57
|
+
.action(validate_1.validateCommand);
|
|
58
|
+
program
|
|
59
|
+
.command('doctor')
|
|
60
|
+
.description('Check system environment and dependencies')
|
|
61
|
+
.action(doctor_1.doctorCommand);
|
|
62
|
+
program
|
|
63
|
+
.command('init')
|
|
64
|
+
.description('Verify and install all prerequisites')
|
|
65
|
+
.option('--install', 'Install missing dependencies automatically')
|
|
66
|
+
.option('--verify-only', 'Verify prerequisites only (no installation)')
|
|
67
|
+
.option('--region <region>', 'AWS region for CDK bootstrap', 'us-east-1')
|
|
68
|
+
.action(init_1.initCommand);
|
|
69
|
+
program
|
|
70
|
+
.command('clean')
|
|
71
|
+
.description('Clean snapshot cache (prune old or stack-specific snapshots)')
|
|
72
|
+
.option('--stack <stackName>', 'Clean snapshots for specific stack')
|
|
73
|
+
.option('--all', 'Clean all snapshots')
|
|
74
|
+
.option('--older-than <days>', 'Clean snapshots older than N days', parseInt)
|
|
75
|
+
.option('--dry-run', 'Show what would be deleted without deleting')
|
|
76
|
+
.option('--verbose', 'Show detailed output')
|
|
77
|
+
.action(clean_1.cleanCommand);
|
|
78
|
+
/**
|
|
79
|
+
* ==========================
|
|
80
|
+
* Planned Command Registration
|
|
81
|
+
* ==========================
|
|
82
|
+
* Uncomment the corresponding import above and the registration call below
|
|
83
|
+
* when implementing each command.
|
|
84
|
+
*/
|
|
85
|
+
// ─── TIER 0: Must Have ───────────────────────────────────────────────────────
|
|
86
|
+
// registerAuthLoginCommand(program);
|
|
87
|
+
// registerAuthWhoamiCommand(program);
|
|
88
|
+
// registerAuthLogoutCommand(program);
|
|
89
|
+
// ─── TIER 1: Core Productivity ───────────────────────────────────────────────
|
|
90
|
+
// registerConfigureCommand(program);
|
|
91
|
+
// registerAppsLinkCommand(program);
|
|
92
|
+
// ─── TIER 3: Nice to Have ────────────────────────────────────────────────────
|
|
93
|
+
// registerAuthRefreshCommand(program);
|
|
94
|
+
// registerAppsListCommand(program);
|
|
95
|
+
// registerConfigShowCommand(program);
|
|
96
|
+
// Show help if no command provided
|
|
97
|
+
if (process.argv.length <= 2) {
|
|
98
|
+
console.log(chalk_1.default.blue('Chaim CLI v0.1.0'));
|
|
99
|
+
console.log('Usage: chaim <command> [options]');
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log(chalk_1.default.yellow('Prerequisite: Run "cdk synth" or "cdk deploy" in your CDK project first'));
|
|
102
|
+
console.log('');
|
|
103
|
+
console.log('Commands:');
|
|
104
|
+
console.log(' init - Verify and install all prerequisites');
|
|
105
|
+
console.log(' generate - Generate SDK code from CDK snapshot (default: java)');
|
|
106
|
+
console.log(' validate - Validate a .bprint schema file');
|
|
107
|
+
console.log(' doctor - Check system environment and dependencies');
|
|
108
|
+
console.log(' clean - Clean snapshot cache (remove old or stale snapshots)');
|
|
109
|
+
console.log('');
|
|
110
|
+
console.log('Use \'chaim <command> --help\' for more information');
|
|
111
|
+
process.exit(0);
|
|
112
|
+
}
|
|
113
|
+
program.parse();
|
|
114
|
+
//# sourceMappingURL=index.js.map
|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ACzB,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planned Commands Registry
|
|
3
|
+
*
|
|
4
|
+
* This module provides a single source of truth for all CLI commands,
|
|
5
|
+
* both implemented and planned. It serves as a typed roadmap for
|
|
6
|
+
* development and can be used to generate documentation or CLI help.
|
|
7
|
+
*
|
|
8
|
+
* See also: docs/CLI_ROADMAP.md
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Priority tier for command implementation
|
|
12
|
+
*/
|
|
13
|
+
export type CommandTier = 'TIER_0' | 'TIER_1' | 'TIER_2' | 'TIER_3';
|
|
14
|
+
/**
|
|
15
|
+
* Implementation status of a command
|
|
16
|
+
*/
|
|
17
|
+
export type CommandStatus = 'PLANNED' | 'STUB' | 'IMPLEMENTED';
|
|
18
|
+
/**
|
|
19
|
+
* Specification for a planned or implemented CLI command
|
|
20
|
+
*/
|
|
21
|
+
export interface PlannedCommandSpec {
|
|
22
|
+
/** Unique identifier (e.g., "auth.login") */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Command path as typed by user (e.g., "auth login") */
|
|
25
|
+
commandPath: string;
|
|
26
|
+
/** Priority tier */
|
|
27
|
+
tier: CommandTier;
|
|
28
|
+
/** One-line summary */
|
|
29
|
+
summary: string;
|
|
30
|
+
/** Detailed intent notes */
|
|
31
|
+
intentNotes: string[];
|
|
32
|
+
/** Current implementation status */
|
|
33
|
+
status: CommandStatus;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* All planned and implemented commands in priority order
|
|
37
|
+
*/
|
|
38
|
+
export declare const PLANNED_COMMANDS: PlannedCommandSpec[];
|
|
39
|
+
/**
|
|
40
|
+
* Get commands by tier
|
|
41
|
+
*/
|
|
42
|
+
export declare function getCommandsByTier(tier: CommandTier): PlannedCommandSpec[];
|
|
43
|
+
/**
|
|
44
|
+
* Get commands by status
|
|
45
|
+
*/
|
|
46
|
+
export declare function getCommandsByStatus(status: CommandStatus): PlannedCommandSpec[];
|
|
47
|
+
/**
|
|
48
|
+
* Get a command by ID
|
|
49
|
+
*/
|
|
50
|
+
export declare function getCommandById(id: string): PlannedCommandSpec | undefined;
|
|
51
|
+
//# sourceMappingURL=planned-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-commands.d.ts","sourceRoot":"","sources":["../src/planned-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oCAAoC;IACpC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAoKhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,kBAAkB,EAAE,CAEzE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,kBAAkB,EAAE,CAE/E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEzE"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Planned Commands Registry
|
|
4
|
+
*
|
|
5
|
+
* This module provides a single source of truth for all CLI commands,
|
|
6
|
+
* both implemented and planned. It serves as a typed roadmap for
|
|
7
|
+
* development and can be used to generate documentation or CLI help.
|
|
8
|
+
*
|
|
9
|
+
* See also: docs/CLI_ROADMAP.md
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getCommandById = exports.getCommandsByStatus = exports.getCommandsByTier = exports.PLANNED_COMMANDS = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* All planned and implemented commands in priority order
|
|
15
|
+
*/
|
|
16
|
+
exports.PLANNED_COMMANDS = [
|
|
17
|
+
// ===================
|
|
18
|
+
// TIER 0 - Must Have
|
|
19
|
+
// ===================
|
|
20
|
+
{
|
|
21
|
+
id: 'auth.login',
|
|
22
|
+
commandPath: 'auth login',
|
|
23
|
+
tier: 'TIER_0',
|
|
24
|
+
summary: 'Authenticate a user for CLI usage',
|
|
25
|
+
intentNotes: [
|
|
26
|
+
'Initiate browser/device OAuth flow',
|
|
27
|
+
'Obtain scoped access and refresh tokens',
|
|
28
|
+
'Store tokens securely in local keychain or encrypted file',
|
|
29
|
+
'Support multiple profiles/accounts',
|
|
30
|
+
],
|
|
31
|
+
status: 'STUB',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'auth.whoami',
|
|
35
|
+
commandPath: 'auth whoami',
|
|
36
|
+
tier: 'TIER_0',
|
|
37
|
+
summary: 'Display current authenticated user/org context',
|
|
38
|
+
intentNotes: [
|
|
39
|
+
'Show authenticated user email/ID',
|
|
40
|
+
'Show current organization context',
|
|
41
|
+
'Show active profile/app context if set',
|
|
42
|
+
'Indicate token expiry status',
|
|
43
|
+
],
|
|
44
|
+
status: 'STUB',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'auth.logout',
|
|
48
|
+
commandPath: 'auth logout',
|
|
49
|
+
tier: 'TIER_0',
|
|
50
|
+
summary: 'Clear local credentials',
|
|
51
|
+
intentNotes: [
|
|
52
|
+
'Remove stored tokens from local storage',
|
|
53
|
+
'Optionally revoke tokens server-side',
|
|
54
|
+
'Support logging out specific profile or all profiles',
|
|
55
|
+
],
|
|
56
|
+
status: 'STUB',
|
|
57
|
+
},
|
|
58
|
+
// ==========================
|
|
59
|
+
// TIER 1 - Core Productivity
|
|
60
|
+
// ==========================
|
|
61
|
+
{
|
|
62
|
+
id: 'configure',
|
|
63
|
+
commandPath: 'configure',
|
|
64
|
+
tier: 'TIER_1',
|
|
65
|
+
summary: 'Interactive setup for CLI defaults',
|
|
66
|
+
intentNotes: [
|
|
67
|
+
'Prompt for common options: appId, env, region, stack, output, javaPackage',
|
|
68
|
+
'Store in global (~/.chaim/config.json) or repo (./chaim.json) config',
|
|
69
|
+
'Validate inputs where possible',
|
|
70
|
+
'Support --global and --local flags',
|
|
71
|
+
],
|
|
72
|
+
status: 'STUB',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'apps.link',
|
|
76
|
+
commandPath: 'apps link',
|
|
77
|
+
tier: 'TIER_1',
|
|
78
|
+
summary: 'Associate CLI with a Chaim application',
|
|
79
|
+
intentNotes: [
|
|
80
|
+
'Accept app ID or prompt interactively',
|
|
81
|
+
'Validate user has access to the application',
|
|
82
|
+
'Cache app descriptor locally for offline use',
|
|
83
|
+
'Store link in repo config (./chaim.json)',
|
|
84
|
+
],
|
|
85
|
+
status: 'STUB',
|
|
86
|
+
},
|
|
87
|
+
// ==========================
|
|
88
|
+
// TIER 2 - Existing Commands
|
|
89
|
+
// ==========================
|
|
90
|
+
{
|
|
91
|
+
id: 'init',
|
|
92
|
+
commandPath: 'init',
|
|
93
|
+
tier: 'TIER_2',
|
|
94
|
+
summary: 'Verify and install all prerequisites',
|
|
95
|
+
intentNotes: [
|
|
96
|
+
'Check Node.js, Java, AWS CLI, CDK CLI versions',
|
|
97
|
+
'Optionally install missing dependencies',
|
|
98
|
+
'Bootstrap CDK if needed',
|
|
99
|
+
],
|
|
100
|
+
status: 'IMPLEMENTED',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'generate',
|
|
104
|
+
commandPath: 'generate',
|
|
105
|
+
tier: 'TIER_2',
|
|
106
|
+
summary: 'Generate SDK from schema or CDK stack',
|
|
107
|
+
intentNotes: [
|
|
108
|
+
'Read CloudFormation stack metadata',
|
|
109
|
+
'Validate schemas using chaim-bprint-spec',
|
|
110
|
+
'Generate language-specific SDK (Java first)',
|
|
111
|
+
'Future: use defaults from config, require auth for Chaim APIs',
|
|
112
|
+
],
|
|
113
|
+
status: 'IMPLEMENTED',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'validate',
|
|
117
|
+
commandPath: 'validate',
|
|
118
|
+
tier: 'TIER_2',
|
|
119
|
+
summary: 'Validate a .bprint schema file',
|
|
120
|
+
intentNotes: [
|
|
121
|
+
'Parse and validate against chaim-bprint-spec',
|
|
122
|
+
'Report detailed validation errors',
|
|
123
|
+
],
|
|
124
|
+
status: 'IMPLEMENTED',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'doctor',
|
|
128
|
+
commandPath: 'doctor',
|
|
129
|
+
tier: 'TIER_2',
|
|
130
|
+
summary: 'Check system environment and dependencies',
|
|
131
|
+
intentNotes: [
|
|
132
|
+
'Verify Node.js, Java, AWS CLI, AWS credentials',
|
|
133
|
+
'Future: validate auth status and config files',
|
|
134
|
+
],
|
|
135
|
+
status: 'IMPLEMENTED',
|
|
136
|
+
},
|
|
137
|
+
// =======================
|
|
138
|
+
// TIER 3 - Nice to Have
|
|
139
|
+
// =======================
|
|
140
|
+
{
|
|
141
|
+
id: 'auth.refresh',
|
|
142
|
+
commandPath: 'auth refresh',
|
|
143
|
+
tier: 'TIER_3',
|
|
144
|
+
summary: 'Manually refresh authentication tokens',
|
|
145
|
+
intentNotes: [
|
|
146
|
+
'Force refresh of access token using refresh token',
|
|
147
|
+
'Useful for debugging token issues',
|
|
148
|
+
'Rarely needed in normal flow (auto-refresh handled internally)',
|
|
149
|
+
],
|
|
150
|
+
status: 'STUB',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'apps.list',
|
|
154
|
+
commandPath: 'apps list',
|
|
155
|
+
tier: 'TIER_3',
|
|
156
|
+
summary: 'List applications the user can access',
|
|
157
|
+
intentNotes: [
|
|
158
|
+
'Query Chaim API for accessible applications',
|
|
159
|
+
'Display app ID, name, and access level',
|
|
160
|
+
'Support filtering and pagination',
|
|
161
|
+
],
|
|
162
|
+
status: 'STUB',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'config.show',
|
|
166
|
+
commandPath: 'config show',
|
|
167
|
+
tier: 'TIER_3',
|
|
168
|
+
summary: 'Print resolved configuration',
|
|
169
|
+
intentNotes: [
|
|
170
|
+
'Load global and repo config files',
|
|
171
|
+
'Show merged/resolved values',
|
|
172
|
+
'Indicate source of each value (global vs repo)',
|
|
173
|
+
'Useful for debugging configuration issues',
|
|
174
|
+
],
|
|
175
|
+
status: 'STUB',
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
/**
|
|
179
|
+
* Get commands by tier
|
|
180
|
+
*/
|
|
181
|
+
function getCommandsByTier(tier) {
|
|
182
|
+
return exports.PLANNED_COMMANDS.filter((cmd) => cmd.tier === tier);
|
|
183
|
+
}
|
|
184
|
+
exports.getCommandsByTier = getCommandsByTier;
|
|
185
|
+
/**
|
|
186
|
+
* Get commands by status
|
|
187
|
+
*/
|
|
188
|
+
function getCommandsByStatus(status) {
|
|
189
|
+
return exports.PLANNED_COMMANDS.filter((cmd) => cmd.status === status);
|
|
190
|
+
}
|
|
191
|
+
exports.getCommandsByStatus = getCommandsByStatus;
|
|
192
|
+
/**
|
|
193
|
+
* Get a command by ID
|
|
194
|
+
*/
|
|
195
|
+
function getCommandById(id) {
|
|
196
|
+
return exports.PLANNED_COMMANDS.find((cmd) => cmd.id === id);
|
|
197
|
+
}
|
|
198
|
+
exports.getCommandById = getCommandById;
|
|
199
|
+
//# sourceMappingURL=planned-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-commands.js","sourceRoot":"","sources":["../src/planned-commands.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA8BH;;GAEG;AACU,QAAA,gBAAgB,GAAyB;IACpD,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB;QACE,EAAE,EAAE,YAAY;QAChB,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,mCAAmC;QAC5C,WAAW,EAAE;YACX,oCAAoC;YACpC,yCAAyC;YACzC,2DAA2D;YAC3D,oCAAoC;SACrC;QACD,MAAM,EAAE,MAAM;KACf;IACD;QACE,EAAE,EAAE,aAAa;QACjB,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,gDAAgD;QACzD,WAAW,EAAE;YACX,kCAAkC;YAClC,mCAAmC;YACnC,wCAAwC;YACxC,8BAA8B;SAC/B;QACD,MAAM,EAAE,MAAM;KACf;IACD;QACE,EAAE,EAAE,aAAa;QACjB,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,yBAAyB;QAClC,WAAW,EAAE;YACX,yCAAyC;YACzC,sCAAsC;YACtC,s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AE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACvD,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the default base directory for Chaim snapshots based on OS.
|
|
3
|
+
* - macOS/Linux: ~/.chaim/cache/snapshots
|
|
4
|
+
* - Windows: %LOCALAPPDATA%/chaim/cache/snapshots (or homedir fallback)
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDefaultSnapshotBaseDir(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the snapshot base directory, respecting CHAIM_SNAPSHOT_DIR override.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getSnapshotBaseDir(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Ensure a directory exists, creating it recursively if needed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ensureDirExists(dir: string): void;
|
|
15
|
+
//# sourceMappingURL=os-cache-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-cache-paths.d.ts","sourceRoot":"","sources":["../../src/services/os-cache-paths.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAMlD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ensureDirExists = exports.getSnapshotBaseDir = exports.getDefaultSnapshotBaseDir = void 0;
|
|
27
|
+
const os = __importStar(require("os"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const fs = __importStar(require("fs"));
|
|
30
|
+
/**
|
|
31
|
+
* Get the default base directory for Chaim snapshots based on OS.
|
|
32
|
+
* - macOS/Linux: ~/.chaim/cache/snapshots
|
|
33
|
+
* - Windows: %LOCALAPPDATA%/chaim/cache/snapshots (or homedir fallback)
|
|
34
|
+
*/
|
|
35
|
+
function getDefaultSnapshotBaseDir() {
|
|
36
|
+
if (process.platform === 'win32') {
|
|
37
|
+
const localAppData = process.env.LOCALAPPDATA ?? os.homedir();
|
|
38
|
+
return path.join(localAppData, 'chaim', 'cache', 'snapshots');
|
|
39
|
+
}
|
|
40
|
+
return path.join(os.homedir(), '.chaim', 'cache', 'snapshots');
|
|
41
|
+
}
|
|
42
|
+
exports.getDefaultSnapshotBaseDir = getDefaultSnapshotBaseDir;
|
|
43
|
+
/**
|
|
44
|
+
* Get the snapshot base directory, respecting CHAIM_SNAPSHOT_DIR override.
|
|
45
|
+
*/
|
|
46
|
+
function getSnapshotBaseDir() {
|
|
47
|
+
return process.env.CHAIM_SNAPSHOT_DIR ?? getDefaultSnapshotBaseDir();
|
|
48
|
+
}
|
|
49
|
+
exports.getSnapshotBaseDir = getSnapshotBaseDir;
|
|
50
|
+
/**
|
|
51
|
+
* Ensure a directory exists, creating it recursively if needed.
|
|
52
|
+
*/
|
|
53
|
+
function ensureDirExists(dir) {
|
|
54
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
exports.ensureDirExists = ensureDirExists;
|
|
57
|
+
//# sourceMappingURL=os-cache-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-cache-paths.js","sourceRoot":"","sources":["../../src/services/os-cache-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB;;;;GAIG;AACH,SAAgB,yBAAyB;IACvC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;KAC/D;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACjE,CAAC;AAND,8DAMC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,yBAAyB,EAAE,CAAC;AACvE,CAAC;AAFD,gDAEC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery options for filtering snapshots.
|
|
3
|
+
*/
|
|
4
|
+
export interface DiscoveryOptions {
|
|
5
|
+
/** Filter by CDK stack name */
|
|
6
|
+
stackName?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Information about a discovered LOCAL snapshot file.
|
|
10
|
+
*
|
|
11
|
+
* Reflects the hierarchical path structure:
|
|
12
|
+
* aws/{accountId}/{region}/{stackName}/{datastoreType}/{resourceId}.json
|
|
13
|
+
*/
|
|
14
|
+
export interface SnapshotFileInfo {
|
|
15
|
+
/** Full path to the snapshot file */
|
|
16
|
+
filePath: string;
|
|
17
|
+
/** AWS account ID (may be 'unknown') */
|
|
18
|
+
accountId: string;
|
|
19
|
+
/** AWS region (may be 'unknown') */
|
|
20
|
+
region: string;
|
|
21
|
+
/** CDK stack name */
|
|
22
|
+
stackName: string;
|
|
23
|
+
/** Data store type (dynamodb, aurora, etc.) */
|
|
24
|
+
datastoreType: string;
|
|
25
|
+
/** Resource ID from filename ({resourceName}__{entityName}[__N]) */
|
|
26
|
+
resourceId: string;
|
|
27
|
+
/** Resource name (parsed from resourceId) */
|
|
28
|
+
resourceName: string;
|
|
29
|
+
/** Entity name (parsed from resourceId) */
|
|
30
|
+
entityName: string;
|
|
31
|
+
/** Captured timestamp from payload (for sorting) */
|
|
32
|
+
capturedAt: Date;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result of resolving a snapshot.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResolvedSnapshot {
|
|
38
|
+
/** Full path to the snapshot file */
|
|
39
|
+
filePath: string;
|
|
40
|
+
/** Parsed snapshot content */
|
|
41
|
+
snapshot: any;
|
|
42
|
+
/** Stack name */
|
|
43
|
+
stackName: string;
|
|
44
|
+
/** AWS account ID */
|
|
45
|
+
accountId: string;
|
|
46
|
+
/** AWS region */
|
|
47
|
+
region: string;
|
|
48
|
+
/** Data store type */
|
|
49
|
+
datastoreType: string;
|
|
50
|
+
/** Resource name */
|
|
51
|
+
resourceName: string;
|
|
52
|
+
/** Entity name */
|
|
53
|
+
entityName: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Recursively discover all LOCAL snapshot files in the OS cache.
|
|
57
|
+
*
|
|
58
|
+
* Directory structure:
|
|
59
|
+
* aws/{accountId}/{region}/{stackName}/{datastoreType}/{resourceId}.json
|
|
60
|
+
*
|
|
61
|
+
* @param snapshotDir - Base snapshot directory (defaults to OS cache)
|
|
62
|
+
* @param options - Discovery options for filtering
|
|
63
|
+
* @returns Array of snapshot file info, sorted by capturedAt descending (newest first)
|
|
64
|
+
*/
|
|
65
|
+
export declare function discoverSnapshots(snapshotDir?: string, options?: DiscoveryOptions): SnapshotFileInfo[];
|
|
66
|
+
/**
|
|
67
|
+
* List all snapshot files with optional stack filtering.
|
|
68
|
+
*
|
|
69
|
+
* @param snapshotDir - Base snapshot directory (defaults to OS cache)
|
|
70
|
+
* @param stackName - Optional stack name filter
|
|
71
|
+
* @returns Array of snapshot file info, sorted by capturedAt descending (newest first)
|
|
72
|
+
*/
|
|
73
|
+
export declare function listSnapshots(snapshotDir?: string, stackName?: string): SnapshotFileInfo[];
|
|
74
|
+
/**
|
|
75
|
+
* Get the latest snapshot matching the given options.
|
|
76
|
+
*
|
|
77
|
+
* @param snapshotDir - Base snapshot directory (defaults to OS cache)
|
|
78
|
+
* @param options - Discovery options for filtering
|
|
79
|
+
* @returns The latest snapshot file info, or undefined if none found
|
|
80
|
+
*/
|
|
81
|
+
export declare function getLatestSnapshot(snapshotDir?: string, options?: DiscoveryOptions): SnapshotFileInfo | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve which snapshot to use based on the requested options.
|
|
84
|
+
*
|
|
85
|
+
* Selection logic:
|
|
86
|
+
* 1. Find all snapshots matching filter (--stack if provided)
|
|
87
|
+
* 2. Select the newest by capturedAt
|
|
88
|
+
* 3. If none found, return undefined
|
|
89
|
+
*
|
|
90
|
+
* @param snapshotDir - Base snapshot directory (defaults to OS cache)
|
|
91
|
+
* @param stackName - Optional stack name filter
|
|
92
|
+
* @returns Resolved snapshot info, or undefined if no snapshot found
|
|
93
|
+
*/
|
|
94
|
+
export declare function resolveSnapshot(snapshotDir?: string, stackName?: string): ResolvedSnapshot | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Resolve all snapshots matching the given options.
|
|
97
|
+
* Used for multi-entity generation.
|
|
98
|
+
*
|
|
99
|
+
* @param snapshotDir - Base snapshot directory (defaults to OS cache)
|
|
100
|
+
* @param options - Discovery options for filtering
|
|
101
|
+
* @returns Array of resolved snapshots, or empty array if none found
|
|
102
|
+
*/
|
|
103
|
+
export declare function resolveAllSnapshots(snapshotDir?: string, options?: DiscoveryOptions): ResolvedSnapshot[];
|
|
104
|
+
/**
|
|
105
|
+
* Get the full path to the snapshot directory.
|
|
106
|
+
*
|
|
107
|
+
* @param snapshotDir - Snapshot directory (relative or absolute, or undefined for OS cache)
|
|
108
|
+
* @returns Absolute path to the snapshot directory
|
|
109
|
+
*/
|
|
110
|
+
export declare function getSnapshotDirPath(snapshotDir?: string): string;
|
|
111
|
+
//# sourceMappingURL=snapshot-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-discovery.d.ts","sourceRoot":"","sources":["../../src/services/snapshot-discovery.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,qBA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