@blinkhost/cli 2.5.1 → 2.5.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  This file records customer-visible CLI changes. BlinkHost uses semantic versioning for the CLI, while security and migration impact are classified separately. A patch may therefore require prompt action, and a major release may coexist with an earlier supported line during its documented migration window.
4
4
 
5
+ ## 2.5.2 — Deployment request recovery
6
+
7
+ Activate, promote, retry and rollback now require a saved `--idempotency-key`.
8
+ After a timeout, `deployments publication-lookup --idempotency-key KEY` reads
9
+ the original request using the same account and profile. Known operations can
10
+ be inspected with `deployments publication-status OPERATION_ID`. Neither
11
+ recovery command resubmits work. Preserve the original key when a response is
12
+ lost; a new key represents a new request.
13
+
14
+ These commands require a control plane with deployment publication support.
15
+ Update deployment scripts to supply the key before upgrading. Publication
16
+ success confirms the control-plane commit; `result_status` and
17
+ `result_is_current` describe propagation and current routing separately.
18
+ Workspace permissions, approvals and Idam limited-preview policy still apply.
19
+
5
20
  ## 2.5.1 — Saved-session concurrency
6
21
 
7
22
  Commands sharing a saved profile now serialize credential refresh and sign-out.
package/README.md CHANGED
@@ -7,7 +7,7 @@ The BlinkHost CLI brings project setup, local development, source control, previ
7
7
  Node.js 22.12 or newer is required.
8
8
 
9
9
  ```bash
10
- npm install --global @blinkhost/cli@2.5.0
10
+ npm install --global @blinkhost/cli@2.5.2
11
11
  blinkhost --version
12
12
  ```
13
13
 
@@ -15,6 +15,15 @@ Signed release archives, checksums, the CycloneDX SBOM, and Sigstore verificatio
15
15
 
16
16
  ## Current release
17
17
 
18
+ ### 2.5.2 — deployment request recovery
19
+
20
+ Activate, promote, retry and rollback require a saved `--idempotency-key`.
21
+ Update scripts to supply a key before upgrading. These commands require a
22
+ control plane with deployment publication support; recovery reads the original
23
+ request after a timeout without submitting another deployment. Keep the same
24
+ account, profile and key while recovering. Workspace permissions and approvals
25
+ still apply.
26
+
18
27
  ### 2.5.1 — saved-session concurrency
19
28
 
20
29
  Commands sharing a saved profile serialize credential refresh and sign-out so
@@ -347,9 +356,24 @@ Create and update operations accept a JSON object or `@path` to a JSON file:
347
356
 
348
357
  ```bash
349
358
  blinkhost projects create --data @project.json
350
- blinkhost deployments action DEPLOYMENT_ID rollback --data @rollback.json
359
+ blinkhost deployments action DEPLOYMENT_ID rollback --data @rollback.json --idempotency-key SAVED_REQUEST_KEY
351
360
  ```
352
361
 
362
+ For activate, promote, retry and rollback, save a unique request key before the
363
+ first command. Keys accept 8–128 letters, digits, dots, underscores, colons or
364
+ hyphens. If the response is lost, use the same account and profile to inspect
365
+ the original request:
366
+
367
+ ```bash
368
+ blinkhost deployments publication-lookup --idempotency-key SAVED_REQUEST_KEY
369
+ blinkhost deployments publication-status OPERATION_ID
370
+ ```
371
+
372
+ These recovery commands only read status. A new key starts a separate request;
373
+ do not replace a key because of a timeout. Publication success confirms the
374
+ control-plane commit. Inspect `result_status` and `result_is_current` to check
375
+ release propagation and current routing.
376
+
353
377
  Destructive operations require the exact resource ID twice:
354
378
 
355
379
  ```bash
@@ -436,7 +460,7 @@ Pin or roll back explicitly with `npm install --global @blinkhost/cli@VERSION`.
436
460
  ```bash
437
461
  cosign verify-blob \
438
462
  --bundle SHA256SUMS.sigstore.json \
439
- --certificate-identity "https://github.com/blinkhost-ltd/blinkhost-cli/.github/workflows/release.yml@refs/tags/v2.5.0" \
463
+ --certificate-identity "https://github.com/blinkhost-ltd/blinkhost-cli/.github/workflows/release.yml@refs/tags/v2.5.2" \
440
464
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
441
465
  SHA256SUMS
