@nosana/api 2.5.1 → 2.6.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.
Files changed (33) hide show
  1. package/dist/client/clientManagerSchema.d.ts +2801 -0
  2. package/dist/client/clientManagerSchema.d.ts.map +1 -0
  3. package/dist/client/clientManagerSchema.js +6 -0
  4. package/dist/client/clientManagerSchema.js.map +1 -0
  5. package/dist/client/clientManagerSchema.lockstep.d.ts +19 -0
  6. package/dist/client/clientManagerSchema.lockstep.d.ts.map +1 -0
  7. package/dist/client/clientManagerSchema.lockstep.js +2 -0
  8. package/dist/client/clientManagerSchema.lockstep.js.map +1 -0
  9. package/dist/client/dashboardClient.d.ts +4 -1
  10. package/dist/client/dashboardClient.d.ts.map +1 -1
  11. package/dist/client/dashboardClient.js.map +1 -1
  12. package/dist/client/jobsBatch.d.ts +66 -0
  13. package/dist/client/jobsBatch.d.ts.map +1 -0
  14. package/dist/client/jobsBatch.js +10 -0
  15. package/dist/client/jobsBatch.js.map +1 -0
  16. package/dist/index.d.ts +3 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/routes/jobs/index.d.ts.map +1 -1
  21. package/dist/routes/jobs/index.js +30 -0
  22. package/dist/routes/jobs/index.js.map +1 -1
  23. package/dist/routes/jobs/types.d.ts +13 -0
  24. package/dist/routes/jobs/types.d.ts.map +1 -1
  25. package/dist/utils/errorFormatter.d.ts +31 -2
  26. package/dist/utils/errorFormatter.d.ts.map +1 -1
  27. package/dist/utils/errorFormatter.js +30 -2
  28. package/dist/utils/errorFormatter.js.map +1 -1
  29. package/dist/utils/idempotency.d.ts +25 -0
  30. package/dist/utils/idempotency.d.ts.map +1 -1
  31. package/dist/utils/idempotency.js +24 -0
  32. package/dist/utils/idempotency.js.map +1 -1
  33. package/package.json +4 -2
@@ -1,3 +1,27 @@
1
+ /**
2
+ * Machine-readable control codes the API returns (as a `409` with the code in
3
+ * the body, lifted onto {@link NosanaApiError.code}) for an idempotent request.
4
+ *
5
+ * The kit owns only this wire contract — *which* code maps to retry / fatal /
6
+ * fresh-key is the caller's policy. Removing or renaming a member is a breaking
7
+ * change, so consumers branching on these get a compile signal if they drift.
8
+ *
9
+ * These constants are kept in lockstep with the client-manager OpenAPI spec by a
10
+ * compile-time assertion in `../client/clientManagerSchema.lockstep.ts` (which
11
+ * is intentionally *not* part of the public import graph, so the large generated
12
+ * schema stays out of consumers' type graph). Regenerate the schema with
13
+ * `pnpm generate:types:client-manager:dev`.
14
+ *
15
+ * - `IN_PROGRESS` — a matching request is still in flight; retry the same key
16
+ * later (honouring `retryAfter`).
17
+ * - `EXPIRED` — the prepared transaction is provably dead; re-post with a fresh key.
18
+ * - `PAYLOAD_MISMATCH` — the same key was reused with a different payload; fatal.
19
+ */
20
+ export const IdempotencyCode = {
21
+ IN_PROGRESS: 'IDEMPOTENCY_KEY_IN_PROGRESS',
22
+ EXPIRED: 'IDEMPOTENCY_KEY_EXPIRED',
23
+ PAYLOAD_MISMATCH: 'IDEMPOTENCY_KEY_PAYLOAD_MISMATCH',
24
+ };
1
25
  /**
2
26
  * Generates a unique idempotency key suitable for the optional `idempotencyKey`
3
27
  * option on the jobs API (`list`, `extend`, `stop`).
@@ -1 +1 @@
1
- {"version":3,"file":"idempotency.js","sourceRoot":"","sources":["../../src/utils/idempotency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"idempotency.js","sourceRoot":"","sources":["../../src/utils/idempotency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,OAAO,EAAE,yBAAyB;IAClC,gBAAgB,EAAE,kCAAkC;CAC5C,CAAC;AAIX;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AACxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosana/api",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "Nosana API module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,6 +24,8 @@
24
24
  "generate:types:dev": "openapi-typescript https://dashboard.k8s.dev.nos.ci/api/swagger/json -o src/client/schema.ts",
25
25
  "generate:types:prd": "openapi-typescript https://dashboard.k8s.prd.nos.ci/api/swagger/json -o src/client/schema.ts",
26
26
  "generate:types:local": "openapi-typescript http://localhost:3000/api/swagger/json -o src/client/schema.ts",
27
+ "generate:types:client-manager:dev": "openapi-typescript https://client-manager.k8s.dev.nos.ci/swagger/json -o src/client/clientManagerSchema.ts",
28
+ "generate:types:client-manager:prd": "openapi-typescript https://client-manager.k8s.prd.nos.ci/swagger/json -o src/client/clientManagerSchema.ts",
27
29
  "test": "vitest run",
28
30
  "test:watch": "vitest",
29
31
  "test:coverage": "vitest run --coverage",
@@ -52,5 +54,5 @@
52
54
  "engines": {
53
55
  "node": ">=20.18.0"
54
56
  },
55
- "gitHead": "e3d3b1b9c487b248f0c501a7455540ae01391cea"
57
+ "gitHead": "1da5818229bc4480b4cf1e8697c0196ee9600b6b"
56
58
  }