@xemahq/workload-runtime-api-client 0.1.1 → 0.2.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 (107) hide show
  1. package/LICENSE +174 -1
  2. package/README.md +62 -0
  3. package/dist/custom-fetch.d.ts +6 -28
  4. package/dist/custom-fetch.js +14 -29
  5. package/dist/endpoints/runner-operations/runner-operations.d.ts +14 -0
  6. package/dist/endpoints/runner-operations/runner-operations.js +75 -0
  7. package/dist/index.d.ts +1 -5
  8. package/dist/index.js +2 -6
  9. package/dist/models/index.d.ts +11 -34
  10. package/dist/models/index.js +11 -34
  11. package/dist/models/paginationMeta.d.ts +1 -1
  12. package/dist/models/paginationMeta.js +1 -1
  13. package/dist/models/runnerJobDeliveryState.d.ts +17 -0
  14. package/dist/models/runnerJobDeliveryState.js +19 -0
  15. package/dist/models/runnerJobManagementControllerListParams.d.ts +14 -0
  16. package/dist/models/{runnerJobsControllerListState.d.ts → runnerJobManagementControllerListState.d.ts} +3 -3
  17. package/dist/models/{runnerJobsControllerListState.js → runnerJobManagementControllerListState.js} +3 -3
  18. package/dist/models/runnerJobState.d.ts +1 -1
  19. package/dist/models/runnerJobState.js +1 -1
  20. package/dist/models/runnerJobSummaryDto.d.ts +27 -0
  21. package/dist/models/{runnerJobDtoPaginatedEnvelope.d.ts → runnerJobSummaryDtoPaginatedEnvelope.d.ts} +5 -5
  22. package/dist/models/{workloadsControllerListKind.d.ts → runnerWorkloadManagementControllerListKind.d.ts} +5 -3
  23. package/dist/models/{workloadsControllerListKind.js → runnerWorkloadManagementControllerListKind.js} +5 -3
  24. package/dist/models/runnerWorkloadManagementControllerListParams.d.ts +17 -0
  25. package/dist/models/{workloadsControllerListState.d.ts → runnerWorkloadManagementControllerListState.d.ts} +3 -3
  26. package/dist/models/{workloadsControllerListState.js → runnerWorkloadManagementControllerListState.js} +3 -3
  27. package/dist/models/runnerWorkloadSummaryDto.d.ts +22 -0
  28. package/dist/models/{workloadConnectionInfoDto.d.ts → runnerWorkloadSummaryDtoDataEnvelope.d.ts} +4 -5
  29. package/dist/models/{workloadInstanceDtoPaginatedEnvelope.d.ts → runnerWorkloadSummaryDtoPaginatedEnvelope.d.ts} +5 -5
  30. package/dist/models/workloadHealthConditionDto.d.ts +1 -1
  31. package/dist/models/workloadHealthConditionDtoStatus.d.ts +1 -1
  32. package/dist/models/workloadHealthConditionDtoStatus.js +1 -1
  33. package/dist/models/workloadHealthSnapshotDto.d.ts +1 -1
  34. package/dist/models/workloadKind.d.ts +3 -1
  35. package/dist/models/workloadKind.js +3 -1
  36. package/dist/models/workloadState.d.ts +1 -1
  37. package/dist/models/workloadState.js +1 -1
  38. package/package.json +12 -2
  39. package/dist/endpoints/health/health.d.ts +0 -15
  40. package/dist/endpoints/health/health.js +0 -53
  41. package/dist/endpoints/internal/internal.d.ts +0 -6
  42. package/dist/endpoints/internal/internal.js +0 -26
  43. package/dist/endpoints/internal-/342/200/224-build-container-image/internal-/342/200/224-build-container-image.d.ts +0 -14
  44. package/dist/endpoints/internal-/342/200/224-build-container-image/internal-/342/200/224-build-container-image.js +0 -21
  45. package/dist/endpoints/runner-jobs/runner-jobs.d.ts +0 -37
  46. package/dist/endpoints/runner-jobs/runner-jobs.js +0 -101
  47. package/dist/endpoints/workloads/workloads.d.ts +0 -45
  48. package/dist/endpoints/workloads/workloads.js +0 -125
  49. package/dist/models/createRunnerJobDto.d.ts +0 -27
  50. package/dist/models/createRunnerJobDto.js +0 -9
  51. package/dist/models/runKanikoRequestDto.d.ts +0 -30
  52. package/dist/models/runKanikoRequestDtoBuildArgs.d.ts +0 -10
  53. package/dist/models/runKanikoRequestDtoBuildArgs.js +0 -9
  54. package/dist/models/runKanikoResponseDto.d.ts +0 -13
  55. package/dist/models/runKanikoResponseDto.js +0 -9
  56. package/dist/models/runnerJobDto.d.ts +0 -30
  57. package/dist/models/runnerJobDtoOutput.d.ts +0 -14
  58. package/dist/models/runnerJobDtoOutput.js +0 -9
  59. package/dist/models/runnerJobReportDto.d.ts +0 -23
  60. package/dist/models/runnerJobReportDtoOutput.d.ts +0 -13
  61. package/dist/models/runnerJobReportDtoOutput.js +0 -9
  62. package/dist/models/runnerJobsControllerListParams.d.ts +0 -14
  63. package/dist/models/workloadConnectionInfoDto.js +0 -9
  64. package/dist/models/workloadDescriptorDto.d.ts +0 -33
  65. package/dist/models/workloadDescriptorDtoCapabilitiesItem.d.ts +0 -12
  66. package/dist/models/workloadDescriptorDtoCapabilitiesItemKind.d.ts +0 -14
  67. package/dist/models/workloadDescriptorDtoCapabilitiesItemKind.js +0 -16
  68. package/dist/models/workloadDescriptorDtoSpec.d.ts +0 -13
  69. package/dist/models/workloadDescriptorDtoSpec.js +0 -9
  70. package/dist/models/workloadEndpointDto.d.ts +0 -11
  71. package/dist/models/workloadEndpointDto.js +0 -9
  72. package/dist/models/workloadGatewayRouteDto.d.ts +0 -22
  73. package/dist/models/workloadGatewayRouteDto.js +0 -2
  74. package/dist/models/workloadGatewayRouteDtoAuthParams.d.ts +0 -13
  75. package/dist/models/workloadGatewayRouteDtoAuthParams.js +0 -9
  76. package/dist/models/workloadGatewayRouteDtoAuthScheme.d.ts +0 -14
  77. package/dist/models/workloadGatewayRouteDtoAuthScheme.js +0 -13
  78. package/dist/models/workloadIngressSourceDto.d.ts +0 -11
  79. package/dist/models/workloadIngressSourceDto.js +0 -9
  80. package/dist/models/workloadInstanceDto.d.ts +0 -36
  81. package/dist/models/workloadInstanceDto.js +0 -2
  82. package/dist/models/workloadInstanceDtoPaginatedEnvelope.js +0 -2
  83. package/dist/models/workloadInstanceDtoSubjectLabels.d.ts +0 -10
  84. package/dist/models/workloadInstanceDtoSubjectLabels.js +0 -9
  85. package/dist/models/workloadLifecycleDto.d.ts +0 -12
  86. package/dist/models/workloadLifecycleDto.js +0 -9
  87. package/dist/models/workloadNetworkDto.d.ts +0 -12
  88. package/dist/models/workloadNetworkDto.js +0 -2
  89. package/dist/models/workloadNodeAffinityDto.d.ts +0 -10
  90. package/dist/models/workloadNodeAffinityDto.js +0 -9
  91. package/dist/models/workloadTarget.d.ts +0 -11
  92. package/dist/models/workloadTarget.js +0 -13
  93. package/dist/models/workloadTenancyDto.d.ts +0 -15
  94. package/dist/models/workloadTenancyDto.js +0 -2
  95. package/dist/models/workloadTenancyDtoSubjectLabels.d.ts +0 -10
  96. package/dist/models/workloadTenancyDtoSubjectLabels.js +0 -9
  97. package/dist/models/workloadVolumeMountDto.d.ts +0 -16
  98. package/dist/models/workloadVolumeMountDto.js +0 -9
  99. package/dist/models/workloadsControllerListParams.d.ts +0 -18
  100. package/dist/models/workloadsControllerListParams.js +0 -2
  101. /package/dist/models/{runKanikoRequestDto.js → runnerJobManagementControllerListParams.js} +0 -0
  102. /package/dist/models/{runnerJobDto.js → runnerJobSummaryDto.js} +0 -0
  103. /package/dist/models/{runnerJobDtoPaginatedEnvelope.js → runnerJobSummaryDtoPaginatedEnvelope.js} +0 -0
  104. /package/dist/models/{runnerJobReportDto.js → runnerWorkloadManagementControllerListParams.js} +0 -0
  105. /package/dist/models/{runnerJobsControllerListParams.js → runnerWorkloadSummaryDto.js} +0 -0
  106. /package/dist/models/{workloadDescriptorDto.js → runnerWorkloadSummaryDtoDataEnvelope.js} +0 -0
  107. /package/dist/models/{workloadDescriptorDtoCapabilitiesItem.js → runnerWorkloadSummaryDtoPaginatedEnvelope.js} +0 -0
