@proteos/sdk 0.18.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 +40 -0
- package/dist/chunk-7RGN4E22.cjs +1185 -0
- package/dist/chunk-7RGN4E22.cjs.map +1 -0
- package/dist/chunk-XJP5WCRZ.js +1125 -0
- package/dist/chunk-XJP5WCRZ.js.map +1 -0
- package/dist/index.cjs +2384 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5225 -0
- package/dist/index.d.ts +5225 -0
- package/dist/index.js +2146 -0
- package/dist/index.js.map +1 -0
- package/dist/meta/index.cjs +204 -0
- package/dist/meta/index.cjs.map +1 -0
- package/dist/meta/index.d.cts +2 -0
- package/dist/meta/index.d.ts +2 -0
- package/dist/meta/index.js +3 -0
- package/dist/meta/index.js.map +1 -0
- package/dist/types-BNsjfU8N.d.cts +3299 -0
- package/dist/types-BNsjfU8N.d.ts +3299 -0
- package/package.json +86 -0
- package/src/agent/agents.ts +53 -0
- package/src/agent/index.ts +134 -0
- package/src/agent/mcp-servers.ts +102 -0
- package/src/agent/prompts.ts +80 -0
- package/src/agent/session-types.ts +397 -0
- package/src/agent/sessions.ts +197 -0
- package/src/agent/skills.ts +89 -0
- package/src/agent/tools.ts +53 -0
- package/src/agent/types.ts +362 -0
- package/src/auth/index.ts +111 -0
- package/src/auth/me.ts +46 -0
- package/src/auth/organizations.ts +128 -0
- package/src/auth/platform-entities.ts +78 -0
- package/src/auth/roles.ts +213 -0
- package/src/auth/types.ts +294 -0
- package/src/auth/users.ts +226 -0
- package/src/client.ts +441 -0
- package/src/connector/index.ts +120 -0
- package/src/connector/types.ts +150 -0
- package/src/conversation/index.ts +297 -0
- package/src/conversation/types.ts +590 -0
- package/src/conversation/voice.ts +123 -0
- package/src/data/index.ts +53 -0
- package/src/data/queries.ts +66 -0
- package/src/data/records.ts +122 -0
- package/src/data/types.ts +89 -0
- package/src/errors.ts +148 -0
- package/src/events/index.ts +172 -0
- package/src/events/types.ts +77 -0
- package/src/functions/actions.ts +95 -0
- package/src/functions/index.ts +32 -0
- package/src/functions/types.ts +71 -0
- package/src/http/index.ts +2 -0
- package/src/http/query-params.ts +106 -0
- package/src/index.ts +598 -0
- package/src/iterator.ts +183 -0
- package/src/knowledge/graph.ts +35 -0
- package/src/knowledge/index.ts +104 -0
- package/src/knowledge/labels.ts +70 -0
- package/src/knowledge/links.ts +65 -0
- package/src/knowledge/nodes.ts +198 -0
- package/src/knowledge/record-links.ts +66 -0
- package/src/knowledge/types.ts +569 -0
- package/src/meta/apps.ts +107 -0
- package/src/meta/components.ts +124 -0
- package/src/meta/currency/index.ts +202 -0
- package/src/meta/entities.ts +193 -0
- package/src/meta/filters.ts +76 -0
- package/src/meta/index.ts +227 -0
- package/src/meta/layout/common-props.ts +93 -0
- package/src/meta/layout/control-registry.json +70 -0
- package/src/meta/layout/control-registry.ts +92 -0
- package/src/meta/layout/elements.ts +203 -0
- package/src/meta/layout/index.ts +41 -0
- package/src/meta/layout/page-layout.ts +35 -0
- package/src/meta/layout/size-value.ts +27 -0
- package/src/meta/list-views.ts +109 -0
- package/src/meta/lists.ts +104 -0
- package/src/meta/menu-configurations.ts +128 -0
- package/src/meta/modules.ts +159 -0
- package/src/meta/pages.ts +106 -0
- package/src/meta/types.ts +1115 -0
- package/src/meta/variables.ts +98 -0
- package/src/storage/files.ts +183 -0
- package/src/storage/index.ts +33 -0
- package/src/storage/types.ts +70 -0
- package/src/types/common.ts +143 -0
- package/src/types/index.ts +28 -0
- package/src/types/options.ts +95 -0
- package/src/workflow/executions.ts +99 -0
- package/src/workflow/index.ts +109 -0
- package/src/workflow/node-types.ts +50 -0
- package/src/workflow/types.ts +658 -0
- package/src/workflow/workflows.ts +152 -0
|
@@ -0,0 +1,3299 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Token provider function for dynamic authentication.
|
|
5
|
+
* Can return a token synchronously or asynchronously.
|
|
6
|
+
*/
|
|
7
|
+
type TokenProvider = () => string | Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Configuration options for the ProteosClient.
|
|
10
|
+
*/
|
|
11
|
+
interface ClientOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Base URL for API requests.
|
|
14
|
+
* Example: 'https://api.proteos.ai'
|
|
15
|
+
*/
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
/**
|
|
18
|
+
* Static bearer token for authentication.
|
|
19
|
+
* Use this for simple authentication scenarios.
|
|
20
|
+
*/
|
|
21
|
+
token?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Dynamic token provider function.
|
|
24
|
+
* Called before each request to get the current token.
|
|
25
|
+
* Takes precedence over static token if both are provided.
|
|
26
|
+
* Useful for token refresh scenarios.
|
|
27
|
+
*/
|
|
28
|
+
tokenProvider?: TokenProvider;
|
|
29
|
+
/**
|
|
30
|
+
* Request timeout in milliseconds.
|
|
31
|
+
* Default: 30000 (30 seconds)
|
|
32
|
+
*/
|
|
33
|
+
timeout?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Custom fetch implementation.
|
|
36
|
+
* Useful for testing or environments without native fetch.
|
|
37
|
+
* Default: global fetch
|
|
38
|
+
*/
|
|
39
|
+
fetch?: typeof fetch;
|
|
40
|
+
/**
|
|
41
|
+
* Custom headers to include in all requests.
|
|
42
|
+
* Authorization header is set automatically from token/tokenProvider.
|
|
43
|
+
*/
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Internal resolved options with defaults applied.
|
|
48
|
+
*/
|
|
49
|
+
interface ResolvedClientOptions {
|
|
50
|
+
baseUrl: string;
|
|
51
|
+
token?: string;
|
|
52
|
+
tokenProvider?: TokenProvider;
|
|
53
|
+
timeout: number;
|
|
54
|
+
fetch: typeof fetch;
|
|
55
|
+
headers: Record<string, string>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Default client options.
|
|
59
|
+
*/
|
|
60
|
+
declare const DEFAULT_OPTIONS: {
|
|
61
|
+
readonly timeout: 30000;
|
|
62
|
+
readonly headers: {};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Resolves client options by applying defaults.
|
|
66
|
+
*/
|
|
67
|
+
declare function resolveOptions(options: ClientOptions): ResolvedClientOptions;
|
|
68
|
+
/**
|
|
69
|
+
* Options for individual requests.
|
|
70
|
+
*/
|
|
71
|
+
interface RequestOptions {
|
|
72
|
+
/** Request timeout in milliseconds (overrides client default) */
|
|
73
|
+
timeout?: number;
|
|
74
|
+
/** Additional headers for this request */
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
/** AbortSignal for request cancellation */
|
|
77
|
+
signal?: AbortSignal;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** One parsed Server-Sent-Events frame yielded by {@link ProteosClient.streamEvents}. */
|
|
81
|
+
interface SseFrame {
|
|
82
|
+
/** The frame `id:` line — Proteos services use the per-stream monotonic seq. */
|
|
83
|
+
id?: string;
|
|
84
|
+
/** The frame `event:` line — the named event type. */
|
|
85
|
+
event?: string;
|
|
86
|
+
/** The frame `data:` line — the raw payload (typically JSON). */
|
|
87
|
+
data: string;
|
|
88
|
+
}
|
|
89
|
+
/** Options for opening an SSE stream. */
|
|
90
|
+
interface StreamOptions {
|
|
91
|
+
/** Abort to tear the stream down (the normal stop path). */
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Base HTTP client for all Proteos services.
|
|
96
|
+
* Handles authentication, request/response formatting, and error handling.
|
|
97
|
+
*/
|
|
98
|
+
declare class ProteosClient {
|
|
99
|
+
private readonly options;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a new ProteosClient instance.
|
|
102
|
+
*
|
|
103
|
+
* @param options - Client configuration options
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* // With static token
|
|
108
|
+
* const client = new ProteosClient({
|
|
109
|
+
* baseUrl: 'https://api.proteos.ai',
|
|
110
|
+
* token: 'your-api-token',
|
|
111
|
+
* });
|
|
112
|
+
*
|
|
113
|
+
* // With dynamic token provider
|
|
114
|
+
* const client = new ProteosClient({
|
|
115
|
+
* baseUrl: 'https://api.proteos.ai',
|
|
116
|
+
* tokenProvider: async () => {
|
|
117
|
+
* return await authService.getAccessToken();
|
|
118
|
+
* },
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
constructor(options: ClientOptions);
|
|
123
|
+
/**
|
|
124
|
+
* Returns the base URL configured for this client.
|
|
125
|
+
*/
|
|
126
|
+
get baseUrl(): string;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the current authentication token.
|
|
129
|
+
* Calls tokenProvider if available, otherwise returns static token.
|
|
130
|
+
*/
|
|
131
|
+
private getToken;
|
|
132
|
+
/**
|
|
133
|
+
* Builds the headers for a request.
|
|
134
|
+
*/
|
|
135
|
+
private buildHeaders;
|
|
136
|
+
/**
|
|
137
|
+
* Creates an AbortSignal with timeout.
|
|
138
|
+
*/
|
|
139
|
+
private createTimeoutSignal;
|
|
140
|
+
/**
|
|
141
|
+
* Performs an HTTP request and decodes the JSON response.
|
|
142
|
+
*
|
|
143
|
+
* @param method - HTTP method (GET, POST, PATCH, DELETE, etc.)
|
|
144
|
+
* @param path - Request path (appended to baseUrl)
|
|
145
|
+
* @param body - Request body (will be JSON-serialized)
|
|
146
|
+
* @param requestOptions - Optional request configuration
|
|
147
|
+
* @returns Decoded response body
|
|
148
|
+
* @throws {ProteosError} If the response status is >= 400
|
|
149
|
+
*/
|
|
150
|
+
request<T>(method: string, path: string, body?: unknown, requestOptions?: RequestOptions): Promise<T>;
|
|
151
|
+
/**
|
|
152
|
+
* Performs an HTTP request with query parameters.
|
|
153
|
+
*
|
|
154
|
+
* @param method - HTTP method
|
|
155
|
+
* @param path - Request path
|
|
156
|
+
* @param query - Query parameters object
|
|
157
|
+
* @param body - Request body
|
|
158
|
+
* @param requestOptions - Optional request configuration
|
|
159
|
+
* @returns Decoded response body
|
|
160
|
+
* @throws {ProteosError} If the response status is >= 400
|
|
161
|
+
*/
|
|
162
|
+
requestWithQuery<T, Q extends object = object>(method: string, path: string, query?: Q, body?: unknown, requestOptions?: RequestOptions): Promise<T>;
|
|
163
|
+
/**
|
|
164
|
+
* Performs a multipart form request (for file uploads).
|
|
165
|
+
*
|
|
166
|
+
* @param method - HTTP method
|
|
167
|
+
* @param path - Request path
|
|
168
|
+
* @param formData - FormData instance with files and fields
|
|
169
|
+
* @param requestOptions - Optional request configuration
|
|
170
|
+
* @returns Decoded response body
|
|
171
|
+
* @throws {ProteosError} If the response status is >= 400
|
|
172
|
+
*/
|
|
173
|
+
requestMultipart<T>(method: string, path: string, formData: FormData, requestOptions?: RequestOptions): Promise<T>;
|
|
174
|
+
/**
|
|
175
|
+
* Performs an HTTP request and returns the raw response.
|
|
176
|
+
* Used for downloading files or streaming responses.
|
|
177
|
+
*
|
|
178
|
+
* @param method - HTTP method
|
|
179
|
+
* @param path - Request path
|
|
180
|
+
* @param body - Request body
|
|
181
|
+
* @param requestOptions - Optional request configuration
|
|
182
|
+
* @returns Object with response body stream and full Response object
|
|
183
|
+
* @throws {ProteosError} If the response status is >= 400
|
|
184
|
+
*/
|
|
185
|
+
requestRaw(method: string, path: string, body?: unknown, requestOptions?: RequestOptions): Promise<{
|
|
186
|
+
body: ReadableStream<Uint8Array> | null;
|
|
187
|
+
response: Response;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Opens a Server-Sent-Events stream and yields each frame as it arrives.
|
|
191
|
+
*
|
|
192
|
+
* Built on `@microsoft/fetch-event-source` (not the browser-native
|
|
193
|
+
* `EventSource`, which can't set an `Authorization` header) so the bearer token
|
|
194
|
+
* is attached like any other request. The library tracks `Last-Event-ID` and
|
|
195
|
+
* reconnects with exponential backoff on transient errors; a 4xx is fatal and
|
|
196
|
+
* rejects. The stream runs until the caller's `AbortSignal` fires.
|
|
197
|
+
*
|
|
198
|
+
* The token is resolved once at stream start; teardown is the caller's signal.
|
|
199
|
+
*
|
|
200
|
+
* @param path - Request path (appended to baseUrl)
|
|
201
|
+
* @param requestOptions - Optional request configuration (signal)
|
|
202
|
+
* @returns Async generator of parsed {@link SseFrame}s
|
|
203
|
+
* @throws {ProteosError} On a non-retryable (4xx) response
|
|
204
|
+
*/
|
|
205
|
+
streamEvents(path: string, requestOptions?: StreamOptions): AsyncGenerator<SseFrame, void, unknown>;
|
|
206
|
+
/**
|
|
207
|
+
* Opens an authenticated WebSocket to a service path and resolves once it is
|
|
208
|
+
* open.
|
|
209
|
+
*
|
|
210
|
+
* The browser-native `WebSocket` can't set an `Authorization` header, so the
|
|
211
|
+
* access token is passed via the `bearer` subprotocol (`["bearer", token]`),
|
|
212
|
+
* which the gateway lifts back into the auth header — the same token resolved
|
|
213
|
+
* for every other request. The `http(s)` base URL is rewritten to `ws(s)`.
|
|
214
|
+
*
|
|
215
|
+
* @param path - Request path (appended to baseUrl), including any query string
|
|
216
|
+
* @returns The open WebSocket
|
|
217
|
+
*/
|
|
218
|
+
openWebSocket(path: string): Promise<WebSocket>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Pagination metadata from list responses.
|
|
223
|
+
* Field names match the backend wire format exactly.
|
|
224
|
+
*/
|
|
225
|
+
interface ResponseMeta {
|
|
226
|
+
/** Current page number (0-indexed across all services). */
|
|
227
|
+
page: number;
|
|
228
|
+
/** Number of items per page */
|
|
229
|
+
page_size: number;
|
|
230
|
+
/** Total number of items across all pages */
|
|
231
|
+
items_total: number;
|
|
232
|
+
/** Total number of pages */
|
|
233
|
+
pages_total: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Zod schema for ResponseMeta validation.
|
|
237
|
+
*/
|
|
238
|
+
declare const ResponseMetaSchema: z.ZodObject<{
|
|
239
|
+
page: z.ZodNumber;
|
|
240
|
+
page_size: z.ZodNumber;
|
|
241
|
+
items_total: z.ZodNumber;
|
|
242
|
+
pages_total: z.ZodNumber;
|
|
243
|
+
}, "strip", z.ZodTypeAny, {
|
|
244
|
+
page: number;
|
|
245
|
+
page_size: number;
|
|
246
|
+
items_total: number;
|
|
247
|
+
pages_total: number;
|
|
248
|
+
}, {
|
|
249
|
+
page: number;
|
|
250
|
+
page_size: number;
|
|
251
|
+
items_total: number;
|
|
252
|
+
pages_total: number;
|
|
253
|
+
}>;
|
|
254
|
+
/**
|
|
255
|
+
* Generic paginated response wrapper.
|
|
256
|
+
*/
|
|
257
|
+
interface ListResult<T> {
|
|
258
|
+
meta: ResponseMeta;
|
|
259
|
+
data: T[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Creates a Zod schema for ListResult with a given item schema.
|
|
263
|
+
*/
|
|
264
|
+
declare function createListResultSchema<T>(itemSchema: z.ZodType<T>): z.ZodObject<{
|
|
265
|
+
meta: z.ZodObject<{
|
|
266
|
+
page: z.ZodNumber;
|
|
267
|
+
page_size: z.ZodNumber;
|
|
268
|
+
items_total: z.ZodNumber;
|
|
269
|
+
pages_total: z.ZodNumber;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
271
|
+
page: number;
|
|
272
|
+
page_size: number;
|
|
273
|
+
items_total: number;
|
|
274
|
+
pages_total: number;
|
|
275
|
+
}, {
|
|
276
|
+
page: number;
|
|
277
|
+
page_size: number;
|
|
278
|
+
items_total: number;
|
|
279
|
+
pages_total: number;
|
|
280
|
+
}>;
|
|
281
|
+
data: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
meta: {
|
|
284
|
+
page: number;
|
|
285
|
+
page_size: number;
|
|
286
|
+
items_total: number;
|
|
287
|
+
pages_total: number;
|
|
288
|
+
};
|
|
289
|
+
data: T[];
|
|
290
|
+
}, {
|
|
291
|
+
meta: {
|
|
292
|
+
page: number;
|
|
293
|
+
page_size: number;
|
|
294
|
+
items_total: number;
|
|
295
|
+
pages_total: number;
|
|
296
|
+
};
|
|
297
|
+
data: T[];
|
|
298
|
+
}>;
|
|
299
|
+
/**
|
|
300
|
+
* Base list options with pagination and sorting.
|
|
301
|
+
*/
|
|
302
|
+
interface ListOptions {
|
|
303
|
+
/** Page number (0-indexed). First page is 0. */
|
|
304
|
+
page?: number;
|
|
305
|
+
/** Number of items per page (default: 100) */
|
|
306
|
+
page_size?: number;
|
|
307
|
+
/** Field to sort by */
|
|
308
|
+
sort_by?: string;
|
|
309
|
+
/** Sort direction */
|
|
310
|
+
sort_direction?: 'asc' | 'desc';
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Common timestamp fields for entities.
|
|
314
|
+
*/
|
|
315
|
+
interface Timestamps {
|
|
316
|
+
/** ISO 8601 timestamp when the entity was created */
|
|
317
|
+
created_at: string;
|
|
318
|
+
/** ISO 8601 timestamp when the entity was last updated */
|
|
319
|
+
updated_at: string;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The kind of user a {@link UserRef} points at. `person` is a human; `agent`
|
|
323
|
+
* is an AI actor; `api` is a non-interactive client (reserved). The `"platform"`
|
|
324
|
+
* sentinel id (system/bootstrap writes) carries `person`.
|
|
325
|
+
*/
|
|
326
|
+
type UserType = 'person' | 'agent' | 'api';
|
|
327
|
+
/**
|
|
328
|
+
* A reference to a platform user — the value stored by every `user` attribute
|
|
329
|
+
* (including `created_by`/`updated_by`). `id` is the platform user id (or the
|
|
330
|
+
* `"platform"` sentinel for system writes); `type` is the user kind. The people
|
|
331
|
+
* picker resolves and filters on `id`.
|
|
332
|
+
*/
|
|
333
|
+
interface UserRef {
|
|
334
|
+
type: UserType;
|
|
335
|
+
id: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Zod schema for a UserRef value.
|
|
339
|
+
*/
|
|
340
|
+
declare const UserRefSchema: z.ZodObject<{
|
|
341
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
342
|
+
id: z.ZodString;
|
|
343
|
+
}, "strip", z.ZodTypeAny, {
|
|
344
|
+
type: "person" | "agent" | "api";
|
|
345
|
+
id: string;
|
|
346
|
+
}, {
|
|
347
|
+
type: "person" | "agent" | "api";
|
|
348
|
+
id: string;
|
|
349
|
+
}>;
|
|
350
|
+
/**
|
|
351
|
+
* Sentinel id stored in created_by/updated_by for writes that didn't originate
|
|
352
|
+
* from a real user (bootstrap / system). Mirrors the backend's
|
|
353
|
+
* `common.PlatformUserId`.
|
|
354
|
+
*/
|
|
355
|
+
declare const PLATFORM_USER_ID = "platform";
|
|
356
|
+
/**
|
|
357
|
+
* A reference to a stored file — the value stored by every `file` attribute.
|
|
358
|
+
* `id` is the storage-service file id; `name` is the denormalised filename the
|
|
359
|
+
* record carries so it has a human label without a storage round-trip. Size and
|
|
360
|
+
* content type are resolved from the storage-service by `id` on read. Mirrors
|
|
361
|
+
* the backend's `common.FileRef`.
|
|
362
|
+
*/
|
|
363
|
+
interface FileRef {
|
|
364
|
+
id: string;
|
|
365
|
+
name: string;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Zod schema for a FileRef value.
|
|
369
|
+
*/
|
|
370
|
+
declare const FileRefSchema: z.ZodObject<{
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
name: z.ZodString;
|
|
373
|
+
}, "strip", z.ZodTypeAny, {
|
|
374
|
+
id: string;
|
|
375
|
+
name: string;
|
|
376
|
+
}, {
|
|
377
|
+
id: string;
|
|
378
|
+
name: string;
|
|
379
|
+
}>;
|
|
380
|
+
/**
|
|
381
|
+
* Common audit fields for entities. `created_by`/`updated_by` hold a
|
|
382
|
+
* {@link UserRef} for the user who made the change (the `"platform"` sentinel
|
|
383
|
+
* id for system writes).
|
|
384
|
+
*/
|
|
385
|
+
interface AuditFields extends Timestamps {
|
|
386
|
+
/** Who created the entity (the "platform" sentinel id for system writes). */
|
|
387
|
+
created_by: UserRef;
|
|
388
|
+
/** Who last updated the entity (the "platform" sentinel id for system writes). */
|
|
389
|
+
updated_by: UserRef;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Zod schema for audit fields validation.
|
|
393
|
+
*/
|
|
394
|
+
declare const AuditFieldsSchema: z.ZodObject<{
|
|
395
|
+
created_at: z.ZodString;
|
|
396
|
+
updated_at: z.ZodString;
|
|
397
|
+
created_by: z.ZodObject<{
|
|
398
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
399
|
+
id: z.ZodString;
|
|
400
|
+
}, "strip", z.ZodTypeAny, {
|
|
401
|
+
type: "person" | "agent" | "api";
|
|
402
|
+
id: string;
|
|
403
|
+
}, {
|
|
404
|
+
type: "person" | "agent" | "api";
|
|
405
|
+
id: string;
|
|
406
|
+
}>;
|
|
407
|
+
updated_by: z.ZodObject<{
|
|
408
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
409
|
+
id: z.ZodString;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
type: "person" | "agent" | "api";
|
|
412
|
+
id: string;
|
|
413
|
+
}, {
|
|
414
|
+
type: "person" | "agent" | "api";
|
|
415
|
+
id: string;
|
|
416
|
+
}>;
|
|
417
|
+
}, "strip", z.ZodTypeAny, {
|
|
418
|
+
created_at: string;
|
|
419
|
+
updated_at: string;
|
|
420
|
+
created_by: {
|
|
421
|
+
type: "person" | "agent" | "api";
|
|
422
|
+
id: string;
|
|
423
|
+
};
|
|
424
|
+
updated_by: {
|
|
425
|
+
type: "person" | "agent" | "api";
|
|
426
|
+
id: string;
|
|
427
|
+
};
|
|
428
|
+
}, {
|
|
429
|
+
created_at: string;
|
|
430
|
+
updated_at: string;
|
|
431
|
+
created_by: {
|
|
432
|
+
type: "person" | "agent" | "api";
|
|
433
|
+
id: string;
|
|
434
|
+
};
|
|
435
|
+
updated_by: {
|
|
436
|
+
type: "person" | "agent" | "api";
|
|
437
|
+
id: string;
|
|
438
|
+
};
|
|
439
|
+
}>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Sentinel symbol indicating iteration is complete.
|
|
443
|
+
*/
|
|
444
|
+
declare const DONE: unique symbol;
|
|
445
|
+
type Done = typeof DONE;
|
|
446
|
+
/**
|
|
447
|
+
* Function type for fetching a page of results.
|
|
448
|
+
* @typeParam T - The type of items in the list
|
|
449
|
+
* @typeParam O - The type of options for the list request
|
|
450
|
+
*/
|
|
451
|
+
type ListFn<T, O extends ListOptions> = (options: O) => Promise<ListResult<T>>;
|
|
452
|
+
/**
|
|
453
|
+
* Default page size for pagination.
|
|
454
|
+
*/
|
|
455
|
+
declare const DEFAULT_PAGE_SIZE = 100;
|
|
456
|
+
/**
|
|
457
|
+
* Async iterator for paginated resources.
|
|
458
|
+
* Provides Google Cloud-style iteration with automatic page fetching.
|
|
459
|
+
*
|
|
460
|
+
* @typeParam T - The type of items being iterated
|
|
461
|
+
* @typeParam O - The type of options for list requests
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```ts
|
|
465
|
+
* // Using for-await-of
|
|
466
|
+
* const iterator = new PageIterator(fetchEntities, { page_size: 50 });
|
|
467
|
+
* for await (const entity of iterator) {
|
|
468
|
+
* console.log(entity);
|
|
469
|
+
* }
|
|
470
|
+
*
|
|
471
|
+
* // Using next() directly
|
|
472
|
+
* const item = await iterator.next();
|
|
473
|
+
* if (item !== DONE) {
|
|
474
|
+
* console.log(item);
|
|
475
|
+
* }
|
|
476
|
+
*
|
|
477
|
+
* // Collecting all items
|
|
478
|
+
* const allItems = await iterator.all();
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
declare class PageIterator<T, O extends ListOptions> implements AsyncIterable<T> {
|
|
482
|
+
private readonly listFn;
|
|
483
|
+
private readonly options;
|
|
484
|
+
private page;
|
|
485
|
+
private buffer;
|
|
486
|
+
private bufferIndex;
|
|
487
|
+
private pagesTotal;
|
|
488
|
+
/**
|
|
489
|
+
* Creates a new PageIterator.
|
|
490
|
+
*
|
|
491
|
+
* @param listFn - Function to fetch a page of results
|
|
492
|
+
* @param options - Options for list requests (including pagination)
|
|
493
|
+
*/
|
|
494
|
+
constructor(listFn: ListFn<T, O>, options: O);
|
|
495
|
+
/**
|
|
496
|
+
* Returns the next item in the iterator.
|
|
497
|
+
* Returns DONE symbol when iteration is complete.
|
|
498
|
+
*
|
|
499
|
+
* @returns The next item or DONE
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```ts
|
|
503
|
+
* const item = await iterator.next();
|
|
504
|
+
* if (item !== DONE) {
|
|
505
|
+
* console.log(item);
|
|
506
|
+
* }
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
next(): Promise<T | Done>;
|
|
510
|
+
/**
|
|
511
|
+
* Collects all remaining items into an array.
|
|
512
|
+
* Useful when you need all items at once.
|
|
513
|
+
*
|
|
514
|
+
* @returns Array of all remaining items
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* ```ts
|
|
518
|
+
* const allEntities = await iterator.all();
|
|
519
|
+
* console.log(`Found ${allEntities.length} entities`);
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
all(): Promise<T[]>;
|
|
523
|
+
/**
|
|
524
|
+
* Implements AsyncIterable for use with for-await-of loops.
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* ```ts
|
|
528
|
+
* for await (const entity of iterator) {
|
|
529
|
+
* console.log(entity.name);
|
|
530
|
+
* }
|
|
531
|
+
* ```
|
|
532
|
+
*/
|
|
533
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Creates a PageIterator with the given list function and options.
|
|
537
|
+
* Convenience function for creating iterators.
|
|
538
|
+
*
|
|
539
|
+
* @param listFn - Function to fetch a page of results
|
|
540
|
+
* @param options - Options for list requests
|
|
541
|
+
* @returns A new PageIterator instance
|
|
542
|
+
*/
|
|
543
|
+
declare function createIterator<T, O extends ListOptions>(listFn: ListFn<T, O>, options: O): PageIterator<T, O>;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Service for managing apps.
|
|
547
|
+
* Apps group menu configurations and other org-scoped metadata under a
|
|
548
|
+
* stable slug. Slugs are unique per org.
|
|
549
|
+
*/
|
|
550
|
+
interface AppService {
|
|
551
|
+
/**
|
|
552
|
+
* Lists apps with optional filtering.
|
|
553
|
+
*
|
|
554
|
+
* @param options - Filter and pagination options
|
|
555
|
+
* @returns Async iterator over apps
|
|
556
|
+
*/
|
|
557
|
+
list(options?: ListAppsOptions): PageIterator<App, ListAppsOptions>;
|
|
558
|
+
/**
|
|
559
|
+
* Fetches a single page of apps.
|
|
560
|
+
*/
|
|
561
|
+
listPage(options?: ListAppsOptions): Promise<ListResult<App>>;
|
|
562
|
+
/**
|
|
563
|
+
* Gets a single app by slug.
|
|
564
|
+
*
|
|
565
|
+
* @param slug - App slug (unique within the caller's org)
|
|
566
|
+
* @returns The app
|
|
567
|
+
* @throws {ProteosError} If app not found (404)
|
|
568
|
+
*/
|
|
569
|
+
get(slug: string): Promise<App>;
|
|
570
|
+
/**
|
|
571
|
+
* Creates a new app.
|
|
572
|
+
*
|
|
573
|
+
* @param request - App creation request
|
|
574
|
+
* @returns The created app
|
|
575
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
576
|
+
*/
|
|
577
|
+
create(request: CreateAppRequest): Promise<App>;
|
|
578
|
+
/**
|
|
579
|
+
* Creates or updates an app idempotently by slug. The URL slug wins on
|
|
580
|
+
* mismatch with the body's slug field (`PUT /meta/v1/apps/:slug`).
|
|
581
|
+
*
|
|
582
|
+
* @param slug - App slug
|
|
583
|
+
* @param request - Full app body
|
|
584
|
+
* @returns The created or updated app
|
|
585
|
+
*/
|
|
586
|
+
upsert(slug: string, request: CreateAppRequest): Promise<App>;
|
|
587
|
+
/**
|
|
588
|
+
* Updates an existing app.
|
|
589
|
+
*
|
|
590
|
+
* @param slug - App slug
|
|
591
|
+
* @param request - Fields to update
|
|
592
|
+
* @returns The updated app
|
|
593
|
+
* @throws {ProteosError} If app not found (404) or validation fails (400)
|
|
594
|
+
*/
|
|
595
|
+
update(slug: string, request: UpdateAppRequest): Promise<App>;
|
|
596
|
+
/**
|
|
597
|
+
* Deletes an app.
|
|
598
|
+
*
|
|
599
|
+
* @param slug - App slug
|
|
600
|
+
* @throws {ProteosError} If app not found (404)
|
|
601
|
+
*/
|
|
602
|
+
delete(slug: string): Promise<void>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Service for managing UI component definitions.
|
|
607
|
+
* Components define reusable UI elements in the system.
|
|
608
|
+
*/
|
|
609
|
+
interface ComponentService {
|
|
610
|
+
/**
|
|
611
|
+
* Lists components with optional filtering.
|
|
612
|
+
*
|
|
613
|
+
* @param options - Filter and pagination options
|
|
614
|
+
* @returns Async iterator over components
|
|
615
|
+
*/
|
|
616
|
+
list(options?: ListComponentsOptions): PageIterator<Component, ListComponentsOptions>;
|
|
617
|
+
/**
|
|
618
|
+
* Fetches a single page of components.
|
|
619
|
+
*/
|
|
620
|
+
listPage(options?: ListComponentsOptions): Promise<ListResult<Component>>;
|
|
621
|
+
/**
|
|
622
|
+
* Gets a single component by ID.
|
|
623
|
+
*
|
|
624
|
+
* @param id - Component ID
|
|
625
|
+
* @returns The component
|
|
626
|
+
* @throws {ProteosError} If component not found (404)
|
|
627
|
+
*/
|
|
628
|
+
get(id: string): Promise<Component>;
|
|
629
|
+
/**
|
|
630
|
+
* Creates a new component.
|
|
631
|
+
*
|
|
632
|
+
* @param request - Component creation request
|
|
633
|
+
* @returns The created component
|
|
634
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
635
|
+
*/
|
|
636
|
+
create(request: CreateComponentRequest): Promise<Component>;
|
|
637
|
+
/**
|
|
638
|
+
* Creates or updates a component (upsert operation).
|
|
639
|
+
* If a component with the same slug exists, it is updated; otherwise, a new one is created.
|
|
640
|
+
*
|
|
641
|
+
* @param request - Component creation request
|
|
642
|
+
* @returns The created or updated component
|
|
643
|
+
*/
|
|
644
|
+
upsert(request: CreateComponentRequest): Promise<Component>;
|
|
645
|
+
/**
|
|
646
|
+
* Updates an existing component.
|
|
647
|
+
*
|
|
648
|
+
* @param id - Component ID
|
|
649
|
+
* @param request - Fields to update
|
|
650
|
+
* @returns The updated component
|
|
651
|
+
* @throws {ProteosError} If component not found (404) or validation fails (400)
|
|
652
|
+
*/
|
|
653
|
+
update(id: string, request: UpdateComponentRequest): Promise<Component>;
|
|
654
|
+
/**
|
|
655
|
+
* Deletes a component.
|
|
656
|
+
*
|
|
657
|
+
* @param id - Component ID
|
|
658
|
+
* @throws {ProteosError} If component not found (404)
|
|
659
|
+
*/
|
|
660
|
+
delete(id: string): Promise<void>;
|
|
661
|
+
/**
|
|
662
|
+
* Returns the URL the component runtime imports to load a component's
|
|
663
|
+
* compiled ESM bundle (`GET /meta/v1/components/:slug/bundle`). The path is
|
|
664
|
+
* gateway-prefixed and relative; prepend the API origin to fetch it.
|
|
665
|
+
*
|
|
666
|
+
* @param slug - Component slug
|
|
667
|
+
* @returns The relative bundle URL
|
|
668
|
+
*/
|
|
669
|
+
bundleUrl(slug: string): string;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Service for managing entity definitions.
|
|
674
|
+
* Entities define the structure of business objects in the system.
|
|
675
|
+
*/
|
|
676
|
+
interface EntityService {
|
|
677
|
+
/**
|
|
678
|
+
* Lists entities with optional filtering.
|
|
679
|
+
* Returns an async iterator that automatically handles pagination.
|
|
680
|
+
*
|
|
681
|
+
* @param options - Filter and pagination options
|
|
682
|
+
* @returns Async iterator over entities
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
* ```ts
|
|
686
|
+
* // Iterate over all entities
|
|
687
|
+
* for await (const entity of service.list()) {
|
|
688
|
+
* console.log(entity.slug);
|
|
689
|
+
* }
|
|
690
|
+
*
|
|
691
|
+
* // With filtering
|
|
692
|
+
* for await (const entity of service.list({ module_slug: 'my-module' })) {
|
|
693
|
+
* console.log(entity.name);
|
|
694
|
+
* }
|
|
695
|
+
* ```
|
|
696
|
+
*/
|
|
697
|
+
list(options?: ListEntitiesOptions): PageIterator<Entity, ListEntitiesOptions>;
|
|
698
|
+
/**
|
|
699
|
+
* Fetches a single page of entities.
|
|
700
|
+
*
|
|
701
|
+
* @param options - Filter and pagination options (including `page`)
|
|
702
|
+
* @returns A single page of entities with pagination metadata
|
|
703
|
+
*/
|
|
704
|
+
listPage(options?: ListEntitiesOptions): Promise<ListResult<Entity>>;
|
|
705
|
+
/**
|
|
706
|
+
* Lists entities including their JSON Schema representation.
|
|
707
|
+
*
|
|
708
|
+
* @param options - Filter and pagination options
|
|
709
|
+
* @returns Async iterator over entities with schema
|
|
710
|
+
*/
|
|
711
|
+
listWithSchema(options?: ListEntitiesOptions): PageIterator<EntityWithSchema, ListEntitiesOptions>;
|
|
712
|
+
/**
|
|
713
|
+
* Fetches a single page of entities with their JSON Schema representation.
|
|
714
|
+
* Useful for integrating with paginated UI frameworks (e.g. React Query's
|
|
715
|
+
* useInfiniteQuery) that need direct access to a page's meta and data.
|
|
716
|
+
*
|
|
717
|
+
* @param options - Filter and pagination options
|
|
718
|
+
* @returns A single page of entities with schema
|
|
719
|
+
*/
|
|
720
|
+
listPageWithSchema(options?: ListEntitiesOptions): Promise<ListResult<EntityWithSchema>>;
|
|
721
|
+
/**
|
|
722
|
+
* Gets a single entity by slug.
|
|
723
|
+
*
|
|
724
|
+
* @param slug - Entity slug
|
|
725
|
+
* @returns The entity
|
|
726
|
+
* @throws {ProteosError} If entity not found (404)
|
|
727
|
+
*/
|
|
728
|
+
get(slug: string): Promise<Entity>;
|
|
729
|
+
/**
|
|
730
|
+
* Gets an entity with its JSON Schema representation.
|
|
731
|
+
*
|
|
732
|
+
* @param slug - Entity slug
|
|
733
|
+
* @returns The entity with schema
|
|
734
|
+
* @throws {ProteosError} If entity not found (404)
|
|
735
|
+
*/
|
|
736
|
+
getWithSchema(slug: string): Promise<EntityWithSchema>;
|
|
737
|
+
/**
|
|
738
|
+
* Creates a new entity.
|
|
739
|
+
*
|
|
740
|
+
* @param request - Entity creation request
|
|
741
|
+
* @returns The created entity
|
|
742
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* ```ts
|
|
746
|
+
* const entity = await service.create({
|
|
747
|
+
* slug: 'customers',
|
|
748
|
+
* name: 'Customer',
|
|
749
|
+
* description: 'Customer records',
|
|
750
|
+
* is_remote: false,
|
|
751
|
+
* module_slug: 'crm',
|
|
752
|
+
* attributes: [
|
|
753
|
+
* { name: 'id', type: 'string', meta: { format: 'uuid' }, label: 'ID', is_required: true, is_unique: true },
|
|
754
|
+
* { name: 'name', type: 'string', label: 'Name', is_required: true, is_unique: false },
|
|
755
|
+
* ],
|
|
756
|
+
* });
|
|
757
|
+
* ```
|
|
758
|
+
*/
|
|
759
|
+
create(request: CreateEntityRequest): Promise<Entity>;
|
|
760
|
+
/**
|
|
761
|
+
* Creates or updates an entity idempotently by slug. The URL slug wins on
|
|
762
|
+
* mismatch with the body's slug field. Backs the CLI/admin idempotent deploy
|
|
763
|
+
* path (`PUT /meta/v1/entities/:slug`).
|
|
764
|
+
*
|
|
765
|
+
* @param slug - Entity slug
|
|
766
|
+
* @param request - Full entity body
|
|
767
|
+
* @returns The created or updated entity
|
|
768
|
+
*/
|
|
769
|
+
upsert(slug: string, request: CreateEntityRequest): Promise<Entity>;
|
|
770
|
+
/**
|
|
771
|
+
* Updates an existing entity.
|
|
772
|
+
*
|
|
773
|
+
* @param slug - Entity slug
|
|
774
|
+
* @param request - Fields to update
|
|
775
|
+
* @returns The updated entity
|
|
776
|
+
* @throws {ProteosError} If entity not found (404) or validation fails (400)
|
|
777
|
+
*/
|
|
778
|
+
update(slug: string, request: UpdateEntityRequest): Promise<Entity>;
|
|
779
|
+
/**
|
|
780
|
+
* Deletes an entity.
|
|
781
|
+
*
|
|
782
|
+
* @param slug - Entity slug
|
|
783
|
+
* @throws {ProteosError} If entity not found (404)
|
|
784
|
+
*/
|
|
785
|
+
delete(slug: string): Promise<void>;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Service for managing list view configurations.
|
|
790
|
+
* List views define filtered and sorted views of lists.
|
|
791
|
+
*/
|
|
792
|
+
interface ListViewService {
|
|
793
|
+
/**
|
|
794
|
+
* Lists list views with optional filtering.
|
|
795
|
+
*
|
|
796
|
+
* @param options - Filter and pagination options
|
|
797
|
+
* @returns Async iterator over list views
|
|
798
|
+
*/
|
|
799
|
+
list(options?: ListListViewsOptions): PageIterator<ListView, ListListViewsOptions>;
|
|
800
|
+
/**
|
|
801
|
+
* Fetches a single page of list views.
|
|
802
|
+
*/
|
|
803
|
+
listPage(options?: ListListViewsOptions): Promise<ListResult<ListView>>;
|
|
804
|
+
/**
|
|
805
|
+
* Gets a single list view by slug.
|
|
806
|
+
*
|
|
807
|
+
* @param slug - List view slug
|
|
808
|
+
* @returns The list view
|
|
809
|
+
* @throws {ProteosError} If list view not found (404)
|
|
810
|
+
*/
|
|
811
|
+
get(slug: string): Promise<ListView>;
|
|
812
|
+
/**
|
|
813
|
+
* Creates a new list view.
|
|
814
|
+
*
|
|
815
|
+
* @param request - List view creation request
|
|
816
|
+
* @returns The created list view
|
|
817
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
818
|
+
*/
|
|
819
|
+
create(request: CreateListViewRequest): Promise<ListView>;
|
|
820
|
+
/**
|
|
821
|
+
* Creates or updates a list view (upsert operation).
|
|
822
|
+
*
|
|
823
|
+
* @param request - List view creation request
|
|
824
|
+
* @returns The created or updated list view
|
|
825
|
+
*/
|
|
826
|
+
upsert(request: CreateListViewRequest): Promise<ListView>;
|
|
827
|
+
/**
|
|
828
|
+
* Updates an existing list view.
|
|
829
|
+
*
|
|
830
|
+
* @param slug - List view slug
|
|
831
|
+
* @param request - Fields to update
|
|
832
|
+
* @returns The updated list view
|
|
833
|
+
* @throws {ProteosError} If list view not found (404) or validation fails (400)
|
|
834
|
+
*/
|
|
835
|
+
update(slug: string, request: UpdateListViewRequest): Promise<ListView>;
|
|
836
|
+
/**
|
|
837
|
+
* Deletes a list view.
|
|
838
|
+
*
|
|
839
|
+
* @param slug - List view slug
|
|
840
|
+
* @throws {ProteosError} If list view not found (404)
|
|
841
|
+
*/
|
|
842
|
+
delete(slug: string): Promise<void>;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Service for managing list configurations.
|
|
847
|
+
* Lists define how data is displayed in tabular format.
|
|
848
|
+
*/
|
|
849
|
+
interface ListService {
|
|
850
|
+
/**
|
|
851
|
+
* Lists list configurations with optional filtering.
|
|
852
|
+
*
|
|
853
|
+
* @param options - Filter and pagination options
|
|
854
|
+
* @returns Async iterator over lists
|
|
855
|
+
*/
|
|
856
|
+
list(options?: ListListsOptions): PageIterator<List, ListListsOptions>;
|
|
857
|
+
/**
|
|
858
|
+
* Fetches a single page of lists.
|
|
859
|
+
*/
|
|
860
|
+
listPage(options?: ListListsOptions): Promise<ListResult<List>>;
|
|
861
|
+
/**
|
|
862
|
+
* Gets a single list by slug.
|
|
863
|
+
*
|
|
864
|
+
* @param slug - List slug
|
|
865
|
+
* @returns The list
|
|
866
|
+
* @throws {ProteosError} If list not found (404)
|
|
867
|
+
*/
|
|
868
|
+
get(slug: string): Promise<List>;
|
|
869
|
+
/**
|
|
870
|
+
* Creates a new list.
|
|
871
|
+
*
|
|
872
|
+
* @param request - List creation request
|
|
873
|
+
* @returns The created list
|
|
874
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
875
|
+
*/
|
|
876
|
+
create(request: CreateListRequest): Promise<List>;
|
|
877
|
+
/**
|
|
878
|
+
* Creates or updates a list (upsert operation).
|
|
879
|
+
*
|
|
880
|
+
* @param request - List creation request
|
|
881
|
+
* @returns The created or updated list
|
|
882
|
+
*/
|
|
883
|
+
upsert(request: CreateListRequest): Promise<List>;
|
|
884
|
+
/**
|
|
885
|
+
* Updates an existing list.
|
|
886
|
+
*
|
|
887
|
+
* @param slug - List slug
|
|
888
|
+
* @param request - Fields to update
|
|
889
|
+
* @returns The updated list
|
|
890
|
+
* @throws {ProteosError} If list not found (404) or validation fails (400)
|
|
891
|
+
*/
|
|
892
|
+
update(slug: string, request: UpdateListRequest): Promise<List>;
|
|
893
|
+
/**
|
|
894
|
+
* Deletes a list.
|
|
895
|
+
*
|
|
896
|
+
* @param slug - List slug
|
|
897
|
+
* @throws {ProteosError} If list not found (404)
|
|
898
|
+
*/
|
|
899
|
+
delete(slug: string): Promise<void>;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Service for managing menu configurations.
|
|
904
|
+
* Menu configurations define the navigation structure of applications.
|
|
905
|
+
*/
|
|
906
|
+
interface MenuConfigurationService {
|
|
907
|
+
/**
|
|
908
|
+
* Lists menu configurations with optional filtering.
|
|
909
|
+
*
|
|
910
|
+
* @param options - Filter and pagination options
|
|
911
|
+
* @returns Async iterator over menu configurations
|
|
912
|
+
*/
|
|
913
|
+
list(options?: ListMenuConfigurationsOptions): PageIterator<MenuConfiguration, ListMenuConfigurationsOptions>;
|
|
914
|
+
/**
|
|
915
|
+
* Fetches a single page of menu configurations.
|
|
916
|
+
*/
|
|
917
|
+
listPage(options?: ListMenuConfigurationsOptions): Promise<ListResult<MenuConfiguration>>;
|
|
918
|
+
/**
|
|
919
|
+
* Gets a single menu configuration by slug.
|
|
920
|
+
*
|
|
921
|
+
* @param slug - Menu configuration slug (author-controlled, kebab-case)
|
|
922
|
+
* @returns The menu configuration
|
|
923
|
+
* @throws {ProteosError} If menu configuration not found (404)
|
|
924
|
+
*/
|
|
925
|
+
get(slug: string): Promise<MenuConfiguration>;
|
|
926
|
+
/**
|
|
927
|
+
* Creates a new menu configuration.
|
|
928
|
+
*
|
|
929
|
+
* @param request - Menu configuration creation request
|
|
930
|
+
* @returns The created menu configuration
|
|
931
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
932
|
+
*/
|
|
933
|
+
create(request: CreateMenuConfigurationRequest): Promise<MenuConfiguration>;
|
|
934
|
+
/**
|
|
935
|
+
* Creates or updates a menu configuration idempotently by slug.
|
|
936
|
+
*
|
|
937
|
+
* @param slug - Menu configuration slug
|
|
938
|
+
* @param request - Body
|
|
939
|
+
* @returns The created or updated menu configuration
|
|
940
|
+
*/
|
|
941
|
+
upsert(slug: string, request: CreateMenuConfigurationRequest): Promise<MenuConfiguration>;
|
|
942
|
+
/**
|
|
943
|
+
* Updates an existing menu configuration.
|
|
944
|
+
*
|
|
945
|
+
* @param slug - Menu configuration slug
|
|
946
|
+
* @param request - Fields to update
|
|
947
|
+
* @returns The updated menu configuration
|
|
948
|
+
* @throws {ProteosError} If menu configuration not found (404) or validation fails (400)
|
|
949
|
+
*/
|
|
950
|
+
update(slug: string, request: UpdateMenuConfigurationRequest): Promise<MenuConfiguration>;
|
|
951
|
+
/**
|
|
952
|
+
* Deletes a menu configuration.
|
|
953
|
+
*
|
|
954
|
+
* @param slug - Menu configuration slug
|
|
955
|
+
* @throws {ProteosError} If menu configuration not found (404)
|
|
956
|
+
*/
|
|
957
|
+
delete(slug: string): Promise<void>;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Service for managing WebAssembly modules.
|
|
962
|
+
* Modules contain business logic that runs in the Proteos runtime.
|
|
963
|
+
*/
|
|
964
|
+
interface ModuleService {
|
|
965
|
+
/**
|
|
966
|
+
* Lists modules with optional filtering.
|
|
967
|
+
*
|
|
968
|
+
* @param options - Filter and pagination options
|
|
969
|
+
* @returns Async iterator over modules
|
|
970
|
+
*/
|
|
971
|
+
list(options?: ListModulesOptions): PageIterator<Module, ListModulesOptions>;
|
|
972
|
+
/**
|
|
973
|
+
* Fetches a single page of modules.
|
|
974
|
+
*/
|
|
975
|
+
listPage(options?: ListModulesOptions): Promise<ListResult<Module>>;
|
|
976
|
+
/**
|
|
977
|
+
* Gets a single module by slug.
|
|
978
|
+
*
|
|
979
|
+
* @param slug - Module slug
|
|
980
|
+
* @returns The module
|
|
981
|
+
* @throws {ProteosError} If module not found (404)
|
|
982
|
+
*/
|
|
983
|
+
get(slug: string): Promise<Module>;
|
|
984
|
+
/**
|
|
985
|
+
* Deploys a new module.
|
|
986
|
+
* Uploads a WASM file with metadata.
|
|
987
|
+
*
|
|
988
|
+
* @param request - Module metadata
|
|
989
|
+
* @param file - WASM file (File, Blob, or ArrayBuffer)
|
|
990
|
+
* @returns The deployed module
|
|
991
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* ```ts
|
|
995
|
+
* const wasmFile = new File([wasmBytes], 'module.wasm');
|
|
996
|
+
* const module = await service.deploy(
|
|
997
|
+
* {
|
|
998
|
+
* slug: 'my-module',
|
|
999
|
+
* version: '1.0.0',
|
|
1000
|
+
* name: 'My Module',
|
|
1001
|
+
* description: 'A custom module',
|
|
1002
|
+
* },
|
|
1003
|
+
* wasmFile
|
|
1004
|
+
* );
|
|
1005
|
+
* ```
|
|
1006
|
+
*/
|
|
1007
|
+
deploy(request: DeployModuleRequest, file: File | Blob | ArrayBuffer): Promise<Module>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Deletes a module.
|
|
1010
|
+
*
|
|
1011
|
+
* @param slug - Module slug
|
|
1012
|
+
* @throws {ProteosError} If module not found (404)
|
|
1013
|
+
*/
|
|
1014
|
+
delete(slug: string): Promise<void>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Activates a deactivated module.
|
|
1017
|
+
*
|
|
1018
|
+
* @param slug - Module slug
|
|
1019
|
+
* @throws {ProteosError} If module not found (404)
|
|
1020
|
+
*/
|
|
1021
|
+
activate(slug: string): Promise<void>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Deactivates an active module.
|
|
1024
|
+
*
|
|
1025
|
+
* @param slug - Module slug
|
|
1026
|
+
* @throws {ProteosError} If module not found (404)
|
|
1027
|
+
*/
|
|
1028
|
+
deactivate(slug: string): Promise<void>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Downloads the module WASM file.
|
|
1031
|
+
*
|
|
1032
|
+
* @param slug - Module slug
|
|
1033
|
+
* @returns Object containing the readable stream and module metadata
|
|
1034
|
+
* @throws {ProteosError} If module not found (404)
|
|
1035
|
+
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* ```ts
|
|
1038
|
+
* const { body, module } = await service.download('my-module');
|
|
1039
|
+
* const reader = body.getReader();
|
|
1040
|
+
* // Read the stream...
|
|
1041
|
+
* ```
|
|
1042
|
+
*/
|
|
1043
|
+
download(slug: string): Promise<{
|
|
1044
|
+
body: ReadableStream<Uint8Array> | null;
|
|
1045
|
+
module: Module;
|
|
1046
|
+
}>;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* Service for managing page configurations.
|
|
1051
|
+
* Pages define the layout and content of entity detail views.
|
|
1052
|
+
*/
|
|
1053
|
+
interface PageService {
|
|
1054
|
+
/**
|
|
1055
|
+
* Lists pages with optional filtering.
|
|
1056
|
+
*
|
|
1057
|
+
* @param options - Filter and pagination options
|
|
1058
|
+
* @returns Async iterator over pages
|
|
1059
|
+
*/
|
|
1060
|
+
list(options?: ListPagesOptions): PageIterator<Page, ListPagesOptions>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Fetches a single page of page configurations.
|
|
1063
|
+
*/
|
|
1064
|
+
listPage(options?: ListPagesOptions): Promise<ListResult<Page>>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Gets a single page by slug.
|
|
1067
|
+
*
|
|
1068
|
+
* @param slug - Page slug (author-controlled, kebab-case, unique per org)
|
|
1069
|
+
* @returns The page
|
|
1070
|
+
* @throws {ProteosError} If page not found (404)
|
|
1071
|
+
*/
|
|
1072
|
+
get(slug: string): Promise<Page>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Creates a new page.
|
|
1075
|
+
*
|
|
1076
|
+
* @param request - Page creation request
|
|
1077
|
+
* @returns The created page
|
|
1078
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
1079
|
+
*/
|
|
1080
|
+
create(request: CreatePageRequest): Promise<Page>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Creates or updates a page idempotently by slug. The URL slug wins on
|
|
1083
|
+
* mismatch with the body's slug field.
|
|
1084
|
+
*
|
|
1085
|
+
* @param slug - Page slug
|
|
1086
|
+
* @param request - Page body
|
|
1087
|
+
* @returns The created or updated page
|
|
1088
|
+
*/
|
|
1089
|
+
upsert(slug: string, request: CreatePageRequest): Promise<Page>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Updates an existing page.
|
|
1092
|
+
*
|
|
1093
|
+
* @param slug - Page slug
|
|
1094
|
+
* @param request - Fields to update
|
|
1095
|
+
* @returns The updated page
|
|
1096
|
+
* @throws {ProteosError} If page not found (404) or validation fails (400)
|
|
1097
|
+
*/
|
|
1098
|
+
update(slug: string, request: UpdatePageRequest): Promise<Page>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Deletes a page.
|
|
1101
|
+
*
|
|
1102
|
+
* @param slug - Page slug
|
|
1103
|
+
* @throws {ProteosError} If page not found (404)
|
|
1104
|
+
*/
|
|
1105
|
+
delete(slug: string): Promise<void>;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Service for managing configuration and secret variables.
|
|
1110
|
+
* Variables store key-value pairs scoped to modules.
|
|
1111
|
+
*/
|
|
1112
|
+
interface VariableService {
|
|
1113
|
+
/**
|
|
1114
|
+
* Lists variables with optional filtering.
|
|
1115
|
+
*
|
|
1116
|
+
* @param options - Filter and pagination options
|
|
1117
|
+
* @returns Async iterator over variables
|
|
1118
|
+
*/
|
|
1119
|
+
list(options?: ListVariablesOptions): PageIterator<Variable, ListVariablesOptions>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Fetches a single page of variables.
|
|
1122
|
+
* Useful for paginated UI frameworks (e.g. React Query's useInfiniteQuery).
|
|
1123
|
+
*/
|
|
1124
|
+
listPage(options?: ListVariablesOptions): Promise<ListResult<Variable>>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Gets a single variable by ID.
|
|
1127
|
+
*
|
|
1128
|
+
* @param id - Variable ID
|
|
1129
|
+
* @returns The variable
|
|
1130
|
+
* @throws {ProteosError} If variable not found (404)
|
|
1131
|
+
*/
|
|
1132
|
+
get(id: string): Promise<Variable>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Creates a new variable.
|
|
1135
|
+
*
|
|
1136
|
+
* @param request - Variable creation request
|
|
1137
|
+
* @returns The created variable
|
|
1138
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
1139
|
+
*/
|
|
1140
|
+
create(request: CreateVariableRequest): Promise<Variable>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Updates an existing variable.
|
|
1143
|
+
*
|
|
1144
|
+
* @param id - Variable ID
|
|
1145
|
+
* @param request - Fields to update
|
|
1146
|
+
* @returns The updated variable
|
|
1147
|
+
* @throws {ProteosError} If variable not found (404) or validation fails (400)
|
|
1148
|
+
*/
|
|
1149
|
+
update(id: string, request: UpdateVariableRequest): Promise<Variable>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Deletes a variable.
|
|
1152
|
+
*
|
|
1153
|
+
* @param id - Variable ID
|
|
1154
|
+
* @throws {ProteosError} If variable not found (404)
|
|
1155
|
+
*/
|
|
1156
|
+
delete(id: string): Promise<void>;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* All currency codes the runtime knows, sorted and memoized. Sourced from
|
|
1161
|
+
* `Intl.supportedValuesOf` (ES2022). When an attribute's
|
|
1162
|
+
* `allowed_currency_codes` is unset, this is the full selectable set.
|
|
1163
|
+
*/
|
|
1164
|
+
declare function allCurrencyCodes(): string[];
|
|
1165
|
+
/**
|
|
1166
|
+
* Localized display name for a currency code (e.g. `"US Dollar"`), via
|
|
1167
|
+
* `Intl.DisplayNames`. Falls back to the code itself when unavailable.
|
|
1168
|
+
*/
|
|
1169
|
+
declare function currencyLabel(code: string, locale?: string): string;
|
|
1170
|
+
/**
|
|
1171
|
+
* The narrow symbol for a currency code (e.g. `"$"`, `"€"`, `"¥"`), via
|
|
1172
|
+
* `Intl.NumberFormat`'s `narrowSymbol` so it's the bare glyph rather than a
|
|
1173
|
+
* disambiguated form like `"US$"`. Falls back to the code itself.
|
|
1174
|
+
*/
|
|
1175
|
+
declare function currencySymbol(code: string, locale?: string): string;
|
|
1176
|
+
type CurrencySymbolSide = 'prefix' | 'suffix';
|
|
1177
|
+
/**
|
|
1178
|
+
* Which side of the amount a currency's symbol sits on. The well-defined rule:
|
|
1179
|
+
* a currency in {@link SUFFIX_SYMBOL_CURRENCIES} suffixes (`"100 €"`), every
|
|
1180
|
+
* other currency prefixes (`"$100"`). Pure and deterministic.
|
|
1181
|
+
*/
|
|
1182
|
+
declare function currencySymbolSide(code: string): CurrencySymbolSide;
|
|
1183
|
+
/**
|
|
1184
|
+
* The grouping (thousands) and decimal separators for a locale — e.g. `de-DE`
|
|
1185
|
+
* → `{ group: ".", decimal: "," }`, `en-US` → `{ group: ",", decimal: "." }`.
|
|
1186
|
+
* Derived from `Intl.NumberFormat.formatToParts` and memoized per locale.
|
|
1187
|
+
*/
|
|
1188
|
+
declare function localeNumberSeparators(locale?: string): {
|
|
1189
|
+
group: string;
|
|
1190
|
+
decimal: string;
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* Render a canonical decimal string in a locale's notation — e.g. `"1234.56"`
|
|
1194
|
+
* → `"1.234,56"` (de) / `"1,234.56"` (en). `grouped: false` omits the thousands
|
|
1195
|
+
* separator (useful while a field is being edited). Precision-preserving: it
|
|
1196
|
+
* splits the string and substitutes separators, never `Number()`.
|
|
1197
|
+
*/
|
|
1198
|
+
declare function formatAmount(canonical: string, locale?: string, options?: {
|
|
1199
|
+
grouped?: boolean;
|
|
1200
|
+
}): string;
|
|
1201
|
+
/**
|
|
1202
|
+
* Parse locale-formatted user input back to a canonical decimal string — e.g.
|
|
1203
|
+
* `"1.234,56"` (de) → `"1234.56"`. Strips the locale group separator,
|
|
1204
|
+
* normalizes the locale decimal to `.`, and drops stray characters (symbols,
|
|
1205
|
+
* spaces). Returns `""` for empty/invalid input.
|
|
1206
|
+
*/
|
|
1207
|
+
declare function parseAmount(input: string, locale?: string): string;
|
|
1208
|
+
/**
|
|
1209
|
+
* Format a currency value for read-only display: the symbol placed by currency
|
|
1210
|
+
* convention ({@link currencySymbolSide}) around the amount grouped per the
|
|
1211
|
+
* viewer's locale ({@link formatAmount}). E.g. USD → `"$1,234.56"`, EUR (de
|
|
1212
|
+
* viewer) → `"1.234,56 €"`. Returns a plain `"amount code"` string when the
|
|
1213
|
+
* value can't be formatted.
|
|
1214
|
+
*/
|
|
1215
|
+
declare function formatMoney(value: CurrencyValue, locale?: string): string;
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Logical operator used to combine filter elements/groups.
|
|
1219
|
+
*/
|
|
1220
|
+
type LogicalOperator = 'and' | 'or';
|
|
1221
|
+
/**
|
|
1222
|
+
* Comparison operator for a single filter element. Mirrors
|
|
1223
|
+
* `ComparisonOperator` in `packages/go/model/comparison-operator.go`.
|
|
1224
|
+
*/
|
|
1225
|
+
type ComparisonOperator = 'eq' | 'gt' | 'lt' | 'gte' | 'lte' | 'ne' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with' | 'empty' | 'not_empty';
|
|
1226
|
+
/**
|
|
1227
|
+
* Single filter element (atomic predicate).
|
|
1228
|
+
*
|
|
1229
|
+
* `value` is a string at the wire level — pipe-joined for `in` / `not_in`,
|
|
1230
|
+
* ignored for `empty` / `not_empty`. This matches the data-service URL query
|
|
1231
|
+
* convention so the same predicate flows through both the GET-with-filters
|
|
1232
|
+
* path and the layout `visible_when` JSONB path without a translation layer.
|
|
1233
|
+
*/
|
|
1234
|
+
interface FilterElement {
|
|
1235
|
+
field: string;
|
|
1236
|
+
value: string;
|
|
1237
|
+
operator: ComparisonOperator;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Filter group with logical operator. Groups can be nested.
|
|
1241
|
+
*/
|
|
1242
|
+
interface FilterGroup {
|
|
1243
|
+
logical_operator: LogicalOperator;
|
|
1244
|
+
elements?: FilterElement[];
|
|
1245
|
+
groups?: FilterGroup[];
|
|
1246
|
+
}
|
|
1247
|
+
declare const FilterElementSchema: z.ZodObject<{
|
|
1248
|
+
field: z.ZodString;
|
|
1249
|
+
value: z.ZodString;
|
|
1250
|
+
operator: z.ZodEnum<["eq", "gt", "lt", "gte", "lte", "ne", "in", "not_in", "contains", "starts_with", "ends_with", "empty", "not_empty"]>;
|
|
1251
|
+
}, "strip", z.ZodTypeAny, {
|
|
1252
|
+
value: string;
|
|
1253
|
+
field: string;
|
|
1254
|
+
operator: "eq" | "gt" | "lt" | "gte" | "lte" | "ne" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | "empty" | "not_empty";
|
|
1255
|
+
}, {
|
|
1256
|
+
value: string;
|
|
1257
|
+
field: string;
|
|
1258
|
+
operator: "eq" | "gt" | "lt" | "gte" | "lte" | "ne" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | "empty" | "not_empty";
|
|
1259
|
+
}>;
|
|
1260
|
+
declare const FilterGroupSchema: z.ZodType<FilterGroup>;
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* SizeValue is a polymorphic sizing value used by `width`, `height`, and the
|
|
1264
|
+
* responsive overrides. Accepted forms:
|
|
1265
|
+
*
|
|
1266
|
+
* - JSON number in [0, 1] for a fraction (0.5 → 50%)
|
|
1267
|
+
* - "n/m" fraction string ("1/2", "2/3", ...)
|
|
1268
|
+
* - "Npx" pixel string
|
|
1269
|
+
* - "N%" percent string
|
|
1270
|
+
* - "auto" — size to content
|
|
1271
|
+
* - "fill" — grow to fill remaining space
|
|
1272
|
+
*/
|
|
1273
|
+
type SizeValue = number | `${number}/${number}` | `${number}px` | `${number}%` | 'auto' | 'fill';
|
|
1274
|
+
declare const SizeValueSchema: z.ZodType<SizeValue>;
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* Cross-axis alignment values. On Row / Column the same string also drives
|
|
1278
|
+
* arrangement of children (cross-axis); on a leaf element it acts as
|
|
1279
|
+
* align-self.
|
|
1280
|
+
*/
|
|
1281
|
+
type LayoutAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
1282
|
+
type LayoutJustify = 'start' | 'center' | 'end' | 'between' | 'around';
|
|
1283
|
+
type LayoutGap = 'xs' | 'sm' | 'md' | 'lg';
|
|
1284
|
+
/**
|
|
1285
|
+
* Partial sizing knobs reused by ResponsiveSizing.
|
|
1286
|
+
*/
|
|
1287
|
+
interface SizingProps {
|
|
1288
|
+
width?: SizeValue;
|
|
1289
|
+
height?: SizeValue;
|
|
1290
|
+
grow?: number;
|
|
1291
|
+
shrink?: number;
|
|
1292
|
+
align?: LayoutAlign;
|
|
1293
|
+
}
|
|
1294
|
+
interface ResponsiveSizing {
|
|
1295
|
+
sm?: SizingProps;
|
|
1296
|
+
md?: SizingProps;
|
|
1297
|
+
lg?: SizingProps;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Common properties present on every LayoutElement.
|
|
1301
|
+
*
|
|
1302
|
+
* `visible_when` and `read_only_when` reuse the `FilterGroup` predicate model
|
|
1303
|
+
* already used by lists and the data-service URL query convention — same
|
|
1304
|
+
* operators, same and/or composition, same `value: string` (pipe-joined for
|
|
1305
|
+
* `in` / `not_in`).
|
|
1306
|
+
*
|
|
1307
|
+
* `align` here is align-self (override of the parent's cross-axis arrangement
|
|
1308
|
+
* for this child). On Row / Column it is shadowed by an outer `align` whose
|
|
1309
|
+
* semantic is the cross-axis arrangement applied to children.
|
|
1310
|
+
*/
|
|
1311
|
+
interface CommonProps {
|
|
1312
|
+
id?: string;
|
|
1313
|
+
visible_when?: FilterGroup;
|
|
1314
|
+
read_only_when?: FilterGroup;
|
|
1315
|
+
width?: SizeValue;
|
|
1316
|
+
height?: SizeValue;
|
|
1317
|
+
grow?: number;
|
|
1318
|
+
shrink?: number;
|
|
1319
|
+
align?: LayoutAlign;
|
|
1320
|
+
responsive?: ResponsiveSizing;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
declare const BUILT_IN_CONTROLS: readonly string[];
|
|
1324
|
+
type BuiltInControlSlug = (typeof BUILT_IN_CONTROLS)[number];
|
|
1325
|
+
interface ControlBucket {
|
|
1326
|
+
readonly primary: string | null;
|
|
1327
|
+
readonly compatible: readonly string[];
|
|
1328
|
+
}
|
|
1329
|
+
/** True when `slug` matches a built-in control. */
|
|
1330
|
+
declare function isBuiltInControl(slug: string): boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Minimal Attribute shape the lookup helpers need. The SDK's full
|
|
1333
|
+
* `Attribute` type extends this; consumers can pass either.
|
|
1334
|
+
*/
|
|
1335
|
+
interface AttributeForLookup {
|
|
1336
|
+
type: string;
|
|
1337
|
+
meta?: {
|
|
1338
|
+
format?: string;
|
|
1339
|
+
items?: {
|
|
1340
|
+
type?: string;
|
|
1341
|
+
};
|
|
1342
|
+
} | null;
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Resolves the full ControlBucket for an attribute. Walks
|
|
1346
|
+
* type → byFormat[meta.format] (string/datetime) or
|
|
1347
|
+
* type → byItemsType[meta.items.type] (array), falling back to the
|
|
1348
|
+
* type-level entry.
|
|
1349
|
+
*
|
|
1350
|
+
* Returns `{ primary: null, compatible: [] }` when neither the type
|
|
1351
|
+
* nor any narrower bucket matches — including when the attribute type
|
|
1352
|
+
* is unknown to the registry (e.g. legacy wire data).
|
|
1353
|
+
*/
|
|
1354
|
+
declare function lookupControls(attr: AttributeForLookup): ControlBucket;
|
|
1355
|
+
/** Convenience: the primary slug, or null for the read-only fallback. */
|
|
1356
|
+
declare function lookupPrimaryControl(attr: AttributeForLookup): string | null;
|
|
1357
|
+
/** Convenience: the compatible slug list (empty for the read-only fallback). */
|
|
1358
|
+
declare function lookupCompatibleControls(attr: AttributeForLookup): readonly string[];
|
|
1359
|
+
|
|
1360
|
+
declare const LayoutElementType: {
|
|
1361
|
+
readonly Row: "row";
|
|
1362
|
+
readonly Column: "column";
|
|
1363
|
+
readonly Section: "section";
|
|
1364
|
+
readonly Tabs: "tabs";
|
|
1365
|
+
readonly Field: "field";
|
|
1366
|
+
readonly RelatedList: "related_list";
|
|
1367
|
+
readonly Component: "component";
|
|
1368
|
+
readonly Divider: "divider";
|
|
1369
|
+
readonly Text: "text";
|
|
1370
|
+
};
|
|
1371
|
+
type LayoutElementType = (typeof LayoutElementType)[keyof typeof LayoutElementType];
|
|
1372
|
+
type RowElement = CommonProps & {
|
|
1373
|
+
type: 'row';
|
|
1374
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg';
|
|
1375
|
+
/** When true (default), children flow to the next line if they don't fit. */
|
|
1376
|
+
allows_wrap?: boolean;
|
|
1377
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
1378
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
|
|
1379
|
+
children: LayoutElement[];
|
|
1380
|
+
};
|
|
1381
|
+
type ColumnElement = CommonProps & {
|
|
1382
|
+
type: 'column';
|
|
1383
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg';
|
|
1384
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
1385
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
|
|
1386
|
+
children: LayoutElement[];
|
|
1387
|
+
};
|
|
1388
|
+
type SectionElement = CommonProps & {
|
|
1389
|
+
type: 'section';
|
|
1390
|
+
title?: string;
|
|
1391
|
+
description?: string;
|
|
1392
|
+
is_collapsible?: boolean;
|
|
1393
|
+
default_collapsed?: boolean;
|
|
1394
|
+
content: LayoutElement;
|
|
1395
|
+
};
|
|
1396
|
+
type LayoutTab = {
|
|
1397
|
+
id: string;
|
|
1398
|
+
label: string;
|
|
1399
|
+
icon?: string;
|
|
1400
|
+
visible_when?: FilterGroup;
|
|
1401
|
+
content: LayoutElement;
|
|
1402
|
+
};
|
|
1403
|
+
type TabsElement = CommonProps & {
|
|
1404
|
+
type: 'tabs';
|
|
1405
|
+
tabs: LayoutTab[];
|
|
1406
|
+
default_tab_id?: string;
|
|
1407
|
+
};
|
|
1408
|
+
type FieldElement = CommonProps & {
|
|
1409
|
+
type: 'field';
|
|
1410
|
+
attribute: string;
|
|
1411
|
+
label?: string | null;
|
|
1412
|
+
description?: string;
|
|
1413
|
+
placeholder?: string;
|
|
1414
|
+
is_read_only?: boolean;
|
|
1415
|
+
is_required?: boolean;
|
|
1416
|
+
empty_display?: 'dash' | 'hide' | string;
|
|
1417
|
+
control?: string;
|
|
1418
|
+
control_props?: Record<string, unknown>;
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Lists records of `related_entity_slug` that reference the current record
|
|
1422
|
+
* through the `via_attribute` relation attribute. Replaces the pre-LUM-20
|
|
1423
|
+
* `relationshipId` reference — the relation is identified directly by the
|
|
1424
|
+
* attribute on the host entity. `list_slug` optionally pins which list
|
|
1425
|
+
* definition drives the column / sort / filter model; when omitted, the
|
|
1426
|
+
* renderer falls back to the first list configured for the related entity.
|
|
1427
|
+
*/
|
|
1428
|
+
type RelatedListElement = CommonProps & {
|
|
1429
|
+
type: 'related_list';
|
|
1430
|
+
related_entity_slug: string;
|
|
1431
|
+
via_attribute: string;
|
|
1432
|
+
list_slug?: string;
|
|
1433
|
+
};
|
|
1434
|
+
type ComponentElement = CommonProps & {
|
|
1435
|
+
type: 'component';
|
|
1436
|
+
component_slug: string;
|
|
1437
|
+
props?: Record<string, unknown>;
|
|
1438
|
+
};
|
|
1439
|
+
type DividerElement = CommonProps & {
|
|
1440
|
+
type: 'divider';
|
|
1441
|
+
};
|
|
1442
|
+
type TextVariant = 'heading' | 'subheading' | 'body' | 'caption' | 'callout';
|
|
1443
|
+
type TextElement = CommonProps & {
|
|
1444
|
+
type: 'text';
|
|
1445
|
+
variant: TextVariant;
|
|
1446
|
+
content: string;
|
|
1447
|
+
};
|
|
1448
|
+
type LayoutElement = RowElement | ColumnElement | SectionElement | TabsElement | FieldElement | RelatedListElement | ComponentElement | DividerElement | TextElement;
|
|
1449
|
+
declare const LayoutElementSchema: z.ZodType<LayoutElement>;
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Side panel slot. Rendered as a sticky-by-default right rail; collapses
|
|
1453
|
+
* below the main column on narrow viewports.
|
|
1454
|
+
*/
|
|
1455
|
+
interface PageLayoutSidePanel {
|
|
1456
|
+
width?: SizeValue;
|
|
1457
|
+
is_sticky?: boolean;
|
|
1458
|
+
content: LayoutElement;
|
|
1459
|
+
}
|
|
1460
|
+
declare const PageLayoutSidePanelSchema: z.ZodObject<{
|
|
1461
|
+
width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1462
|
+
is_sticky: z.ZodOptional<z.ZodBoolean>;
|
|
1463
|
+
content: z.ZodType<LayoutElement, z.ZodTypeDef, LayoutElement>;
|
|
1464
|
+
}, "strip", z.ZodTypeAny, {
|
|
1465
|
+
content: LayoutElement;
|
|
1466
|
+
width?: SizeValue | undefined;
|
|
1467
|
+
is_sticky?: boolean | undefined;
|
|
1468
|
+
}, {
|
|
1469
|
+
content: LayoutElement;
|
|
1470
|
+
width?: SizeValue | undefined;
|
|
1471
|
+
is_sticky?: boolean | undefined;
|
|
1472
|
+
}>;
|
|
1473
|
+
/**
|
|
1474
|
+
* Top-level page layout. Replaces the legacy `mainContent` / `side_panel`
|
|
1475
|
+
* arrays of `PageSection`s with a single typed element tree.
|
|
1476
|
+
*/
|
|
1477
|
+
interface PageLayout {
|
|
1478
|
+
version: 1;
|
|
1479
|
+
main: LayoutElement;
|
|
1480
|
+
side_panel?: PageLayoutSidePanel;
|
|
1481
|
+
}
|
|
1482
|
+
declare const PageLayoutSchema: z.ZodObject<{
|
|
1483
|
+
version: z.ZodLiteral<1>;
|
|
1484
|
+
main: z.ZodType<LayoutElement, z.ZodTypeDef, LayoutElement>;
|
|
1485
|
+
side_panel: z.ZodOptional<z.ZodObject<{
|
|
1486
|
+
width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1487
|
+
is_sticky: z.ZodOptional<z.ZodBoolean>;
|
|
1488
|
+
content: z.ZodType<LayoutElement, z.ZodTypeDef, LayoutElement>;
|
|
1489
|
+
}, "strip", z.ZodTypeAny, {
|
|
1490
|
+
content: LayoutElement;
|
|
1491
|
+
width?: SizeValue | undefined;
|
|
1492
|
+
is_sticky?: boolean | undefined;
|
|
1493
|
+
}, {
|
|
1494
|
+
content: LayoutElement;
|
|
1495
|
+
width?: SizeValue | undefined;
|
|
1496
|
+
is_sticky?: boolean | undefined;
|
|
1497
|
+
}>>;
|
|
1498
|
+
}, "strip", z.ZodTypeAny, {
|
|
1499
|
+
version: 1;
|
|
1500
|
+
main: LayoutElement;
|
|
1501
|
+
side_panel?: {
|
|
1502
|
+
content: LayoutElement;
|
|
1503
|
+
width?: SizeValue | undefined;
|
|
1504
|
+
is_sticky?: boolean | undefined;
|
|
1505
|
+
} | undefined;
|
|
1506
|
+
}, {
|
|
1507
|
+
version: 1;
|
|
1508
|
+
main: LayoutElement;
|
|
1509
|
+
side_panel?: {
|
|
1510
|
+
content: LayoutElement;
|
|
1511
|
+
width?: SizeValue | undefined;
|
|
1512
|
+
is_sticky?: boolean | undefined;
|
|
1513
|
+
} | undefined;
|
|
1514
|
+
}>;
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* Client for the Proteos Metadata Service API.
|
|
1518
|
+
* Provides access to all metadata management services.
|
|
1519
|
+
*
|
|
1520
|
+
* @example
|
|
1521
|
+
* ```ts
|
|
1522
|
+
* import { ProteosClient, MetaClient } from 'proteos-sdk';
|
|
1523
|
+
*
|
|
1524
|
+
* const client = new ProteosClient({
|
|
1525
|
+
* baseUrl: 'https://api.proteos.ai',
|
|
1526
|
+
* token: 'your-api-token',
|
|
1527
|
+
* });
|
|
1528
|
+
*
|
|
1529
|
+
* const meta = new MetaClient(client);
|
|
1530
|
+
*
|
|
1531
|
+
* // Use services
|
|
1532
|
+
* const entities = await meta.entities.list().all();
|
|
1533
|
+
* const module = await meta.modules.get('my-module');
|
|
1534
|
+
* ```
|
|
1535
|
+
*/
|
|
1536
|
+
declare class MetaClient {
|
|
1537
|
+
/**
|
|
1538
|
+
* Service for managing entity definitions.
|
|
1539
|
+
*/
|
|
1540
|
+
readonly entities: EntityService;
|
|
1541
|
+
/**
|
|
1542
|
+
* Service for managing WebAssembly modules.
|
|
1543
|
+
*/
|
|
1544
|
+
readonly modules: ModuleService;
|
|
1545
|
+
/**
|
|
1546
|
+
* Service for managing configuration and secret variables.
|
|
1547
|
+
*/
|
|
1548
|
+
readonly variables: VariableService;
|
|
1549
|
+
/**
|
|
1550
|
+
* Service for managing UI component definitions.
|
|
1551
|
+
*/
|
|
1552
|
+
readonly components: ComponentService;
|
|
1553
|
+
/**
|
|
1554
|
+
* Service for managing list configurations.
|
|
1555
|
+
*/
|
|
1556
|
+
readonly lists: ListService;
|
|
1557
|
+
/**
|
|
1558
|
+
* Service for managing list view configurations.
|
|
1559
|
+
*/
|
|
1560
|
+
readonly listViews: ListViewService;
|
|
1561
|
+
/**
|
|
1562
|
+
* Service for managing page configurations.
|
|
1563
|
+
*/
|
|
1564
|
+
readonly pages: PageService;
|
|
1565
|
+
/**
|
|
1566
|
+
* Service for managing menu configurations.
|
|
1567
|
+
*/
|
|
1568
|
+
readonly menuConfigurations: MenuConfigurationService;
|
|
1569
|
+
/**
|
|
1570
|
+
* Service for managing apps.
|
|
1571
|
+
*/
|
|
1572
|
+
readonly apps: AppService;
|
|
1573
|
+
/**
|
|
1574
|
+
* Creates a new MetaClient instance.
|
|
1575
|
+
*
|
|
1576
|
+
* @param client - The base ProteosClient to use for API requests
|
|
1577
|
+
*/
|
|
1578
|
+
constructor(client: ProteosClient);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Base list options with source filters for the meta namespace.
|
|
1583
|
+
*/
|
|
1584
|
+
interface MetaListOptions extends ListOptions {
|
|
1585
|
+
created_by?: string;
|
|
1586
|
+
updated_by?: string;
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Attribute type — canonical to the Go `model.AttributeType` union
|
|
1590
|
+
* (packages/go/model/meta/attribute.go). The members below are the
|
|
1591
|
+
* full set; format/structural variation lives on `Attribute.meta` (see
|
|
1592
|
+
* `AttributeMeta` below), not on the type discriminator.
|
|
1593
|
+
*/
|
|
1594
|
+
type AttributeType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'datetime' | 'enum' | 'relation' | 'user' | 'currency' | 'knowledge-text' | 'file';
|
|
1595
|
+
/** JSON-Schema string formats carried by `string` attributes. */
|
|
1596
|
+
type StringFormat = 'email' | 'uri' | 'uuid' | 'hostname' | 'ipv4' | 'ipv6';
|
|
1597
|
+
interface StringAttributeMeta {
|
|
1598
|
+
format?: StringFormat;
|
|
1599
|
+
min_length?: number;
|
|
1600
|
+
max_length?: number;
|
|
1601
|
+
pattern?: string;
|
|
1602
|
+
}
|
|
1603
|
+
interface NumberAttributeMeta {
|
|
1604
|
+
minimum?: number;
|
|
1605
|
+
maximum?: number;
|
|
1606
|
+
exclusive_minimum?: number;
|
|
1607
|
+
exclusive_maximum?: number;
|
|
1608
|
+
multiple_of?: number;
|
|
1609
|
+
}
|
|
1610
|
+
/** Datetime storage/display behavior. `format` is required. */
|
|
1611
|
+
type DatetimeFormat = 'date-time' | 'date' | 'time' | 'duration';
|
|
1612
|
+
interface DatetimeAttributeMeta {
|
|
1613
|
+
format: DatetimeFormat;
|
|
1614
|
+
minimum?: string;
|
|
1615
|
+
maximum?: string;
|
|
1616
|
+
}
|
|
1617
|
+
interface ArrayAttributeMeta {
|
|
1618
|
+
items?: Attribute;
|
|
1619
|
+
min_items?: number;
|
|
1620
|
+
max_items?: number;
|
|
1621
|
+
items_must_be_unique?: boolean;
|
|
1622
|
+
}
|
|
1623
|
+
interface ObjectAttributeMeta {
|
|
1624
|
+
attributes?: Attribute[];
|
|
1625
|
+
}
|
|
1626
|
+
interface EnumValue {
|
|
1627
|
+
value: string;
|
|
1628
|
+
label?: string;
|
|
1629
|
+
description?: string;
|
|
1630
|
+
}
|
|
1631
|
+
interface EnumAttributeMeta {
|
|
1632
|
+
values: EnumValue[];
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Policy applied to the host row when the related row is deleted. Mirror
|
|
1636
|
+
* of `model.OnDeleteAction`. The runtime semantic is enforced at the
|
|
1637
|
+
* data-service level; this metadata declares the intent.
|
|
1638
|
+
*/
|
|
1639
|
+
type OnDeleteAction = 'cascade' | 'restrict' | 'set-null';
|
|
1640
|
+
declare const OnDeleteActionSchema: z.ZodEnum<["cascade", "restrict", "set-null"]>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Metadata for a `relation`-typed attribute. The attribute is a foreign-key
|
|
1643
|
+
* column on the host entity pointing at `related_attribute` on
|
|
1644
|
+
* `related_entity_slug`. `predicate` reads from the host outward (e.g. on
|
|
1645
|
+
* `Order.customerId` with `predicate: "is placed by"`, the sentence is
|
|
1646
|
+
* "Order is placed by Customer").
|
|
1647
|
+
*/
|
|
1648
|
+
interface RelationAttributeMeta {
|
|
1649
|
+
related_entity_slug: string;
|
|
1650
|
+
related_attribute: string;
|
|
1651
|
+
predicate: string;
|
|
1652
|
+
description?: string;
|
|
1653
|
+
on_delete: OnDeleteAction;
|
|
1654
|
+
}
|
|
1655
|
+
declare const RelationAttributeMetaSchema: z.ZodObject<{
|
|
1656
|
+
related_entity_slug: z.ZodString;
|
|
1657
|
+
related_attribute: z.ZodString;
|
|
1658
|
+
predicate: z.ZodString;
|
|
1659
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1660
|
+
on_delete: z.ZodEnum<["cascade", "restrict", "set-null"]>;
|
|
1661
|
+
}, "strip", z.ZodTypeAny, {
|
|
1662
|
+
related_entity_slug: string;
|
|
1663
|
+
related_attribute: string;
|
|
1664
|
+
predicate: string;
|
|
1665
|
+
on_delete: "cascade" | "restrict" | "set-null";
|
|
1666
|
+
description?: string | undefined;
|
|
1667
|
+
}, {
|
|
1668
|
+
related_entity_slug: string;
|
|
1669
|
+
related_attribute: string;
|
|
1670
|
+
predicate: string;
|
|
1671
|
+
on_delete: "cascade" | "restrict" | "set-null";
|
|
1672
|
+
description?: string | undefined;
|
|
1673
|
+
}>;
|
|
1674
|
+
/**
|
|
1675
|
+
* Metadata for a `user`-typed attribute. A user attribute stores a
|
|
1676
|
+
* {@link UserRef} `{ type, id }` (the account-service identity plus its
|
|
1677
|
+
* kind), rendered as a people picker that resolves and filters on `id`. Mirror
|
|
1678
|
+
* of the Go `metamodel.UserAttributeMeta`.
|
|
1679
|
+
*
|
|
1680
|
+
* It carries no required configuration today; the shape exists for parity
|
|
1681
|
+
* with the other metas and reserves room for future options (e.g.
|
|
1682
|
+
* multi-user selection).
|
|
1683
|
+
*/
|
|
1684
|
+
interface UserAttributeMeta {
|
|
1685
|
+
description?: string;
|
|
1686
|
+
}
|
|
1687
|
+
declare const UserAttributeMetaSchema: z.ZodObject<{
|
|
1688
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1689
|
+
}, "strip", z.ZodTypeAny, {
|
|
1690
|
+
description?: string | undefined;
|
|
1691
|
+
}, {
|
|
1692
|
+
description?: string | undefined;
|
|
1693
|
+
}>;
|
|
1694
|
+
/**
|
|
1695
|
+
* The stored value of a `currency`-typed attribute: an exact decimal `amount`
|
|
1696
|
+
* (a STRING, never a JS number — preserves financial-system precision and
|
|
1697
|
+
* trailing zeros) paired with an ISO-4217 `currency_code`. This is the wire
|
|
1698
|
+
* shape; the `@proteos/ui` `CurrencyInput` and the web control both read/write
|
|
1699
|
+
* it directly to avoid an adapter.
|
|
1700
|
+
*/
|
|
1701
|
+
interface CurrencyValue {
|
|
1702
|
+
amount: string;
|
|
1703
|
+
currency_code: string;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Metadata for a `currency`-typed attribute. Both fields are optional: when
|
|
1707
|
+
* `allowed_currency_codes` is empty/absent, any ISO-4217 code is accepted;
|
|
1708
|
+
* `default_currency_code` seeds the picker for new values and must be a member
|
|
1709
|
+
* of `allowed_currency_codes` when that allow-list is set. Mirror of the Go
|
|
1710
|
+
* `metamodel.CurrencyAttributeMeta`.
|
|
1711
|
+
*/
|
|
1712
|
+
interface CurrencyAttributeMeta {
|
|
1713
|
+
default_currency_code?: string;
|
|
1714
|
+
allowed_currency_codes?: string[];
|
|
1715
|
+
}
|
|
1716
|
+
declare const CurrencyAttributeMetaSchema: z.ZodObject<{
|
|
1717
|
+
default_currency_code: z.ZodOptional<z.ZodString>;
|
|
1718
|
+
allowed_currency_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1719
|
+
}, "strip", z.ZodTypeAny, {
|
|
1720
|
+
default_currency_code?: string | undefined;
|
|
1721
|
+
allowed_currency_codes?: string[] | undefined;
|
|
1722
|
+
}, {
|
|
1723
|
+
default_currency_code?: string | undefined;
|
|
1724
|
+
allowed_currency_codes?: string[] | undefined;
|
|
1725
|
+
}>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Metadata for a `knowledge-text`-typed attribute. The value is a
|
|
1728
|
+
* {@link KnowledgeNodeRef}; the data-service materializes client-sent text
|
|
1729
|
+
* into a knowledge node before persisting. Mirror of the Go
|
|
1730
|
+
* `metamodel.KnowledgeTextAttributeMeta`.
|
|
1731
|
+
*
|
|
1732
|
+
* It carries no required configuration today; the shape exists for parity
|
|
1733
|
+
* with the other metas and reserves room for future options (e.g. node
|
|
1734
|
+
* labels, status overrides).
|
|
1735
|
+
*/
|
|
1736
|
+
interface KnowledgeTextAttributeMeta {
|
|
1737
|
+
description?: string;
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* Metadata for a `file`-typed attribute. The value is a {@link FileRef}
|
|
1741
|
+
* `{ id, name }` referencing a storage-service file; the frontend uploads to
|
|
1742
|
+
* the storage-service and writes the resulting id + name. Mirror of the Go
|
|
1743
|
+
* `metamodel.FileAttributeMeta`.
|
|
1744
|
+
*
|
|
1745
|
+
* It carries no required configuration today; the shape exists for parity with
|
|
1746
|
+
* the other metas and reserves room for future options (e.g. accepted content
|
|
1747
|
+
* types, max size).
|
|
1748
|
+
*/
|
|
1749
|
+
interface FileAttributeMeta {
|
|
1750
|
+
description?: string;
|
|
1751
|
+
}
|
|
1752
|
+
declare const FileAttributeMetaSchema: z.ZodObject<{
|
|
1753
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1754
|
+
}, "strip", z.ZodTypeAny, {
|
|
1755
|
+
description?: string | undefined;
|
|
1756
|
+
}, {
|
|
1757
|
+
description?: string | undefined;
|
|
1758
|
+
}>;
|
|
1759
|
+
/**
|
|
1760
|
+
* Discriminated union of attribute metas. The wire JSON carries the
|
|
1761
|
+
* appropriate shape based on `Attribute.type`; runtime consumers can
|
|
1762
|
+
* narrow via the `type` field.
|
|
1763
|
+
*/
|
|
1764
|
+
type AttributeMeta = StringAttributeMeta | NumberAttributeMeta | DatetimeAttributeMeta | ArrayAttributeMeta | ObjectAttributeMeta | EnumAttributeMeta | RelationAttributeMeta | UserAttributeMeta | CurrencyAttributeMeta | KnowledgeTextAttributeMeta | FileAttributeMeta;
|
|
1765
|
+
/**
|
|
1766
|
+
* Entity attribute definition. Mirrors `model.Attribute` in the Go SDK.
|
|
1767
|
+
*/
|
|
1768
|
+
interface Attribute {
|
|
1769
|
+
name: string;
|
|
1770
|
+
type: AttributeType;
|
|
1771
|
+
label: string;
|
|
1772
|
+
description?: string;
|
|
1773
|
+
is_required: boolean;
|
|
1774
|
+
is_nullable?: boolean;
|
|
1775
|
+
is_unique: boolean;
|
|
1776
|
+
is_read_only?: boolean;
|
|
1777
|
+
/**
|
|
1778
|
+
* Platform-managed flag. Marks the canonical platform attributes (id,
|
|
1779
|
+
* created_at, updated_at, created_by, updated_by) — auto-added to every
|
|
1780
|
+
* entity, locked in the designer, and rejected from client redefinition.
|
|
1781
|
+
* Mirrors `IsPlatformManaged` in the Go `metamodel.Attribute`.
|
|
1782
|
+
*/
|
|
1783
|
+
is_platform_managed?: boolean;
|
|
1784
|
+
default_value?: unknown;
|
|
1785
|
+
/**
|
|
1786
|
+
* Type-specific metadata. The concrete shape is determined by `type`
|
|
1787
|
+
* — e.g. `type: 'string'` carries `StringAttributeMeta`. The wire
|
|
1788
|
+
* field name is `meta`; `options` is an older alias still emitted by
|
|
1789
|
+
* some service paths and accepted for backwards compatibility.
|
|
1790
|
+
*/
|
|
1791
|
+
meta?: AttributeMeta;
|
|
1792
|
+
/** @deprecated Older wire alias for `meta`. Prefer `meta`. */
|
|
1793
|
+
options?: Record<string, unknown>;
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Canonical platform attribute names — the system-managed set every entity
|
|
1797
|
+
* carries. Mirrors `metamodel.PlatformAttribute*` constants in the Go model.
|
|
1798
|
+
*/
|
|
1799
|
+
declare const PLATFORM_ATTRIBUTE_NAMES: readonly ["id", "created_at", "updated_at", "created_by", "updated_by"];
|
|
1800
|
+
/** True when `name` is one of the canonical platform attributes. */
|
|
1801
|
+
declare function isPlatformAttributeName(name: string): boolean;
|
|
1802
|
+
/**
|
|
1803
|
+
* The canonical platform attributes, in display order. Mirror of the Go
|
|
1804
|
+
* `metamodel.PlatformAttributes()`. Used by the entity designer to seed new
|
|
1805
|
+
* entities; the backend re-asserts these on save regardless.
|
|
1806
|
+
*/
|
|
1807
|
+
declare function platformAttributes(): Attribute[];
|
|
1808
|
+
declare const AttributeSchema: z.ZodObject<{
|
|
1809
|
+
name: z.ZodString;
|
|
1810
|
+
type: z.ZodString;
|
|
1811
|
+
label: z.ZodString;
|
|
1812
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1813
|
+
is_required: z.ZodBoolean;
|
|
1814
|
+
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
1815
|
+
is_unique: z.ZodBoolean;
|
|
1816
|
+
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
1817
|
+
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
1818
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
1819
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1820
|
+
}, "strip", z.ZodTypeAny, {
|
|
1821
|
+
type: string;
|
|
1822
|
+
name: string;
|
|
1823
|
+
label: string;
|
|
1824
|
+
is_required: boolean;
|
|
1825
|
+
is_unique: boolean;
|
|
1826
|
+
options?: Record<string, unknown> | undefined;
|
|
1827
|
+
meta?: unknown;
|
|
1828
|
+
description?: string | undefined;
|
|
1829
|
+
is_read_only?: boolean | undefined;
|
|
1830
|
+
is_nullable?: boolean | undefined;
|
|
1831
|
+
default_value?: unknown;
|
|
1832
|
+
}, {
|
|
1833
|
+
type: string;
|
|
1834
|
+
name: string;
|
|
1835
|
+
label: string;
|
|
1836
|
+
is_required: boolean;
|
|
1837
|
+
is_unique: boolean;
|
|
1838
|
+
options?: Record<string, unknown> | undefined;
|
|
1839
|
+
meta?: unknown;
|
|
1840
|
+
description?: string | undefined;
|
|
1841
|
+
is_read_only?: boolean | undefined;
|
|
1842
|
+
is_nullable?: boolean | undefined;
|
|
1843
|
+
default_value?: unknown;
|
|
1844
|
+
}>;
|
|
1845
|
+
/**
|
|
1846
|
+
* Returns the typed `RelationAttributeMeta` when `attr` is a relation
|
|
1847
|
+
* attribute with a valid meta shape; null otherwise. The `AttributeSchema`
|
|
1848
|
+
* intentionally keeps `meta` lax, so callers that need the relation fields
|
|
1849
|
+
* narrowed should go through this helper rather than casting.
|
|
1850
|
+
*/
|
|
1851
|
+
declare function parseRelationMeta(attr: Attribute): RelationAttributeMeta | null;
|
|
1852
|
+
/**
|
|
1853
|
+
* Returns the typed `UserAttributeMeta` when `attr` is a user attribute;
|
|
1854
|
+
* null otherwise. User meta is optional (and usually absent), so a user
|
|
1855
|
+
* attribute with no meta still resolves to an empty `{}` rather than null.
|
|
1856
|
+
*/
|
|
1857
|
+
declare function parseCurrencyMeta(attr: Attribute): CurrencyAttributeMeta | null;
|
|
1858
|
+
declare function parseUserMeta(attr: Attribute): UserAttributeMeta | null;
|
|
1859
|
+
/**
|
|
1860
|
+
* Returns the typed `FileAttributeMeta` when `attr` is a file attribute; null
|
|
1861
|
+
* otherwise. File meta is optional (and usually absent), so a file attribute
|
|
1862
|
+
* with no meta still resolves to an empty `{}` rather than null.
|
|
1863
|
+
*/
|
|
1864
|
+
declare function parseFileMeta(attr: Attribute): FileAttributeMeta | null;
|
|
1865
|
+
/**
|
|
1866
|
+
* Entity definition.
|
|
1867
|
+
* Note: Entity uses `slug` as its primary identifier, not `id`.
|
|
1868
|
+
*/
|
|
1869
|
+
interface Entity extends AuditFields {
|
|
1870
|
+
slug: string;
|
|
1871
|
+
name: string;
|
|
1872
|
+
description: string;
|
|
1873
|
+
is_remote: boolean;
|
|
1874
|
+
module_slug: string;
|
|
1875
|
+
/**
|
|
1876
|
+
* Liquid template that renders a human-readable title for an instance
|
|
1877
|
+
* (record) of this entity — e.g. `{{ first_name }} {{ last_name }}` for a
|
|
1878
|
+
* Customer, `{{ number }}` for an Order. Empty string means "no template
|
|
1879
|
+
* configured"; consumers fall back to the record id.
|
|
1880
|
+
*
|
|
1881
|
+
* Render via `renderRecordTitle(entity, record)` rather than evaluating
|
|
1882
|
+
* the template directly, so the fallback chain stays consistent.
|
|
1883
|
+
*/
|
|
1884
|
+
title_template: string;
|
|
1885
|
+
attributes: Attribute[];
|
|
1886
|
+
}
|
|
1887
|
+
declare const EntitySchema: z.ZodObject<{
|
|
1888
|
+
created_at: z.ZodString;
|
|
1889
|
+
updated_at: z.ZodString;
|
|
1890
|
+
created_by: z.ZodObject<{
|
|
1891
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
1892
|
+
id: z.ZodString;
|
|
1893
|
+
}, "strip", z.ZodTypeAny, {
|
|
1894
|
+
type: "person" | "agent" | "api";
|
|
1895
|
+
id: string;
|
|
1896
|
+
}, {
|
|
1897
|
+
type: "person" | "agent" | "api";
|
|
1898
|
+
id: string;
|
|
1899
|
+
}>;
|
|
1900
|
+
updated_by: z.ZodObject<{
|
|
1901
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
1902
|
+
id: z.ZodString;
|
|
1903
|
+
}, "strip", z.ZodTypeAny, {
|
|
1904
|
+
type: "person" | "agent" | "api";
|
|
1905
|
+
id: string;
|
|
1906
|
+
}, {
|
|
1907
|
+
type: "person" | "agent" | "api";
|
|
1908
|
+
id: string;
|
|
1909
|
+
}>;
|
|
1910
|
+
} & {
|
|
1911
|
+
slug: z.ZodString;
|
|
1912
|
+
name: z.ZodString;
|
|
1913
|
+
description: z.ZodString;
|
|
1914
|
+
is_remote: z.ZodBoolean;
|
|
1915
|
+
module_slug: z.ZodString;
|
|
1916
|
+
title_template: z.ZodDefault<z.ZodString>;
|
|
1917
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
1918
|
+
name: z.ZodString;
|
|
1919
|
+
type: z.ZodString;
|
|
1920
|
+
label: z.ZodString;
|
|
1921
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1922
|
+
is_required: z.ZodBoolean;
|
|
1923
|
+
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
1924
|
+
is_unique: z.ZodBoolean;
|
|
1925
|
+
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
1926
|
+
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
1927
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
1928
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1929
|
+
}, "strip", z.ZodTypeAny, {
|
|
1930
|
+
type: string;
|
|
1931
|
+
name: string;
|
|
1932
|
+
label: string;
|
|
1933
|
+
is_required: boolean;
|
|
1934
|
+
is_unique: boolean;
|
|
1935
|
+
options?: Record<string, unknown> | undefined;
|
|
1936
|
+
meta?: unknown;
|
|
1937
|
+
description?: string | undefined;
|
|
1938
|
+
is_read_only?: boolean | undefined;
|
|
1939
|
+
is_nullable?: boolean | undefined;
|
|
1940
|
+
default_value?: unknown;
|
|
1941
|
+
}, {
|
|
1942
|
+
type: string;
|
|
1943
|
+
name: string;
|
|
1944
|
+
label: string;
|
|
1945
|
+
is_required: boolean;
|
|
1946
|
+
is_unique: boolean;
|
|
1947
|
+
options?: Record<string, unknown> | undefined;
|
|
1948
|
+
meta?: unknown;
|
|
1949
|
+
description?: string | undefined;
|
|
1950
|
+
is_read_only?: boolean | undefined;
|
|
1951
|
+
is_nullable?: boolean | undefined;
|
|
1952
|
+
default_value?: unknown;
|
|
1953
|
+
}>, "many">;
|
|
1954
|
+
}, "strip", z.ZodTypeAny, {
|
|
1955
|
+
name: string;
|
|
1956
|
+
created_at: string;
|
|
1957
|
+
updated_at: string;
|
|
1958
|
+
created_by: {
|
|
1959
|
+
type: "person" | "agent" | "api";
|
|
1960
|
+
id: string;
|
|
1961
|
+
};
|
|
1962
|
+
updated_by: {
|
|
1963
|
+
type: "person" | "agent" | "api";
|
|
1964
|
+
id: string;
|
|
1965
|
+
};
|
|
1966
|
+
description: string;
|
|
1967
|
+
attributes: {
|
|
1968
|
+
type: string;
|
|
1969
|
+
name: string;
|
|
1970
|
+
label: string;
|
|
1971
|
+
is_required: boolean;
|
|
1972
|
+
is_unique: boolean;
|
|
1973
|
+
options?: Record<string, unknown> | undefined;
|
|
1974
|
+
meta?: unknown;
|
|
1975
|
+
description?: string | undefined;
|
|
1976
|
+
is_read_only?: boolean | undefined;
|
|
1977
|
+
is_nullable?: boolean | undefined;
|
|
1978
|
+
default_value?: unknown;
|
|
1979
|
+
}[];
|
|
1980
|
+
slug: string;
|
|
1981
|
+
is_remote: boolean;
|
|
1982
|
+
module_slug: string;
|
|
1983
|
+
title_template: string;
|
|
1984
|
+
}, {
|
|
1985
|
+
name: string;
|
|
1986
|
+
created_at: string;
|
|
1987
|
+
updated_at: string;
|
|
1988
|
+
created_by: {
|
|
1989
|
+
type: "person" | "agent" | "api";
|
|
1990
|
+
id: string;
|
|
1991
|
+
};
|
|
1992
|
+
updated_by: {
|
|
1993
|
+
type: "person" | "agent" | "api";
|
|
1994
|
+
id: string;
|
|
1995
|
+
};
|
|
1996
|
+
description: string;
|
|
1997
|
+
attributes: {
|
|
1998
|
+
type: string;
|
|
1999
|
+
name: string;
|
|
2000
|
+
label: string;
|
|
2001
|
+
is_required: boolean;
|
|
2002
|
+
is_unique: boolean;
|
|
2003
|
+
options?: Record<string, unknown> | undefined;
|
|
2004
|
+
meta?: unknown;
|
|
2005
|
+
description?: string | undefined;
|
|
2006
|
+
is_read_only?: boolean | undefined;
|
|
2007
|
+
is_nullable?: boolean | undefined;
|
|
2008
|
+
default_value?: unknown;
|
|
2009
|
+
}[];
|
|
2010
|
+
slug: string;
|
|
2011
|
+
is_remote: boolean;
|
|
2012
|
+
module_slug: string;
|
|
2013
|
+
title_template?: string | undefined;
|
|
2014
|
+
}>;
|
|
2015
|
+
/**
|
|
2016
|
+
* Entity with JSON Schema representation.
|
|
2017
|
+
*/
|
|
2018
|
+
interface EntityWithSchema extends Entity {
|
|
2019
|
+
schema: Record<string, unknown>;
|
|
2020
|
+
}
|
|
2021
|
+
declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
2022
|
+
created_at: z.ZodString;
|
|
2023
|
+
updated_at: z.ZodString;
|
|
2024
|
+
created_by: z.ZodObject<{
|
|
2025
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2026
|
+
id: z.ZodString;
|
|
2027
|
+
}, "strip", z.ZodTypeAny, {
|
|
2028
|
+
type: "person" | "agent" | "api";
|
|
2029
|
+
id: string;
|
|
2030
|
+
}, {
|
|
2031
|
+
type: "person" | "agent" | "api";
|
|
2032
|
+
id: string;
|
|
2033
|
+
}>;
|
|
2034
|
+
updated_by: z.ZodObject<{
|
|
2035
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2036
|
+
id: z.ZodString;
|
|
2037
|
+
}, "strip", z.ZodTypeAny, {
|
|
2038
|
+
type: "person" | "agent" | "api";
|
|
2039
|
+
id: string;
|
|
2040
|
+
}, {
|
|
2041
|
+
type: "person" | "agent" | "api";
|
|
2042
|
+
id: string;
|
|
2043
|
+
}>;
|
|
2044
|
+
} & {
|
|
2045
|
+
slug: z.ZodString;
|
|
2046
|
+
name: z.ZodString;
|
|
2047
|
+
description: z.ZodString;
|
|
2048
|
+
is_remote: z.ZodBoolean;
|
|
2049
|
+
module_slug: z.ZodString;
|
|
2050
|
+
title_template: z.ZodDefault<z.ZodString>;
|
|
2051
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
2052
|
+
name: z.ZodString;
|
|
2053
|
+
type: z.ZodString;
|
|
2054
|
+
label: z.ZodString;
|
|
2055
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2056
|
+
is_required: z.ZodBoolean;
|
|
2057
|
+
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
2058
|
+
is_unique: z.ZodBoolean;
|
|
2059
|
+
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
2060
|
+
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
2061
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
2062
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2063
|
+
}, "strip", z.ZodTypeAny, {
|
|
2064
|
+
type: string;
|
|
2065
|
+
name: string;
|
|
2066
|
+
label: string;
|
|
2067
|
+
is_required: boolean;
|
|
2068
|
+
is_unique: boolean;
|
|
2069
|
+
options?: Record<string, unknown> | undefined;
|
|
2070
|
+
meta?: unknown;
|
|
2071
|
+
description?: string | undefined;
|
|
2072
|
+
is_read_only?: boolean | undefined;
|
|
2073
|
+
is_nullable?: boolean | undefined;
|
|
2074
|
+
default_value?: unknown;
|
|
2075
|
+
}, {
|
|
2076
|
+
type: string;
|
|
2077
|
+
name: string;
|
|
2078
|
+
label: string;
|
|
2079
|
+
is_required: boolean;
|
|
2080
|
+
is_unique: boolean;
|
|
2081
|
+
options?: Record<string, unknown> | undefined;
|
|
2082
|
+
meta?: unknown;
|
|
2083
|
+
description?: string | undefined;
|
|
2084
|
+
is_read_only?: boolean | undefined;
|
|
2085
|
+
is_nullable?: boolean | undefined;
|
|
2086
|
+
default_value?: unknown;
|
|
2087
|
+
}>, "many">;
|
|
2088
|
+
} & {
|
|
2089
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2090
|
+
}, "strip", z.ZodTypeAny, {
|
|
2091
|
+
name: string;
|
|
2092
|
+
created_at: string;
|
|
2093
|
+
updated_at: string;
|
|
2094
|
+
created_by: {
|
|
2095
|
+
type: "person" | "agent" | "api";
|
|
2096
|
+
id: string;
|
|
2097
|
+
};
|
|
2098
|
+
updated_by: {
|
|
2099
|
+
type: "person" | "agent" | "api";
|
|
2100
|
+
id: string;
|
|
2101
|
+
};
|
|
2102
|
+
description: string;
|
|
2103
|
+
attributes: {
|
|
2104
|
+
type: string;
|
|
2105
|
+
name: string;
|
|
2106
|
+
label: string;
|
|
2107
|
+
is_required: boolean;
|
|
2108
|
+
is_unique: boolean;
|
|
2109
|
+
options?: Record<string, unknown> | undefined;
|
|
2110
|
+
meta?: unknown;
|
|
2111
|
+
description?: string | undefined;
|
|
2112
|
+
is_read_only?: boolean | undefined;
|
|
2113
|
+
is_nullable?: boolean | undefined;
|
|
2114
|
+
default_value?: unknown;
|
|
2115
|
+
}[];
|
|
2116
|
+
slug: string;
|
|
2117
|
+
is_remote: boolean;
|
|
2118
|
+
module_slug: string;
|
|
2119
|
+
title_template: string;
|
|
2120
|
+
schema: Record<string, unknown>;
|
|
2121
|
+
}, {
|
|
2122
|
+
name: string;
|
|
2123
|
+
created_at: string;
|
|
2124
|
+
updated_at: string;
|
|
2125
|
+
created_by: {
|
|
2126
|
+
type: "person" | "agent" | "api";
|
|
2127
|
+
id: string;
|
|
2128
|
+
};
|
|
2129
|
+
updated_by: {
|
|
2130
|
+
type: "person" | "agent" | "api";
|
|
2131
|
+
id: string;
|
|
2132
|
+
};
|
|
2133
|
+
description: string;
|
|
2134
|
+
attributes: {
|
|
2135
|
+
type: string;
|
|
2136
|
+
name: string;
|
|
2137
|
+
label: string;
|
|
2138
|
+
is_required: boolean;
|
|
2139
|
+
is_unique: boolean;
|
|
2140
|
+
options?: Record<string, unknown> | undefined;
|
|
2141
|
+
meta?: unknown;
|
|
2142
|
+
description?: string | undefined;
|
|
2143
|
+
is_read_only?: boolean | undefined;
|
|
2144
|
+
is_nullable?: boolean | undefined;
|
|
2145
|
+
default_value?: unknown;
|
|
2146
|
+
}[];
|
|
2147
|
+
slug: string;
|
|
2148
|
+
is_remote: boolean;
|
|
2149
|
+
module_slug: string;
|
|
2150
|
+
schema: Record<string, unknown>;
|
|
2151
|
+
title_template?: string | undefined;
|
|
2152
|
+
}>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Options for listing entities.
|
|
2155
|
+
*/
|
|
2156
|
+
interface ListEntitiesOptions extends MetaListOptions {
|
|
2157
|
+
slug?: string;
|
|
2158
|
+
name?: string;
|
|
2159
|
+
is_remote?: boolean;
|
|
2160
|
+
module_slug?: string;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Request to create an entity.
|
|
2164
|
+
*/
|
|
2165
|
+
interface CreateEntityRequest {
|
|
2166
|
+
slug: string;
|
|
2167
|
+
name: string;
|
|
2168
|
+
is_remote: boolean;
|
|
2169
|
+
module_slug: string;
|
|
2170
|
+
description: string;
|
|
2171
|
+
title_template?: string;
|
|
2172
|
+
attributes: Attribute[];
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Request to update an entity.
|
|
2176
|
+
*/
|
|
2177
|
+
interface UpdateEntityRequest {
|
|
2178
|
+
name?: string;
|
|
2179
|
+
is_remote?: boolean;
|
|
2180
|
+
module_slug?: string;
|
|
2181
|
+
description?: string;
|
|
2182
|
+
title_template?: string;
|
|
2183
|
+
attributes?: Attribute[];
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Module deployment status.
|
|
2187
|
+
*/
|
|
2188
|
+
type ModuleStatus = 'pending' | 'deploying' | 'active' | 'failed' | 'deactivating' | 'inactive';
|
|
2189
|
+
/**
|
|
2190
|
+
* Module definition.
|
|
2191
|
+
*/
|
|
2192
|
+
interface Module extends AuditFields {
|
|
2193
|
+
slug: string;
|
|
2194
|
+
org_id: string;
|
|
2195
|
+
name: string;
|
|
2196
|
+
description: string;
|
|
2197
|
+
version: string;
|
|
2198
|
+
file_id: string;
|
|
2199
|
+
status: ModuleStatus;
|
|
2200
|
+
status_details: string;
|
|
2201
|
+
is_deactivated: boolean;
|
|
2202
|
+
}
|
|
2203
|
+
declare const ModuleSchema: z.ZodObject<{
|
|
2204
|
+
created_at: z.ZodString;
|
|
2205
|
+
updated_at: z.ZodString;
|
|
2206
|
+
created_by: z.ZodObject<{
|
|
2207
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2208
|
+
id: z.ZodString;
|
|
2209
|
+
}, "strip", z.ZodTypeAny, {
|
|
2210
|
+
type: "person" | "agent" | "api";
|
|
2211
|
+
id: string;
|
|
2212
|
+
}, {
|
|
2213
|
+
type: "person" | "agent" | "api";
|
|
2214
|
+
id: string;
|
|
2215
|
+
}>;
|
|
2216
|
+
updated_by: z.ZodObject<{
|
|
2217
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2218
|
+
id: z.ZodString;
|
|
2219
|
+
}, "strip", z.ZodTypeAny, {
|
|
2220
|
+
type: "person" | "agent" | "api";
|
|
2221
|
+
id: string;
|
|
2222
|
+
}, {
|
|
2223
|
+
type: "person" | "agent" | "api";
|
|
2224
|
+
id: string;
|
|
2225
|
+
}>;
|
|
2226
|
+
} & {
|
|
2227
|
+
slug: z.ZodString;
|
|
2228
|
+
name: z.ZodString;
|
|
2229
|
+
description: z.ZodString;
|
|
2230
|
+
version: z.ZodString;
|
|
2231
|
+
file_id: z.ZodString;
|
|
2232
|
+
status: z.ZodEnum<["pending", "deploying", "active", "failed", "deactivating", "inactive"]>;
|
|
2233
|
+
status_details: z.ZodString;
|
|
2234
|
+
is_deactivated: z.ZodBoolean;
|
|
2235
|
+
}, "strip", z.ZodTypeAny, {
|
|
2236
|
+
status: "pending" | "deploying" | "active" | "failed" | "deactivating" | "inactive";
|
|
2237
|
+
name: string;
|
|
2238
|
+
created_at: string;
|
|
2239
|
+
updated_at: string;
|
|
2240
|
+
created_by: {
|
|
2241
|
+
type: "person" | "agent" | "api";
|
|
2242
|
+
id: string;
|
|
2243
|
+
};
|
|
2244
|
+
updated_by: {
|
|
2245
|
+
type: "person" | "agent" | "api";
|
|
2246
|
+
id: string;
|
|
2247
|
+
};
|
|
2248
|
+
description: string;
|
|
2249
|
+
version: string;
|
|
2250
|
+
slug: string;
|
|
2251
|
+
file_id: string;
|
|
2252
|
+
status_details: string;
|
|
2253
|
+
is_deactivated: boolean;
|
|
2254
|
+
}, {
|
|
2255
|
+
status: "pending" | "deploying" | "active" | "failed" | "deactivating" | "inactive";
|
|
2256
|
+
name: string;
|
|
2257
|
+
created_at: string;
|
|
2258
|
+
updated_at: string;
|
|
2259
|
+
created_by: {
|
|
2260
|
+
type: "person" | "agent" | "api";
|
|
2261
|
+
id: string;
|
|
2262
|
+
};
|
|
2263
|
+
updated_by: {
|
|
2264
|
+
type: "person" | "agent" | "api";
|
|
2265
|
+
id: string;
|
|
2266
|
+
};
|
|
2267
|
+
description: string;
|
|
2268
|
+
version: string;
|
|
2269
|
+
slug: string;
|
|
2270
|
+
file_id: string;
|
|
2271
|
+
status_details: string;
|
|
2272
|
+
is_deactivated: boolean;
|
|
2273
|
+
}>;
|
|
2274
|
+
/**
|
|
2275
|
+
* Options for listing modules.
|
|
2276
|
+
*/
|
|
2277
|
+
interface ListModulesOptions extends MetaListOptions {
|
|
2278
|
+
slug?: string;
|
|
2279
|
+
name?: string;
|
|
2280
|
+
is_deactivated?: boolean;
|
|
2281
|
+
file_id?: string;
|
|
2282
|
+
status?: ModuleStatus;
|
|
2283
|
+
version?: string;
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Request to deploy a module.
|
|
2287
|
+
*/
|
|
2288
|
+
interface DeployModuleRequest {
|
|
2289
|
+
slug: string;
|
|
2290
|
+
version: string;
|
|
2291
|
+
name: string;
|
|
2292
|
+
description: string;
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Configuration/secret variable.
|
|
2296
|
+
*/
|
|
2297
|
+
interface Variable extends AuditFields {
|
|
2298
|
+
id: string;
|
|
2299
|
+
org_id: string;
|
|
2300
|
+
key: string;
|
|
2301
|
+
value: string;
|
|
2302
|
+
is_secret: boolean;
|
|
2303
|
+
module: string;
|
|
2304
|
+
}
|
|
2305
|
+
declare const VariableSchema: z.ZodObject<{
|
|
2306
|
+
created_at: z.ZodString;
|
|
2307
|
+
updated_at: z.ZodString;
|
|
2308
|
+
created_by: z.ZodObject<{
|
|
2309
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2310
|
+
id: z.ZodString;
|
|
2311
|
+
}, "strip", z.ZodTypeAny, {
|
|
2312
|
+
type: "person" | "agent" | "api";
|
|
2313
|
+
id: string;
|
|
2314
|
+
}, {
|
|
2315
|
+
type: "person" | "agent" | "api";
|
|
2316
|
+
id: string;
|
|
2317
|
+
}>;
|
|
2318
|
+
updated_by: z.ZodObject<{
|
|
2319
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2320
|
+
id: z.ZodString;
|
|
2321
|
+
}, "strip", z.ZodTypeAny, {
|
|
2322
|
+
type: "person" | "agent" | "api";
|
|
2323
|
+
id: string;
|
|
2324
|
+
}, {
|
|
2325
|
+
type: "person" | "agent" | "api";
|
|
2326
|
+
id: string;
|
|
2327
|
+
}>;
|
|
2328
|
+
} & {
|
|
2329
|
+
id: z.ZodString;
|
|
2330
|
+
key: z.ZodString;
|
|
2331
|
+
value: z.ZodString;
|
|
2332
|
+
is_secret: z.ZodBoolean;
|
|
2333
|
+
module: z.ZodString;
|
|
2334
|
+
}, "strip", z.ZodTypeAny, {
|
|
2335
|
+
key: string;
|
|
2336
|
+
value: string;
|
|
2337
|
+
id: string;
|
|
2338
|
+
created_at: string;
|
|
2339
|
+
updated_at: string;
|
|
2340
|
+
created_by: {
|
|
2341
|
+
type: "person" | "agent" | "api";
|
|
2342
|
+
id: string;
|
|
2343
|
+
};
|
|
2344
|
+
updated_by: {
|
|
2345
|
+
type: "person" | "agent" | "api";
|
|
2346
|
+
id: string;
|
|
2347
|
+
};
|
|
2348
|
+
is_secret: boolean;
|
|
2349
|
+
module: string;
|
|
2350
|
+
}, {
|
|
2351
|
+
key: string;
|
|
2352
|
+
value: string;
|
|
2353
|
+
id: string;
|
|
2354
|
+
created_at: string;
|
|
2355
|
+
updated_at: string;
|
|
2356
|
+
created_by: {
|
|
2357
|
+
type: "person" | "agent" | "api";
|
|
2358
|
+
id: string;
|
|
2359
|
+
};
|
|
2360
|
+
updated_by: {
|
|
2361
|
+
type: "person" | "agent" | "api";
|
|
2362
|
+
id: string;
|
|
2363
|
+
};
|
|
2364
|
+
is_secret: boolean;
|
|
2365
|
+
module: string;
|
|
2366
|
+
}>;
|
|
2367
|
+
/**
|
|
2368
|
+
* Options for listing variables.
|
|
2369
|
+
*/
|
|
2370
|
+
interface ListVariablesOptions extends MetaListOptions {
|
|
2371
|
+
id?: string;
|
|
2372
|
+
key?: string;
|
|
2373
|
+
is_secret?: boolean;
|
|
2374
|
+
module?: string;
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Request to create a variable.
|
|
2378
|
+
*/
|
|
2379
|
+
interface CreateVariableRequest {
|
|
2380
|
+
key: string;
|
|
2381
|
+
value: string;
|
|
2382
|
+
is_secret: boolean;
|
|
2383
|
+
module: string;
|
|
2384
|
+
}
|
|
2385
|
+
/**
|
|
2386
|
+
* Request to update a variable.
|
|
2387
|
+
*/
|
|
2388
|
+
interface UpdateVariableRequest {
|
|
2389
|
+
value?: string;
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* UI component definition.
|
|
2393
|
+
* Note: Component uses `slug` as its primary identifier, not `id`.
|
|
2394
|
+
*/
|
|
2395
|
+
interface Component extends AuditFields {
|
|
2396
|
+
slug: string;
|
|
2397
|
+
org_id: string;
|
|
2398
|
+
name: string;
|
|
2399
|
+
description: string;
|
|
2400
|
+
module_slug: string;
|
|
2401
|
+
/** FK to the compiled, single-file ESM bundle in storage. Empty until deployed. Served via {@link ComponentService.bundleUrl}. */
|
|
2402
|
+
bundle_file_id: string;
|
|
2403
|
+
/** FK to a tar.gz of the component source directory in storage (provenance / rebuild). Empty until deployed. */
|
|
2404
|
+
source_file_id: string;
|
|
2405
|
+
/** The component's JSON Schema, driving the page-designer props editor + runtime validation. `null` until set. */
|
|
2406
|
+
props_schema: Record<string, unknown> | null;
|
|
2407
|
+
}
|
|
2408
|
+
declare const ComponentSchema: z.ZodObject<{
|
|
2409
|
+
created_at: z.ZodString;
|
|
2410
|
+
updated_at: z.ZodString;
|
|
2411
|
+
created_by: z.ZodObject<{
|
|
2412
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2413
|
+
id: z.ZodString;
|
|
2414
|
+
}, "strip", z.ZodTypeAny, {
|
|
2415
|
+
type: "person" | "agent" | "api";
|
|
2416
|
+
id: string;
|
|
2417
|
+
}, {
|
|
2418
|
+
type: "person" | "agent" | "api";
|
|
2419
|
+
id: string;
|
|
2420
|
+
}>;
|
|
2421
|
+
updated_by: z.ZodObject<{
|
|
2422
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2423
|
+
id: z.ZodString;
|
|
2424
|
+
}, "strip", z.ZodTypeAny, {
|
|
2425
|
+
type: "person" | "agent" | "api";
|
|
2426
|
+
id: string;
|
|
2427
|
+
}, {
|
|
2428
|
+
type: "person" | "agent" | "api";
|
|
2429
|
+
id: string;
|
|
2430
|
+
}>;
|
|
2431
|
+
} & {
|
|
2432
|
+
slug: z.ZodString;
|
|
2433
|
+
name: z.ZodString;
|
|
2434
|
+
description: z.ZodString;
|
|
2435
|
+
module_slug: z.ZodString;
|
|
2436
|
+
bundle_file_id: z.ZodString;
|
|
2437
|
+
source_file_id: z.ZodString;
|
|
2438
|
+
props_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2439
|
+
}, "strip", z.ZodTypeAny, {
|
|
2440
|
+
name: string;
|
|
2441
|
+
created_at: string;
|
|
2442
|
+
updated_at: string;
|
|
2443
|
+
created_by: {
|
|
2444
|
+
type: "person" | "agent" | "api";
|
|
2445
|
+
id: string;
|
|
2446
|
+
};
|
|
2447
|
+
updated_by: {
|
|
2448
|
+
type: "person" | "agent" | "api";
|
|
2449
|
+
id: string;
|
|
2450
|
+
};
|
|
2451
|
+
description: string;
|
|
2452
|
+
slug: string;
|
|
2453
|
+
module_slug: string;
|
|
2454
|
+
bundle_file_id: string;
|
|
2455
|
+
source_file_id: string;
|
|
2456
|
+
props_schema: Record<string, unknown> | null;
|
|
2457
|
+
}, {
|
|
2458
|
+
name: string;
|
|
2459
|
+
created_at: string;
|
|
2460
|
+
updated_at: string;
|
|
2461
|
+
created_by: {
|
|
2462
|
+
type: "person" | "agent" | "api";
|
|
2463
|
+
id: string;
|
|
2464
|
+
};
|
|
2465
|
+
updated_by: {
|
|
2466
|
+
type: "person" | "agent" | "api";
|
|
2467
|
+
id: string;
|
|
2468
|
+
};
|
|
2469
|
+
description: string;
|
|
2470
|
+
slug: string;
|
|
2471
|
+
module_slug: string;
|
|
2472
|
+
bundle_file_id: string;
|
|
2473
|
+
source_file_id: string;
|
|
2474
|
+
props_schema: Record<string, unknown> | null;
|
|
2475
|
+
}>;
|
|
2476
|
+
/**
|
|
2477
|
+
* Options for listing components.
|
|
2478
|
+
*/
|
|
2479
|
+
interface ListComponentsOptions extends MetaListOptions {
|
|
2480
|
+
slug?: string;
|
|
2481
|
+
name?: string;
|
|
2482
|
+
module_slug?: string;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Request to create a component.
|
|
2486
|
+
*/
|
|
2487
|
+
interface CreateComponentRequest {
|
|
2488
|
+
slug: string;
|
|
2489
|
+
name: string;
|
|
2490
|
+
module_slug: string;
|
|
2491
|
+
description: string;
|
|
2492
|
+
bundle_file_id?: string;
|
|
2493
|
+
source_file_id?: string;
|
|
2494
|
+
props_schema?: Record<string, unknown>;
|
|
2495
|
+
}
|
|
2496
|
+
/**
|
|
2497
|
+
* Request to update a component.
|
|
2498
|
+
*/
|
|
2499
|
+
interface UpdateComponentRequest {
|
|
2500
|
+
name?: string;
|
|
2501
|
+
description?: string;
|
|
2502
|
+
bundle_file_id?: string;
|
|
2503
|
+
source_file_id?: string;
|
|
2504
|
+
props_schema?: Record<string, unknown>;
|
|
2505
|
+
}
|
|
2506
|
+
/**
|
|
2507
|
+
* List column definition.
|
|
2508
|
+
*/
|
|
2509
|
+
interface Column {
|
|
2510
|
+
attribute: string;
|
|
2511
|
+
label: string;
|
|
2512
|
+
width: number;
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* Sort direction.
|
|
2516
|
+
*/
|
|
2517
|
+
type SortDirection = 'asc' | 'desc';
|
|
2518
|
+
/**
|
|
2519
|
+
* Sort configuration.
|
|
2520
|
+
*/
|
|
2521
|
+
interface SortConfig {
|
|
2522
|
+
attribute: string;
|
|
2523
|
+
direction: SortDirection;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
/**
|
|
2527
|
+
* List configuration.
|
|
2528
|
+
* Note: List uses `slug` as its primary identifier, not `id`.
|
|
2529
|
+
*/
|
|
2530
|
+
interface List extends AuditFields {
|
|
2531
|
+
slug: string;
|
|
2532
|
+
org_id: string;
|
|
2533
|
+
module_slug: string;
|
|
2534
|
+
name: string;
|
|
2535
|
+
entity_slug: string;
|
|
2536
|
+
columns: Column[];
|
|
2537
|
+
sorting: SortConfig[];
|
|
2538
|
+
filters: FilterGroup[];
|
|
2539
|
+
}
|
|
2540
|
+
declare const ColumnSchema: z.ZodObject<{
|
|
2541
|
+
attribute: z.ZodString;
|
|
2542
|
+
label: z.ZodString;
|
|
2543
|
+
width: z.ZodNumber;
|
|
2544
|
+
}, "strip", z.ZodTypeAny, {
|
|
2545
|
+
width: number;
|
|
2546
|
+
label: string;
|
|
2547
|
+
attribute: string;
|
|
2548
|
+
}, {
|
|
2549
|
+
width: number;
|
|
2550
|
+
label: string;
|
|
2551
|
+
attribute: string;
|
|
2552
|
+
}>;
|
|
2553
|
+
declare const SortConfigSchema: z.ZodObject<{
|
|
2554
|
+
attribute: z.ZodString;
|
|
2555
|
+
direction: z.ZodEnum<["asc", "desc"]>;
|
|
2556
|
+
}, "strip", z.ZodTypeAny, {
|
|
2557
|
+
attribute: string;
|
|
2558
|
+
direction: "asc" | "desc";
|
|
2559
|
+
}, {
|
|
2560
|
+
attribute: string;
|
|
2561
|
+
direction: "asc" | "desc";
|
|
2562
|
+
}>;
|
|
2563
|
+
declare const ListSchema: z.ZodObject<{
|
|
2564
|
+
created_at: z.ZodString;
|
|
2565
|
+
updated_at: z.ZodString;
|
|
2566
|
+
created_by: z.ZodObject<{
|
|
2567
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2568
|
+
id: z.ZodString;
|
|
2569
|
+
}, "strip", z.ZodTypeAny, {
|
|
2570
|
+
type: "person" | "agent" | "api";
|
|
2571
|
+
id: string;
|
|
2572
|
+
}, {
|
|
2573
|
+
type: "person" | "agent" | "api";
|
|
2574
|
+
id: string;
|
|
2575
|
+
}>;
|
|
2576
|
+
updated_by: z.ZodObject<{
|
|
2577
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2578
|
+
id: z.ZodString;
|
|
2579
|
+
}, "strip", z.ZodTypeAny, {
|
|
2580
|
+
type: "person" | "agent" | "api";
|
|
2581
|
+
id: string;
|
|
2582
|
+
}, {
|
|
2583
|
+
type: "person" | "agent" | "api";
|
|
2584
|
+
id: string;
|
|
2585
|
+
}>;
|
|
2586
|
+
} & {
|
|
2587
|
+
slug: z.ZodString;
|
|
2588
|
+
module_slug: z.ZodString;
|
|
2589
|
+
name: z.ZodString;
|
|
2590
|
+
entity_slug: z.ZodString;
|
|
2591
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
2592
|
+
attribute: z.ZodString;
|
|
2593
|
+
label: z.ZodString;
|
|
2594
|
+
width: z.ZodNumber;
|
|
2595
|
+
}, "strip", z.ZodTypeAny, {
|
|
2596
|
+
width: number;
|
|
2597
|
+
label: string;
|
|
2598
|
+
attribute: string;
|
|
2599
|
+
}, {
|
|
2600
|
+
width: number;
|
|
2601
|
+
label: string;
|
|
2602
|
+
attribute: string;
|
|
2603
|
+
}>, "many">;
|
|
2604
|
+
sorting: z.ZodArray<z.ZodObject<{
|
|
2605
|
+
attribute: z.ZodString;
|
|
2606
|
+
direction: z.ZodEnum<["asc", "desc"]>;
|
|
2607
|
+
}, "strip", z.ZodTypeAny, {
|
|
2608
|
+
attribute: string;
|
|
2609
|
+
direction: "asc" | "desc";
|
|
2610
|
+
}, {
|
|
2611
|
+
attribute: string;
|
|
2612
|
+
direction: "asc" | "desc";
|
|
2613
|
+
}>, "many">;
|
|
2614
|
+
filters: z.ZodArray<z.ZodType<FilterGroup, z.ZodTypeDef, FilterGroup>, "many">;
|
|
2615
|
+
}, "strip", z.ZodTypeAny, {
|
|
2616
|
+
name: string;
|
|
2617
|
+
created_at: string;
|
|
2618
|
+
updated_at: string;
|
|
2619
|
+
created_by: {
|
|
2620
|
+
type: "person" | "agent" | "api";
|
|
2621
|
+
id: string;
|
|
2622
|
+
};
|
|
2623
|
+
updated_by: {
|
|
2624
|
+
type: "person" | "agent" | "api";
|
|
2625
|
+
id: string;
|
|
2626
|
+
};
|
|
2627
|
+
slug: string;
|
|
2628
|
+
module_slug: string;
|
|
2629
|
+
entity_slug: string;
|
|
2630
|
+
columns: {
|
|
2631
|
+
width: number;
|
|
2632
|
+
label: string;
|
|
2633
|
+
attribute: string;
|
|
2634
|
+
}[];
|
|
2635
|
+
sorting: {
|
|
2636
|
+
attribute: string;
|
|
2637
|
+
direction: "asc" | "desc";
|
|
2638
|
+
}[];
|
|
2639
|
+
filters: FilterGroup[];
|
|
2640
|
+
}, {
|
|
2641
|
+
name: string;
|
|
2642
|
+
created_at: string;
|
|
2643
|
+
updated_at: string;
|
|
2644
|
+
created_by: {
|
|
2645
|
+
type: "person" | "agent" | "api";
|
|
2646
|
+
id: string;
|
|
2647
|
+
};
|
|
2648
|
+
updated_by: {
|
|
2649
|
+
type: "person" | "agent" | "api";
|
|
2650
|
+
id: string;
|
|
2651
|
+
};
|
|
2652
|
+
slug: string;
|
|
2653
|
+
module_slug: string;
|
|
2654
|
+
entity_slug: string;
|
|
2655
|
+
columns: {
|
|
2656
|
+
width: number;
|
|
2657
|
+
label: string;
|
|
2658
|
+
attribute: string;
|
|
2659
|
+
}[];
|
|
2660
|
+
sorting: {
|
|
2661
|
+
attribute: string;
|
|
2662
|
+
direction: "asc" | "desc";
|
|
2663
|
+
}[];
|
|
2664
|
+
filters: FilterGroup[];
|
|
2665
|
+
}>;
|
|
2666
|
+
/**
|
|
2667
|
+
* Options for listing lists.
|
|
2668
|
+
*/
|
|
2669
|
+
interface ListListsOptions extends MetaListOptions {
|
|
2670
|
+
slug?: string;
|
|
2671
|
+
name?: string;
|
|
2672
|
+
module_slug?: string;
|
|
2673
|
+
entity_slug?: string;
|
|
2674
|
+
}
|
|
2675
|
+
/**
|
|
2676
|
+
* Request to create a list.
|
|
2677
|
+
*/
|
|
2678
|
+
interface CreateListRequest {
|
|
2679
|
+
slug: string;
|
|
2680
|
+
module_slug?: string;
|
|
2681
|
+
entity_slug: string;
|
|
2682
|
+
name: string;
|
|
2683
|
+
columns: Column[];
|
|
2684
|
+
sorting: SortConfig[];
|
|
2685
|
+
filters: FilterGroup[];
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* Request to update a list.
|
|
2689
|
+
*/
|
|
2690
|
+
interface UpdateListRequest {
|
|
2691
|
+
name?: string;
|
|
2692
|
+
module_slug?: string;
|
|
2693
|
+
columns?: Column[];
|
|
2694
|
+
sorting?: SortConfig[];
|
|
2695
|
+
filters?: FilterGroup[];
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* List view configuration.
|
|
2699
|
+
* Note: ListView uses `slug` as its primary identifier, not `id`.
|
|
2700
|
+
*/
|
|
2701
|
+
interface ListView extends AuditFields {
|
|
2702
|
+
slug: string;
|
|
2703
|
+
org_id: string;
|
|
2704
|
+
module_slug: string;
|
|
2705
|
+
list_slug: string;
|
|
2706
|
+
name: string;
|
|
2707
|
+
columns: Column[];
|
|
2708
|
+
sorting: SortConfig[];
|
|
2709
|
+
filters: FilterGroup[];
|
|
2710
|
+
}
|
|
2711
|
+
declare const ListViewSchema: z.ZodObject<{
|
|
2712
|
+
created_at: z.ZodString;
|
|
2713
|
+
updated_at: z.ZodString;
|
|
2714
|
+
created_by: z.ZodObject<{
|
|
2715
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2716
|
+
id: z.ZodString;
|
|
2717
|
+
}, "strip", z.ZodTypeAny, {
|
|
2718
|
+
type: "person" | "agent" | "api";
|
|
2719
|
+
id: string;
|
|
2720
|
+
}, {
|
|
2721
|
+
type: "person" | "agent" | "api";
|
|
2722
|
+
id: string;
|
|
2723
|
+
}>;
|
|
2724
|
+
updated_by: z.ZodObject<{
|
|
2725
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2726
|
+
id: z.ZodString;
|
|
2727
|
+
}, "strip", z.ZodTypeAny, {
|
|
2728
|
+
type: "person" | "agent" | "api";
|
|
2729
|
+
id: string;
|
|
2730
|
+
}, {
|
|
2731
|
+
type: "person" | "agent" | "api";
|
|
2732
|
+
id: string;
|
|
2733
|
+
}>;
|
|
2734
|
+
} & {
|
|
2735
|
+
slug: z.ZodString;
|
|
2736
|
+
module_slug: z.ZodString;
|
|
2737
|
+
list_slug: z.ZodString;
|
|
2738
|
+
name: z.ZodString;
|
|
2739
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
2740
|
+
attribute: z.ZodString;
|
|
2741
|
+
label: z.ZodString;
|
|
2742
|
+
width: z.ZodNumber;
|
|
2743
|
+
}, "strip", z.ZodTypeAny, {
|
|
2744
|
+
width: number;
|
|
2745
|
+
label: string;
|
|
2746
|
+
attribute: string;
|
|
2747
|
+
}, {
|
|
2748
|
+
width: number;
|
|
2749
|
+
label: string;
|
|
2750
|
+
attribute: string;
|
|
2751
|
+
}>, "many">;
|
|
2752
|
+
sorting: z.ZodArray<z.ZodObject<{
|
|
2753
|
+
attribute: z.ZodString;
|
|
2754
|
+
direction: z.ZodEnum<["asc", "desc"]>;
|
|
2755
|
+
}, "strip", z.ZodTypeAny, {
|
|
2756
|
+
attribute: string;
|
|
2757
|
+
direction: "asc" | "desc";
|
|
2758
|
+
}, {
|
|
2759
|
+
attribute: string;
|
|
2760
|
+
direction: "asc" | "desc";
|
|
2761
|
+
}>, "many">;
|
|
2762
|
+
filters: z.ZodArray<z.ZodType<FilterGroup, z.ZodTypeDef, FilterGroup>, "many">;
|
|
2763
|
+
}, "strip", z.ZodTypeAny, {
|
|
2764
|
+
name: string;
|
|
2765
|
+
created_at: string;
|
|
2766
|
+
updated_at: string;
|
|
2767
|
+
created_by: {
|
|
2768
|
+
type: "person" | "agent" | "api";
|
|
2769
|
+
id: string;
|
|
2770
|
+
};
|
|
2771
|
+
updated_by: {
|
|
2772
|
+
type: "person" | "agent" | "api";
|
|
2773
|
+
id: string;
|
|
2774
|
+
};
|
|
2775
|
+
list_slug: string;
|
|
2776
|
+
slug: string;
|
|
2777
|
+
module_slug: string;
|
|
2778
|
+
columns: {
|
|
2779
|
+
width: number;
|
|
2780
|
+
label: string;
|
|
2781
|
+
attribute: string;
|
|
2782
|
+
}[];
|
|
2783
|
+
sorting: {
|
|
2784
|
+
attribute: string;
|
|
2785
|
+
direction: "asc" | "desc";
|
|
2786
|
+
}[];
|
|
2787
|
+
filters: FilterGroup[];
|
|
2788
|
+
}, {
|
|
2789
|
+
name: string;
|
|
2790
|
+
created_at: string;
|
|
2791
|
+
updated_at: string;
|
|
2792
|
+
created_by: {
|
|
2793
|
+
type: "person" | "agent" | "api";
|
|
2794
|
+
id: string;
|
|
2795
|
+
};
|
|
2796
|
+
updated_by: {
|
|
2797
|
+
type: "person" | "agent" | "api";
|
|
2798
|
+
id: string;
|
|
2799
|
+
};
|
|
2800
|
+
list_slug: string;
|
|
2801
|
+
slug: string;
|
|
2802
|
+
module_slug: string;
|
|
2803
|
+
columns: {
|
|
2804
|
+
width: number;
|
|
2805
|
+
label: string;
|
|
2806
|
+
attribute: string;
|
|
2807
|
+
}[];
|
|
2808
|
+
sorting: {
|
|
2809
|
+
attribute: string;
|
|
2810
|
+
direction: "asc" | "desc";
|
|
2811
|
+
}[];
|
|
2812
|
+
filters: FilterGroup[];
|
|
2813
|
+
}>;
|
|
2814
|
+
/**
|
|
2815
|
+
* Options for listing list views.
|
|
2816
|
+
*/
|
|
2817
|
+
interface ListListViewsOptions extends MetaListOptions {
|
|
2818
|
+
slug?: string;
|
|
2819
|
+
name?: string;
|
|
2820
|
+
module_slug?: string;
|
|
2821
|
+
list_slug?: string;
|
|
2822
|
+
}
|
|
2823
|
+
/**
|
|
2824
|
+
* Request to create a list view.
|
|
2825
|
+
*/
|
|
2826
|
+
interface CreateListViewRequest {
|
|
2827
|
+
slug: string;
|
|
2828
|
+
module_slug?: string;
|
|
2829
|
+
list_slug: string;
|
|
2830
|
+
name: string;
|
|
2831
|
+
columns: Column[];
|
|
2832
|
+
sorting?: SortConfig[];
|
|
2833
|
+
filters?: FilterGroup[];
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* Request to update a list view.
|
|
2837
|
+
*/
|
|
2838
|
+
interface UpdateListViewRequest {
|
|
2839
|
+
name?: string;
|
|
2840
|
+
module_slug?: string;
|
|
2841
|
+
columns?: Column[];
|
|
2842
|
+
sorting?: SortConfig[];
|
|
2843
|
+
filters?: FilterGroup[];
|
|
2844
|
+
}
|
|
2845
|
+
/**
|
|
2846
|
+
* Page action definition. Page-level toolbar item; addressed by permissions
|
|
2847
|
+
* and shortcuts systems.
|
|
2848
|
+
*/
|
|
2849
|
+
interface PageAction {
|
|
2850
|
+
label: string;
|
|
2851
|
+
icon: string;
|
|
2852
|
+
action: string;
|
|
2853
|
+
}
|
|
2854
|
+
declare const PageActionSchema: z.ZodObject<{
|
|
2855
|
+
label: z.ZodString;
|
|
2856
|
+
icon: z.ZodString;
|
|
2857
|
+
action: z.ZodString;
|
|
2858
|
+
}, "strip", z.ZodTypeAny, {
|
|
2859
|
+
label: string;
|
|
2860
|
+
icon: string;
|
|
2861
|
+
action: string;
|
|
2862
|
+
}, {
|
|
2863
|
+
label: string;
|
|
2864
|
+
icon: string;
|
|
2865
|
+
action: string;
|
|
2866
|
+
}>;
|
|
2867
|
+
/**
|
|
2868
|
+
* Page type. `record` pages render against a single record of `entity_slug`;
|
|
2869
|
+
* `platform` pages are standalone (no record context — e.g. a dashboard
|
|
2870
|
+
* launched from a menu item). `external` is reserved for a future chromeless
|
|
2871
|
+
* variant and is not yet accepted by the API.
|
|
2872
|
+
*/
|
|
2873
|
+
type PageType = 'record' | 'platform';
|
|
2874
|
+
/**
|
|
2875
|
+
* Page configuration. A `record` page is the detail-page shape for a single
|
|
2876
|
+
* entity; a `platform` page is standalone (no entity, no record).
|
|
2877
|
+
*
|
|
2878
|
+
* `layout` is a typed tree of LayoutElements (see `./layout`). The legacy
|
|
2879
|
+
* `mainContent` / `side_panel` / `formLayout` shape was replaced in the
|
|
2880
|
+
* v1 PageLayout design.
|
|
2881
|
+
*/
|
|
2882
|
+
interface Page extends AuditFields {
|
|
2883
|
+
slug: string;
|
|
2884
|
+
name: string;
|
|
2885
|
+
module_slug: string;
|
|
2886
|
+
type: PageType;
|
|
2887
|
+
/** Required for `record` pages; absent on `platform` pages. */
|
|
2888
|
+
entity_slug?: string;
|
|
2889
|
+
actions: PageAction[];
|
|
2890
|
+
layout: PageLayout;
|
|
2891
|
+
}
|
|
2892
|
+
declare const PageSchema: z.ZodObject<{
|
|
2893
|
+
created_at: z.ZodString;
|
|
2894
|
+
updated_at: z.ZodString;
|
|
2895
|
+
created_by: z.ZodObject<{
|
|
2896
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2897
|
+
id: z.ZodString;
|
|
2898
|
+
}, "strip", z.ZodTypeAny, {
|
|
2899
|
+
type: "person" | "agent" | "api";
|
|
2900
|
+
id: string;
|
|
2901
|
+
}, {
|
|
2902
|
+
type: "person" | "agent" | "api";
|
|
2903
|
+
id: string;
|
|
2904
|
+
}>;
|
|
2905
|
+
updated_by: z.ZodObject<{
|
|
2906
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
2907
|
+
id: z.ZodString;
|
|
2908
|
+
}, "strip", z.ZodTypeAny, {
|
|
2909
|
+
type: "person" | "agent" | "api";
|
|
2910
|
+
id: string;
|
|
2911
|
+
}, {
|
|
2912
|
+
type: "person" | "agent" | "api";
|
|
2913
|
+
id: string;
|
|
2914
|
+
}>;
|
|
2915
|
+
} & {
|
|
2916
|
+
slug: z.ZodString;
|
|
2917
|
+
name: z.ZodString;
|
|
2918
|
+
module_slug: z.ZodString;
|
|
2919
|
+
type: z.ZodEnum<["record", "platform"]>;
|
|
2920
|
+
entity_slug: z.ZodOptional<z.ZodString>;
|
|
2921
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
2922
|
+
label: z.ZodString;
|
|
2923
|
+
icon: z.ZodString;
|
|
2924
|
+
action: z.ZodString;
|
|
2925
|
+
}, "strip", z.ZodTypeAny, {
|
|
2926
|
+
label: string;
|
|
2927
|
+
icon: string;
|
|
2928
|
+
action: string;
|
|
2929
|
+
}, {
|
|
2930
|
+
label: string;
|
|
2931
|
+
icon: string;
|
|
2932
|
+
action: string;
|
|
2933
|
+
}>, "many">;
|
|
2934
|
+
layout: z.ZodObject<{
|
|
2935
|
+
version: z.ZodLiteral<1>;
|
|
2936
|
+
main: z.ZodType<LayoutElement, z.ZodTypeDef, LayoutElement>;
|
|
2937
|
+
side_panel: z.ZodOptional<z.ZodObject<{
|
|
2938
|
+
width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
2939
|
+
is_sticky: z.ZodOptional<z.ZodBoolean>;
|
|
2940
|
+
content: z.ZodType<LayoutElement, z.ZodTypeDef, LayoutElement>;
|
|
2941
|
+
}, "strip", z.ZodTypeAny, {
|
|
2942
|
+
content: LayoutElement;
|
|
2943
|
+
width?: SizeValue | undefined;
|
|
2944
|
+
is_sticky?: boolean | undefined;
|
|
2945
|
+
}, {
|
|
2946
|
+
content: LayoutElement;
|
|
2947
|
+
width?: SizeValue | undefined;
|
|
2948
|
+
is_sticky?: boolean | undefined;
|
|
2949
|
+
}>>;
|
|
2950
|
+
}, "strip", z.ZodTypeAny, {
|
|
2951
|
+
version: 1;
|
|
2952
|
+
main: LayoutElement;
|
|
2953
|
+
side_panel?: {
|
|
2954
|
+
content: LayoutElement;
|
|
2955
|
+
width?: SizeValue | undefined;
|
|
2956
|
+
is_sticky?: boolean | undefined;
|
|
2957
|
+
} | undefined;
|
|
2958
|
+
}, {
|
|
2959
|
+
version: 1;
|
|
2960
|
+
main: LayoutElement;
|
|
2961
|
+
side_panel?: {
|
|
2962
|
+
content: LayoutElement;
|
|
2963
|
+
width?: SizeValue | undefined;
|
|
2964
|
+
is_sticky?: boolean | undefined;
|
|
2965
|
+
} | undefined;
|
|
2966
|
+
}>;
|
|
2967
|
+
}, "strip", z.ZodTypeAny, {
|
|
2968
|
+
type: "platform" | "record";
|
|
2969
|
+
name: string;
|
|
2970
|
+
created_at: string;
|
|
2971
|
+
updated_at: string;
|
|
2972
|
+
created_by: {
|
|
2973
|
+
type: "person" | "agent" | "api";
|
|
2974
|
+
id: string;
|
|
2975
|
+
};
|
|
2976
|
+
updated_by: {
|
|
2977
|
+
type: "person" | "agent" | "api";
|
|
2978
|
+
id: string;
|
|
2979
|
+
};
|
|
2980
|
+
slug: string;
|
|
2981
|
+
module_slug: string;
|
|
2982
|
+
actions: {
|
|
2983
|
+
label: string;
|
|
2984
|
+
icon: string;
|
|
2985
|
+
action: string;
|
|
2986
|
+
}[];
|
|
2987
|
+
layout: {
|
|
2988
|
+
version: 1;
|
|
2989
|
+
main: LayoutElement;
|
|
2990
|
+
side_panel?: {
|
|
2991
|
+
content: LayoutElement;
|
|
2992
|
+
width?: SizeValue | undefined;
|
|
2993
|
+
is_sticky?: boolean | undefined;
|
|
2994
|
+
} | undefined;
|
|
2995
|
+
};
|
|
2996
|
+
entity_slug?: string | undefined;
|
|
2997
|
+
}, {
|
|
2998
|
+
type: "platform" | "record";
|
|
2999
|
+
name: string;
|
|
3000
|
+
created_at: string;
|
|
3001
|
+
updated_at: string;
|
|
3002
|
+
created_by: {
|
|
3003
|
+
type: "person" | "agent" | "api";
|
|
3004
|
+
id: string;
|
|
3005
|
+
};
|
|
3006
|
+
updated_by: {
|
|
3007
|
+
type: "person" | "agent" | "api";
|
|
3008
|
+
id: string;
|
|
3009
|
+
};
|
|
3010
|
+
slug: string;
|
|
3011
|
+
module_slug: string;
|
|
3012
|
+
actions: {
|
|
3013
|
+
label: string;
|
|
3014
|
+
icon: string;
|
|
3015
|
+
action: string;
|
|
3016
|
+
}[];
|
|
3017
|
+
layout: {
|
|
3018
|
+
version: 1;
|
|
3019
|
+
main: LayoutElement;
|
|
3020
|
+
side_panel?: {
|
|
3021
|
+
content: LayoutElement;
|
|
3022
|
+
width?: SizeValue | undefined;
|
|
3023
|
+
is_sticky?: boolean | undefined;
|
|
3024
|
+
} | undefined;
|
|
3025
|
+
};
|
|
3026
|
+
entity_slug?: string | undefined;
|
|
3027
|
+
}>;
|
|
3028
|
+
/**
|
|
3029
|
+
* Options for listing pages.
|
|
3030
|
+
*/
|
|
3031
|
+
interface ListPagesOptions extends MetaListOptions {
|
|
3032
|
+
slug?: string;
|
|
3033
|
+
name?: string;
|
|
3034
|
+
module_slug?: string;
|
|
3035
|
+
type?: PageType;
|
|
3036
|
+
entity_slug?: string;
|
|
3037
|
+
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Request to create a page. `type` defaults to `record` when omitted.
|
|
3040
|
+
* `entity_slug` is required for record pages and must be absent for platform
|
|
3041
|
+
* pages.
|
|
3042
|
+
*/
|
|
3043
|
+
interface CreatePageRequest {
|
|
3044
|
+
slug: string;
|
|
3045
|
+
name: string;
|
|
3046
|
+
module_slug?: string;
|
|
3047
|
+
type?: PageType;
|
|
3048
|
+
entity_slug?: string;
|
|
3049
|
+
actions: PageAction[];
|
|
3050
|
+
layout: PageLayout;
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* Request to update a page. Layout, when present, must be a complete valid
|
|
3054
|
+
* tree — partial / element-level patches are not supported.
|
|
3055
|
+
*/
|
|
3056
|
+
interface UpdatePageRequest {
|
|
3057
|
+
name?: string;
|
|
3058
|
+
module_slug?: string;
|
|
3059
|
+
actions?: PageAction[];
|
|
3060
|
+
layout?: PageLayout;
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Menu item type values. Use as both enum-like constant and type union.
|
|
3064
|
+
*/
|
|
3065
|
+
declare const MenuItemType: {
|
|
3066
|
+
readonly Link: "link";
|
|
3067
|
+
readonly Group: "group";
|
|
3068
|
+
readonly Entity: "entity";
|
|
3069
|
+
readonly Page: "page";
|
|
3070
|
+
readonly List: "list";
|
|
3071
|
+
};
|
|
3072
|
+
type MenuItemType = (typeof MenuItemType)[keyof typeof MenuItemType];
|
|
3073
|
+
/**
|
|
3074
|
+
* Menu item definition. Matches the backend JSON shape for nested menus.
|
|
3075
|
+
*/
|
|
3076
|
+
interface MenuItem {
|
|
3077
|
+
id: string;
|
|
3078
|
+
order: number;
|
|
3079
|
+
label: string;
|
|
3080
|
+
type: MenuItemType;
|
|
3081
|
+
icon: string;
|
|
3082
|
+
reference?: string;
|
|
3083
|
+
children: MenuItem[] | null;
|
|
3084
|
+
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Menu configuration.
|
|
3087
|
+
*/
|
|
3088
|
+
interface MenuConfiguration extends AuditFields {
|
|
3089
|
+
slug: string;
|
|
3090
|
+
name: string;
|
|
3091
|
+
module_slug: string;
|
|
3092
|
+
app_slug: string;
|
|
3093
|
+
items: MenuItem[];
|
|
3094
|
+
is_default: boolean;
|
|
3095
|
+
}
|
|
3096
|
+
declare const MenuItemSchema: z.ZodType<MenuItem>;
|
|
3097
|
+
declare const MenuConfigurationSchema: z.ZodObject<{
|
|
3098
|
+
created_at: z.ZodString;
|
|
3099
|
+
updated_at: z.ZodString;
|
|
3100
|
+
created_by: z.ZodObject<{
|
|
3101
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3102
|
+
id: z.ZodString;
|
|
3103
|
+
}, "strip", z.ZodTypeAny, {
|
|
3104
|
+
type: "person" | "agent" | "api";
|
|
3105
|
+
id: string;
|
|
3106
|
+
}, {
|
|
3107
|
+
type: "person" | "agent" | "api";
|
|
3108
|
+
id: string;
|
|
3109
|
+
}>;
|
|
3110
|
+
updated_by: z.ZodObject<{
|
|
3111
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3112
|
+
id: z.ZodString;
|
|
3113
|
+
}, "strip", z.ZodTypeAny, {
|
|
3114
|
+
type: "person" | "agent" | "api";
|
|
3115
|
+
id: string;
|
|
3116
|
+
}, {
|
|
3117
|
+
type: "person" | "agent" | "api";
|
|
3118
|
+
id: string;
|
|
3119
|
+
}>;
|
|
3120
|
+
} & {
|
|
3121
|
+
slug: z.ZodString;
|
|
3122
|
+
name: z.ZodString;
|
|
3123
|
+
module_slug: z.ZodString;
|
|
3124
|
+
app_slug: z.ZodString;
|
|
3125
|
+
items: z.ZodArray<z.ZodType<MenuItem, z.ZodTypeDef, MenuItem>, "many">;
|
|
3126
|
+
is_default: z.ZodBoolean;
|
|
3127
|
+
}, "strip", z.ZodTypeAny, {
|
|
3128
|
+
name: string;
|
|
3129
|
+
created_at: string;
|
|
3130
|
+
updated_at: string;
|
|
3131
|
+
created_by: {
|
|
3132
|
+
type: "person" | "agent" | "api";
|
|
3133
|
+
id: string;
|
|
3134
|
+
};
|
|
3135
|
+
updated_by: {
|
|
3136
|
+
type: "person" | "agent" | "api";
|
|
3137
|
+
id: string;
|
|
3138
|
+
};
|
|
3139
|
+
items: MenuItem[];
|
|
3140
|
+
slug: string;
|
|
3141
|
+
module_slug: string;
|
|
3142
|
+
app_slug: string;
|
|
3143
|
+
is_default: boolean;
|
|
3144
|
+
}, {
|
|
3145
|
+
name: string;
|
|
3146
|
+
created_at: string;
|
|
3147
|
+
updated_at: string;
|
|
3148
|
+
created_by: {
|
|
3149
|
+
type: "person" | "agent" | "api";
|
|
3150
|
+
id: string;
|
|
3151
|
+
};
|
|
3152
|
+
updated_by: {
|
|
3153
|
+
type: "person" | "agent" | "api";
|
|
3154
|
+
id: string;
|
|
3155
|
+
};
|
|
3156
|
+
items: MenuItem[];
|
|
3157
|
+
slug: string;
|
|
3158
|
+
module_slug: string;
|
|
3159
|
+
app_slug: string;
|
|
3160
|
+
is_default: boolean;
|
|
3161
|
+
}>;
|
|
3162
|
+
/**
|
|
3163
|
+
* Options for listing menu configurations.
|
|
3164
|
+
*/
|
|
3165
|
+
interface ListMenuConfigurationsOptions extends MetaListOptions {
|
|
3166
|
+
slug?: string;
|
|
3167
|
+
name?: string;
|
|
3168
|
+
module_slug?: string;
|
|
3169
|
+
app_slug?: string;
|
|
3170
|
+
is_default?: boolean;
|
|
3171
|
+
}
|
|
3172
|
+
/**
|
|
3173
|
+
* Request to create a menu configuration.
|
|
3174
|
+
*/
|
|
3175
|
+
interface CreateMenuConfigurationRequest {
|
|
3176
|
+
slug: string;
|
|
3177
|
+
module_slug?: string;
|
|
3178
|
+
name: string;
|
|
3179
|
+
app_slug: string;
|
|
3180
|
+
items: MenuItem[];
|
|
3181
|
+
is_default: boolean;
|
|
3182
|
+
}
|
|
3183
|
+
/**
|
|
3184
|
+
* Request to update a menu configuration.
|
|
3185
|
+
*/
|
|
3186
|
+
interface UpdateMenuConfigurationRequest {
|
|
3187
|
+
name?: string;
|
|
3188
|
+
module_slug?: string;
|
|
3189
|
+
items?: MenuItem[];
|
|
3190
|
+
is_default?: boolean;
|
|
3191
|
+
}
|
|
3192
|
+
/**
|
|
3193
|
+
* App definition. Apps group menu configurations and other org-scoped
|
|
3194
|
+
* metadata under a stable slug. Slug is unique per org (composite key
|
|
3195
|
+
* `(org_id, slug)`).
|
|
3196
|
+
*/
|
|
3197
|
+
interface App extends AuditFields {
|
|
3198
|
+
slug: string;
|
|
3199
|
+
org_id: string;
|
|
3200
|
+
module_slug: string;
|
|
3201
|
+
name: string;
|
|
3202
|
+
description: string;
|
|
3203
|
+
icon_slug: string;
|
|
3204
|
+
}
|
|
3205
|
+
declare const AppSchema: z.ZodObject<{
|
|
3206
|
+
created_at: z.ZodString;
|
|
3207
|
+
updated_at: z.ZodString;
|
|
3208
|
+
created_by: z.ZodObject<{
|
|
3209
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3210
|
+
id: z.ZodString;
|
|
3211
|
+
}, "strip", z.ZodTypeAny, {
|
|
3212
|
+
type: "person" | "agent" | "api";
|
|
3213
|
+
id: string;
|
|
3214
|
+
}, {
|
|
3215
|
+
type: "person" | "agent" | "api";
|
|
3216
|
+
id: string;
|
|
3217
|
+
}>;
|
|
3218
|
+
updated_by: z.ZodObject<{
|
|
3219
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3220
|
+
id: z.ZodString;
|
|
3221
|
+
}, "strip", z.ZodTypeAny, {
|
|
3222
|
+
type: "person" | "agent" | "api";
|
|
3223
|
+
id: string;
|
|
3224
|
+
}, {
|
|
3225
|
+
type: "person" | "agent" | "api";
|
|
3226
|
+
id: string;
|
|
3227
|
+
}>;
|
|
3228
|
+
} & {
|
|
3229
|
+
slug: z.ZodString;
|
|
3230
|
+
org_id: z.ZodString;
|
|
3231
|
+
module_slug: z.ZodString;
|
|
3232
|
+
name: z.ZodString;
|
|
3233
|
+
description: z.ZodString;
|
|
3234
|
+
icon_slug: z.ZodString;
|
|
3235
|
+
}, "strip", z.ZodTypeAny, {
|
|
3236
|
+
name: string;
|
|
3237
|
+
created_at: string;
|
|
3238
|
+
updated_at: string;
|
|
3239
|
+
created_by: {
|
|
3240
|
+
type: "person" | "agent" | "api";
|
|
3241
|
+
id: string;
|
|
3242
|
+
};
|
|
3243
|
+
updated_by: {
|
|
3244
|
+
type: "person" | "agent" | "api";
|
|
3245
|
+
id: string;
|
|
3246
|
+
};
|
|
3247
|
+
description: string;
|
|
3248
|
+
slug: string;
|
|
3249
|
+
module_slug: string;
|
|
3250
|
+
org_id: string;
|
|
3251
|
+
icon_slug: string;
|
|
3252
|
+
}, {
|
|
3253
|
+
name: string;
|
|
3254
|
+
created_at: string;
|
|
3255
|
+
updated_at: string;
|
|
3256
|
+
created_by: {
|
|
3257
|
+
type: "person" | "agent" | "api";
|
|
3258
|
+
id: string;
|
|
3259
|
+
};
|
|
3260
|
+
updated_by: {
|
|
3261
|
+
type: "person" | "agent" | "api";
|
|
3262
|
+
id: string;
|
|
3263
|
+
};
|
|
3264
|
+
description: string;
|
|
3265
|
+
slug: string;
|
|
3266
|
+
module_slug: string;
|
|
3267
|
+
org_id: string;
|
|
3268
|
+
icon_slug: string;
|
|
3269
|
+
}>;
|
|
3270
|
+
/**
|
|
3271
|
+
* Options for listing apps.
|
|
3272
|
+
*/
|
|
3273
|
+
interface ListAppsOptions extends MetaListOptions {
|
|
3274
|
+
slug?: string;
|
|
3275
|
+
name?: string;
|
|
3276
|
+
module_slug?: string;
|
|
3277
|
+
icon_slug?: string;
|
|
3278
|
+
}
|
|
3279
|
+
/**
|
|
3280
|
+
* Request to create an app.
|
|
3281
|
+
*/
|
|
3282
|
+
interface CreateAppRequest {
|
|
3283
|
+
slug: string;
|
|
3284
|
+
module_slug?: string;
|
|
3285
|
+
name: string;
|
|
3286
|
+
icon_slug: string;
|
|
3287
|
+
description?: string;
|
|
3288
|
+
}
|
|
3289
|
+
/**
|
|
3290
|
+
* Request to update an app. Slug and org_id are immutable.
|
|
3291
|
+
*/
|
|
3292
|
+
interface UpdateAppRequest {
|
|
3293
|
+
name?: string;
|
|
3294
|
+
module_slug?: string;
|
|
3295
|
+
description?: string;
|
|
3296
|
+
icon_slug?: string;
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
export { type ListFn as $, type AuditFields as A, type CurrencyValue as B, type ClientOptions as C, DEFAULT_OPTIONS as D, DEFAULT_PAGE_SIZE as E, type FileRef as F, DONE as G, type DeployModuleRequest as H, type Done as I, type Entity as J, EntitySchema as K, type ListOptions as L, type EntityService as M, type EntityWithSchema as N, EntityWithSchemaSchema as O, PageIterator as P, type FileAttributeMeta as Q, FileRefSchema as R, type FilterElement as S, FilterElementSchema as T, type UserRef as U, type FilterGroup as V, FilterGroupSchema as W, type List as X, type ListAppsOptions as Y, type ListComponentsOptions as Z, type ListEntitiesOptions as _, type Attribute as a, currencySymbol as a$, type ListListViewsOptions as a0, type ListListsOptions as a1, type ListMenuConfigurationsOptions as a2, type ListModulesOptions as a3, type ListPagesOptions as a4, ListSchema as a5, type ListService as a6, type ListVariablesOptions as a7, type ListView as a8, ListViewSchema as a9, RelationAttributeMetaSchema as aA, type RequestOptions as aB, type ResolvedClientOptions as aC, type ResponseMeta as aD, ResponseMetaSchema as aE, type SortConfig as aF, SortConfigSchema as aG, type SortDirection as aH, type Timestamps as aI, type TokenProvider as aJ, type UpdateAppRequest as aK, type UpdateComponentRequest as aL, type UpdateEntityRequest as aM, type UpdateListRequest as aN, type UpdateListViewRequest as aO, type UpdateMenuConfigurationRequest as aP, type UpdatePageRequest as aQ, type UpdateVariableRequest as aR, UserRefSchema as aS, type UserType as aT, type Variable as aU, VariableSchema as aV, type VariableService as aW, allCurrencyCodes as aX, createIterator as aY, createListResultSchema as aZ, currencyLabel as a_, type ListViewService as aa, type LogicalOperator as ab, type MenuConfiguration as ac, MenuConfigurationSchema as ad, type MenuConfigurationService as ae, type MenuItem as af, MenuItemSchema as ag, MenuItemType as ah, MetaClient as ai, type MetaListOptions as aj, type Module as ak, ModuleSchema as al, type ModuleService as am, type ModuleStatus as an, type OnDeleteAction as ao, OnDeleteActionSchema as ap, PLATFORM_ATTRIBUTE_NAMES as aq, PLATFORM_USER_ID as ar, type Page as as, type PageAction as at, PageActionSchema as au, type PageLayout as av, PageLayoutSchema as aw, PageSchema as ax, type PageService as ay, type RelationAttributeMeta as az, type ListResult as b, currencySymbolSide as b0, formatAmount as b1, formatMoney as b2, isPlatformAttributeName as b3, localeNumberSeparators as b4, parseAmount as b5, parseCurrencyMeta as b6, parseFileMeta as b7, parseRelationMeta as b8, platformAttributes as b9, type PageLayoutSidePanel as bA, PageLayoutSidePanelSchema as bB, type RelatedListElement as bC, type ResponsiveSizing as bD, type RowElement as bE, type SectionElement as bF, type SizeValue as bG, SizeValueSchema as bH, type SizingProps as bI, type StringAttributeMeta as bJ, type StringFormat as bK, type TabsElement as bL, type TextElement as bM, type TextVariant as bN, type UserAttributeMeta as bO, UserAttributeMetaSchema as bP, isBuiltInControl as bQ, lookupCompatibleControls as bR, lookupControls as bS, lookupPrimaryControl as bT, parseUserMeta as bU, resolveOptions as ba, type ArrayAttributeMeta as bb, type AttributeForLookup as bc, type AttributeMeta as bd, BUILT_IN_CONTROLS as be, type BuiltInControlSlug as bf, type ColumnElement as bg, type CommonProps as bh, type ComponentElement as bi, type ControlBucket as bj, type DatetimeAttributeMeta as bk, type DatetimeFormat as bl, type DividerElement as bm, type EnumAttributeMeta as bn, type EnumValue as bo, type FieldElement as bp, FileAttributeMetaSchema as bq, type LayoutAlign as br, type LayoutElement as bs, LayoutElementSchema as bt, LayoutElementType as bu, type LayoutGap as bv, type LayoutJustify as bw, type LayoutTab as bx, type NumberAttributeMeta as by, type ObjectAttributeMeta as bz, ProteosClient as c, type App as d, AppSchema as e, type AppService as f, AttributeSchema as g, type AttributeType as h, AuditFieldsSchema as i, type Column as j, ColumnSchema as k, type ComparisonOperator as l, type Component as m, ComponentSchema as n, type ComponentService as o, type CreateAppRequest as p, type CreateComponentRequest as q, type CreateEntityRequest as r, type CreateListRequest as s, type CreateListViewRequest as t, type CreateMenuConfigurationRequest as u, type CreatePageRequest as v, type CreateVariableRequest as w, type CurrencyAttributeMeta as x, CurrencyAttributeMetaSchema as y, type CurrencySymbolSide as z };
|