@xemahq/webapp-studio-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 (96) hide show
  1. package/LICENSE +1 -0
  2. package/dist/custom-fetch.d.ts +49 -0
  3. package/dist/custom-fetch.js +147 -0
  4. package/dist/endpoints/app-databases/app-databases.d.ts +28 -0
  5. package/dist/endpoints/app-databases/app-databases.js +64 -0
  6. package/dist/endpoints/health/health.d.ts +15 -0
  7. package/dist/endpoints/health/health.js +53 -0
  8. package/dist/endpoints/internal/internal.d.ts +30 -0
  9. package/dist/endpoints/internal/internal.js +68 -0
  10. package/dist/endpoints/studio/studio.d.ts +53 -0
  11. package/dist/endpoints/studio/studio.js +157 -0
  12. package/dist/index.d.ts +6 -0
  13. package/dist/index.js +28 -0
  14. package/dist/models/appDbResponseDto.d.ts +34 -0
  15. package/dist/models/appDbResponseDto.js +2 -0
  16. package/dist/models/appDbsResponseDto.d.ts +16 -0
  17. package/dist/models/appDbsResponseDto.js +2 -0
  18. package/dist/models/appTargetDto.d.ts +26 -0
  19. package/dist/models/appTargetDto.js +2 -0
  20. package/dist/models/createStudioDto.d.ts +36 -0
  21. package/dist/models/createStudioDto.js +2 -0
  22. package/dist/models/detectFrameworksDto.d.ts +13 -0
  23. package/dist/models/detectFrameworksDto.js +9 -0
  24. package/dist/models/detectFrameworksResponseDto.d.ts +22 -0
  25. package/dist/models/detectFrameworksResponseDto.js +2 -0
  26. package/dist/models/detectFrameworksResponseDtoInaccessibleReason.d.ts +14 -0
  27. package/dist/models/detectFrameworksResponseDtoInaccessibleReason.js +9 -0
  28. package/dist/models/index.d.ts +40 -0
  29. package/dist/models/index.js +57 -0
  30. package/dist/models/internalBiomeCleanupRequestDto.d.ts +25 -0
  31. package/dist/models/internalBiomeCleanupRequestDto.js +9 -0
  32. package/dist/models/internalBiomeCleanupResponseDto.d.ts +11 -0
  33. package/dist/models/internalBiomeCleanupResponseDto.js +9 -0
  34. package/dist/models/migrateAppDbDto.d.ts +15 -0
  35. package/dist/models/migrateAppDbDto.js +9 -0
  36. package/dist/models/migrateAppDbResponseDto.d.ts +14 -0
  37. package/dist/models/migrateAppDbResponseDto.js +2 -0
  38. package/dist/models/migrationRunnerKind.d.ts +17 -0
  39. package/dist/models/migrationRunnerKind.js +16 -0
  40. package/dist/models/openPrResponseDto.d.ts +15 -0
  41. package/dist/models/openPrResponseDto.js +9 -0
  42. package/dist/models/orgDatabasePurpose.d.ts +17 -0
  43. package/dist/models/orgDatabasePurpose.js +16 -0
  44. package/dist/models/orgDatabaseStatus.d.ts +18 -0
  45. package/dist/models/orgDatabaseStatus.js +17 -0
  46. package/dist/models/patchStudioAppsDto.d.ts +16 -0
  47. package/dist/models/patchStudioAppsDto.js +2 -0
  48. package/dist/models/projectKitAuthInputDto.d.ts +13 -0
  49. package/dist/models/projectKitAuthInputDto.js +9 -0
  50. package/dist/models/projectKitBindingDto.d.ts +23 -0
  51. package/dist/models/projectKitBindingDto.js +2 -0
  52. package/dist/models/projectKitBindingKind.d.ts +15 -0
  53. package/dist/models/projectKitBindingKind.js +14 -0
  54. package/dist/models/projectKitKind.d.ts +15 -0
  55. package/dist/models/projectKitKind.js +14 -0
  56. package/dist/models/projectKitPurpose.d.ts +15 -0
  57. package/dist/models/projectKitPurpose.js +14 -0
  58. package/dist/models/projectKitSourceInputDto.d.ts +27 -0
  59. package/dist/models/projectKitSourceInputDto.js +2 -0
  60. package/dist/models/projectKitSourceKind.d.ts +16 -0
  61. package/dist/models/projectKitSourceKind.js +15 -0
  62. package/dist/models/promoteToProdDto.d.ts +17 -0
  63. package/dist/models/promoteToProdDto.js +9 -0
  64. package/dist/models/promoteToProdResponseDto.d.ts +16 -0
  65. package/dist/models/promoteToProdResponseDto.js +2 -0
  66. package/dist/models/studioControllerListParams.d.ts +32 -0
  67. package/dist/models/studioControllerListParams.js +2 -0
  68. package/dist/models/studioProvisioningFailRequestDto.d.ts +18 -0
  69. package/dist/models/studioProvisioningFailRequestDto.js +2 -0
  70. package/dist/models/studioProvisioningFailRequestDtoActorType.d.ts +16 -0
  71. package/dist/models/studioProvisioningFailRequestDtoActorType.js +15 -0
  72. package/dist/models/studioProvisioningStepRequestDto.d.ts +16 -0
  73. package/dist/models/studioProvisioningStepRequestDto.js +2 -0
  74. package/dist/models/studioProvisioningStepRequestDtoActorType.d.ts +16 -0
  75. package/dist/models/studioProvisioningStepRequestDtoActorType.js +15 -0
  76. package/dist/models/studioResponseDto.d.ts +57 -0
  77. package/dist/models/studioResponseDto.js +2 -0
  78. package/dist/models/studioResponseDtoAgentSlug.d.ts +14 -0
  79. package/dist/models/studioResponseDtoAgentSlug.js +9 -0
  80. package/dist/models/studioResponseDtoDescription.d.ts +13 -0
  81. package/dist/models/studioResponseDtoDescription.js +9 -0
  82. package/dist/models/studioResponseDtoFailureReason.d.ts +14 -0
  83. package/dist/models/studioResponseDtoFailureReason.js +9 -0
  84. package/dist/models/studioResponseDtoLatestPrUrl.d.ts +14 -0
  85. package/dist/models/studioResponseDtoLatestPrUrl.js +9 -0
  86. package/dist/models/studioResponseDtoSessionId.d.ts +14 -0
  87. package/dist/models/studioResponseDtoSessionId.js +9 -0
  88. package/dist/models/updateStudioDto.d.ts +21 -0
  89. package/dist/models/updateStudioDto.js +9 -0
  90. package/dist/models/webappDetectState.d.ts +13 -0
  91. package/dist/models/webappDetectState.js +15 -0
  92. package/dist/models/webappKind.d.ts +15 -0
  93. package/dist/models/webappKind.js +14 -0
  94. package/dist/models/webappStudioStatus.d.ts +13 -0
  95. package/dist/models/webappStudioStatus.js +15 -0
  96. package/package.json +18 -0
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2026 Xema. All rights reserved.
@@ -0,0 +1,49 @@
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://webapp-studio-api:3215',
18
+ * getAuthToken: () => identityBootstrapService.getAccessToken(),
19
+ * getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
20
+ * });
21
+ */
22
+ export interface ClientConfig {
23
+ /** Base URL for the API (e.g. 'http://localhost:3215') — no trailing slash. */
24
+ baseUrl?: string;
25
+ /**
26
+ * Per-request base-URL resolver. When set, the peer URL is resolved from
27
+ * the service registry on EVERY request (boot-order-safe). Wired by
28
+ * `configureOrvalClientResolved` from `@xemahq/platform-common`.
29
+ */
30
+ baseUrlResolver?: () => string | Promise<string>;
31
+ /** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
32
+ getAuthToken?: () => Promise<string>;
33
+ /** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
34
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
35
+ /** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
36
+ onUnauthorized?: () => Promise<void>;
37
+ /** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
38
+ maxRetries?: number;
39
+ }
40
+ export declare class ClientError extends Error {
41
+ readonly status: number;
42
+ readonly url: string;
43
+ readonly body: unknown;
44
+ constructor(status: number, url: string, body: unknown);
45
+ }
46
+ export declare function configureClient(config: ClientConfig): void;
47
+ export declare function getClientConfig(): ClientConfig;
48
+ export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
49
+ export default customFetch;
@@ -0,0 +1,147 @@
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://webapp-studio-api:3215',
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
+ if (config.getHeaders) {
54
+ const globalHeaders = await Promise.resolve(config.getHeaders());
55
+ for (const [key, value] of Object.entries(globalHeaders)) {
56
+ if (!headers.has(key)) {
57
+ headers.set(key, value);
58
+ }
59
+ }
60
+ }
61
+ if (config.getAuthToken && !headers.has('Authorization')) {
62
+ const token = await config.getAuthToken();
63
+ headers.set('Authorization', `Bearer ${token}`);
64
+ }
65
+ return headers;
66
+ }
67
+ const customFetch = async (url, options) => {
68
+ const config = getClientConfig();
69
+ const base = config.baseUrlResolver
70
+ ? await config.baseUrlResolver()
71
+ : config.baseUrl;
72
+ if (base === undefined) {
73
+ throw new Error('Client not configured: set baseUrl or baseUrlResolver via configureClient().');
74
+ }
75
+ const fullUrl = `${base}${url}`;
76
+ const maxRetries = config.maxRetries ?? 3;
77
+ const headers = await buildHeaders(config, options.headers);
78
+ const requestInit = { ...options, headers };
79
+ let delay = 1000;
80
+ let lastError;
81
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
82
+ try {
83
+ const response = await fetch(fullUrl, requestInit);
84
+ if (response.status === 401 && config.onUnauthorized && attempt === 0) {
85
+ await config.onUnauthorized();
86
+ const refreshedHeaders = await buildHeaders(config, options.headers);
87
+ const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
88
+ const retryBody = await parseBody(retryResponse);
89
+ if (retryResponse.status >= 400) {
90
+ throw new ClientError(retryResponse.status, fullUrl, retryBody);
91
+ }
92
+ return retryBody;
93
+ }
94
+ if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
95
+ const body = await parseBody(response);
96
+ if (response.status >= 400) {
97
+ throw new ClientError(response.status, fullUrl, body);
98
+ }
99
+ return body;
100
+ }
101
+ const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
102
+ const waitMs = retryAfter ?? addJitter(delay);
103
+ await sleep(waitMs);
104
+ delay = Math.min(delay * 2, 30_000);
105
+ }
106
+ catch (error) {
107
+ if (error instanceof ClientError)
108
+ throw error;
109
+ lastError = error instanceof Error ? error : new Error(String(error));
110
+ if (attempt >= maxRetries)
111
+ throw lastError;
112
+ const waitMs = addJitter(delay);
113
+ await sleep(waitMs);
114
+ delay = Math.min(delay * 2, 30_000);
115
+ }
116
+ }
117
+ throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
118
+ };
119
+ exports.customFetch = customFetch;
120
+ async function parseBody(response) {
121
+ const contentType = response.headers.get('content-type');
122
+ if (contentType?.includes('application/json')) {
123
+ return response.json();
124
+ }
125
+ if (response.status === 204) {
126
+ return undefined;
127
+ }
128
+ return response.text();
129
+ }
130
+ function parseRetryAfter(value) {
131
+ if (!value)
132
+ return undefined;
133
+ const seconds = Number(value);
134
+ if (!isNaN(seconds) && seconds >= 0)
135
+ return seconds * 1000;
136
+ const date = new Date(value);
137
+ if (!isNaN(date.getTime()))
138
+ return Math.max(0, date.getTime() - Date.now());
139
+ return undefined;
140
+ }
141
+ function addJitter(delay) {
142
+ return delay + (Math.random() * 2 - 1) * delay * 0.25;
143
+ }
144
+ function sleep(ms) {
145
+ return new Promise(resolve => setTimeout(resolve, ms));
146
+ }
147
+ exports.default = exports.customFetch;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * Webapp Studio API
5
+ * Studio session CRUD + lifecycle + PR-from-working-branch handoff
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { AppDbsResponseDto, MigrateAppDbDto, MigrateAppDbResponseDto, PromoteToProdDto, PromoteToProdResponseDto } from '../../models';
9
+ /**
10
+ * @summary List the dev (and, when promoted, prod) org-managed databases attached to one app slug of a webapp-studio session.
11
+ */
12
+ export declare const getAppDbsControllerListUrl: (studioId: string, appSlug: string) => string;
13
+ export declare const appDbsControllerList: (studioId: string, appSlug: string, options?: RequestInit) => Promise<AppDbsResponseDto>;
14
+ /**
15
+ * @summary Idempotently provision the dev database for this app and wait for it to become Active. Safe to call on first migration too.
16
+ */
17
+ export declare const getAppDbsControllerEnsureDevUrl: (studioId: string, appSlug: string) => string;
18
+ export declare const appDbsControllerEnsureDev: (studioId: string, appSlug: string, options?: RequestInit) => Promise<AppDbsResponseDto>;
19
+ /**
20
+ * @summary Run the app’s Prisma migration package against its dev DB. Polls org-database-pool-api until the run is succeeded/failed.
21
+ */
22
+ export declare const getAppDbsControllerMigrateUrl: (studioId: string, appSlug: string) => string;
23
+ export declare const appDbsControllerMigrate: (studioId: string, appSlug: string, migrateAppDbDto: MigrateAppDbDto, options?: RequestInit) => Promise<MigrateAppDbResponseDto>;
24
+ /**
25
+ * @summary Provision (or attach) the prod DB, run the app’s migrations against it, and return the synchronized (dev, prod) pair. `copyData=true` is currently a documented stub and returns 501 NotImplemented.
26
+ */
27
+ export declare const getAppDbsControllerPromoteUrl: (studioId: string, appSlug: string) => string;
28
+ export declare const appDbsControllerPromote: (studioId: string, appSlug: string, promoteToProdDto: PromoteToProdDto, options?: RequestInit) => Promise<PromoteToProdResponseDto>;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appDbsControllerPromote = exports.getAppDbsControllerPromoteUrl = exports.appDbsControllerMigrate = exports.getAppDbsControllerMigrateUrl = exports.appDbsControllerEnsureDev = exports.getAppDbsControllerEnsureDevUrl = exports.appDbsControllerList = exports.getAppDbsControllerListUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * @summary List the dev (and, when promoted, prod) org-managed databases attached to one app slug of a webapp-studio session.
7
+ */
8
+ const getAppDbsControllerListUrl = (studioId, appSlug) => {
9
+ return `/studio/${studioId}/apps/${appSlug}/dbs`;
10
+ };
11
+ exports.getAppDbsControllerListUrl = getAppDbsControllerListUrl;
12
+ const appDbsControllerList = async (studioId, appSlug, options) => {
13
+ return (0, custom_fetch_1.customFetch)((0, exports.getAppDbsControllerListUrl)(studioId, appSlug), {
14
+ ...options,
15
+ method: 'GET'
16
+ });
17
+ };
18
+ exports.appDbsControllerList = appDbsControllerList;
19
+ /**
20
+ * @summary Idempotently provision the dev database for this app and wait for it to become Active. Safe to call on first migration too.
21
+ */
22
+ const getAppDbsControllerEnsureDevUrl = (studioId, appSlug) => {
23
+ return `/studio/${studioId}/apps/${appSlug}/dbs/ensure-dev`;
24
+ };
25
+ exports.getAppDbsControllerEnsureDevUrl = getAppDbsControllerEnsureDevUrl;
26
+ const appDbsControllerEnsureDev = async (studioId, appSlug, options) => {
27
+ return (0, custom_fetch_1.customFetch)((0, exports.getAppDbsControllerEnsureDevUrl)(studioId, appSlug), {
28
+ ...options,
29
+ method: 'POST'
30
+ });
31
+ };
32
+ exports.appDbsControllerEnsureDev = appDbsControllerEnsureDev;
33
+ /**
34
+ * @summary Run the app’s Prisma migration package against its dev DB. Polls org-database-pool-api until the run is succeeded/failed.
35
+ */
36
+ const getAppDbsControllerMigrateUrl = (studioId, appSlug) => {
37
+ return `/studio/${studioId}/apps/${appSlug}/dbs/migrate`;
38
+ };
39
+ exports.getAppDbsControllerMigrateUrl = getAppDbsControllerMigrateUrl;
40
+ const appDbsControllerMigrate = async (studioId, appSlug, migrateAppDbDto, options) => {
41
+ return (0, custom_fetch_1.customFetch)((0, exports.getAppDbsControllerMigrateUrl)(studioId, appSlug), {
42
+ ...options,
43
+ method: 'POST',
44
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
45
+ body: JSON.stringify(migrateAppDbDto)
46
+ });
47
+ };
48
+ exports.appDbsControllerMigrate = appDbsControllerMigrate;
49
+ /**
50
+ * @summary Provision (or attach) the prod DB, run the app’s migrations against it, and return the synchronized (dev, prod) pair. `copyData=true` is currently a documented stub and returns 501 NotImplemented.
51
+ */
52
+ const getAppDbsControllerPromoteUrl = (studioId, appSlug) => {
53
+ return `/studio/${studioId}/apps/${appSlug}/dbs/promote-to-prod`;
54
+ };
55
+ exports.getAppDbsControllerPromoteUrl = getAppDbsControllerPromoteUrl;
56
+ const appDbsControllerPromote = async (studioId, appSlug, promoteToProdDto, options) => {
57
+ return (0, custom_fetch_1.customFetch)((0, exports.getAppDbsControllerPromoteUrl)(studioId, appSlug), {
58
+ ...options,
59
+ method: 'POST',
60
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
61
+ body: JSON.stringify(promoteToProdDto)
62
+ });
63
+ };
64
+ exports.appDbsControllerPromote = appDbsControllerPromote;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @summary Health check
3
+ */
4
+ export declare const getPluginHealthControllerCheckUrl: () => string;
5
+ export declare const pluginHealthControllerCheck: (options?: RequestInit) => Promise<void>;
6
+ /**
7
+ * @summary Liveness probe
8
+ */
9
+ export declare const getPluginHealthControllerLiveUrl: () => string;
10
+ export declare const pluginHealthControllerLive: (options?: RequestInit) => Promise<void>;
11
+ /**
12
+ * @summary Readiness probe — checks database connectivity
13
+ */
14
+ export declare const getPluginHealthControllerReadyUrl: () => string;
15
+ export declare const pluginHealthControllerReady: (options?: RequestInit) => Promise<void>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pluginHealthControllerReady = exports.getPluginHealthControllerReadyUrl = exports.pluginHealthControllerLive = exports.getPluginHealthControllerLiveUrl = exports.pluginHealthControllerCheck = exports.getPluginHealthControllerCheckUrl = void 0;
4
+ /**
5
+ * Generated by orval v8.6.2 🍺
6
+ * Do not edit manually.
7
+ * Webapp Studio API
8
+ * Studio session CRUD + lifecycle + PR-from-working-branch handoff
9
+ * OpenAPI spec version: 0.1.0
10
+ */
11
+ const custom_fetch_1 = require("../../custom-fetch");
12
+ /**
13
+ * @summary Health check
14
+ */
15
+ const getPluginHealthControllerCheckUrl = () => {
16
+ return `/health`;
17
+ };
18
+ exports.getPluginHealthControllerCheckUrl = getPluginHealthControllerCheckUrl;
19
+ const pluginHealthControllerCheck = async (options) => {
20
+ return (0, custom_fetch_1.customFetch)((0, exports.getPluginHealthControllerCheckUrl)(), {
21
+ ...options,
22
+ method: 'GET'
23
+ });
24
+ };
25
+ exports.pluginHealthControllerCheck = pluginHealthControllerCheck;
26
+ /**
27
+ * @summary Liveness probe
28
+ */
29
+ const getPluginHealthControllerLiveUrl = () => {
30
+ return `/health/live`;
31
+ };
32
+ exports.getPluginHealthControllerLiveUrl = getPluginHealthControllerLiveUrl;
33
+ const pluginHealthControllerLive = async (options) => {
34
+ return (0, custom_fetch_1.customFetch)((0, exports.getPluginHealthControllerLiveUrl)(), {
35
+ ...options,
36
+ method: 'GET'
37
+ });
38
+ };
39
+ exports.pluginHealthControllerLive = pluginHealthControllerLive;
40
+ /**
41
+ * @summary Readiness probe — checks database connectivity
42
+ */
43
+ const getPluginHealthControllerReadyUrl = () => {
44
+ return `/health/ready`;
45
+ };
46
+ exports.getPluginHealthControllerReadyUrl = getPluginHealthControllerReadyUrl;
47
+ const pluginHealthControllerReady = async (options) => {
48
+ return (0, custom_fetch_1.customFetch)((0, exports.getPluginHealthControllerReadyUrl)(), {
49
+ ...options,
50
+ method: 'GET'
51
+ });
52
+ };
53
+ exports.pluginHealthControllerReady = pluginHealthControllerReady;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * Webapp Studio API
5
+ * Studio session CRUD + lifecycle + PR-from-working-branch handoff
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { InternalBiomeCleanupRequestDto, InternalBiomeCleanupResponseDto, StudioProvisioningFailRequestDto, StudioProvisioningStepRequestDto } from '../../models';
9
+ /**
10
+ * @summary Provisioning step — advance the studio state machine by one tick
11
+ */
12
+ export declare const getInternalStudioProvisioningControllerTickUrl: (studioId: string) => string;
13
+ export declare const internalStudioProvisioningControllerTick: (studioId: string, studioProvisioningStepRequestDto: StudioProvisioningStepRequestDto, options?: RequestInit) => Promise<void>;
14
+ /**
15
+ * @summary Provisioning compensation — archive the studio with the failure reason
16
+ */
17
+ export declare const getInternalStudioProvisioningControllerFailUrl: (studioId: string) => string;
18
+ export declare const internalStudioProvisioningControllerFail: (studioId: string, studioProvisioningFailRequestDto: StudioProvisioningFailRequestDto, options?: RequestInit) => Promise<void>;
19
+ /**
20
+ * Service-to-service endpoint fired by the studio-provisioning-reconcile Temporal Schedule. (Re)starts provisioning workflows for studios stranded in CREATING.
21
+ * @summary Run one studio-provisioning reconcile sweep
22
+ */
23
+ export declare const getInternalStudioProvisioningControllerReconcileTickUrl: () => string;
24
+ export declare const internalStudioProvisioningControllerReconcileTick: (options?: RequestInit) => Promise<void>;
25
+ /**
26
+ * Service-to-service endpoint fired by the uninstallBiomeCascadeWorkflow when a BiomeInstallation is hard-deleted. Acts only when the deleted biomeId is `xema/webapp-studio`; every other biome is a no-op for this service.
27
+ * @summary Archive every webapp_studios row in the project whose biome was uninstalled
28
+ */
29
+ export declare const getInternalBiomeCleanupControllerInstallationDeletedUrl: () => string;
30
+ export declare const internalBiomeCleanupControllerInstallationDeleted: (internalBiomeCleanupRequestDto: InternalBiomeCleanupRequestDto, options?: RequestInit) => Promise<InternalBiomeCleanupResponseDto>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.internalBiomeCleanupControllerInstallationDeleted = exports.getInternalBiomeCleanupControllerInstallationDeletedUrl = exports.internalStudioProvisioningControllerReconcileTick = exports.getInternalStudioProvisioningControllerReconcileTickUrl = exports.internalStudioProvisioningControllerFail = exports.getInternalStudioProvisioningControllerFailUrl = exports.internalStudioProvisioningControllerTick = exports.getInternalStudioProvisioningControllerTickUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * @summary Provisioning step — advance the studio state machine by one tick
7
+ */
8
+ const getInternalStudioProvisioningControllerTickUrl = (studioId) => {
9
+ return `/internal/studios/${studioId}/provisioning/tick`;
10
+ };
11
+ exports.getInternalStudioProvisioningControllerTickUrl = getInternalStudioProvisioningControllerTickUrl;
12
+ const internalStudioProvisioningControllerTick = async (studioId, studioProvisioningStepRequestDto, options) => {
13
+ return (0, custom_fetch_1.customFetch)((0, exports.getInternalStudioProvisioningControllerTickUrl)(studioId), {
14
+ ...options,
15
+ method: 'POST',
16
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
17
+ body: JSON.stringify(studioProvisioningStepRequestDto)
18
+ });
19
+ };
20
+ exports.internalStudioProvisioningControllerTick = internalStudioProvisioningControllerTick;
21
+ /**
22
+ * @summary Provisioning compensation — archive the studio with the failure reason
23
+ */
24
+ const getInternalStudioProvisioningControllerFailUrl = (studioId) => {
25
+ return `/internal/studios/${studioId}/provisioning/fail`;
26
+ };
27
+ exports.getInternalStudioProvisioningControllerFailUrl = getInternalStudioProvisioningControllerFailUrl;
28
+ const internalStudioProvisioningControllerFail = async (studioId, studioProvisioningFailRequestDto, options) => {
29
+ return (0, custom_fetch_1.customFetch)((0, exports.getInternalStudioProvisioningControllerFailUrl)(studioId), {
30
+ ...options,
31
+ method: 'POST',
32
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
33
+ body: JSON.stringify(studioProvisioningFailRequestDto)
34
+ });
35
+ };
36
+ exports.internalStudioProvisioningControllerFail = internalStudioProvisioningControllerFail;
37
+ /**
38
+ * Service-to-service endpoint fired by the studio-provisioning-reconcile Temporal Schedule. (Re)starts provisioning workflows for studios stranded in CREATING.
39
+ * @summary Run one studio-provisioning reconcile sweep
40
+ */
41
+ const getInternalStudioProvisioningControllerReconcileTickUrl = () => {
42
+ return `/internal/studio-provisioning/reconcile-tick`;
43
+ };
44
+ exports.getInternalStudioProvisioningControllerReconcileTickUrl = getInternalStudioProvisioningControllerReconcileTickUrl;
45
+ const internalStudioProvisioningControllerReconcileTick = async (options) => {
46
+ return (0, custom_fetch_1.customFetch)((0, exports.getInternalStudioProvisioningControllerReconcileTickUrl)(), {
47
+ ...options,
48
+ method: 'POST'
49
+ });
50
+ };
51
+ exports.internalStudioProvisioningControllerReconcileTick = internalStudioProvisioningControllerReconcileTick;
52
+ /**
53
+ * Service-to-service endpoint fired by the uninstallBiomeCascadeWorkflow when a BiomeInstallation is hard-deleted. Acts only when the deleted biomeId is `xema/webapp-studio`; every other biome is a no-op for this service.
54
+ * @summary Archive every webapp_studios row in the project whose biome was uninstalled
55
+ */
56
+ const getInternalBiomeCleanupControllerInstallationDeletedUrl = () => {
57
+ return `/internal/biome-cleanup/installation-deleted`;
58
+ };
59
+ exports.getInternalBiomeCleanupControllerInstallationDeletedUrl = getInternalBiomeCleanupControllerInstallationDeletedUrl;
60
+ const internalBiomeCleanupControllerInstallationDeleted = async (internalBiomeCleanupRequestDto, options) => {
61
+ return (0, custom_fetch_1.customFetch)((0, exports.getInternalBiomeCleanupControllerInstallationDeletedUrl)(), {
62
+ ...options,
63
+ method: 'POST',
64
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
65
+ body: JSON.stringify(internalBiomeCleanupRequestDto)
66
+ });
67
+ };
68
+ exports.internalBiomeCleanupControllerInstallationDeleted = internalBiomeCleanupControllerInstallationDeleted;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * Webapp Studio API
5
+ * Studio session CRUD + lifecycle + PR-from-working-branch handoff
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { CreateStudioDto, DetectFrameworksDto, DetectFrameworksResponseDto, OpenPrResponseDto, PatchStudioAppsDto, StudioControllerListParams, StudioResponseDto, UpdateStudioDto } from '../../models';
9
+ /**
10
+ * @summary Probe a repo subfolder for a recognised webapp framework. Used by the create dialog to detect mismatches between the user-chosen `kind` and what already lives in the repo. Read-only and safe to call from a debounced input.
11
+ */
12
+ export declare const getStudioControllerDetectUrl: () => string;
13
+ export declare const studioControllerDetect: (detectFrameworksDto: DetectFrameworksDto, options?: RequestInit) => Promise<DetectFrameworksResponseDto>;
14
+ /**
15
+ * @summary Create a webapp studio session + provision its interactive agent
16
+ */
17
+ export declare const getStudioControllerCreateUrl: () => string;
18
+ export declare const studioControllerCreate: (createStudioDto: CreateStudioDto, options?: RequestInit) => Promise<StudioResponseDto>;
19
+ /**
20
+ * @summary List studio sessions
21
+ */
22
+ export declare const getStudioControllerListUrl: (params?: StudioControllerListParams) => string;
23
+ export declare const studioControllerList: (params?: StudioControllerListParams, options?: RequestInit) => Promise<StudioResponseDto[]>;
24
+ /**
25
+ * @summary Get a studio session by id
26
+ */
27
+ export declare const getStudioControllerGetByIdUrl: (id: string) => string;
28
+ export declare const studioControllerGetById: (id: string, options?: RequestInit) => Promise<StudioResponseDto>;
29
+ /**
30
+ * @summary Update studio metadata (title, description, agent override).
31
+ */
32
+ export declare const getStudioControllerUpdateUrl: (id: string) => string;
33
+ export declare const studioControllerUpdate: (id: string, updateStudioDto: UpdateStudioDto, options?: RequestInit) => Promise<StudioResponseDto>;
34
+ /**
35
+ * @summary Archive a studio (terminates the interactive session). Does NOT delete the long-lived `xema/webapp/<projectId>` working branch on the SCM remote — other sessions may target the same branch. Idempotent.
36
+ */
37
+ export declare const getStudioControllerArchiveUrl: (id: string) => string;
38
+ export declare const studioControllerArchive: (id: string, options?: RequestInit) => Promise<StudioResponseDto>;
39
+ /**
40
+ * @summary Replace the studio app-target list. The supervisor picks up the new list on the next watcher rescan. Refuses on ARCHIVED studios.
41
+ */
42
+ export declare const getStudioControllerPatchAppsUrl: (id: string) => string;
43
+ export declare const studioControllerPatchApps: (id: string, patchStudioAppsDto: PatchStudioAppsDto, options?: RequestInit) => Promise<StudioResponseDto>;
44
+ /**
45
+ * @summary Provision a fresh interactive session for this studio. Reuses the studio identity, working branch, and app-target list. The previous session is terminated; its id is captured in `previousSessionIds` for audit.
46
+ */
47
+ export declare const getStudioControllerRestartUrl: (id: string) => string;
48
+ export declare const studioControllerRestart: (id: string, options?: RequestInit) => Promise<StudioResponseDto>;
49
+ /**
50
+ * @summary Open (or refresh) a PR from the studio working branch against the repo default branch. Idempotent — calling when a PR is already open returns its URL without creating a duplicate.
51
+ */
52
+ export declare const getStudioControllerOpenPrUrl: (id: string) => string;
53
+ export declare const studioControllerOpenPr: (id: string, options?: RequestInit) => Promise<OpenPrResponseDto>;