package/LICENSE CHANGED
@@ -1 +1,174 @@
1
- Copyright (c) 2026 Xema. All rights reserved.
1
+ Xema Business Source License 1.1
2
+
3
+ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ -----------------------------------------------------------------------------
7
+
8
+ Parameters
9
+
10
+ Licensor: Neuralchowder Inc.
11
+
12
+ Licensed Work: Xema. The Licensed Work is (c) 2026 Neuralchowder Inc..
13
+
14
+ The Licensed Work includes, without limitation, Xema Core, Xema Runtime,
15
+ Xema Kernel, Xema control plane, Xema application runtime, Xema biome
16
+ runtime, Xema biome registry, Xema store services, Xema orchestration
17
+ services, Xema agents, Xema skills, Xema memory services, Xema APIs, Xema
18
+ user interfaces, Xema command-line tools, Xema deployment artifacts, Xema
19
+ templates, Xema specifications, Xema schemas, Xema manifests, Xema
20
+ documentation, Xema examples, and all source code, object code, binaries,
21
+ packages, modules, configuration files, manifests, schemas, examples,
22
+ templates, documentation, and derivative works included in or distributed
23
+ as part of the Xema software project.
24
+
25
+ The Licensed Work does not include any third-party software, libraries,
26
+ dependencies, packages, assets, or components that are distributed with the
27
+ Licensed Work but are governed by their own separate license terms. Such
28
+ third-party materials remain subject to their respective licenses.
29
+
30
+ A specific file, package, component, or directory may state that it is
31
+ governed by a different license. In that case, that specific file, package,
32
+ component, or directory is governed by the license expressly stated therein.
33
+
34
+ Additional Use Grant:
35
+
36
+ You may make production use of the Licensed Work, provided that your use
37
+ does not include offering, providing, making available, distributing,
38
+ hosting, managing, embedding, reselling, white-labeling, sublicensing,
39
+ commercializing, or otherwise making the Licensed Work, or any modified
40
+ version or derivative work of the Licensed Work, available to Third Parties
41
+ as part of a Competitive Offering.
42
+
43
+ The following definitions and clarifications form part of, and govern
44
+ the interpretation of, the Additional Use Grant set out above.
45
+
46
+ 1. "Production Use" means any use of the Licensed Work other than for
47
+ development, testing, evaluation, demonstration, experimentation,
48
+ benchmarking, or other non-production purposes.
49
+
50
+ 2. "Affiliate" means any entity that, directly or indirectly,
51
+ controls, is controlled by, or is under common control with you,
52
+ where "control" means ownership of more than fifty percent (50%) of
53
+ the voting interests of the entity, or the power to direct its
54
+ management.
55
+
56
+ 3. "Third Party" means any natural person or legal entity other than
57
+ you and your Affiliates.
58
+
59
+ 4. "Competitive Offering" means any product or service, made available
60
+ to one or more Third Parties for a fee or other consideration
61
+ (including without limitation on a paid, subscription,
62
+ advertising-supported, hosted, or managed-service basis), that is
63
+ offered or marketed as, or that competes with, a software platform,
64
+ runtime, orchestration system, agent or automation system,
65
+ extension or distribution marketplace, or other software system
66
+ that provides, in substantial part, the same or substantially
67
+ similar capabilities as those provided by the Licensed Work. A
68
+ product or service is a Competitive Offering whether the Licensed
69
+ Work is provided in whole or in part, alone or bundled with other
70
+ software, and whether modified or unmodified.
71
+
72
+ 5. Providing, hosting, or managing the Licensed Work for a Third Party,
73
+ or otherwise making the Licensed Work available to a Third Party as
74
+ a hosted or managed service such that the Third Party obtains the
75
+ principal value or functionality of the Licensed Work, is a
76
+ Competitive Offering and is not permitted by the Additional Use
77
+ Grant.
78
+
79
+ 6. Subject to the foregoing, the Additional Use Grant permits you to
80
+ make Production Use of the Licensed Work for your own internal
81
+ business purposes and to build, operate, and provide your own
82
+ products and services to Third Parties, provided that the Licensed
83
+ Work itself (whether modified or unmodified) is not the product or
84
+ service, and is not a Competitive Offering, made available to those
85
+ Third Parties.
86
+
87
+ 7. You may modify the Licensed Work and create derivative works for
88
+ any purpose permitted by this License. Any Production Use of such
89
+ modified or derivative works remains subject to the same
90
+ restrictions as the Licensed Work, including the prohibition on
91
+ Competitive Offerings.
92
+
93
+ 8. Use of the Licensed Work by your own employees, contractors, and
94
+ agents, acting on your behalf and for your benefit, is not by
95
+ itself making the Licensed Work available to a Third Party.
96
+
97
+ 9. Embedding or distributing the Licensed Work as a component of your
98
+ own product or service is permitted only where the Licensed Work
99
+ does not constitute the principal value of that product or service
100
+ and the product or service is not a Competitive Offering.
101
+
102
+ 10. Nothing in this Additional Use Grant grants any right to use any
103
+ name, trademark, service mark, or logo of the Licensor or its
104
+ Affiliates, except as reasonably required for customary
105
+ attribution.
106
+
107
+ 11. The rights stated in this Additional Use Grant are the maximum
108
+ rights granted for Production Use prior to the Change Date. Any
109
+ Production Use not expressly permitted requires a separate
110
+ commercial license from the Licensor.
111
+
112
+ 12. If any provision of this Additional Use Grant is held invalid or
113
+ unenforceable, that provision shall be limited or eliminated to
114
+ the minimum extent necessary so that the remainder of this
115
+ Additional Use Grant, and of this License, remains in full force
116
+ and effect. The Licensor reserves all rights not expressly granted
117
+ by this License.
118
+
119
+ Change Date: Four years from the date the specific version of the Licensed
120
+ Work is first publicly released by Licensor.
121
+
122
+ Change License: Mozilla Public License, Version 2.0
123
+
124
+ For information about alternative licensing arrangements, commercial
125
+ licensing, enterprise licensing, OEM licensing, appliance licensing, managed
126
+ service licensing, cloud provider licensing, or other commercial use of the
127
+ Licensed Work, please contact: licensing@neuralchowder.com
128
+
129
+ -----------------------------------------------------------------------------
130
+
131
+ Notice
132
+
133
+ Business Source License 1.1
134
+
135
+ Terms
136
+
137
+ The Licensor hereby grants you the right to copy, modify, create derivative
138
+ works, redistribute, and make non-production use of the Licensed Work. The
139
+ Licensor may make an Additional Use Grant, above, permitting limited
140
+ production use.
141
+
142
+ Effective on the Change Date, or the fourth anniversary of the first publicly
143
+ available distribution of a specific version of the Licensed Work under this
144
+ License, whichever comes first, the Licensor hereby grants you rights under
145
+ the terms of the Change License, and the rights granted in the paragraph above
146
+ terminate.
147
+
148
+ If your use of the Licensed Work does not comply with the requirements
149
+ currently in effect as described in this License, you must purchase a
150
+ commercial license from the Licensor, its affiliated entities, or authorized
151
+ resellers, or you must refrain from using the Licensed Work.
152
+
153
+ All copies of the original and modified Licensed Work, and derivative works of
154
+ the Licensed Work, are subject to this License. This License applies separately
155
+ for each version of the Licensed Work and the Change Date may vary for each
156
+ version of the Licensed Work released by Licensor.
157
+
158
+ You must conspicuously display this License on each original or modified copy
159
+ of the Licensed Work. If you receive the Licensed Work in original or modified
160
+ form from a third party, the terms and conditions set forth in this License
161
+ apply to your use of that work.
162
+
163
+ Any use of the Licensed Work in violation of this License will automatically
164
+ terminate your rights under this License for the current and all other
165
+ versions of the Licensed Work.
166
+
167
+ This License does not grant you any right in any trademark or logo of Licensor
168
+ or its affiliates, provided that you may use a trademark or logo of Licensor
169
+ as expressly required by this License.
170
+
171
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN
172
+ "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS
173
+ OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS
174
+ FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ <!-- Generated by @xemahq/api-client-generator. Do not edit by hand. -->
2
+ <p align="center">
3
+ <svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/workload-runtime-api-client">
4
+ <rect width="680" height="120" rx="14" fill="#0B1020"/>
5
+ <g transform="translate(28,34)">
6
+ <path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#14B8A6" opacity="0.18"/>
7
+ <path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#14B8A6"/>
8
+ </g>
9
+ <text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/workload-runtime-api-client</text>
10
+ <text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Typed, generated HTTP client for the Workload Runtime API.</text>
11
+ <text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
12
+ </svg>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://xema.dev">Website</a> &middot;
17
+ <a href="https://www.npmjs.com/package/@xemahq/workload-runtime-api-client">npm</a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fworkload-runtime-api-client?color=2563eb&label=npm">
22
+ <img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fworkload-runtime-api-client?color=10b981">
23
+ <img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fworkload-runtime-api-client?color=3178c6">
24
+ </p>
25
+
26
+ # @xemahq/workload-runtime-api-client
27
+
28
+ > Typed, generated HTTP client for the Workload Runtime API.
29
+
30
+ ## Overview
31
+
32
+ Auto-generated TypeScript client for the **Workload Runtime API**. It exports typed
33
+ request functions and response models that mirror the service's OpenAPI surface,
34
+ so callers get end-to-end type safety without hand-writing HTTP calls. This
35
+ package is produced by `@xemahq/api-client-generator` and regenerated whenever
36
+ the service's API changes — do not edit it by hand.
37
+
38
+ ## When to use it
39
+
40
+ - Use it from any TypeScript service or app that calls the Workload Runtime API over HTTP.
41
+ - You get compile-time types for every endpoint and payload; regenerate to pick
42
+ up API changes rather than editing the client.
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pnpm add @xemahq/workload-runtime-api-client
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ ```ts
53
+ // Every endpoint function and response model is exported from the package root.
54
+ import * as client from '@xemahq/workload-runtime-api-client';
55
+ ```
56
+
57
+ Call the typed endpoint functions; request and response shapes are fully typed
58
+ from the service's OpenAPI spec.
59
+
60
+ ## License
61
+
62
+ Proprietary — &copy; Xema. All rights reserved. — [xema.dev](https://xema.dev)
@@ -3,41 +3,19 @@
3
3
  *
4
4
  * Consumers must call `configureClient()` before using any endpoint function.
5
5
  * The baseUrl is prepended to the relative paths generated by Orval.
6
- *
7
- * Features:
8
- * - Automatic bearer-token injection via `getAuthToken` callback
9
- * - Per-request header injection via `getHeaders` callback
10
- * - Automatic 401 handling via `onUnauthorized` callback (single retry)
11
- * - Exponential-backoff retry for transient failures (429, 502, 503, 504)
12
- * - Typed `ClientError` for non-2xx responses
13
- * - Per-call header overrides (take precedence over global headers)
14
- *
15
- * @example
16
- * configureClient({
17
- * baseUrl: 'http://governance-api:3400',
18
- * getAuthToken: () => identityBootstrapService.getAccessToken(),
19
- * getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
20
- * });
21
6
  */
22
7
  export interface ClientConfig {
23
- /**
24
- * Static base URL (e.g. 'http://localhost:3140') — no trailing slash.
25
- * Mutually exclusive with `baseUrlResolver`; exactly one MUST be set.
26
- */
8
+ /** Static base URL (e.g. 'http://localhost:3140') — no trailing slash. */
27
9
  baseUrl?: string;
28
- /**
29
- * Per-request base-URL resolver. When set, the peer URL is resolved from
30
- * the service registry on EVERY request (boot-order-safe). Wired by
31
- * `configureOrvalClientResolved` from `@xemahq/platform-common`.
32
- */
10
+ /** Per-request base-URL resolver (service-registry-safe). */
33
11
  baseUrlResolver?: () => string | Promise<string>;
34
- /** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
12
+ /** Optional async callback to get an auth token. */
35
13
  getAuthToken?: () => Promise<string>;
36
- /** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
14
+ /** Optional callback returning headers to inject on every request. */
37
15
  getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
38
- /** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
16
+ /** Optional callback invoked on 401 before a single retry. */
39
17
  onUnauthorized?: () => Promise<void>;
40
- /** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
18
+ /** Maximum retry attempts for transient failures (default: 3). */
41
19
  maxRetries?: number;
42
20
  }
43
21
  export declare class ClientError extends Error {
@@ -4,21 +4,6 @@
4
4
  *
5
5
  * Consumers must call `configureClient()` before using any endpoint function.
6
6
  * The baseUrl is prepended to the relative paths generated by Orval.
7
- *
8
- * Features:
9
- * - Automatic bearer-token injection via `getAuthToken` callback
10
- * - Per-request header injection via `getHeaders` callback
11
- * - Automatic 401 handling via `onUnauthorized` callback (single retry)
12
- * - Exponential-backoff retry for transient failures (429, 502, 503, 504)
13
- * - Typed `ClientError` for non-2xx responses
14
- * - Per-call header overrides (take precedence over global headers)
15
- *
16
- * @example
17
- * configureClient({
18
- * baseUrl: 'http://governance-api:3400',
19
- * getAuthToken: () => identityBootstrapService.getAccessToken(),
20
- * getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
21
- * });
22
7
  */
23
8
  Object.defineProperty(exports, "__esModule", { value: true });
24
9
  exports.customFetch = exports.ClientError = void 0;
@@ -50,7 +35,6 @@ function getClientConfig() {
50
35
  const RETRYABLE_STATUSES = [429, 502, 503, 504];
51
36
  async function buildHeaders(config, callerHeaders) {
52
37
  const headers = new Headers(callerHeaders);
53
- // Global headers from config (caller-provided headers take precedence)
54
38
  if (config.getHeaders) {
55
39
  const globalHeaders = await Promise.resolve(config.getHeaders());
56
40
  for (const [key, value] of Object.entries(globalHeaders)) {
@@ -59,7 +43,6 @@ async function buildHeaders(config, callerHeaders) {
59
43
  }
60
44
  }
61
45
  }
62
- // Auth token (caller or global headers take precedence)
63
46
  if (config.getAuthToken && !headers.has('Authorization')) {
64
47
  const token = await config.getAuthToken();
65
48
  headers.set('Authorization', `Bearer ${token}`);
@@ -83,7 +66,6 @@ const customFetch = async (url, options) => {
83
66
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
84
67
  try {
85
68
  const response = await fetch(fullUrl, requestInit);
86
- // 401 — invoke onUnauthorized and retry once (outside the transient retry loop)
87
69
  if (response.status === 401 && config.onUnauthorized && attempt === 0) {
88
70
  await config.onUnauthorized();
89
71
  const refreshedHeaders = await buildHeaders(config, options.headers);
@@ -94,7 +76,6 @@ const customFetch = async (url, options) => {
94
76
  }
95
77
  return unwrapEnvelope(retryBody);
96
78
  }
97
- // Non-retryable status — return or throw
98
79
  if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
99
80
  const body = await parseBody(response);
100
81
  if (response.status >= 400) {
@@ -102,7 +83,6 @@ const customFetch = async (url, options) => {
102
83
  }
103
84
  return unwrapEnvelope(body);
104
85
  }
105
- // Retryable — wait and retry
106
86
  const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
107
87
  const waitMs = retryAfter ?? addJitter(delay);
108
88
  await sleep(waitMs);
@@ -110,7 +90,7 @@ const customFetch = async (url, options) => {
110
90
  }
111
91
  catch (error) {
112
92
  if (error instanceof ClientError)
113
- throw error; // Don't retry client errors
93
+ throw error;
114
94
  lastError = error instanceof Error ? error : new Error(String(error));
115
95
  if (attempt >= maxRetries)
116
96
  throw lastError;
@@ -123,14 +103,19 @@ const customFetch = async (url, options) => {
123
103
  };
124
104
  exports.customFetch = customFetch;
125
105
  /**
126
- * The server wraps every non-`@RawResponse()` payload in `{ data: T }`
127
- * via `ResponseEnvelopeInterceptor` (see platform-common). Orval's
128
- * generated types describe the INNER `T` (because the controllers
129
- * declare their return type as `T`, not `{ data: T }`), so the client
130
- * must peel `data` to keep types and wire shape consistent. Paginated
131
- * lists return `{ data: T[], pagination: {...} }` and consumers read
132
- * both fields — keep that envelope intact (detected by the presence
133
- * of `pagination`). Anything without a `data` field is returned as-is.
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.
134
119
  */
135
120
  function unwrapEnvelope(body) {
136
121
  if (body === null ||
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * Workload Runtime API
5
+ * Declarative workload scheduling for biome sidecars, biome APIs,
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { RunnerJobManagementControllerListParams, RunnerJobSummaryDtoPaginatedEnvelope, RunnerWorkloadManagementControllerListParams, RunnerWorkloadSummaryDtoDataEnvelope, RunnerWorkloadSummaryDtoPaginatedEnvelope } from '../../models';
9
+ export declare const getRunnerWorkloadManagementControllerListUrl: (params?: RunnerWorkloadManagementControllerListParams) => string;
10
+ export declare const runnerWorkloadManagementControllerList: (params?: RunnerWorkloadManagementControllerListParams, options?: RequestInit) => Promise<RunnerWorkloadSummaryDtoPaginatedEnvelope>;
11
+ export declare const getRunnerWorkloadManagementControllerRefreshHealthUrl: (id: string) => string;
12
+ export declare const runnerWorkloadManagementControllerRefreshHealth: (id: string, options?: RequestInit) => Promise<RunnerWorkloadSummaryDtoDataEnvelope>;
13
+ export declare const getRunnerJobManagementControllerListUrl: (params?: RunnerJobManagementControllerListParams) => string;
14
+ export declare const runnerJobManagementControllerList: (params?: RunnerJobManagementControllerListParams, options?: RequestInit) => Promise<RunnerJobSummaryDtoPaginatedEnvelope>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runnerJobManagementControllerList = exports.getRunnerJobManagementControllerListUrl = exports.runnerWorkloadManagementControllerRefreshHealth = exports.getRunnerWorkloadManagementControllerRefreshHealthUrl = exports.runnerWorkloadManagementControllerList = exports.getRunnerWorkloadManagementControllerListUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ const getRunnerWorkloadManagementControllerListUrl = (params) => {
6
+ const normalizedParams = new URLSearchParams();
7
+ Object.entries(params || {}).forEach(([key, value]) => {
8
+ if (value === undefined)
9
+ return;
10
+ if (value === null) {
11
+ normalizedParams.append(key, 'null');
12
+ return;
13
+ }
14
+ if (Array.isArray(value)) {
15
+ for (const item of value) {
16
+ if (item === undefined || item === null)
17
+ continue;
18
+ normalizedParams.append(key, item.toString());
19
+ }
20
+ return;
21
+ }
22
+ normalizedParams.append(key, value.toString());
23
+ });
24
+ const stringifiedParams = normalizedParams.toString();
25
+ return stringifiedParams.length > 0 ? `/bff/runner-operations/workloads?${stringifiedParams}` : `/bff/runner-operations/workloads`;
26
+ };
27
+ exports.getRunnerWorkloadManagementControllerListUrl = getRunnerWorkloadManagementControllerListUrl;
28
+ const runnerWorkloadManagementControllerList = async (params, options) => {
29
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerWorkloadManagementControllerListUrl)(params), {
30
+ ...options,
31
+ method: 'GET'
32
+ });
33
+ };
34
+ exports.runnerWorkloadManagementControllerList = runnerWorkloadManagementControllerList;
35
+ const getRunnerWorkloadManagementControllerRefreshHealthUrl = (id) => {
36
+ return `/bff/runner-operations/workloads/${id}/refresh-health`;
37
+ };
38
+ exports.getRunnerWorkloadManagementControllerRefreshHealthUrl = getRunnerWorkloadManagementControllerRefreshHealthUrl;
39
+ const runnerWorkloadManagementControllerRefreshHealth = async (id, options) => {
40
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerWorkloadManagementControllerRefreshHealthUrl)(id), {
41
+ ...options,
42
+ method: 'POST'
43
+ });
44
+ };
45
+ exports.runnerWorkloadManagementControllerRefreshHealth = runnerWorkloadManagementControllerRefreshHealth;
46
+ const getRunnerJobManagementControllerListUrl = (params) => {
47
+ const normalizedParams = new URLSearchParams();
48
+ Object.entries(params || {}).forEach(([key, value]) => {
49
+ if (value === undefined)
50
+ return;
51
+ if (value === null) {
52
+ normalizedParams.append(key, 'null');
53
+ return;
54
+ }
55
+ if (Array.isArray(value)) {
56
+ for (const item of value) {
57
+ if (item === undefined || item === null)
58
+ continue;
59
+ normalizedParams.append(key, item.toString());
60
+ }
61
+ return;
62
+ }
63
+ normalizedParams.append(key, value.toString());
64
+ });
65
+ const stringifiedParams = normalizedParams.toString();
66
+ return stringifiedParams.length > 0 ? `/bff/runner-operations/jobs?${stringifiedParams}` : `/bff/runner-operations/jobs`;
67
+ };
68
+ exports.getRunnerJobManagementControllerListUrl = getRunnerJobManagementControllerListUrl;
69
+ const runnerJobManagementControllerList = async (params, options) => {
70
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobManagementControllerListUrl)(params), {
71
+ ...options,
72
+ method: 'GET'
73
+ });
74
+ };
75
+ exports.runnerJobManagementControllerList = runnerJobManagementControllerList;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
1
  export { configureClient, getClientConfig, ClientError, customFetch, type ClientConfig } from './custom-fetch';
2
2
  export * from './models';
3
- export * from './endpoints/health/health';
4
- export * from './endpoints/internal/internal';
5
- export * from './endpoints/internal-—-build-container-image/internal-—-build-container-image';
6
- export * from './endpoints/runner-jobs/runner-jobs';
7
- export * from './endpoints/workloads/workloads';
3
+ export * from './endpoints/runner-operations/runner-operations';
package/dist/index.js CHANGED
@@ -15,15 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.customFetch = exports.ClientError = exports.getClientConfig = exports.configureClient = void 0;
18
- // Auto-generated by scripts/build-client-index.js — do not edit manually.
18
+ // Auto-generated by @xemahq/api-client-generator — do not edit manually.
19
19
  var custom_fetch_1 = require("./custom-fetch");
20
20
  Object.defineProperty(exports, "configureClient", { enumerable: true, get: function () { return custom_fetch_1.configureClient; } });
21
21
  Object.defineProperty(exports, "getClientConfig", { enumerable: true, get: function () { return custom_fetch_1.getClientConfig; } });
22
22
  Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return custom_fetch_1.ClientError; } });
23
23
  Object.defineProperty(exports, "customFetch", { enumerable: true, get: function () { return custom_fetch_1.customFetch; } });
24
24
  __exportStar(require("./models"), exports);
25
- __exportStar(require("./endpoints/health/health"), exports);
26
- __exportStar(require("./endpoints/internal/internal"), exports);
27
- __exportStar(require("./endpoints/internal-\u2014-build-container-image/internal-\u2014-build-container-image"), exports);
28
- __exportStar(require("./endpoints/runner-jobs/runner-jobs"), exports);
29
- __exportStar(require("./endpoints/workloads/workloads"), exports);
25
+ __exportStar(require("./endpoints/runner-operations/runner-operations"), exports);
@@ -1,41 +1,18 @@
1
- export * from './createRunnerJobDto';
2
1
  export * from './paginationMeta';
3
- export * from './runKanikoRequestDto';
4
- export * from './runKanikoRequestDtoBuildArgs';
5
- export * from './runKanikoResponseDto';
6
- export * from './runnerJobDto';
7
- export * from './runnerJobDtoOutput';
8
- export * from './runnerJobDtoPaginatedEnvelope';
9
- export * from './runnerJobReportDto';
10
- export * from './runnerJobReportDtoOutput';
2
+ export * from './runnerJobDeliveryState';
3
+ export * from './runnerJobManagementControllerListParams';
4
+ export * from './runnerJobManagementControllerListState';
11
5
  export * from './runnerJobState';
12
- export * from './runnerJobsControllerListParams';
13
- export * from './runnerJobsControllerListState';
14
- export * from './workloadConnectionInfoDto';
15
- export * from './workloadDescriptorDto';
16
- export * from './workloadDescriptorDtoCapabilitiesItem';
17
- export * from './workloadDescriptorDtoCapabilitiesItemKind';
18
- export * from './workloadDescriptorDtoSpec';
19
- export * from './workloadEndpointDto';
20
- export * from './workloadGatewayRouteDto';
21
- export * from './workloadGatewayRouteDtoAuthParams';
22
- export * from './workloadGatewayRouteDtoAuthScheme';
6
+ export * from './runnerJobSummaryDto';
7
+ export * from './runnerJobSummaryDtoPaginatedEnvelope';
8
+ export * from './runnerWorkloadManagementControllerListKind';
9
+ export * from './runnerWorkloadManagementControllerListParams';
10
+ export * from './runnerWorkloadManagementControllerListState';
11
+ export * from './runnerWorkloadSummaryDto';
12
+ export * from './runnerWorkloadSummaryDtoDataEnvelope';
13
+ export * from './runnerWorkloadSummaryDtoPaginatedEnvelope';
23
14
  export * from './workloadHealthConditionDto';
24
15
  export * from './workloadHealthConditionDtoStatus';
25
16
  export * from './workloadHealthSnapshotDto';
26
- export * from './workloadIngressSourceDto';
27
- export * from './workloadInstanceDto';
28
- export * from './workloadInstanceDtoPaginatedEnvelope';
29
- export * from './workloadInstanceDtoSubjectLabels';
30
17
  export * from './workloadKind';
31
- export * from './workloadLifecycleDto';
32
- export * from './workloadNetworkDto';
33
- export * from './workloadNodeAffinityDto';
34
18
  export * from './workloadState';
35
- export * from './workloadTarget';
36
- export * from './workloadTenancyDto';
37
- export * from './workloadTenancyDtoSubjectLabels';
38
- export * from './workloadVolumeMountDto';
39
- export * from './workloadsControllerListKind';
40
- export * from './workloadsControllerListParams';
41
- export * from './workloadsControllerListState';
@@ -15,44 +15,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Auto-generated by tooling/codegen/regenerate-models-barrel.js — do not edit manually.
18
- __exportStar(require("./createRunnerJobDto"), exports);
19
18
  __exportStar(require("./paginationMeta"), exports);
20
- __exportStar(require("./runKanikoRequestDto"), exports);
21
- __exportStar(require("./runKanikoRequestDtoBuildArgs"), exports);
22
- __exportStar(require("./runKanikoResponseDto"), exports);
23
- __exportStar(require("./runnerJobDto"), exports);
24
- __exportStar(require("./runnerJobDtoOutput"), exports);
25
- __exportStar(require("./runnerJobDtoPaginatedEnvelope"), exports);
26
- __exportStar(require("./runnerJobReportDto"), exports);
27
- __exportStar(require("./runnerJobReportDtoOutput"), exports);
19
+ __exportStar(require("./runnerJobDeliveryState"), exports);
20
+ __exportStar(require("./runnerJobManagementControllerListParams"), exports);
21
+ __exportStar(require("./runnerJobManagementControllerListState"), exports);
28
22
  __exportStar(require("./runnerJobState"), exports);
29
- __exportStar(require("./runnerJobsControllerListParams"), exports);
30
- __exportStar(require("./runnerJobsControllerListState"), exports);
31
- __exportStar(require("./workloadConnectionInfoDto"), exports);
32
- __exportStar(require("./workloadDescriptorDto"), exports);
33
- __exportStar(require("./workloadDescriptorDtoCapabilitiesItem"), exports);
34
- __exportStar(require("./workloadDescriptorDtoCapabilitiesItemKind"), exports);
35
- __exportStar(require("./workloadDescriptorDtoSpec"), exports);
36
- __exportStar(require("./workloadEndpointDto"), exports);
37
- __exportStar(require("./workloadGatewayRouteDto"), exports);
38
- __exportStar(require("./workloadGatewayRouteDtoAuthParams"), exports);
39
- __exportStar(require("./workloadGatewayRouteDtoAuthScheme"), exports);
23
+ __exportStar(require("./runnerJobSummaryDto"), exports);
24
+ __exportStar(require("./runnerJobSummaryDtoPaginatedEnvelope"), exports);
25
+ __exportStar(require("./runnerWorkloadManagementControllerListKind"), exports);
26
+ __exportStar(require("./runnerWorkloadManagementControllerListParams"), exports);
27
+ __exportStar(require("./runnerWorkloadManagementControllerListState"), exports);
28
+ __exportStar(require("./runnerWorkloadSummaryDto"), exports);
29
+ __exportStar(require("./runnerWorkloadSummaryDtoDataEnvelope"), exports);
30
+ __exportStar(require("./runnerWorkloadSummaryDtoPaginatedEnvelope"), exports);
40
31
  __exportStar(require("./workloadHealthConditionDto"), exports);
41
32
  __exportStar(require("./workloadHealthConditionDtoStatus"), exports);
42
33
  __exportStar(require("./workloadHealthSnapshotDto"), exports);
43
- __exportStar(require("./workloadIngressSourceDto"), exports);
44
- __exportStar(require("./workloadInstanceDto"), exports);
45
- __exportStar(require("./workloadInstanceDtoPaginatedEnvelope"), exports);
46
- __exportStar(require("./workloadInstanceDtoSubjectLabels"), exports);
47
34
  __exportStar(require("./workloadKind"), exports);
48
- __exportStar(require("./workloadLifecycleDto"), exports);
49
- __exportStar(require("./workloadNetworkDto"), exports);
50
- __exportStar(require("./workloadNodeAffinityDto"), exports);
51
35
  __exportStar(require("./workloadState"), exports);
52
- __exportStar(require("./workloadTarget"), exports);
53
- __exportStar(require("./workloadTenancyDto"), exports);
54
- __exportStar(require("./workloadTenancyDtoSubjectLabels"), exports);
55
- __exportStar(require("./workloadVolumeMountDto"), exports);
56
- __exportStar(require("./workloadsControllerListKind"), exports);
57
- __exportStar(require("./workloadsControllerListParams"), exports);
58
- __exportStar(require("./workloadsControllerListState"), exports);
@@ -2,7 +2,7 @@
2
2
  * Generated by orval v8.6.2 🍺
3
3
  * Do not edit manually.
4
4
  * Workload Runtime API
5
- * Declarative workload scheduling for biome sidecars, biome APIs, opencode workers, previews, and DB schemas.
5
+ * Declarative workload scheduling for biome sidecars, biome APIs,
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
8
  export interface PaginationMeta {
@@ -3,7 +3,7 @@
3
3
  * Generated by orval v8.6.2 🍺
4
4
  * Do not edit manually.
5
5
  * Workload Runtime API
6
- * Declarative workload scheduling for biome sidecars, biome APIs, opencode workers, previews, and DB schemas.
6
+ * Declarative workload scheduling for biome sidecars, biome APIs,
7
7
  * OpenAPI spec version: 0.1.0
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });