@formigio/fazemos-cli 0.10.55 → 0.10.58

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.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * F48-B — Execution Profile Image Build CLI commands.
3
+ *
4
+ * Exports `registerImageCommands(program)` which wires the following
5
+ * subcommands under `fazemos image`:
6
+ *
7
+ * fazemos image build <name> [--ref <ref>]
8
+ * → POST /api/projects/:projectId/profiles/:name/build {ref?}
9
+ * Owner/admin only. Creates a build row + triggers the shared build service.
10
+ * Returns {buildId, status, buildRefExternal, codebuildEnabled, note?}.
11
+ * When codebuildEnabled=false, the build row is created but CodeBuild is not
12
+ * called yet (infrastructure pending). CLI surfaces the `note` field.
13
+ *
14
+ * fazemos image status <name> [--build <buildId>]
15
+ * → GET /api/projects/:projectId/profiles/:name/builds/:buildId (with --build)
16
+ * → GET /api/projects/:projectId/profiles/:name/builds (latest)
17
+ * All project members. Shows build status, resolvedSha, imageDigest, logRef.
18
+ *
19
+ * fazemos image list <name>
20
+ * → GET /api/projects/:projectId/profiles/:name/builds
21
+ * All project members. Lists up to 50 most recent builds newest-first.
22
+ *
23
+ * Auth: all commands require a valid Cognito session + active project context.
24
+ * Project ID is threaded in the URL path so noProjectHeader: true on every call.
25
+ *
26
+ * Spec: F48-phaseB-partner-custom-images-manifest.yaml §cli / §api
27
+ */
28
+ import type { Command } from 'commander';
29
+ export declare function registerImageCommands(program: Command): void;
@@ -0,0 +1,255 @@
1
+ /**
2
+ * F48-B — Execution Profile Image Build CLI commands.
3
+ *
4
+ * Exports `registerImageCommands(program)` which wires the following
5
+ * subcommands under `fazemos image`:
6
+ *
7
+ * fazemos image build <name> [--ref <ref>]
8
+ * → POST /api/projects/:projectId/profiles/:name/build {ref?}
9
+ * Owner/admin only. Creates a build row + triggers the shared build service.
10
+ * Returns {buildId, status, buildRefExternal, codebuildEnabled, note?}.
11
+ * When codebuildEnabled=false, the build row is created but CodeBuild is not
12
+ * called yet (infrastructure pending). CLI surfaces the `note` field.
13
+ *
14
+ * fazemos image status <name> [--build <buildId>]
15
+ * → GET /api/projects/:projectId/profiles/:name/builds/:buildId (with --build)
16
+ * → GET /api/projects/:projectId/profiles/:name/builds (latest)
17
+ * All project members. Shows build status, resolvedSha, imageDigest, logRef.
18
+ *
19
+ * fazemos image list <name>
20
+ * → GET /api/projects/:projectId/profiles/:name/builds
21
+ * All project members. Lists up to 50 most recent builds newest-first.
22
+ *
23
+ * Auth: all commands require a valid Cognito session + active project context.
24
+ * Project ID is threaded in the URL path so noProjectHeader: true on every call.
25
+ *
26
+ * Spec: F48-phaseB-partner-custom-images-manifest.yaml §cli / §api
27
+ */
28
+ import chalk from 'chalk';
29
+ import { api, ApiError, resolveProjectIdBySlug } from '../api.js';
30
+ // ── Project resolution ────────────────────────────────────────────────────────
31
+ async function requireProjectForImage(slugOverride) {
32
+ let projectId;
33
+ try {
34
+ projectId = await resolveProjectIdBySlug(slugOverride);
35
+ }
36
+ catch (err) {
37
+ console.error(chalk.red(err?.message ?? String(err)));
38
+ process.exit(1);
39
+ }
40
+ if (!projectId) {
41
+ console.error(chalk.red('Error: requirement missing: project'));
42
+ console.error('');
43
+ console.error(chalk.gray('Set one with: fazemos projects switch <slug>'));
44
+ console.error(chalk.gray('Or pass: --project <slug>'));
45
+ process.exit(1);
46
+ }
47
+ return projectId;
48
+ }
49
+ // ── Build status formatting ───────────────────────────────────────────────────
50
+ function buildStatusColor(status) {
51
+ switch (status) {
52
+ case 'complete': return chalk.green(status);
53
+ case 'failed':
54
+ case 'cancelled': return chalk.red(status);
55
+ case 'queued': return chalk.gray(status);
56
+ default: return chalk.yellow(status); // cloning, building, smoke, scanning, pushing
57
+ }
58
+ }
59
+ function printBuild(b, { verbose = false } = {}) {
60
+ console.log('');
61
+ console.log(`Build ${chalk.cyan(b.id)} ${buildStatusColor(b.status)}`);
62
+ console.log(` Profile ID: ${b.profileId}`);
63
+ console.log(` Requested ref: ${b.requestedRef}`);
64
+ console.log(` Resolved SHA: ${b.resolvedSha ?? '(pending)'}`);
65
+ console.log(` Image digest: ${b.imageDigest ?? '(pending)'}`);
66
+ console.log(` Image tag: ${b.imageTag ?? '(pending)'}`);
67
+ console.log(` Base version: ${b.baseVersion ?? '(pending)'}`);
68
+ console.log(` Status: ${buildStatusColor(b.status)}`);
69
+ if (b.failureReason) {
70
+ console.log(` Failure reason: ${chalk.red(b.failureReason)}`);
71
+ }
72
+ if (b.buildRefExternal) {
73
+ console.log(` External ref: ${b.buildRefExternal} ${chalk.gray('(CodeBuild ARN)')}`);
74
+ }
75
+ if (b.logRef) {
76
+ console.log(` Log ref: ${b.logRef}`);
77
+ }
78
+ console.log(` Created: ${b.createdAt ? new Date(b.createdAt).toLocaleString() : ''}`);
79
+ console.log(` Updated: ${b.updatedAt ? new Date(b.updatedAt).toLocaleString() : ''}`);
80
+ }
81
+ function handleImageError(err, profileName) {
82
+ if (err instanceof ApiError) {
83
+ if (err.code === 'INSUFFICIENT_ROLE') {
84
+ console.error(chalk.red('Error: Only project owners and admins can trigger builds'));
85
+ }
86
+ else if (err.code === 'PROFILE_NOT_FOUND') {
87
+ const hint = profileName ? ` Profile name: ${profileName}` : '';
88
+ console.error(chalk.red('Error: Profile not found'));
89
+ if (hint)
90
+ console.error(chalk.gray(hint));
91
+ }
92
+ else if (err.code === 'SOURCE_REQUIRED') {
93
+ console.error(chalk.red('Error: Profile has no registered build source — run `fazemos profiles register-source <name>` first'));
94
+ }
95
+ else if (err.code === 'BUILD_IN_PROGRESS') {
96
+ console.error(chalk.red('Error: A build is already in progress for this profile'));
97
+ console.error(chalk.gray('Run `fazemos image status <name>` to check its state, or wait for it to finish.'));
98
+ }
99
+ else if (err.code === 'BUILD_NOT_FOUND') {
100
+ console.error(chalk.red('Error: Build not found'));
101
+ }
102
+ else {
103
+ console.error(chalk.red(err.message));
104
+ }
105
+ }
106
+ else {
107
+ console.error(chalk.red(err?.message ?? String(err)));
108
+ }
109
+ process.exit(1);
110
+ }
111
+ // ── Command registration ──────────────────────────────────────────────────────
112
+ export function registerImageCommands(program) {
113
+ const image = program
114
+ .command('image')
115
+ .description('Execution profile image build management (F48-B — partner custom images)');
116
+ // ── image build ────────────────────────────────────────────────────────────
117
+ image
118
+ .command('build')
119
+ .description('Trigger a Model B image build for a profile (owner/admin only). ' +
120
+ 'Creates a build record and submits the job to the shared Fazemos build service. ' +
121
+ 'Use `fazemos image status <name>` to monitor progress.')
122
+ .argument('<name>', 'Profile name')
123
+ .option('--ref <ref>', 'Override the registered build ref (branch, tag, or commit SHA)')
124
+ .option('--project <slug>', 'Override active project for this call')
125
+ .option('--json', 'Output raw JSON')
126
+ .action(async (name, opts) => {
127
+ try {
128
+ const projectId = await requireProjectForImage(opts.project);
129
+ const body = {};
130
+ if (opts.ref)
131
+ body.ref = opts.ref;
132
+ const data = await api('POST', `/api/projects/${projectId}/profiles/${encodeURIComponent(name)}/build`, body, { noProjectHeader: true });
133
+ if (opts.json) {
134
+ console.log(JSON.stringify(data, null, 2));
135
+ return;
136
+ }
137
+ console.log(chalk.green(`Build queued for profile '${name}'.`));
138
+ console.log(` Build ID: ${data.buildId}`);
139
+ console.log(` Status: ${buildStatusColor(data.status)}`);
140
+ if (data.buildRefExternal) {
141
+ console.log(` External: ${data.buildRefExternal} ${chalk.gray('(CodeBuild ARN)')}`);
142
+ }
143
+ if (!data.codebuildEnabled) {
144
+ const note = data.note ?? 'CodeBuild infrastructure not yet deployed — build row created but CodeBuild not called.';
145
+ console.log('');
146
+ console.log(chalk.yellow(`Note: ${note}`));
147
+ console.log(chalk.gray('Once Atlas deploys the build compute stack (fazemos-tenant-image-build-{env}), builds will run end-to-end.'));
148
+ }
149
+ console.log('');
150
+ console.log(chalk.gray(`Monitor: fazemos image status ${name} --build ${data.buildId}`));
151
+ }
152
+ catch (err) {
153
+ handleImageError(err, name);
154
+ }
155
+ });
156
+ // ── image status ───────────────────────────────────────────────────────────
157
+ image
158
+ .command('status')
159
+ .description('Show build status for a profile. ' +
160
+ 'Without --build shows the latest build; with --build shows a specific build.')
161
+ .argument('<name>', 'Profile name')
162
+ .option('--build <buildId>', 'Show a specific build by ID')
163
+ .option('--project <slug>', 'Override active project for this call')
164
+ .option('--json', 'Output raw JSON')
165
+ .action(async (name, opts) => {
166
+ try {
167
+ const projectId = await requireProjectForImage(opts.project);
168
+ let data;
169
+ if (opts.build) {
170
+ data = await api('GET', `/api/projects/${projectId}/profiles/${encodeURIComponent(name)}/builds/${encodeURIComponent(opts.build)}`, undefined, { noProjectHeader: true });
171
+ if (opts.json) {
172
+ console.log(JSON.stringify(data, null, 2));
173
+ return;
174
+ }
175
+ if (!data.build) {
176
+ console.log(chalk.yellow('Build not found'));
177
+ return;
178
+ }
179
+ printBuild(data.build);
180
+ }
181
+ else {
182
+ // No specific build — fetch list, show the latest (first entry)
183
+ data = await api('GET', `/api/projects/${projectId}/profiles/${encodeURIComponent(name)}/builds`, undefined, { noProjectHeader: true });
184
+ if (opts.json) {
185
+ console.log(JSON.stringify(data, null, 2));
186
+ return;
187
+ }
188
+ const builds = data.builds ?? [];
189
+ if (builds.length === 0) {
190
+ console.log(chalk.yellow(`No builds found for profile '${name}'.`));
191
+ console.log(chalk.gray('Run `fazemos image build ' + name + '` to start one.'));
192
+ return;
193
+ }
194
+ printBuild(builds[0]);
195
+ if (builds.length > 1) {
196
+ console.log('');
197
+ console.log(chalk.gray(`(${builds.length - 1} older build(s) — run \`fazemos image list ${name}\` to see all)`));
198
+ }
199
+ }
200
+ }
201
+ catch (err) {
202
+ handleImageError(err, name);
203
+ }
204
+ });
205
+ // ── image list ─────────────────────────────────────────────────────────────
206
+ image
207
+ .command('list')
208
+ .description('List builds for a profile — newest first, up to 50 results')
209
+ .argument('<name>', 'Profile name')
210
+ .option('--project <slug>', 'Override active project for this call')
211
+ .option('--json', 'Output raw JSON')
212
+ .action(async (name, opts) => {
213
+ try {
214
+ const projectId = await requireProjectForImage(opts.project);
215
+ const data = await api('GET', `/api/projects/${projectId}/profiles/${encodeURIComponent(name)}/builds`, undefined, { noProjectHeader: true });
216
+ if (opts.json) {
217
+ console.log(JSON.stringify(data, null, 2));
218
+ return;
219
+ }
220
+ const builds = data.builds ?? [];
221
+ if (builds.length === 0) {
222
+ console.log(chalk.yellow(`No builds for profile '${name}'.`));
223
+ console.log(chalk.gray('Run `fazemos image build ' + name + '` to start one.'));
224
+ return;
225
+ }
226
+ const idW = Math.max(8, ...builds.map((b) => String(b.id ?? '').length));
227
+ const statusW = Math.max(6, ...builds.map((b) => String(b.status ?? '').length));
228
+ const refW = Math.max(12, ...builds.map((b) => String(b.requestedRef ?? '').length));
229
+ const header = [
230
+ 'BUILD ID'.padEnd(idW),
231
+ 'STATUS'.padEnd(statusW),
232
+ 'REQUESTED REF'.padEnd(refW),
233
+ 'RESOLVED SHA'.padEnd(12),
234
+ 'CREATED',
235
+ ].join(' ');
236
+ console.log(chalk.gray(header));
237
+ console.log(chalk.gray('─'.repeat(header.length + 10)));
238
+ for (const b of builds) {
239
+ const sha = b.resolvedSha ? b.resolvedSha.slice(0, 10) : '(pending) ';
240
+ const created = b.createdAt ? new Date(b.createdAt).toLocaleString() : '';
241
+ console.log([
242
+ String(b.id ?? '').padEnd(idW),
243
+ String(b.status ?? '').padEnd(statusW),
244
+ String(b.requestedRef ?? '').padEnd(refW),
245
+ sha.padEnd(12),
246
+ created,
247
+ ].join(' '));
248
+ }
249
+ }
250
+ catch (err) {
251
+ handleImageError(err, name);
252
+ }
253
+ });
254
+ }
255
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/commands/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAElE,iFAAiF;AAEjF,KAAK,UAAU,sBA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,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1E,OAAO,CAAC,GAAG,CAAC;oBACV,MAAM,CAAC,CAAC,CAAC,EAAE,IAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;oBAClC,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;oBACtC,MAAM,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;oBACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;oBACd,OAAO;iBACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * F48-B — Execution Profiles CLI commands.
3
+ *
4
+ * Exports `registerProfilesCommands(program)` which wires the following
5
+ * subcommands under `fazemos profiles`:
6
+ *
7
+ * fazemos profiles create <name>
8
+ * → POST /api/projects/:projectId/profiles {name, model, description, baseVersion, cpu, memory, networkPlacement}
9
+ * Owner/admin only. Returns { profile }.
10
+ *
11
+ * fazemos profiles list
12
+ * → GET /api/projects/:projectId/profiles
13
+ * All project members. Returns metadata list.
14
+ *
15
+ * fazemos profiles show <name>
16
+ * → GET /api/projects/:projectId/profiles/:name
17
+ * All project members. Full profile detail including build source + latest build.
18
+ *
19
+ * fazemos profiles delete <name> [-y]
20
+ * → DELETE /api/projects/:projectId/profiles/:name (owner/admin)
21
+ * Soft-deletes profile row. Prompts for confirmation unless --yes / -y is passed.
22
+ *
23
+ * fazemos profiles register-source <name>
24
+ * → POST /api/projects/:projectId/profiles/:name/source
25
+ * Owner/admin. Registers/replaces Model B build source. credentialSecretName
26
+ * is a POINTER (name of a project_secrets row); value is NEVER stored or logged.
27
+ *
28
+ * fazemos profiles register-image <name> [B2 DEFERRED — stub]
29
+ * fazemos profiles admit <name> [B2 DEFERRED — stub]
30
+ *
31
+ * Auth: all commands require a valid Cognito session + active project context.
32
+ * Project ID is threaded in the URL path so noProjectHeader: true on every call.
33
+ *
34
+ * Spec: F48-phaseB-partner-custom-images-manifest.yaml §cli / §api
35
+ */
36
+ import type { Command } from 'commander';
37
+ export declare function registerProfilesCommands(program: Command): void;