@ductape/cli 0.3.28 → 0.3.30

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.
@@ -51,7 +51,9 @@ export class ApiClient {
51
51
  endpoint: safeEndpoint(url), httpStatus: res.status,
52
52
  requestId: res.headers.get('x-request-id') ?? res.headers.get('x-correlation-id') ?? undefined,
53
53
  retryable: res.status === 408 || res.status === 429 || res.status >= 500,
54
- mutationState: mutating ? 'unknown' : 'not_attempted',
54
+ mutationState: mutating
55
+ ? (res.status >= 400 && res.status < 500 && ![408, 429].includes(res.status) ? 'confirmed_failed' : 'unknown')
56
+ : 'not_attempted',
55
57
  contentType: res.headers.get('content-type') ?? undefined,
56
58
  });
57
59
  }
package/dist/lib/http.js CHANGED
@@ -33,6 +33,7 @@ export async function parseJsonResponse(res, url, context = {}) {
33
33
  }
34
34
  }
35
35
  function responseError(message, res, url, context, code) {
36
+ const deterministicClientFailure = res.status >= 400 && res.status < 500 && ![408, 429].includes(res.status);
36
37
  return new DuctapeOperationError(message, {
37
38
  code,
38
39
  operation: context.operation ?? 'http.request',
@@ -40,7 +41,9 @@ function responseError(message, res, url, context, code) {
40
41
  httpStatus: res.status,
41
42
  requestId: res.headers.get('x-request-id') ?? res.headers.get('x-correlation-id') ?? undefined,
42
43
  retryable: res.status === 408 || res.status === 429 || res.status >= 500,
43
- mutationState: context.mutationState ?? 'not_attempted',
44
+ mutationState: deterministicClientFailure && context.mutationState === 'unknown'
45
+ ? 'confirmed_failed'
46
+ : (context.mutationState ?? 'not_attempted'),
44
47
  contentType: res.headers.get('content-type') ?? undefined,
45
48
  });
46
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Ductape CLI — local platform, login, link projects, and manage resources via the proxy (Workbench-compatible)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",