@xemahq/design-system-builder-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.
- package/LICENSE +1 -0
- package/dist/custom-fetch.d.ts +52 -0
- package/dist/custom-fetch.js +152 -0
- package/dist/endpoints/brainstorming/brainstorming.d.ts +58 -0
- package/dist/endpoints/brainstorming/brainstorming.js +173 -0
- package/dist/endpoints/design-system-builder/design-system-builder.d.ts +58 -0
- package/dist/endpoints/design-system-builder/design-system-builder.js +173 -0
- package/dist/endpoints/health/health.d.ts +15 -0
- package/dist/endpoints/health/health.js +53 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +27 -0
- package/dist/models/brainstormingControllerListParams.d.ts +32 -0
- package/dist/models/brainstormingControllerListParams.js +2 -0
- package/dist/models/brainstormingKBPushDto.d.ts +20 -0
- package/dist/models/brainstormingKBPushDto.js +2 -0
- package/dist/models/brainstormingKBPushResponseDto.d.ts +15 -0
- package/dist/models/brainstormingKBPushResponseDto.js +9 -0
- package/dist/models/brainstormingKbMountsResponseDto.d.ts +16 -0
- package/dist/models/brainstormingKbMountsResponseDto.js +2 -0
- package/dist/models/brainstormingKbPageMountDto.d.ts +13 -0
- package/dist/models/brainstormingKbPageMountDto.js +9 -0
- package/dist/models/brainstormingResponseDto.d.ts +48 -0
- package/dist/models/brainstormingResponseDto.js +2 -0
- package/dist/models/brainstormingResponseDtoAgentSlug.d.ts +14 -0
- package/dist/models/brainstormingResponseDtoAgentSlug.js +9 -0
- package/dist/models/brainstormingResponseDtoDescription.d.ts +13 -0
- package/dist/models/brainstormingResponseDtoDescription.js +9 -0
- package/dist/models/brainstormingResponseDtoFailureReason.d.ts +14 -0
- package/dist/models/brainstormingResponseDtoFailureReason.js +9 -0
- package/dist/models/brainstormingResponseDtoLatestBootstrapJobId.d.ts +14 -0
- package/dist/models/brainstormingResponseDtoLatestBootstrapJobId.js +9 -0
- package/dist/models/brainstormingResponseDtoSessionId.d.ts +14 -0
- package/dist/models/brainstormingResponseDtoSessionId.js +9 -0
- package/dist/models/brainstormingStatus.d.ts +13 -0
- package/dist/models/brainstormingStatus.js +15 -0
- package/dist/models/createBrainstormingDto.d.ts +23 -0
- package/dist/models/createBrainstormingDto.js +9 -0
- package/dist/models/createDesignSystemBuilderDto.d.ts +23 -0
- package/dist/models/createDesignSystemBuilderDto.js +9 -0
- package/dist/models/designSystemBuildStatus.d.ts +13 -0
- package/dist/models/designSystemBuildStatus.js +15 -0
- package/dist/models/designSystemBuilderControllerListParams.d.ts +32 -0
- package/dist/models/designSystemBuilderControllerListParams.js +2 -0
- package/dist/models/designSystemBuilderKBPushDto.d.ts +20 -0
- package/dist/models/designSystemBuilderKBPushDto.js +2 -0
- package/dist/models/designSystemBuilderKBPushResponseDto.d.ts +15 -0
- package/dist/models/designSystemBuilderKBPushResponseDto.js +9 -0
- package/dist/models/designSystemBuilderKbMountsResponseDto.d.ts +16 -0
- package/dist/models/designSystemBuilderKbMountsResponseDto.js +2 -0
- package/dist/models/designSystemBuilderKbPageMountDto.d.ts +13 -0
- package/dist/models/designSystemBuilderKbPageMountDto.js +9 -0
- package/dist/models/designSystemBuilderResponseDto.d.ts +48 -0
- package/dist/models/designSystemBuilderResponseDto.js +2 -0
- package/dist/models/designSystemBuilderResponseDtoAgentSlug.d.ts +14 -0
- package/dist/models/designSystemBuilderResponseDtoAgentSlug.js +9 -0
- package/dist/models/designSystemBuilderResponseDtoDescription.d.ts +13 -0
- package/dist/models/designSystemBuilderResponseDtoDescription.js +9 -0
- package/dist/models/designSystemBuilderResponseDtoFailureReason.d.ts +14 -0
- package/dist/models/designSystemBuilderResponseDtoFailureReason.js +9 -0
- package/dist/models/designSystemBuilderResponseDtoLatestBootstrapJobId.d.ts +14 -0
- package/dist/models/designSystemBuilderResponseDtoLatestBootstrapJobId.js +9 -0
- package/dist/models/designSystemBuilderResponseDtoSessionId.d.ts +14 -0
- package/dist/models/designSystemBuilderResponseDtoSessionId.js +9 -0
- package/dist/models/index.d.ts +36 -0
- package/dist/models/index.js +53 -0
- package/dist/models/kBPushEntryDto.d.ts +14 -0
- package/dist/models/kBPushEntryDto.js +2 -0
- package/dist/models/kBPushEntryDtoType.d.ts +15 -0
- package/dist/models/kBPushEntryDtoType.js +14 -0
- package/dist/models/launchPipelineDto.d.ts +13 -0
- package/dist/models/launchPipelineDto.js +9 -0
- package/dist/models/launchPipelineResponseDto.d.ts +15 -0
- package/dist/models/launchPipelineResponseDto.js +9 -0
- package/dist/models/updateBrainstormingDto.d.ts +21 -0
- package/dist/models/updateBrainstormingDto.js +2 -0
- package/dist/models/updateBrainstormingDtoDescription.d.ts +14 -0
- package/dist/models/updateBrainstormingDtoDescription.js +9 -0
- package/dist/models/updateBrainstormingKbMountsDto.d.ts +14 -0
- package/dist/models/updateBrainstormingKbMountsDto.js +2 -0
- package/dist/models/updateDesignSystemBuilderDto.d.ts +21 -0
- package/dist/models/updateDesignSystemBuilderDto.js +2 -0
- package/dist/models/updateDesignSystemBuilderDtoDescription.d.ts +14 -0
- package/dist/models/updateDesignSystemBuilderDtoDescription.js +9 -0
- package/dist/models/updateDesignSystemBuilderKbMountsDto.d.ts +14 -0
- package/dist/models/updateDesignSystemBuilderKbMountsDto.js +2 -0
- 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,152 @@
|
|
|
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 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 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
|
+
async function parseBody(response) {
|
|
126
|
+
const contentType = response.headers.get('content-type');
|
|
127
|
+
if (contentType?.includes('application/json')) {
|
|
128
|
+
return response.json();
|
|
129
|
+
}
|
|
130
|
+
if (response.status === 204) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
return response.text();
|
|
134
|
+
}
|
|
135
|
+
function parseRetryAfter(value) {
|
|
136
|
+
if (!value)
|
|
137
|
+
return undefined;
|
|
138
|
+
const seconds = Number(value);
|
|
139
|
+
if (!isNaN(seconds) && seconds >= 0)
|
|
140
|
+
return seconds * 1000;
|
|
141
|
+
const date = new Date(value);
|
|
142
|
+
if (!isNaN(date.getTime()))
|
|
143
|
+
return Math.max(0, date.getTime() - Date.now());
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
function addJitter(delay) {
|
|
147
|
+
return delay + (Math.random() * 2 - 1) * delay * 0.25;
|
|
148
|
+
}
|
|
149
|
+
function sleep(ms) {
|
|
150
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
151
|
+
}
|
|
152
|
+
exports.default = exports.customFetch;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Brainstorming API
|
|
5
|
+
* Brainstorming exploration, chat, widgets, attachments, and promotion to pipeline
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { BrainstormingControllerListParams, BrainstormingKBPushDto, BrainstormingKBPushResponseDto, BrainstormingKbMountsResponseDto, BrainstormingResponseDto, CreateBrainstormingDto, LaunchPipelineDto, LaunchPipelineResponseDto, UpdateBrainstormingDto, UpdateBrainstormingKbMountsDto } from '../../models';
|
|
9
|
+
/**
|
|
10
|
+
* @summary Create a brainstorming session + provision its interactive agent
|
|
11
|
+
*/
|
|
12
|
+
export declare const getBrainstormingControllerCreateUrl: () => string;
|
|
13
|
+
export declare const brainstormingControllerCreate: (createBrainstormingDto: CreateBrainstormingDto, options?: RequestInit) => Promise<BrainstormingResponseDto>;
|
|
14
|
+
/**
|
|
15
|
+
* @summary List brainstormings
|
|
16
|
+
*/
|
|
17
|
+
export declare const getBrainstormingControllerListUrl: (params?: BrainstormingControllerListParams) => string;
|
|
18
|
+
export declare const brainstormingControllerList: (params?: BrainstormingControllerListParams, options?: RequestInit) => Promise<BrainstormingResponseDto[]>;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Get a brainstorming by id
|
|
21
|
+
*/
|
|
22
|
+
export declare const getBrainstormingControllerGetByIdUrl: (id: string) => string;
|
|
23
|
+
export declare const brainstormingControllerGetById: (id: string, options?: RequestInit) => Promise<BrainstormingResponseDto>;
|
|
24
|
+
/**
|
|
25
|
+
* @summary Archive a brainstorming (terminates its interactive session). Idempotent.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getBrainstormingControllerArchiveUrl: (id: string) => string;
|
|
28
|
+
export declare const brainstormingControllerArchive: (id: string, options?: RequestInit) => Promise<BrainstormingResponseDto>;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Update brainstorming metadata (title, description).
|
|
31
|
+
*/
|
|
32
|
+
export declare const getBrainstormingControllerUpdateUrl: (id: string) => string;
|
|
33
|
+
export declare const brainstormingControllerUpdate: (id: string, updateBrainstormingDto: UpdateBrainstormingDto, options?: RequestInit) => Promise<BrainstormingResponseDto>;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Replace the interactive session backing this brainstorming. Used when the prior session has ended unrecoverably. The old session id is kept in `previousSessionIds` as an audit trail.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getBrainstormingControllerRestartUrl: (id: string) => string;
|
|
38
|
+
export declare const brainstormingControllerRestart: (id: string, options?: RequestInit) => Promise<BrainstormingResponseDto>;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Hand off selected session deliverables + deliverables/PIPELINE_INTENT.md to work-orchestrator-api as a clarification-driven bootstrap. Returns the bootstrap jobId the frontend uses to navigate into the clarification chat. Keeps the brainstorming ACTIVE so the user can iterate further.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getBrainstormingControllerLaunchUrl: (id: string) => string;
|
|
43
|
+
export declare const brainstormingControllerLaunch: (id: string, launchPipelineDto: LaunchPipelineDto, options?: RequestInit) => Promise<LaunchPipelineResponseDto>;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Push selected files or directories from the brainstorming session to a knowledge-base space. Optionally creates the target space if createSpace=true. Directory entries are expanded recursively.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getBrainstormingControllerPushToDocumentsUrl: (id: string) => string;
|
|
48
|
+
export declare const brainstormingControllerPushToDocuments: (id: string, brainstormingKBPushDto: BrainstormingKBPushDto, options?: RequestInit) => Promise<BrainstormingKBPushResponseDto>;
|
|
49
|
+
/**
|
|
50
|
+
* @summary List KB spaces and per-space page selections currently mounted into this brainstorming's session workspace.
|
|
51
|
+
*/
|
|
52
|
+
export declare const getBrainstormingControllerListKbMountsUrl: (id: string) => string;
|
|
53
|
+
export declare const brainstormingControllerListKbMounts: (id: string, options?: RequestInit) => Promise<BrainstormingKbMountsResponseDto>;
|
|
54
|
+
/**
|
|
55
|
+
* @summary Full-replace the KB mount selection for this brainstorming’s session. The workspace references slot is re-applied so the agent sees the change on its next turn. Send `{ spaceIds: [], pageMounts: [] }` to clear.
|
|
56
|
+
*/
|
|
57
|
+
export declare const getBrainstormingControllerUpdateKbMountsUrl: (id: string) => string;
|
|
58
|
+
export declare const brainstormingControllerUpdateKbMounts: (id: string, updateBrainstormingKbMountsDto: UpdateBrainstormingKbMountsDto, options?: RequestInit) => Promise<BrainstormingKbMountsResponseDto>;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.brainstormingControllerUpdateKbMounts = exports.getBrainstormingControllerUpdateKbMountsUrl = exports.brainstormingControllerListKbMounts = exports.getBrainstormingControllerListKbMountsUrl = exports.brainstormingControllerPushToDocuments = exports.getBrainstormingControllerPushToDocumentsUrl = exports.brainstormingControllerLaunch = exports.getBrainstormingControllerLaunchUrl = exports.brainstormingControllerRestart = exports.getBrainstormingControllerRestartUrl = exports.brainstormingControllerUpdate = exports.getBrainstormingControllerUpdateUrl = exports.brainstormingControllerArchive = exports.getBrainstormingControllerArchiveUrl = exports.brainstormingControllerGetById = exports.getBrainstormingControllerGetByIdUrl = exports.brainstormingControllerList = exports.getBrainstormingControllerListUrl = exports.brainstormingControllerCreate = exports.getBrainstormingControllerCreateUrl = void 0;
|
|
4
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
|
+
/**
|
|
6
|
+
* @summary Create a brainstorming session + provision its interactive agent
|
|
7
|
+
*/
|
|
8
|
+
const getBrainstormingControllerCreateUrl = () => {
|
|
9
|
+
return `/brainstorming`;
|
|
10
|
+
};
|
|
11
|
+
exports.getBrainstormingControllerCreateUrl = getBrainstormingControllerCreateUrl;
|
|
12
|
+
const brainstormingControllerCreate = async (createBrainstormingDto, options) => {
|
|
13
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerCreateUrl)(), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'POST',
|
|
16
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
17
|
+
body: JSON.stringify(createBrainstormingDto)
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.brainstormingControllerCreate = brainstormingControllerCreate;
|
|
21
|
+
/**
|
|
22
|
+
* @summary List brainstormings
|
|
23
|
+
*/
|
|
24
|
+
const getBrainstormingControllerListUrl = (params) => {
|
|
25
|
+
const normalizedParams = new URLSearchParams();
|
|
26
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
27
|
+
if (value === undefined)
|
|
28
|
+
return;
|
|
29
|
+
if (value === null) {
|
|
30
|
+
normalizedParams.append(key, 'null');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(value)) {
|
|
34
|
+
for (const item of value) {
|
|
35
|
+
if (item === undefined || item === null)
|
|
36
|
+
continue;
|
|
37
|
+
normalizedParams.append(key, item.toString());
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
normalizedParams.append(key, value.toString());
|
|
42
|
+
});
|
|
43
|
+
const stringifiedParams = normalizedParams.toString();
|
|
44
|
+
return stringifiedParams.length > 0 ? `/brainstorming?${stringifiedParams}` : `/brainstorming`;
|
|
45
|
+
};
|
|
46
|
+
exports.getBrainstormingControllerListUrl = getBrainstormingControllerListUrl;
|
|
47
|
+
const brainstormingControllerList = async (params, options) => {
|
|
48
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerListUrl)(params), {
|
|
49
|
+
...options,
|
|
50
|
+
method: 'GET'
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.brainstormingControllerList = brainstormingControllerList;
|
|
54
|
+
/**
|
|
55
|
+
* @summary Get a brainstorming by id
|
|
56
|
+
*/
|
|
57
|
+
const getBrainstormingControllerGetByIdUrl = (id) => {
|
|
58
|
+
return `/brainstorming/${id}`;
|
|
59
|
+
};
|
|
60
|
+
exports.getBrainstormingControllerGetByIdUrl = getBrainstormingControllerGetByIdUrl;
|
|
61
|
+
const brainstormingControllerGetById = async (id, options) => {
|
|
62
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerGetByIdUrl)(id), {
|
|
63
|
+
...options,
|
|
64
|
+
method: 'GET'
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.brainstormingControllerGetById = brainstormingControllerGetById;
|
|
68
|
+
/**
|
|
69
|
+
* @summary Archive a brainstorming (terminates its interactive session). Idempotent.
|
|
70
|
+
*/
|
|
71
|
+
const getBrainstormingControllerArchiveUrl = (id) => {
|
|
72
|
+
return `/brainstorming/${id}`;
|
|
73
|
+
};
|
|
74
|
+
exports.getBrainstormingControllerArchiveUrl = getBrainstormingControllerArchiveUrl;
|
|
75
|
+
const brainstormingControllerArchive = async (id, options) => {
|
|
76
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerArchiveUrl)(id), {
|
|
77
|
+
...options,
|
|
78
|
+
method: 'DELETE'
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
exports.brainstormingControllerArchive = brainstormingControllerArchive;
|
|
82
|
+
/**
|
|
83
|
+
* @summary Update brainstorming metadata (title, description).
|
|
84
|
+
*/
|
|
85
|
+
const getBrainstormingControllerUpdateUrl = (id) => {
|
|
86
|
+
return `/brainstorming/${id}`;
|
|
87
|
+
};
|
|
88
|
+
exports.getBrainstormingControllerUpdateUrl = getBrainstormingControllerUpdateUrl;
|
|
89
|
+
const brainstormingControllerUpdate = async (id, updateBrainstormingDto, options) => {
|
|
90
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerUpdateUrl)(id), {
|
|
91
|
+
...options,
|
|
92
|
+
method: 'PATCH',
|
|
93
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
94
|
+
body: JSON.stringify(updateBrainstormingDto)
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.brainstormingControllerUpdate = brainstormingControllerUpdate;
|
|
98
|
+
/**
|
|
99
|
+
* @summary Replace the interactive session backing this brainstorming. Used when the prior session has ended unrecoverably. The old session id is kept in `previousSessionIds` as an audit trail.
|
|
100
|
+
*/
|
|
101
|
+
const getBrainstormingControllerRestartUrl = (id) => {
|
|
102
|
+
return `/brainstorming/${id}/restart`;
|
|
103
|
+
};
|
|
104
|
+
exports.getBrainstormingControllerRestartUrl = getBrainstormingControllerRestartUrl;
|
|
105
|
+
const brainstormingControllerRestart = async (id, options) => {
|
|
106
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerRestartUrl)(id), {
|
|
107
|
+
...options,
|
|
108
|
+
method: 'POST'
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
exports.brainstormingControllerRestart = brainstormingControllerRestart;
|
|
112
|
+
/**
|
|
113
|
+
* @summary Hand off selected session deliverables + deliverables/PIPELINE_INTENT.md to work-orchestrator-api as a clarification-driven bootstrap. Returns the bootstrap jobId the frontend uses to navigate into the clarification chat. Keeps the brainstorming ACTIVE so the user can iterate further.
|
|
114
|
+
*/
|
|
115
|
+
const getBrainstormingControllerLaunchUrl = (id) => {
|
|
116
|
+
return `/brainstorming/${id}/launch`;
|
|
117
|
+
};
|
|
118
|
+
exports.getBrainstormingControllerLaunchUrl = getBrainstormingControllerLaunchUrl;
|
|
119
|
+
const brainstormingControllerLaunch = async (id, launchPipelineDto, options) => {
|
|
120
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerLaunchUrl)(id), {
|
|
121
|
+
...options,
|
|
122
|
+
method: 'POST',
|
|
123
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
124
|
+
body: JSON.stringify(launchPipelineDto)
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
exports.brainstormingControllerLaunch = brainstormingControllerLaunch;
|
|
128
|
+
/**
|
|
129
|
+
* @summary Push selected files or directories from the brainstorming session to a knowledge-base space. Optionally creates the target space if createSpace=true. Directory entries are expanded recursively.
|
|
130
|
+
*/
|
|
131
|
+
const getBrainstormingControllerPushToDocumentsUrl = (id) => {
|
|
132
|
+
return `/brainstorming/${id}/kb-push`;
|
|
133
|
+
};
|
|
134
|
+
exports.getBrainstormingControllerPushToDocumentsUrl = getBrainstormingControllerPushToDocumentsUrl;
|
|
135
|
+
const brainstormingControllerPushToDocuments = async (id, brainstormingKBPushDto, options) => {
|
|
136
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerPushToDocumentsUrl)(id), {
|
|
137
|
+
...options,
|
|
138
|
+
method: 'POST',
|
|
139
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
140
|
+
body: JSON.stringify(brainstormingKBPushDto)
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
exports.brainstormingControllerPushToDocuments = brainstormingControllerPushToDocuments;
|
|
144
|
+
/**
|
|
145
|
+
* @summary List KB spaces and per-space page selections currently mounted into this brainstorming's session workspace.
|
|
146
|
+
*/
|
|
147
|
+
const getBrainstormingControllerListKbMountsUrl = (id) => {
|
|
148
|
+
return `/brainstorming/${id}/kb-mounts`;
|
|
149
|
+
};
|
|
150
|
+
exports.getBrainstormingControllerListKbMountsUrl = getBrainstormingControllerListKbMountsUrl;
|
|
151
|
+
const brainstormingControllerListKbMounts = async (id, options) => {
|
|
152
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerListKbMountsUrl)(id), {
|
|
153
|
+
...options,
|
|
154
|
+
method: 'GET'
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
exports.brainstormingControllerListKbMounts = brainstormingControllerListKbMounts;
|
|
158
|
+
/**
|
|
159
|
+
* @summary Full-replace the KB mount selection for this brainstorming’s session. The workspace references slot is re-applied so the agent sees the change on its next turn. Send `{ spaceIds: [], pageMounts: [] }` to clear.
|
|
160
|
+
*/
|
|
161
|
+
const getBrainstormingControllerUpdateKbMountsUrl = (id) => {
|
|
162
|
+
return `/brainstorming/${id}/kb-mounts`;
|
|
163
|
+
};
|
|
164
|
+
exports.getBrainstormingControllerUpdateKbMountsUrl = getBrainstormingControllerUpdateKbMountsUrl;
|
|
165
|
+
const brainstormingControllerUpdateKbMounts = async (id, updateBrainstormingKbMountsDto, options) => {
|
|
166
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getBrainstormingControllerUpdateKbMountsUrl)(id), {
|
|
167
|
+
...options,
|
|
168
|
+
method: 'PATCH',
|
|
169
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
170
|
+
body: JSON.stringify(updateBrainstormingKbMountsDto)
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
exports.brainstormingControllerUpdateKbMounts = brainstormingControllerUpdateKbMounts;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Brainstorming API
|
|
5
|
+
* Brainstorming exploration, chat, widgets, attachments, and promotion to pipeline
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { CreateDesignSystemBuilderDto, DesignSystemBuilderControllerListParams, DesignSystemBuilderKBPushDto, DesignSystemBuilderKBPushResponseDto, DesignSystemBuilderKbMountsResponseDto, DesignSystemBuilderResponseDto, LaunchPipelineDto, LaunchPipelineResponseDto, UpdateDesignSystemBuilderDto, UpdateDesignSystemBuilderKbMountsDto } from '../../models';
|
|
9
|
+
/**
|
|
10
|
+
* @summary Create a design system build + provision its interactive agent
|
|
11
|
+
*/
|
|
12
|
+
export declare const getDesignSystemBuilderControllerCreateUrl: () => string;
|
|
13
|
+
export declare const designSystemBuilderControllerCreate: (createDesignSystemBuilderDto: CreateDesignSystemBuilderDto, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto>;
|
|
14
|
+
/**
|
|
15
|
+
* @summary List design system builds
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDesignSystemBuilderControllerListUrl: (params?: DesignSystemBuilderControllerListParams) => string;
|
|
18
|
+
export declare const designSystemBuilderControllerList: (params?: DesignSystemBuilderControllerListParams, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto[]>;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Get a design system build by id
|
|
21
|
+
*/
|
|
22
|
+
export declare const getDesignSystemBuilderControllerGetByIdUrl: (id: string) => string;
|
|
23
|
+
export declare const designSystemBuilderControllerGetById: (id: string, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto>;
|
|
24
|
+
/**
|
|
25
|
+
* @summary Archive a design system build (terminates its interactive session). Idempotent.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getDesignSystemBuilderControllerArchiveUrl: (id: string) => string;
|
|
28
|
+
export declare const designSystemBuilderControllerArchive: (id: string, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto>;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Update design system build metadata (title, description).
|
|
31
|
+
*/
|
|
32
|
+
export declare const getDesignSystemBuilderControllerUpdateUrl: (id: string) => string;
|
|
33
|
+
export declare const designSystemBuilderControllerUpdate: (id: string, updateDesignSystemBuilderDto: UpdateDesignSystemBuilderDto, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto>;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Replace the interactive session backing this design system build. Used when the prior session has ended unrecoverably. The old session id is kept in `previousSessionIds` as an audit trail.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getDesignSystemBuilderControllerRestartUrl: (id: string) => string;
|
|
38
|
+
export declare const designSystemBuilderControllerRestart: (id: string, options?: RequestInit) => Promise<DesignSystemBuilderResponseDto>;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Hand off selected session deliverables + deliverables/PIPELINE_INTENT.md to work-orchestrator-api as a clarification-driven bootstrap. Returns the bootstrap jobId the frontend uses to navigate into the clarification chat. Keeps the design system build ACTIVE so the user can iterate further.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getDesignSystemBuilderControllerLaunchUrl: (id: string) => string;
|
|
43
|
+
export declare const designSystemBuilderControllerLaunch: (id: string, launchPipelineDto: LaunchPipelineDto, options?: RequestInit) => Promise<LaunchPipelineResponseDto>;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Push selected files or directories from the design system build session to a knowledge-base space. Optionally creates the target space if createSpace=true. Directory entries are expanded recursively.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getDesignSystemBuilderControllerPushToDocumentsUrl: (id: string) => string;
|
|
48
|
+
export declare const designSystemBuilderControllerPushToDocuments: (id: string, designSystemBuilderKBPushDto: DesignSystemBuilderKBPushDto, options?: RequestInit) => Promise<DesignSystemBuilderKBPushResponseDto>;
|
|
49
|
+
/**
|
|
50
|
+
* @summary List KB spaces and per-space page selections currently mounted into this design system build's session workspace.
|
|
51
|
+
*/
|
|
52
|
+
export declare const getDesignSystemBuilderControllerListKbMountsUrl: (id: string) => string;
|
|
53
|
+
export declare const designSystemBuilderControllerListKbMounts: (id: string, options?: RequestInit) => Promise<DesignSystemBuilderKbMountsResponseDto>;
|
|
54
|
+
/**
|
|
55
|
+
* @summary Full-replace the KB mount selection for this design system build’s session. The workspace references slot is re-applied so the agent sees the change on its next turn. Send `{ spaceIds: [], pageMounts: [] }` to clear.
|
|
56
|
+
*/
|
|
57
|
+
export declare const getDesignSystemBuilderControllerUpdateKbMountsUrl: (id: string) => string;
|
|
58
|
+
export declare const designSystemBuilderControllerUpdateKbMounts: (id: string, updateDesignSystemBuilderKbMountsDto: UpdateDesignSystemBuilderKbMountsDto, options?: RequestInit) => Promise<DesignSystemBuilderKbMountsResponseDto>;
|