442
466
  ```
package/dist/guidance.js CHANGED
@@ -141,7 +141,11 @@ const TOPICS = {
141
141
  connections: resource('connections', 'Manage project-to-repository source connections.'),
142
142
  previews: resource('previews', 'Manage temporary preview environments.', ['`previews wait ID [--timeout 10..3600]` waits for a terminal state. `previews open ID` accepts only trusted BlinkHost HTTPS preview hosts. Preview operations can consume plan resources.']),
143
143
  builds: resource('builds', 'Create, inspect and wait for verified builds.', ['`builds wait ID [--timeout 10..3600]` stops on success, failure, cancellation, expiry or timeout. Builds can consume plan resources.']),
144
- deployments: resource('deployments', 'Manage production deployments and protected release actions.', ['Rollback uses `deployments action DEPLOYMENT_ID rollback --data @rollback.json`. Protected environments can require approval and a verified artifact. Deployment operations can consume plan resources.']),
144
+ deployments: resource('deployments', 'Manage production deployments and protected release actions.', [
145
+ 'Activate, promote, retry and rollback require a saved request key: `deployments action DEPLOYMENT_ID rollback --idempotency-key KEY`. Use 8–128 letters, digits, dots, underscores, colons or hyphens. A new key means a new request.',
146
+ 'After a timeout, use `deployments publication-lookup --idempotency-key KEY` with the same account and profile. Inspect a known operation with `deployments publication-status OPERATION_ID`. Keep the original key when recovering a request; these commands never resubmit it.',
147
+ 'Publication success confirms the control-plane commit. Check result_status and result_is_current to establish release propagation and current routing. Protected environments can require approval and a verified artifact. Deployment operations can consume plan resources.',
148
+ ]),
145
149
  modules: resource('modules', 'Manage Rust, Go, Python, JavaScript and TypeScript Functions.'),
146
150
  functions: {
147
151
  name: 'functions', title: 'Function triggers and runs', summary: 'Manage beta event, schedule and background triggers with explicit retry and idempotency controls.',
package/dist/remote.js CHANGED
@@ -63,6 +63,12 @@ function validIdempotencyKey(value) {
63
63
  throw new CliError('Idempotency keys must be from 1 to 256 bytes and cannot contain control characters.', EXIT.usage, 'invalid_idempotency_key');
64
64
  return value;
65
65
  }
66
+ function publicationKey(value) {
67
+ if (!value || !/^[A-Za-z0-9._:-]{8,128}$/.test(value)) {
68
+ throw new CliError('Publication requires --idempotency-key KEY: 8–128 letters, digits, dots, underscores, colons or hyphens. Save this key to recover the same request after a timeout.', EXIT.usage, 'publication_key_required');
69
+ }
70
+ return value;
71
+ }
66
72
  async function readPayload(value) {
67
73
  if (!value)
68
74
  return {};
@@ -109,9 +115,27 @@ export async function runRemote(group, input, profile) {
109
115
  const project = takeOption(args, '--project');
110
116
  const query = takeRepeated(args, '--query');
111
117
  const dataOption = takeOption(args, '--data');
118
+ const publicationKeyOption = group === 'deployments' && ['action', 'publication-lookup'].includes(action)
119
+ ? takeOption(args, '--idempotency-key') : undefined;
120
+ const isPublication = group === 'deployments' && action === 'action'
121
+ && ['activate', 'promote', 'retry', 'rollback'].includes(args[1] || '');
122
+ const key = isPublication || (group === 'deployments' && action === 'publication-lookup')
123
+ ? publicationKey(publicationKeyOption) : undefined;
124
+ if (publicationKeyOption !== undefined && key === undefined) {
125
+ throw new CliError('--idempotency-key is supported here only for activate, promote, retry and rollback.', EXIT.usage, 'unexpected_argument');
126
+ }
112
127
  const client = await ApiClient.create(profile);
113
128
  const base = collectionPath(group, project);
114
129
  const data = await readPayload(dataOption);
130
+ if (group === 'deployments' && ['publication-status', 'publication-lookup'].includes(action)) {
131
+ if (query.length || dataOption || project)
132
+ throw new CliError('Publication recovery accepts only its operation ID or original idempotency key.', EXIT.usage, 'unexpected_argument');
133
+ const path = action === 'publication-status'
134
+ ? `/api/deployment-publications/${safeIdentifier(args.shift(), 'Operation ID')}/`
135
+ : '/api/deployment-publications/lookup/';
136
+ noExtra(args);
137
+ return client.request(path, key ? { headers: { 'Idempotency-Key': key } } : {});
138
+ }
115
139
  if (action === 'list') {
116
140
  noExtra(args);
117
141
  return client.request(`${base}${queryString(query)}`);
@@ -143,6 +167,24 @@ export async function runRemote(group, input, profile) {
143
167
  const id = safeIdentifier(args.shift());
144
168
  const operation = safeIdentifier(args.shift(), 'Action');
145
169
  noExtra(args);
170
+ if (isPublication && key) {
171
+ try {
172
+ const result = await client.request(`${base}${id}/${operation}/`, {
173
+ method: 'POST', body: JSON.stringify(data), headers: { 'Idempotency-Key': key },
174
+ });
175
+ return { ...result, idempotency_key: key };
176
+ }
177
+ catch (error) {
178
+ if (error instanceof CliError) {
179
+ throw new CliError(error.message, error.exitCode, error.code, [...error.details,
180
+ `Publication key: ${key}`,
181
+ `Check with the same account and profile: blinkhost deployments publication-lookup --idempotency-key ${key}`,
182
+ 'A timeout or server error may follow a committed request. Keep the original key; do not submit a replacement request.',
183
+ ]);
184
+ }
185
+ throw error;
186
+ }
187
+ }
146
188
  return client.request(`${base}${id}/${operation}/`, { method: 'POST', body: JSON.stringify(data) });
147
189
  }
148
190
  throw new CliError(`Unknown ${group} action: ${action}.`, EXIT.usage, 'unknown_action');
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "2.5.1";
1
+ export declare const VERSION = "2.5.2";
2
2
  export declare const DOCUMENTATION_URL = "https://app.blinkhost.me/docs/source-control/cli";
3
3
  export declare const RELEASES_URL = "https://github.com/blinkhost-ltd/blinkhost-cli/releases";
4
4
  export declare function supportedNodeVersion(version?: string): boolean;
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = '2.5.1';
1
+ export const VERSION = '2.5.2';
2
2
  export const DOCUMENTATION_URL = 'https://app.blinkhost.me/docs/source-control/cli';
3
3
  export const RELEASES_URL = 'https://github.com/blinkhost-ltd/blinkhost-cli/releases';
4
4
  export function supportedNodeVersion(version = process.versions.node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkhost/cli",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "Secure local and remote developer workflows for BlinkHost",
5
5
  "keywords": ["blinkhost", "deployment", "hosting", "cloud", "cli", "developer-tools"],
6
6
  "homepage": "https://app.blinkhost.me/docs/source-control/cli",