@xemahq/workload-runtime-api-client 0.2.0 → 0.3.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 (32) hide show
  1. package/LICENSE +2 -1
  2. package/dist/custom-fetch.d.ts +17 -0
  3. package/dist/custom-fetch.js +19 -30
  4. package/dist/endpoints/runner-operations/runner-operations.d.ts +1 -1
  5. package/dist/models/paginationMeta.d.ts +1 -1
  6. package/dist/models/paginationMeta.js +1 -1
  7. package/dist/models/runnerJobDeliveryState.d.ts +1 -1
  8. package/dist/models/runnerJobDeliveryState.js +1 -1
  9. package/dist/models/runnerJobManagementControllerListParams.d.ts +2 -2
  10. package/dist/models/runnerJobManagementControllerListState.d.ts +1 -1
  11. package/dist/models/runnerJobManagementControllerListState.js +1 -1
  12. package/dist/models/runnerJobState.d.ts +1 -1
  13. package/dist/models/runnerJobState.js +1 -1
  14. package/dist/models/runnerJobSummaryDto.d.ts +3 -3
  15. package/dist/models/runnerJobSummaryDtoPaginatedEnvelope.d.ts +3 -3
  16. package/dist/models/runnerWorkloadManagementControllerListKind.d.ts +1 -1
  17. package/dist/models/runnerWorkloadManagementControllerListKind.js +1 -1
  18. package/dist/models/runnerWorkloadManagementControllerListParams.d.ts +3 -3
  19. package/dist/models/runnerWorkloadManagementControllerListState.d.ts +1 -1
  20. package/dist/models/runnerWorkloadManagementControllerListState.js +1 -1
  21. package/dist/models/runnerWorkloadSummaryDto.d.ts +4 -4
  22. package/dist/models/runnerWorkloadSummaryDtoDataEnvelope.d.ts +2 -2
  23. package/dist/models/runnerWorkloadSummaryDtoPaginatedEnvelope.d.ts +3 -3
  24. package/dist/models/workloadHealthConditionDto.d.ts +2 -2
  25. package/dist/models/workloadHealthConditionDtoStatus.d.ts +1 -1
  26. package/dist/models/workloadHealthConditionDtoStatus.js +1 -1
  27. package/dist/models/workloadHealthSnapshotDto.d.ts +2 -2
  28. package/dist/models/workloadKind.d.ts +1 -1
  29. package/dist/models/workloadKind.js +1 -1
  30. package/dist/models/workloadState.d.ts +1 -1
  31. package/dist/models/workloadState.js +1 -1
  32. package/package.json +7 -1
package/LICENSE CHANGED
@@ -9,7 +9,7 @@ Parameters
9
9
 
10
10
  Licensor: Neuralchowder Inc.
11
11
 
12
- Licensed Work: Xema. The Licensed Work is (c) 2026 Neuralchowder Inc..
12
+ Licensed Work: Xema. The Licensed Work is (c) 2026 Neuralchowder Inc.
13
13
 
14
14
  The Licensed Work includes, without limitation, Xema Core, Xema Runtime,
15
15
  Xema Kernel, Xema control plane, Xema application runtime, Xema biome
@@ -116,6 +116,7 @@ the interpretation of, the Additional Use Grant set out above.
116
116
  and effect. The Licensor reserves all rights not expressly granted
117
117
  by this License.
118
118
 
119
+
119
120
  Change Date: Four years from the date the specific version of the Licensed
120
121
  Work is first publicly released by Licensor.
121
122
 
@@ -26,5 +26,22 @@ export declare class ClientError extends Error {
26
26
  }
27
27
  export declare function configureClient(config: ClientConfig): void;
28
28
  export declare function getClientConfig(): ClientConfig;
29
+ /**
30
+ * Returns the response body EXACTLY as the service sent it.
31
+ *
32
+ * Xema platform services wrap every 2xx payload in a `{ data: T }` envelope
33
+ * (`{ data: T[], pagination }` for lists) via the global
34
+ * ResponseEnvelopeInterceptor. That envelope is part of the wire contract, so
35
+ * controllers document it with the `@ApiDataResponse` / `@ApiDataArrayResponse`
36
+ * / `@ApiPaginatedResponse` family and the generated types describe it —
37
+ * consumers read `.data`.
38
+ *
39
+ * This client therefore does NOT peel the envelope. It used to, which made the
40
+ * transport contradict the published schema: any endpoint documented honestly
41
+ * returned `undefined` from `.data` at runtime. Do not re-introduce an unwrap
42
+ * here — fix the controller's decorator instead.
43
+ *
44
+ * Only 2xx bodies are returned: non-2xx is surfaced as a thrown ClientError.
45
+ */
29
46
  export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
