@xemahq/workload-runtime-api-client 0.1.1

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 (100) hide show
  1. package/LICENSE +1 -0
  2. package/dist/custom-fetch.d.ts +52 -0
  3. package/dist/custom-fetch.js +175 -0
  4. package/dist/endpoints/health/health.d.ts +15 -0
  5. package/dist/endpoints/health/health.js +53 -0
  6. package/dist/endpoints/internal/internal.d.ts +6 -0
  7. package/dist/endpoints/internal/internal.js +26 -0
  8. package/dist/endpoints/internal-/342/200/224-build-container-image/internal-/342/200/224-build-container-image.d.ts +14 -0
  9. package/dist/endpoints/internal-/342/200/224-build-container-image/internal-/342/200/224-build-container-image.js +21 -0
  10. package/dist/endpoints/runner-jobs/runner-jobs.d.ts +37 -0
  11. package/dist/endpoints/runner-jobs/runner-jobs.js +101 -0
  12. package/dist/endpoints/workloads/workloads.d.ts +45 -0
  13. package/dist/endpoints/workloads/workloads.js +125 -0
  14. package/dist/index.d.ts +7 -0
  15. package/dist/index.js +29 -0
  16. package/dist/models/createRunnerJobDto.d.ts +27 -0
  17. package/dist/models/createRunnerJobDto.js +9 -0
  18. package/dist/models/index.d.ts +41 -0
  19. package/dist/models/index.js +58 -0
  20. package/dist/models/paginationMeta.d.ts +18 -0
  21. package/dist/models/paginationMeta.js +9 -0
  22. package/dist/models/runKanikoRequestDto.d.ts +30 -0
  23. package/dist/models/runKanikoRequestDto.js +2 -0
  24. package/dist/models/runKanikoRequestDtoBuildArgs.d.ts +10 -0
  25. package/dist/models/runKanikoRequestDtoBuildArgs.js +9 -0
  26. package/dist/models/runKanikoResponseDto.d.ts +13 -0
  27. package/dist/models/runKanikoResponseDto.js +9 -0
  28. package/dist/models/runnerJobDto.d.ts +30 -0
  29. package/dist/models/runnerJobDto.js +2 -0
  30. package/dist/models/runnerJobDtoOutput.d.ts +14 -0
  31. package/dist/models/runnerJobDtoOutput.js +9 -0
  32. package/dist/models/runnerJobDtoPaginatedEnvelope.d.ts +13 -0
  33. package/dist/models/runnerJobDtoPaginatedEnvelope.js +2 -0
  34. package/dist/models/runnerJobReportDto.d.ts +23 -0
  35. package/dist/models/runnerJobReportDto.js +2 -0
  36. package/dist/models/runnerJobReportDtoOutput.d.ts +13 -0
  37. package/dist/models/runnerJobReportDtoOutput.js +9 -0
  38. package/dist/models/runnerJobState.d.ts +17 -0
  39. package/dist/models/runnerJobState.js +19 -0
  40. package/dist/models/runnerJobsControllerListParams.d.ts +14 -0
  41. package/dist/models/runnerJobsControllerListParams.js +2 -0
  42. package/dist/models/runnerJobsControllerListState.d.ts +17 -0
  43. package/dist/models/runnerJobsControllerListState.js +19 -0
  44. package/dist/models/workloadConnectionInfoDto.d.ts +12 -0
  45. package/dist/models/workloadConnectionInfoDto.js +9 -0
  46. package/dist/models/workloadDescriptorDto.d.ts +33 -0
  47. package/dist/models/workloadDescriptorDto.js +2 -0
  48. package/dist/models/workloadDescriptorDtoCapabilitiesItem.d.ts +12 -0
  49. package/dist/models/workloadDescriptorDtoCapabilitiesItem.js +2 -0
  50. package/dist/models/workloadDescriptorDtoCapabilitiesItemKind.d.ts +14 -0
  51. package/dist/models/workloadDescriptorDtoCapabilitiesItemKind.js +16 -0
  52. package/dist/models/workloadDescriptorDtoSpec.d.ts +13 -0
  53. package/dist/models/workloadDescriptorDtoSpec.js +9 -0
  54. package/dist/models/workloadEndpointDto.d.ts +11 -0
  55. package/dist/models/workloadEndpointDto.js +9 -0
  56. package/dist/models/workloadGatewayRouteDto.d.ts +22 -0
  57. package/dist/models/workloadGatewayRouteDto.js +2 -0
  58. package/dist/models/workloadGatewayRouteDtoAuthParams.d.ts +13 -0
  59. package/dist/models/workloadGatewayRouteDtoAuthParams.js +9 -0
  60. package/dist/models/workloadGatewayRouteDtoAuthScheme.d.ts +14 -0
  61. package/dist/models/workloadGatewayRouteDtoAuthScheme.js +13 -0
  62. package/dist/models/workloadHealthConditionDto.d.ts +16 -0
  63. package/dist/models/workloadHealthConditionDto.js +2 -0
  64. package/dist/models/workloadHealthConditionDtoStatus.d.ts +13 -0
  65. package/dist/models/workloadHealthConditionDtoStatus.js +15 -0
  66. package/dist/models/workloadHealthSnapshotDto.d.ts +13 -0
  67. package/dist/models/workloadHealthSnapshotDto.js +2 -0
  68. package/dist/models/workloadIngressSourceDto.d.ts +11 -0
  69. package/dist/models/workloadIngressSourceDto.js +9 -0
  70. package/dist/models/workloadInstanceDto.d.ts +36 -0
  71. package/dist/models/workloadInstanceDto.js +2 -0
  72. package/dist/models/workloadInstanceDtoPaginatedEnvelope.d.ts +13 -0
  73. package/dist/models/workloadInstanceDtoPaginatedEnvelope.js +2 -0
  74. package/dist/models/workloadInstanceDtoSubjectLabels.d.ts +10 -0
  75. package/dist/models/workloadInstanceDtoSubjectLabels.js +9 -0
  76. package/dist/models/workloadKind.d.ts +16 -0
  77. package/dist/models/workloadKind.js +18 -0
  78. package/dist/models/workloadLifecycleDto.d.ts +12 -0
  79. package/dist/models/workloadLifecycleDto.js +9 -0
  80. package/dist/models/workloadNetworkDto.d.ts +12 -0
  81. package/dist/models/workloadNetworkDto.js +2 -0
  82. package/dist/models/workloadNodeAffinityDto.d.ts +10 -0
  83. package/dist/models/workloadNodeAffinityDto.js +9 -0
  84. package/dist/models/workloadState.d.ts +17 -0
  85. package/dist/models/workloadState.js +19 -0
  86. package/dist/models/workloadTarget.d.ts +11 -0
  87. package/dist/models/workloadTarget.js +13 -0
  88. package/dist/models/workloadTenancyDto.d.ts +15 -0
  89. package/dist/models/workloadTenancyDto.js +2 -0
  90. package/dist/models/workloadTenancyDtoSubjectLabels.d.ts +10 -0
  91. package/dist/models/workloadTenancyDtoSubjectLabels.js +9 -0
  92. package/dist/models/workloadVolumeMountDto.d.ts +16 -0
  93. package/dist/models/workloadVolumeMountDto.js +9 -0
  94. package/dist/models/workloadsControllerListKind.d.ts +16 -0
  95. package/dist/models/workloadsControllerListKind.js +18 -0
  96. package/dist/models/workloadsControllerListParams.d.ts +18 -0
  97. package/dist/models/workloadsControllerListParams.js +2 -0
  98. package/dist/models/workloadsControllerListState.d.ts +17 -0
  99. package/dist/models/workloadsControllerListState.js +19 -0
  100. package/package.json +18 -0
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2026 Xema. All rights reserved.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Configurable fetch wrapper for Orval-generated clients.
3
+ *
4
+ * Consumers must call `configureClient()` before using any endpoint function.
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
+ */
22
+ 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
+ */
27
+ 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
+ */
33
+ baseUrlResolver?: () => string | Promise<string>;
34
+ /** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
35
+ getAuthToken?: () => Promise<string>;
36
+ /** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
37
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
38
+ /** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
39
+ onUnauthorized?: () => Promise<void>;
40
+ /** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
41
+ maxRetries?: number;
42
+ }
43
+ export declare class ClientError extends Error {
44
+ readonly status: number;
45
+ readonly url: string;
46
+ readonly body: unknown;
47
+ constructor(status: number, url: string, body: unknown);
48
+ }
49
+ export declare function configureClient(config: ClientConfig): void;
50
+ export declare function getClientConfig(): ClientConfig;
51
+ export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
52
+ export default customFetch;
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ /**
3
+ * Configurable fetch wrapper for Orval-generated clients.
4
+ *
5
+ * Consumers must call `configureClient()` before using any endpoint function.
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
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.customFetch = exports.ClientError = void 0;
25
+ exports.configureClient = configureClient;
26
+ exports.getClientConfig = getClientConfig;
27
+ class ClientError extends Error {
28
+ status;
29
+ url;
30
+ body;
31
+ constructor(status, url, body) {
32
+ super(`HTTP ${status} from ${url}`);
33
+ this.status = status;
34
+ this.url = url;
35
+ this.body = body;
36
+ this.name = 'ClientError';
37
+ }
38
+ }
39
+ exports.ClientError = ClientError;
40
+ let clientConfig = null;
41
+ function configureClient(config) {
42
+ clientConfig = config;
43
+ }
44
+ function getClientConfig() {
45
+ if (!clientConfig) {
46
+ throw new Error('Client not configured. Call configureClient({ baseUrl }) before using endpoint functions.');
47
+ }
48
+ return clientConfig;
49
+ }
50
+ const RETRYABLE_STATUSES = [429, 502, 503, 504];
51
+ async function buildHeaders(config, callerHeaders) {
52
+ const headers = new Headers(callerHeaders);
53
+ // Global headers from config (caller-provided headers take precedence)
54
+ if (config.getHeaders) {
55
+ const globalHeaders = await Promise.resolve(config.getHeaders());
56
+ for (const [key, value] of Object.entries(globalHeaders)) {
57
+ if (!headers.has(key)) {
58
+ headers.set(key, value);
59
+ }
60
+ }
61
+ }
62
+ // Auth token (caller or global headers take precedence)
63
+ if (config.getAuthToken && !headers.has('Authorization')) {
64
+ const token = await config.getAuthToken();
65
+ headers.set('Authorization', `Bearer ${token}`);
66
+ }
67
+ return headers;
68
+ }
69
+ const customFetch = async (url, options) => {
70
+ const config = getClientConfig();
71
+ const base = config.baseUrlResolver
72
+ ? await config.baseUrlResolver()
73
+ : config.baseUrl;
74
+ if (base === undefined) {
75
+ throw new Error('Client not configured: set baseUrl or baseUrlResolver via configureClient().');
76
+ }
77
+ const fullUrl = `${base}${url}`;
78
+ const maxRetries = config.maxRetries ?? 3;
79
+ const headers = await buildHeaders(config, options.headers);
80
+ const requestInit = { ...options, headers };
81
+ let delay = 1000;
82
+ let lastError;
83
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
84
+ try {
85
+ const response = await fetch(fullUrl, requestInit);
86
+ // 401 — invoke onUnauthorized and retry once (outside the transient retry loop)
87
+ if (response.status === 401 && config.onUnauthorized && attempt === 0) {
88
+ await config.onUnauthorized();
89
+ const refreshedHeaders = await buildHeaders(config, options.headers);
90
+ const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
91
+ const retryBody = await parseBody(retryResponse);
92
+ if (retryResponse.status >= 400) {
93
+ throw new ClientError(retryResponse.status, fullUrl, retryBody);
94
+ }
95
+ return unwrapEnvelope(retryBody);
96
+ }
97
+ // Non-retryable status — return or throw
98
+ if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
99
+ const body = await parseBody(response);
100
+ if (response.status >= 400) {
101
+ throw new ClientError(response.status, fullUrl, body);
102
+ }
103
+ return unwrapEnvelope(body);
104
+ }
105
+ // Retryable — wait and retry
106
+ const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
107
+ const waitMs = retryAfter ?? addJitter(delay);
108
+ await sleep(waitMs);
109
+ delay = Math.min(delay * 2, 30_000);
110
+ }
111
+ catch (error) {
112
+ if (error instanceof ClientError)
113
+ throw error; // Don't retry client errors
114
+ lastError = error instanceof Error ? error : new Error(String(error));
115
+ if (attempt >= maxRetries)
116
+ throw lastError;
117
+ const waitMs = addJitter(delay);
118
+ await sleep(waitMs);
119
+ delay = Math.min(delay * 2, 30_000);
120
+ }
121
+ }
122
+ throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
123
+ };
124
+ exports.customFetch = customFetch;
125
+ /**
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.
134
+ */
135
+ function unwrapEnvelope(body) {
136
+ if (body === null ||
137
+ typeof body !== 'object' ||
138
+ Array.isArray(body) ||
139
+ !('data' in body)) {
140
+ return body;
141
+ }
142
+ const envelope = body;
143
+ if ('pagination' in envelope) {
144
+ return envelope;
145
+ }
146
+ return envelope.data;
147
+ }
148
+ async function parseBody(response) {
149
+ const contentType = response.headers.get('content-type');
150
+ if (contentType?.includes('application/json')) {
151
+ return response.json();
152
+ }
153
+ if (response.status === 204) {
154
+ return undefined;
155
+ }
156
+ return response.text();
157
+ }
158
+ function parseRetryAfter(value) {
159
+ if (!value)
160
+ return undefined;
161
+ const seconds = Number(value);
162
+ if (!isNaN(seconds) && seconds >= 0)
163
+ return seconds * 1000;
164
+ const date = new Date(value);
165
+ if (!isNaN(date.getTime()))
166
+ return Math.max(0, date.getTime() - Date.now());
167
+ return undefined;
168
+ }
169
+ function addJitter(delay) {
170
+ return delay + (Math.random() * 2 - 1) * delay * 0.25;
171
+ }
172
+ function sleep(ms) {
173
+ return new Promise(resolve => setTimeout(resolve, ms));
174
+ }
175
+ exports.default = exports.customFetch;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @summary Health check
3
+ */
4
+ export declare const getHealthControllerCheckUrl: () => string;
5
+ export declare const healthControllerCheck: (options?: RequestInit) => Promise<void>;
6
+ /**
7
+ * @summary Liveness probe
8
+ */
9
+ export declare const getHealthControllerLiveUrl: () => string;
10
+ export declare const healthControllerLive: (options?: RequestInit) => Promise<void>;
11
+ /**
12
+ * @summary Readiness probe — checks database connectivity
13
+ */
14
+ export declare const getHealthControllerReadyUrl: () => string;
15
+ export declare const healthControllerReady: (options?: RequestInit) => Promise<void>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.healthControllerReady = exports.getHealthControllerReadyUrl = exports.healthControllerLive = exports.getHealthControllerLiveUrl = exports.healthControllerCheck = exports.getHealthControllerCheckUrl = void 0;
4
+ /**
5
+ * Generated by orval v8.6.2 🍺
6
+ * Do not edit manually.
7
+ * Workload Runtime API
8
+ * Declarative workload scheduling for biome sidecars, biome APIs, opencode workers, previews, and DB schemas.
9
+ * OpenAPI spec version: 0.1.0
10
+ */
11
+ const custom_fetch_1 = require("../../custom-fetch");
12
+ /**
13
+ * @summary Health check
14
+ */
15
+ const getHealthControllerCheckUrl = () => {
16
+ return `/health`;
17
+ };
18
+ exports.getHealthControllerCheckUrl = getHealthControllerCheckUrl;
19
+ const healthControllerCheck = async (options) => {
20
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerCheckUrl)(), {
21
+ ...options,
22
+ method: 'GET'
23
+ });
24
+ };
25
+ exports.healthControllerCheck = healthControllerCheck;
26
+ /**
27
+ * @summary Liveness probe
28
+ */
29
+ const getHealthControllerLiveUrl = () => {
30
+ return `/health/live`;
31
+ };
32
+ exports.getHealthControllerLiveUrl = getHealthControllerLiveUrl;
33
+ const healthControllerLive = async (options) => {
34
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerLiveUrl)(), {
35
+ ...options,
36
+ method: 'GET'
37
+ });
38
+ };
39
+ exports.healthControllerLive = healthControllerLive;
40
+ /**
41
+ * @summary Readiness probe — checks database connectivity
42
+ */
43
+ const getHealthControllerReadyUrl = () => {
44
+ return `/health/ready`;
45
+ };
46
+ exports.getHealthControllerReadyUrl = getHealthControllerReadyUrl;
47
+ const healthControllerReady = async (options) => {
48
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerReadyUrl)(), {
49
+ ...options,
50
+ method: 'GET'
51
+ });
52
+ };
53
+ exports.healthControllerReady = healthControllerReady;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Service-to-service endpoint fired by the workload-reconcile Temporal Schedule. Runs a full reconcile sweep and returns the per-category counts.
3
+ * @summary Run one workload reconcile sweep
4
+ */
5
+ export declare const getInternalReconcileControllerTickUrl: () => string;
6
+ export declare const internalReconcileControllerTick: (options?: RequestInit) => Promise<void>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.internalReconcileControllerTick = exports.getInternalReconcileControllerTickUrl = void 0;
4
+ /**
5
+ * Generated by orval v8.6.2 🍺
6
+ * Do not edit manually.
7
+ * Workload Runtime API
8
+ * Declarative workload scheduling for biome sidecars, biome APIs, opencode workers, previews, and DB schemas.
9
+ * OpenAPI spec version: 0.1.0
10
+ */
11
+ const custom_fetch_1 = require("../../custom-fetch");
12
+ /**
13
+ * Service-to-service endpoint fired by the workload-reconcile Temporal Schedule. Runs a full reconcile sweep and returns the per-category counts.
14
+ * @summary Run one workload reconcile sweep
15
+ */
16
+ const getInternalReconcileControllerTickUrl = () => {
17
+ return `/internal/reconcile/tick`;
18
+ };
19
+ exports.getInternalReconcileControllerTickUrl = getInternalReconcileControllerTickUrl;
20
+ const internalReconcileControllerTick = async (options) => {
21
+ return (0, custom_fetch_1.customFetch)((0, exports.getInternalReconcileControllerTickUrl)(), {
22
+ ...options,
23
+ method: 'POST'
24
+ });
25
+ };
26
+ exports.internalReconcileControllerTick = internalReconcileControllerTick;
@@ -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, opencode workers, previews, and DB schemas.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { RunKanikoRequestDto, RunKanikoResponseDto } from '../../models';
9
+ /**
10
+ * Synchronous endpoint — blocks until Kaniko completes, fails, or the 25-minute outer timeout fires. Returns the pushed image digest + end-to-end duration. The owning Temporal workflow handles retries.
11
+ * @summary Run a Kaniko build via the workload runtime
12
+ */
13
+ export declare const getBuildContainerImageControllerRunKanikoUrl: () => string;
14
+ export declare const buildContainerImageControllerRunKaniko: (runKanikoRequestDto: RunKanikoRequestDto, options?: RequestInit) => Promise<RunKanikoResponseDto>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildContainerImageControllerRunKaniko = exports.getBuildContainerImageControllerRunKanikoUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * Synchronous endpoint — blocks until Kaniko completes, fails, or the 25-minute outer timeout fires. Returns the pushed image digest + end-to-end duration. The owning Temporal workflow handles retries.
7
+ * @summary Run a Kaniko build via the workload runtime
8
+ */
9
+ const getBuildContainerImageControllerRunKanikoUrl = () => {
10
+ return `/internal/build-container-image/run-kaniko`;
11
+ };
12
+ exports.getBuildContainerImageControllerRunKanikoUrl = getBuildContainerImageControllerRunKanikoUrl;
13
+ const buildContainerImageControllerRunKaniko = async (runKanikoRequestDto, options) => {
14
+ return (0, custom_fetch_1.customFetch)((0, exports.getBuildContainerImageControllerRunKanikoUrl)(), {
15
+ ...options,
16
+ method: 'POST',
17
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
18
+ body: JSON.stringify(runKanikoRequestDto)
19
+ });
20
+ };
21
+ exports.buildContainerImageControllerRunKaniko = buildContainerImageControllerRunKaniko;
@@ -0,0 +1,37 @@
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, opencode workers, previews, and DB schemas.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { CreateRunnerJobDto, RunnerJobDto, RunnerJobDtoPaginatedEnvelope, RunnerJobReportDto, RunnerJobsControllerListParams } from '../../models';
9
+ /**
10
+ * Called by the capability router after it decides to dispatch a capability to a runner and the kernel-server has minted the job token. Re-POSTing the same `jobId` returns the existing row (HTTP 200) without creating a duplicate; first creation returns HTTP 201. A `jti` already bound to a different job is rejected (409) — replay guard.
11
+ * @summary Create a RunnerJob in `pending` (idempotent by jobId)
12
+ */
13
+ export declare const getRunnerJobsControllerCreateUrl: () => string;
14
+ export declare const runnerJobsControllerCreate: (createRunnerJobDto: CreateRunnerJobDto, options?: RequestInit) => Promise<RunnerJobDto>;
15
+ /**
16
+ * Powers the operator RunnerJob inspector (runners-web). Filter by `state` and/or `runnerInstanceId`. `cursor` + `limit` page through results in `updatedAt desc` order (newest-touched first, `jobId` as a stable tiebreaker). Callers that walk every job MUST follow `nextCursor` until null. Default limit 200, max 1000. These are service-to-service routes (ServiceTokenGuard); a RunnerJob carries no org column, so there is no org filter — same scoping as `GET /:jobId`.
17
+ * @summary List RunnerJobs with filters and cursor pagination
18
+ */
19
+ export declare const getRunnerJobsControllerListUrl: (params?: RunnerJobsControllerListParams) => string;
20
+ export declare const runnerJobsControllerList: (params?: RunnerJobsControllerListParams, options?: RequestInit) => Promise<RunnerJobDtoPaginatedEnvelope>;
21
+ /**
22
+ * @summary Fetch a RunnerJob by jobId
23
+ */
24
+ export declare const getRunnerJobsControllerGetUrl: (jobId: string) => string;
25
+ export declare const runnerJobsControllerGet: (jobId: string, options?: RequestInit) => Promise<RunnerJobDto>;
26
+ /**
27
+ * Called by the capability router AFTER it hands the dispatch envelope to the runner (push CloudEvent or pull-queue enqueue). Records the `pending → dispatched` transition. Idempotent — a re-mark or a job already past dispatched is a no-op; a terminal row is rejected (409).
28
+ * @summary Mark a RunnerJob dispatched (router-owned; idempotent)
29
+ */
30
+ export declare const getRunnerJobsControllerMarkDispatchedUrl: (jobId: string) => string;
31
+ export declare const runnerJobsControllerMarkDispatched: (jobId: string, options?: RequestInit) => Promise<RunnerJobDto>;
32
+ /**
33
+ * Advances the RunnerJob state machine from a `RunnerJobReport`. Mirror of the `xema.runner.job.*` CloudEvent consumers for runners on the pull/HTTP transport. A duplicate report (same state) is a no-op; a report against a terminal row or an illegal transition is rejected (409).
34
+ * @summary Apply a runner job report (direct report path; idempotent)
35
+ */
36
+ export declare const getRunnerJobsControllerReportUrl: (jobId: string) => string;
37
+ export declare const runnerJobsControllerReport: (jobId: string, runnerJobReportDto: RunnerJobReportDto, options?: RequestInit) => Promise<RunnerJobDto>;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runnerJobsControllerReport = exports.getRunnerJobsControllerReportUrl = exports.runnerJobsControllerMarkDispatched = exports.getRunnerJobsControllerMarkDispatchedUrl = exports.runnerJobsControllerGet = exports.getRunnerJobsControllerGetUrl = exports.runnerJobsControllerList = exports.getRunnerJobsControllerListUrl = exports.runnerJobsControllerCreate = exports.getRunnerJobsControllerCreateUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * Called by the capability router after it decides to dispatch a capability to a runner and the kernel-server has minted the job token. Re-POSTing the same `jobId` returns the existing row (HTTP 200) without creating a duplicate; first creation returns HTTP 201. A `jti` already bound to a different job is rejected (409) — replay guard.
7
+ * @summary Create a RunnerJob in `pending` (idempotent by jobId)
8
+ */
9
+ const getRunnerJobsControllerCreateUrl = () => {
10
+ return `/runner-jobs`;
11
+ };
12
+ exports.getRunnerJobsControllerCreateUrl = getRunnerJobsControllerCreateUrl;
13
+ const runnerJobsControllerCreate = async (createRunnerJobDto, options) => {
14
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobsControllerCreateUrl)(), {
15
+ ...options,
16
+ method: 'POST',
17
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
18
+ body: JSON.stringify(createRunnerJobDto)
19
+ });
20
+ };
21
+ exports.runnerJobsControllerCreate = runnerJobsControllerCreate;
22
+ /**
23
+ * Powers the operator RunnerJob inspector (runners-web). Filter by `state` and/or `runnerInstanceId`. `cursor` + `limit` page through results in `updatedAt desc` order (newest-touched first, `jobId` as a stable tiebreaker). Callers that walk every job MUST follow `nextCursor` until null. Default limit 200, max 1000. These are service-to-service routes (ServiceTokenGuard); a RunnerJob carries no org column, so there is no org filter — same scoping as `GET /:jobId`.
24
+ * @summary List RunnerJobs with filters and cursor pagination
25
+ */
26
+ const getRunnerJobsControllerListUrl = (params) => {
27
+ const normalizedParams = new URLSearchParams();
28
+ Object.entries(params || {}).forEach(([key, value]) => {
29
+ if (value === undefined)
30
+ return;
31
+ if (value === null) {
32
+ normalizedParams.append(key, 'null');
33
+ return;
34
+ }
35
+ if (Array.isArray(value)) {
36
+ for (const item of value) {
37
+ if (item === undefined || item === null)
38
+ continue;
39
+ normalizedParams.append(key, item.toString());
40
+ }
41
+ return;
42
+ }
43
+ normalizedParams.append(key, value.toString());
44
+ });
45
+ const stringifiedParams = normalizedParams.toString();
46
+ return stringifiedParams.length > 0 ? `/runner-jobs?${stringifiedParams}` : `/runner-jobs`;
47
+ };
48
+ exports.getRunnerJobsControllerListUrl = getRunnerJobsControllerListUrl;
49
+ const runnerJobsControllerList = async (params, options) => {
50
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobsControllerListUrl)(params), {
51
+ ...options,
52
+ method: 'GET'
53
+ });
54
+ };
55
+ exports.runnerJobsControllerList = runnerJobsControllerList;
56
+ /**
57
+ * @summary Fetch a RunnerJob by jobId
58
+ */
59
+ const getRunnerJobsControllerGetUrl = (jobId) => {
60
+ return `/runner-jobs/${jobId}`;
61
+ };
62
+ exports.getRunnerJobsControllerGetUrl = getRunnerJobsControllerGetUrl;
63
+ const runnerJobsControllerGet = async (jobId, options) => {
64
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobsControllerGetUrl)(jobId), {
65
+ ...options,
66
+ method: 'GET'
67
+ });
68
+ };
69
+ exports.runnerJobsControllerGet = runnerJobsControllerGet;
70
+ /**
71
+ * Called by the capability router AFTER it hands the dispatch envelope to the runner (push CloudEvent or pull-queue enqueue). Records the `pending → dispatched` transition. Idempotent — a re-mark or a job already past dispatched is a no-op; a terminal row is rejected (409).
72
+ * @summary Mark a RunnerJob dispatched (router-owned; idempotent)
73
+ */
74
+ const getRunnerJobsControllerMarkDispatchedUrl = (jobId) => {
75
+ return `/runner-jobs/${jobId}/dispatched`;
76
+ };
77
+ exports.getRunnerJobsControllerMarkDispatchedUrl = getRunnerJobsControllerMarkDispatchedUrl;
78
+ const runnerJobsControllerMarkDispatched = async (jobId, options) => {
79
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobsControllerMarkDispatchedUrl)(jobId), {
80
+ ...options,
81
+ method: 'POST'
82
+ });
83
+ };
84
+ exports.runnerJobsControllerMarkDispatched = runnerJobsControllerMarkDispatched;
85
+ /**
86
+ * Advances the RunnerJob state machine from a `RunnerJobReport`. Mirror of the `xema.runner.job.*` CloudEvent consumers for runners on the pull/HTTP transport. A duplicate report (same state) is a no-op; a report against a terminal row or an illegal transition is rejected (409).
87
+ * @summary Apply a runner job report (direct report path; idempotent)
88
+ */
89
+ const getRunnerJobsControllerReportUrl = (jobId) => {
90
+ return `/runner-jobs/${jobId}/report`;
91
+ };
92
+ exports.getRunnerJobsControllerReportUrl = getRunnerJobsControllerReportUrl;
93
+ const runnerJobsControllerReport = async (jobId, runnerJobReportDto, options) => {
94
+ return (0, custom_fetch_1.customFetch)((0, exports.getRunnerJobsControllerReportUrl)(jobId), {
95
+ ...options,
96
+ method: 'POST',
97
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
98
+ body: JSON.stringify(runnerJobReportDto)
99
+ });
100
+ };
101
+ exports.runnerJobsControllerReport = runnerJobsControllerReport;
@@ -0,0 +1,45 @@
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, opencode workers, previews, and DB schemas.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { WorkloadDescriptorDto, WorkloadInstanceDto, WorkloadInstanceDtoPaginatedEnvelope, WorkloadsControllerListParams } from '../../models';
9
+ /**
10
+ * Creates a workload from a descriptor. Re-POSTing with the same `(kind, ownerKey)` returns the existing workload (HTTP 200) without reapplying; first-time creation returns HTTP 201. The scheduler runs asynchronously — clients subscribe to `workload.lifecycle.*` events to learn when the workload reaches `ready`.
11
+ * @summary Create or upsert a workload (idempotent by kind+ownerKey)
12
+ */
13
+ export declare const getWorkloadsControllerCreateUrl: () => string;
14
+ export declare const workloadsControllerCreate: (workloadDescriptorDto: WorkloadDescriptorDto, options?: RequestInit) => Promise<WorkloadInstanceDto>;
15
+ /**
16
+ * Filter by kind/state/org/project/ownerKey. `cursor` + `limit` page through results in `createdAt desc` order — callers that walk every workload (pool reconcilers, ops sweepers) MUST follow `nextCursor` until null. Default limit 200, max 1000.
17
+ * @summary List workloads with filters and cursor pagination
18
+ */
19
+ export declare const getWorkloadsControllerListUrl: (params?: WorkloadsControllerListParams) => string;
20
+ export declare const workloadsControllerList: (params?: WorkloadsControllerListParams, options?: RequestInit) => Promise<WorkloadInstanceDtoPaginatedEnvelope>;
21
+ /**
22
+ * @summary Fetch a workload by id with last-known health snapshot
23
+ */
24
+ export declare const getWorkloadsControllerGetUrl: (id: string) => string;
25
+ export declare const workloadsControllerGet: (id: string, options?: RequestInit) => Promise<WorkloadInstanceDto>;
26
+ /**
27
+ * @summary Drain then delete a workload (state → draining → deleted)
28
+ */
29
+ export declare const getWorkloadsControllerDeleteUrl: (id: string) => string;
30
+ export declare const workloadsControllerDelete: (id: string, options?: RequestInit) => Promise<void>;
31
+ /**
32
+ * @summary Force scheduler.reconcile() with current descriptor (rolling restart)
33
+ */
34
+ export declare const getWorkloadsControllerRestartUrl: (id: string) => string;
35
+ export declare const workloadsControllerRestart: (id: string, options?: RequestInit) => Promise<void>;
36
+ /**
37
+ * @summary On-demand health probe (synchronous scheduler.describe)
38
+ */
39
+ export declare const getWorkloadsControllerRefreshHealthUrl: (id: string) => string;
40
+ export declare const workloadsControllerRefreshHealth: (id: string, options?: RequestInit) => Promise<WorkloadInstanceDto>;
41
+ /**
42
+ * @summary Trigger a full reconciler sweep (admin-only)
43
+ */
44
+ export declare const getWorkloadsControllerReconcileAllUrl: () => string;
45
+ export declare const workloadsControllerReconcileAll: (options?: RequestInit) => Promise<void>;