30
47
  export default customFetch;
@@ -49,6 +49,23 @@ async function buildHeaders(config, callerHeaders) {
49
49
  }
50
50
  return headers;
51
51
  }
52
+ /**
53
+ * Returns the response body EXACTLY as the service sent it.
54
+ *
55
+ * Xema platform services wrap every 2xx payload in a `{ data: T }` envelope
56
+ * (`{ data: T[], pagination }` for lists) via the global
57
+ * ResponseEnvelopeInterceptor. That envelope is part of the wire contract, so
58
+ * controllers document it with the `@ApiDataResponse` / `@ApiDataArrayResponse`
59
+ * / `@ApiPaginatedResponse` family and the generated types describe it —
60
+ * consumers read `.data`.
61
+ *
62
+ * This client therefore does NOT peel the envelope. It used to, which made the
63
+ * transport contradict the published schema: any endpoint documented honestly
64
+ * returned `undefined` from `.data` at runtime. Do not re-introduce an unwrap
65
+ * here — fix the controller's decorator instead.
66
+ *
67
+ * Only 2xx bodies are returned: non-2xx is surfaced as a thrown ClientError.
68
+ */
52
69
  const customFetch = async (url, options) => {
53
70
  const config = getClientConfig();
54
71
  const base = config.baseUrlResolver
@@ -74,14 +91,14 @@ const customFetch = async (url, options) => {
74
91
  if (retryResponse.status >= 400) {
75
92
  throw new ClientError(retryResponse.status, fullUrl, retryBody);
76
93
  }
77
- return unwrapEnvelope(retryBody);
94
+ return retryBody;
78
95
  }
79
96
  if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
80
97
  const body = await parseBody(response);
81
98
  if (response.status >= 400) {
82
99
  throw new ClientError(response.status, fullUrl, body);
83
100
  }
84
- return unwrapEnvelope(body);
101
+ return body;
85
102
  }
86
103
  const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
87
104
  const waitMs = retryAfter ?? addJitter(delay);
@@ -102,34 +119,6 @@ const customFetch = async (url, options) => {
102
119
  throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
103
120
  };
104
121
  exports.customFetch = customFetch;
105
- /**
106
- * Xema platform services wrap every 2xx payload in a { data: T } envelope via
107
- * the global ResponseEnvelopeInterceptor (platform-common). Generated types
108
- * describe the INNER T (controllers declare their return type as T, not
109
- * { data: T }), so the client must peel data to keep the static types and the
110
- * wire shape consistent — otherwise consumers read fields off the envelope and
111
- * get undefined.
112
- *
113
- * Only 2xx bodies reach this helper: non-2xx responses are surfaced as a thrown
114
- * ClientError before unwrap, and error envelopes are emitted by the
115
- * GlobalExceptionFilter, never wrapped in { data }. Paginated lists arrive as
116
- * { data: T[], pagination: {...} }; consumers read both fields, so that envelope
117
- * is kept intact (detected by the presence of pagination). Any body without a
118
- * top-level data field is returned as-is.
119
- */
120
- function unwrapEnvelope(body) {
121
- if (body === null ||
122
- typeof body !== 'object' ||
123
- Array.isArray(body) ||
124
- !('data' in body)) {
125
- return body;
126
- }
127
- const envelope = body;
128
- if ('pagination' in envelope) {
129
- return envelope;
130
- }
131
- return envelope.data;
132
- }
133
122
  async function parseBody(response) {
134
123
  const contentType = response.headers.get('content-type');
135
124
  if (contentType?.includes('application/json')) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { RunnerJobManagementControllerListState } from './runnerJobManagementControllerListState';
8
+ import type { RunnerJobManagementControllerListState } from './runnerJobManagementControllerListState.js';
9
9
  export type RunnerJobManagementControllerListParams = {
10
10
  runnerId?: string;
11
11
  cursor?: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { RunnerJobDeliveryState } from './runnerJobDeliveryState';
9
- import type { RunnerJobState } from './runnerJobState';
8
+ import type { RunnerJobDeliveryState } from './runnerJobDeliveryState.js';
9
+ import type { RunnerJobState } from './runnerJobState.js';
10
10
  export interface RunnerJobSummaryDto {
11
11
  jobId: string;
12
12
  projectId?: string;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { PaginationMeta } from './paginationMeta';
9
- import type { RunnerJobSummaryDto } from './runnerJobSummaryDto';
8
+ import type { PaginationMeta } from './paginationMeta.js';
9
+ import type { RunnerJobSummaryDto } from './runnerJobSummaryDto.js';
10
10
  export interface RunnerJobSummaryDtoPaginatedEnvelope {
11
11
  data: RunnerJobSummaryDto[];
12
12
  pagination: PaginationMeta;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { RunnerWorkloadManagementControllerListKind } from './runnerWorkloadManagementControllerListKind';
9
- import type { RunnerWorkloadManagementControllerListState } from './runnerWorkloadManagementControllerListState';
8
+ import type { RunnerWorkloadManagementControllerListKind } from './runnerWorkloadManagementControllerListKind.js';
9
+ import type { RunnerWorkloadManagementControllerListState } from './runnerWorkloadManagementControllerListState.js';
10
10
  export type RunnerWorkloadManagementControllerListParams = {
11
11
  projectId?: string;
12
12
  ownerKey?: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { WorkloadHealthSnapshotDto } from './workloadHealthSnapshotDto';
9
- import type { WorkloadKind } from './workloadKind';
10
- import type { WorkloadState } from './workloadState';
8
+ import type { WorkloadHealthSnapshotDto } from './workloadHealthSnapshotDto.js';
9
+ import type { WorkloadKind } from './workloadKind.js';
10
+ import type { WorkloadState } from './workloadState.js';
11
11
  export interface RunnerWorkloadSummaryDto {
12
12
  id: string;
13
13
  kind: WorkloadKind;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { RunnerWorkloadSummaryDto } from './runnerWorkloadSummaryDto';
8
+ import type { RunnerWorkloadSummaryDto } from './runnerWorkloadSummaryDto.js';
9
9
  export interface RunnerWorkloadSummaryDtoDataEnvelope {
10
10
  data: RunnerWorkloadSummaryDto;
11
11
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { PaginationMeta } from './paginationMeta';
9
- import type { RunnerWorkloadSummaryDto } from './runnerWorkloadSummaryDto';
8
+ import type { PaginationMeta } from './paginationMeta.js';
9
+ import type { RunnerWorkloadSummaryDto } from './runnerWorkloadSummaryDto.js';
10
10
  export interface RunnerWorkloadSummaryDtoPaginatedEnvelope {
11
11
  data: RunnerWorkloadSummaryDto[];
12
12
  pagination: PaginationMeta;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { WorkloadHealthConditionDtoStatus } from './workloadHealthConditionDtoStatus';
8
+ import type { WorkloadHealthConditionDtoStatus } from './workloadHealthConditionDtoStatus.js';
9
9
  export interface WorkloadHealthConditionDto {
10
10
  type: string;
11
11
  status: WorkloadHealthConditionDtoStatus;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
- import type { WorkloadHealthConditionDto } from './workloadHealthConditionDto';
8
+ import type { WorkloadHealthConditionDto } from './workloadHealthConditionDto.js';
9
9
  export interface WorkloadHealthSnapshotDto {
10
10
  replicasReady: number;
11
11
  replicasDesired: number;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v8.6.2 🍺
2
+ * Generated by orval v8.16.0 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
5
  * Declarative workload scheduling for biome sidecars, biome APIs,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Generated by orval v8.6.2 🍺
3
+ * Generated by orval v8.16.0 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
6
  * Declarative workload scheduling for biome sidecars, biome APIs,
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "@xemahq/workload-runtime-api-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/xema-dev/xema-base.git",
7
+ "directory": "packages/clients/workload-runtime-api"
8
+ },
9
+ "license": "LicenseRef-Xema-BSL-1.1",
4
10
  "main": "./dist/index.js",
5
11
  "types": "./dist/index.d.ts",
6
12
  "files": [