@lumibase/sdk 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +1326 -0
- package/dist/index.d.cts +1753 -0
- package/dist/index.d.ts +1753 -0
- package/dist/index.js +1257 -0
- package/package.json +38 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ACCESS_EXPORT_SCHEMA: () => ACCESS_EXPORT_SCHEMA,
|
|
24
|
+
LumiError: () => LumiError,
|
|
25
|
+
RealtimeClient: () => RealtimeClient,
|
|
26
|
+
checkCdcPipelineHealth: () => checkCdcPipelineHealth,
|
|
27
|
+
createAgentArtifact: () => createAgentArtifact,
|
|
28
|
+
createAgentGoal: () => createAgentGoal,
|
|
29
|
+
createCdcPipeline: () => createCdcPipeline,
|
|
30
|
+
createLumiClient: () => createLumiClient,
|
|
31
|
+
decideAgentApproval: () => decideAgentApproval,
|
|
32
|
+
deleteCdcPipeline: () => deleteCdcPipeline,
|
|
33
|
+
deployCdc: () => deployCdc,
|
|
34
|
+
dryRunAccessImport: () => dryRunAccessImport,
|
|
35
|
+
evaluateAgentArtifact: () => evaluateAgentArtifact,
|
|
36
|
+
exportAccessManifest: () => exportAccessManifest,
|
|
37
|
+
extractSeo: () => extractSeo,
|
|
38
|
+
generateAgentApp: () => generateAgentApp,
|
|
39
|
+
generateTypes: () => generateTypes,
|
|
40
|
+
graphql: () => graphql,
|
|
41
|
+
importAccessManifest: () => importAccessManifest,
|
|
42
|
+
jsonLdScript: () => jsonLdScript,
|
|
43
|
+
legacyRest: () => legacyRest,
|
|
44
|
+
listAgentApprovals: () => listAgentApprovals,
|
|
45
|
+
listAgentArtifacts: () => listAgentArtifacts,
|
|
46
|
+
listAgentGoals: () => listAgentGoals,
|
|
47
|
+
listAgentRuns: () => listAgentRuns,
|
|
48
|
+
listAgentTools: () => listAgentTools,
|
|
49
|
+
listCdcPipelines: () => listCdcPipelines,
|
|
50
|
+
publishAgentArtifact: () => publishAgentArtifact,
|
|
51
|
+
readAgentMemoryContext: () => readAgentMemoryContext,
|
|
52
|
+
readCdcPipeline: () => readCdcPipeline,
|
|
53
|
+
readCdcPipelineMetricHistory: () => readCdcPipelineMetricHistory,
|
|
54
|
+
readCdcPipelineMetrics: () => readCdcPipelineMetrics,
|
|
55
|
+
readItem: () => readItem,
|
|
56
|
+
readItems: () => readItems,
|
|
57
|
+
retryAgentRun: () => retryAgentRun,
|
|
58
|
+
rollbackAgentArtifact: () => rollbackAgentArtifact,
|
|
59
|
+
rollbackCdcDeployment: () => rollbackCdcDeployment,
|
|
60
|
+
startCdcPipeline: () => startCdcPipeline,
|
|
61
|
+
stopCdcPipeline: () => stopCdcPipeline,
|
|
62
|
+
toNextMetadata: () => toNextMetadata,
|
|
63
|
+
updateCdcPipeline: () => updateCdcPipeline,
|
|
64
|
+
validateCdcDeploymentEnv: () => validateCdcDeploymentEnv,
|
|
65
|
+
writeAgentMemory: () => writeAgentMemory
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(index_exports);
|
|
68
|
+
|
|
69
|
+
// src/client.ts
|
|
70
|
+
var LumiError = class extends Error {
|
|
71
|
+
constructor(status, body) {
|
|
72
|
+
super(body?.errors?.[0]?.message ?? `LumiBase ${status}`);
|
|
73
|
+
this.status = status;
|
|
74
|
+
this.body = body;
|
|
75
|
+
this.name = "LumiError";
|
|
76
|
+
}
|
|
77
|
+
status;
|
|
78
|
+
body;
|
|
79
|
+
};
|
|
80
|
+
function parseResponseBody(text) {
|
|
81
|
+
if (!text) return null;
|
|
82
|
+
try {
|
|
83
|
+
return JSON.parse(text);
|
|
84
|
+
} catch {
|
|
85
|
+
return text;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function toErrorBody(status, body) {
|
|
89
|
+
if (body && typeof body === "object" && Array.isArray(body.errors)) {
|
|
90
|
+
return body;
|
|
91
|
+
}
|
|
92
|
+
const message = typeof body === "string" && body.trim() ? body.trim() : `LumiBase ${status}`;
|
|
93
|
+
return {
|
|
94
|
+
errors: [
|
|
95
|
+
{
|
|
96
|
+
code: "HTTP_ERROR",
|
|
97
|
+
message
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function createLumiClient(opts) {
|
|
103
|
+
const fetcher = opts.fetcher ?? globalThis.fetch;
|
|
104
|
+
const base = opts.url.replace(/\/$/, "");
|
|
105
|
+
async function rawRequest(path, init = {}) {
|
|
106
|
+
const headers = new Headers(init.headers);
|
|
107
|
+
for (const [key, value] of Object.entries(opts.headers ?? {})) {
|
|
108
|
+
headers.set(key, value);
|
|
109
|
+
}
|
|
110
|
+
headers.set("authorization", `Bearer ${opts.token}`);
|
|
111
|
+
headers.set("x-lumi-site", opts.siteId);
|
|
112
|
+
if (!headers.has("content-type") && init.body) {
|
|
113
|
+
headers.set("content-type", "application/json");
|
|
114
|
+
}
|
|
115
|
+
const res = await fetcher(`${base}${path}`, { ...init, headers });
|
|
116
|
+
const text = await res.text();
|
|
117
|
+
const body = parseResponseBody(text);
|
|
118
|
+
if (!res.ok) {
|
|
119
|
+
if (res.status === 401 && opts.onUnauthorized) {
|
|
120
|
+
try {
|
|
121
|
+
opts.onUnauthorized();
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
throw new LumiError(res.status, toErrorBody(res.status, body));
|
|
126
|
+
}
|
|
127
|
+
return body;
|
|
128
|
+
}
|
|
129
|
+
const baseClient = {
|
|
130
|
+
url: opts.url,
|
|
131
|
+
token: opts.token,
|
|
132
|
+
siteId: opts.siteId,
|
|
133
|
+
fetcher,
|
|
134
|
+
rawRequest,
|
|
135
|
+
async request(command) {
|
|
136
|
+
return command(this);
|
|
137
|
+
},
|
|
138
|
+
with(plugin) {
|
|
139
|
+
const ext = plugin(this);
|
|
140
|
+
return Object.assign(this, ext);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return baseClient;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/types.ts
|
|
147
|
+
var ACCESS_EXPORT_SCHEMA = "lumibase.access@v1";
|
|
148
|
+
|
|
149
|
+
// src/realtime/index.ts
|
|
150
|
+
var RealtimeClient = class {
|
|
151
|
+
constructor(opts) {
|
|
152
|
+
this.opts = opts;
|
|
153
|
+
this.backoffMs = opts.initialBackoffMs ?? 1e3;
|
|
154
|
+
}
|
|
155
|
+
opts;
|
|
156
|
+
ws = null;
|
|
157
|
+
subscriptions = /* @__PURE__ */ new Map();
|
|
158
|
+
presenceListeners = /* @__PURE__ */ new Set();
|
|
159
|
+
currentPresence = {};
|
|
160
|
+
sessionId = null;
|
|
161
|
+
reconnectTimeout = null;
|
|
162
|
+
backoffMs;
|
|
163
|
+
stopped = false;
|
|
164
|
+
// ─── Public API ─────────────────────────────────────────────────────────────
|
|
165
|
+
/** Open the WebSocket connection. Safe to call multiple times. */
|
|
166
|
+
connect() {
|
|
167
|
+
this.stopped = false;
|
|
168
|
+
this._connect();
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
/** Close the WebSocket and stop reconnect attempts. */
|
|
172
|
+
disconnect() {
|
|
173
|
+
this.stopped = true;
|
|
174
|
+
if (this.reconnectTimeout) {
|
|
175
|
+
clearTimeout(this.reconnectTimeout);
|
|
176
|
+
this.reconnectTimeout = null;
|
|
177
|
+
}
|
|
178
|
+
if (this.ws) {
|
|
179
|
+
try {
|
|
180
|
+
this.ws.close(1e3, "client disconnect");
|
|
181
|
+
} catch {
|
|
182
|
+
}
|
|
183
|
+
this.ws = null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Subscribe to item mutation events for a specific collection.
|
|
188
|
+
* Multiple handlers per collection are supported.
|
|
189
|
+
*
|
|
190
|
+
* @returns Unsubscribe function.
|
|
191
|
+
*/
|
|
192
|
+
subscribe(collection, callback) {
|
|
193
|
+
if (!this.subscriptions.has(collection)) {
|
|
194
|
+
this.subscriptions.set(collection, /* @__PURE__ */ new Set());
|
|
195
|
+
}
|
|
196
|
+
this.subscriptions.get(collection).add(callback);
|
|
197
|
+
this._send({ type: "subscribe", collection });
|
|
198
|
+
return () => this.unsubscribe(collection, callback);
|
|
199
|
+
}
|
|
200
|
+
/** Remove a specific handler from a collection subscription. */
|
|
201
|
+
unsubscribe(collection, callback) {
|
|
202
|
+
const set = this.subscriptions.get(collection);
|
|
203
|
+
if (!set) return;
|
|
204
|
+
set.delete(callback);
|
|
205
|
+
if (set.size === 0) {
|
|
206
|
+
this.subscriptions.delete(collection);
|
|
207
|
+
this._send({ type: "unsubscribe", collection });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** Update the current user's presence. Sent immediately and on reconnect. */
|
|
211
|
+
presence(opts) {
|
|
212
|
+
this.currentPresence = opts;
|
|
213
|
+
this._send({ type: "presence", ...opts });
|
|
214
|
+
}
|
|
215
|
+
/** Register a callback for peer presence updates. */
|
|
216
|
+
onPresence(callback) {
|
|
217
|
+
this.presenceListeners.add(callback);
|
|
218
|
+
return () => this.presenceListeners.delete(callback);
|
|
219
|
+
}
|
|
220
|
+
/** Returns the current session ID assigned by the server after connection. */
|
|
221
|
+
get session() {
|
|
222
|
+
return this.sessionId;
|
|
223
|
+
}
|
|
224
|
+
/** Whether the WebSocket is currently OPEN. */
|
|
225
|
+
get isConnected() {
|
|
226
|
+
return this.ws?.readyState === WebSocket.OPEN;
|
|
227
|
+
}
|
|
228
|
+
// ─── Internal ────────────────────────────────────────────────────────────────
|
|
229
|
+
async _connect() {
|
|
230
|
+
if (this.ws?.readyState === WebSocket.OPEN || this.ws?.readyState === WebSocket.CONNECTING) return;
|
|
231
|
+
const { baseUrl, token, siteId, userId } = this.opts;
|
|
232
|
+
let ticket;
|
|
233
|
+
try {
|
|
234
|
+
const res = await fetch(`${baseUrl}/api/v1/realtime/ticket`, {
|
|
235
|
+
method: "POST",
|
|
236
|
+
headers: {
|
|
237
|
+
"Authorization": `Bearer ${token}`,
|
|
238
|
+
"X-Lumi-Site": siteId
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
if (!res.ok) {
|
|
242
|
+
throw new Error(`Failed to fetch ticket: ${res.status}`);
|
|
243
|
+
}
|
|
244
|
+
const body = await res.json();
|
|
245
|
+
if (!body.data?.ticket) {
|
|
246
|
+
throw new Error("Ticket missing from response");
|
|
247
|
+
}
|
|
248
|
+
ticket = body.data.ticket;
|
|
249
|
+
} catch (err) {
|
|
250
|
+
console.warn("[RealtimeClient] Ticket fetch failed", err);
|
|
251
|
+
this._scheduleReconnect();
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (this.stopped) return;
|
|
255
|
+
const wsBase = baseUrl.replace(/^http/, "ws");
|
|
256
|
+
const url = new URL(`${wsBase}/api/v1/realtime`);
|
|
257
|
+
url.searchParams.set("ticket", ticket);
|
|
258
|
+
url.searchParams.set("site", siteId);
|
|
259
|
+
url.searchParams.set("siteId", siteId);
|
|
260
|
+
let ws;
|
|
261
|
+
try {
|
|
262
|
+
ws = new WebSocket(url.toString());
|
|
263
|
+
} catch {
|
|
264
|
+
this._scheduleReconnect();
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
this.ws = ws;
|
|
268
|
+
ws.addEventListener("open", () => {
|
|
269
|
+
this.backoffMs = this.opts.initialBackoffMs ?? 1e3;
|
|
270
|
+
for (const collection of this.subscriptions.keys()) {
|
|
271
|
+
this._sendRaw({ type: "subscribe", collection });
|
|
272
|
+
}
|
|
273
|
+
if (Object.keys(this.currentPresence).length > 0) {
|
|
274
|
+
this._sendRaw({ type: "presence", ...this.currentPresence });
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
ws.addEventListener("message", (event) => {
|
|
278
|
+
try {
|
|
279
|
+
const msg = JSON.parse(event.data);
|
|
280
|
+
this._handleMessage(msg);
|
|
281
|
+
} catch {
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
ws.addEventListener("close", () => {
|
|
285
|
+
this.ws = null;
|
|
286
|
+
if (!this.stopped) this._scheduleReconnect();
|
|
287
|
+
});
|
|
288
|
+
ws.addEventListener("error", () => {
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
_handleMessage(msg) {
|
|
292
|
+
switch (msg.type) {
|
|
293
|
+
case "welcome":
|
|
294
|
+
this.sessionId = msg.sessionId;
|
|
295
|
+
break;
|
|
296
|
+
case "ping":
|
|
297
|
+
this._sendRaw({ type: "pong" });
|
|
298
|
+
break;
|
|
299
|
+
case "event": {
|
|
300
|
+
const event = msg;
|
|
301
|
+
const handlers = this.subscriptions.get(event.collection);
|
|
302
|
+
if (handlers) {
|
|
303
|
+
for (const cb of handlers) cb(event);
|
|
304
|
+
}
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
case "presence": {
|
|
308
|
+
const users = msg.users ?? [];
|
|
309
|
+
for (const cb of this.presenceListeners) cb(users);
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
_scheduleReconnect() {
|
|
315
|
+
if (this.stopped || this.reconnectTimeout) return;
|
|
316
|
+
this.reconnectTimeout = setTimeout(() => {
|
|
317
|
+
this.reconnectTimeout = null;
|
|
318
|
+
this._connect();
|
|
319
|
+
this.backoffMs = Math.min(this.backoffMs * 2, this.opts.maxBackoffMs ?? 3e4);
|
|
320
|
+
}, this.backoffMs);
|
|
321
|
+
}
|
|
322
|
+
_send(data) {
|
|
323
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
324
|
+
this._sendRaw(data);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
_sendRaw(data) {
|
|
328
|
+
try {
|
|
329
|
+
this.ws?.send(JSON.stringify(data));
|
|
330
|
+
} catch {
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// src/rest/legacy.ts
|
|
336
|
+
function withQuery(path, params = {}) {
|
|
337
|
+
const qs = new URLSearchParams();
|
|
338
|
+
for (const [key, value] of Object.entries(params)) {
|
|
339
|
+
if (value === void 0) continue;
|
|
340
|
+
qs.set(key, typeof value === "string" ? value : JSON.stringify(value));
|
|
341
|
+
}
|
|
342
|
+
const query = qs.toString();
|
|
343
|
+
return query ? `${path}?${query}` : path;
|
|
344
|
+
}
|
|
345
|
+
function legacyRest() {
|
|
346
|
+
return function(client) {
|
|
347
|
+
const collections = {
|
|
348
|
+
list: () => client.rawRequest("/api/v1/collections"),
|
|
349
|
+
get: (name) => client.rawRequest(`/api/v1/collections/${name}`),
|
|
350
|
+
compiled: (name) => client.rawRequest(`/api/v1/collections/${name}/compiled`),
|
|
351
|
+
create: (input) => client.rawRequest("/api/v1/collections", {
|
|
352
|
+
method: "POST",
|
|
353
|
+
body: JSON.stringify(input)
|
|
354
|
+
}),
|
|
355
|
+
update: (name, patch) => client.rawRequest(`/api/v1/collections/${name}`, {
|
|
356
|
+
method: "PATCH",
|
|
357
|
+
body: JSON.stringify(patch)
|
|
358
|
+
}),
|
|
359
|
+
delete: (name) => client.rawRequest(`/api/v1/collections/${name}`, {
|
|
360
|
+
method: "DELETE"
|
|
361
|
+
})
|
|
362
|
+
};
|
|
363
|
+
const fields = {
|
|
364
|
+
list: (collectionName) => client.rawRequest(
|
|
365
|
+
`/api/v1/collections/${collectionName}/fields`
|
|
366
|
+
),
|
|
367
|
+
upsert: (collectionName, fieldName, input) => client.rawRequest(
|
|
368
|
+
`/api/v1/collections/${collectionName}/fields/${fieldName}`,
|
|
369
|
+
{
|
|
370
|
+
method: "PUT",
|
|
371
|
+
body: JSON.stringify(input)
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
create: (collectionName, input) => fields.upsert(collectionName, input.name, input),
|
|
375
|
+
update: (collectionName, fieldName, input) => fields.upsert(collectionName, fieldName, input),
|
|
376
|
+
rename: (collectionName, fromFieldName, toFieldName, input) => fields.upsert(
|
|
377
|
+
collectionName,
|
|
378
|
+
toFieldName,
|
|
379
|
+
{
|
|
380
|
+
...input,
|
|
381
|
+
name: toFieldName,
|
|
382
|
+
renameFrom: fromFieldName
|
|
383
|
+
}
|
|
384
|
+
),
|
|
385
|
+
delete: (collectionName, fieldName, options = {}) => client.rawRequest(
|
|
386
|
+
withQuery(
|
|
387
|
+
`/api/v1/collections/${collectionName}/fields/${fieldName}`,
|
|
388
|
+
options
|
|
389
|
+
),
|
|
390
|
+
{ method: "DELETE" }
|
|
391
|
+
)
|
|
392
|
+
};
|
|
393
|
+
const relations = {
|
|
394
|
+
list: () => client.rawRequest("/api/v1/relations"),
|
|
395
|
+
create: (input) => client.rawRequest("/api/v1/relations", {
|
|
396
|
+
method: "POST",
|
|
397
|
+
body: JSON.stringify(input)
|
|
398
|
+
}),
|
|
399
|
+
delete: (id) => client.rawRequest(`/api/v1/relations/${id}`, {
|
|
400
|
+
method: "DELETE"
|
|
401
|
+
})
|
|
402
|
+
};
|
|
403
|
+
const schema = {
|
|
404
|
+
collections,
|
|
405
|
+
fields,
|
|
406
|
+
relations,
|
|
407
|
+
diff: (name, proposed) => client.rawRequest("/api/v1/collections/diff", {
|
|
408
|
+
method: "POST",
|
|
409
|
+
body: JSON.stringify({ name, ...proposed })
|
|
410
|
+
}),
|
|
411
|
+
diffInput: (input) => client.rawRequest("/api/v1/collections/diff", {
|
|
412
|
+
method: "POST",
|
|
413
|
+
body: JSON.stringify(input)
|
|
414
|
+
}),
|
|
415
|
+
apply: (name, proposed) => client.rawRequest(
|
|
416
|
+
`/api/v1/collections/${name}/schema`,
|
|
417
|
+
{
|
|
418
|
+
method: "PUT",
|
|
419
|
+
body: JSON.stringify(proposed)
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
typegen: (filters) => {
|
|
423
|
+
const params = new URLSearchParams();
|
|
424
|
+
if (filters?.include?.length)
|
|
425
|
+
params.set("include", filters.include.join(","));
|
|
426
|
+
if (filters?.exclude?.length)
|
|
427
|
+
params.set("exclude", filters.exclude.join(","));
|
|
428
|
+
const qs = params.toString();
|
|
429
|
+
return client.rawRequest(
|
|
430
|
+
`/api/v1/typegen/schema${qs ? `?${qs}` : ""}`
|
|
431
|
+
);
|
|
432
|
+
},
|
|
433
|
+
listCollections: collections.list,
|
|
434
|
+
getCollection: collections.get,
|
|
435
|
+
getCompiled: collections.compiled,
|
|
436
|
+
createCollection: collections.create,
|
|
437
|
+
updateCollection: collections.update,
|
|
438
|
+
deleteCollection: collections.delete,
|
|
439
|
+
listFields: fields.list,
|
|
440
|
+
upsertField: fields.upsert,
|
|
441
|
+
deleteField: fields.delete,
|
|
442
|
+
listRelations: relations.list,
|
|
443
|
+
createRelation: relations.create,
|
|
444
|
+
deleteRelation: relations.delete
|
|
445
|
+
};
|
|
446
|
+
function items(name) {
|
|
447
|
+
function buildQuery(params) {
|
|
448
|
+
if (!params) return "";
|
|
449
|
+
const qs = new URLSearchParams();
|
|
450
|
+
if (params.fields?.length) qs.set("fields", params.fields.join(","));
|
|
451
|
+
if (params.filter) qs.set("filter", JSON.stringify(params.filter));
|
|
452
|
+
if (params.sort?.length) qs.set("sort", params.sort.join(","));
|
|
453
|
+
if (params.limit !== void 0) qs.set("limit", String(params.limit));
|
|
454
|
+
if (params.offset !== void 0)
|
|
455
|
+
qs.set("offset", String(params.offset));
|
|
456
|
+
if (params.status) qs.set("status", params.status);
|
|
457
|
+
if (params.search) qs.set("search", params.search);
|
|
458
|
+
const s = qs.toString();
|
|
459
|
+
return s ? `?${s}` : "";
|
|
460
|
+
}
|
|
461
|
+
const base = `/api/v1/items/${name}`;
|
|
462
|
+
return {
|
|
463
|
+
list: async (params) => {
|
|
464
|
+
const res = await client.rawRequest(
|
|
465
|
+
`${base}${buildQuery(params)}`
|
|
466
|
+
);
|
|
467
|
+
return res;
|
|
468
|
+
},
|
|
469
|
+
detail: (id, fields2) => client.rawRequest(
|
|
470
|
+
`${base}/${id}${fields2?.length ? `?fields=${fields2.join(",")}` : ""}`
|
|
471
|
+
),
|
|
472
|
+
create: (input) => client.rawRequest(base, {
|
|
473
|
+
method: "POST",
|
|
474
|
+
body: JSON.stringify(input)
|
|
475
|
+
}),
|
|
476
|
+
patch: (id, input) => client.rawRequest(`${base}/${id}`, {
|
|
477
|
+
method: "PATCH",
|
|
478
|
+
body: JSON.stringify(input)
|
|
479
|
+
}),
|
|
480
|
+
replace: (id, input) => client.rawRequest(`${base}/${id}`, {
|
|
481
|
+
method: "PUT",
|
|
482
|
+
body: JSON.stringify(input)
|
|
483
|
+
}),
|
|
484
|
+
delete: (id) => client.rawRequest(`${base}/${id}`, { method: "DELETE" }),
|
|
485
|
+
bulk: (op, payload) => client.rawRequest(`${base}/bulk`, {
|
|
486
|
+
method: "POST",
|
|
487
|
+
body: JSON.stringify({ op, items: payload })
|
|
488
|
+
}),
|
|
489
|
+
listRevisions: (id) => client.rawRequest(`${base}/${id}/revisions`),
|
|
490
|
+
revertRevision: (id, revisionId) => client.rawRequest(`${base}/${id}/revert/${revisionId}`, {
|
|
491
|
+
method: "POST"
|
|
492
|
+
}),
|
|
493
|
+
// Law Zero pins (content-os Req 8.4/8.5): fields a human edit locked
|
|
494
|
+
// against agent writes. Release hands the field back to agents.
|
|
495
|
+
listPins: (id) => client.rawRequest(`${base}/${id}/pins`),
|
|
496
|
+
releasePin: (id, field) => client.rawRequest(
|
|
497
|
+
`${base}/${id}/pins/${encodeURIComponent(field)}`,
|
|
498
|
+
{ method: "DELETE" }
|
|
499
|
+
)
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
const roles = {
|
|
503
|
+
list: () => client.rawRequest("/api/v1/roles"),
|
|
504
|
+
detail: (id) => client.rawRequest(`/api/v1/roles/${id}`),
|
|
505
|
+
create: (input) => client.rawRequest("/api/v1/roles", {
|
|
506
|
+
method: "POST",
|
|
507
|
+
body: JSON.stringify(input)
|
|
508
|
+
}),
|
|
509
|
+
update: (id, patch) => client.rawRequest(`/api/v1/roles/${id}`, {
|
|
510
|
+
method: "PATCH",
|
|
511
|
+
body: JSON.stringify(patch)
|
|
512
|
+
}),
|
|
513
|
+
delete: (id) => client.rawRequest(`/api/v1/roles/${id}`, { method: "DELETE" }),
|
|
514
|
+
attachPolicy: (id, input) => client.rawRequest(`/api/v1/roles/${id}/policies`, {
|
|
515
|
+
method: "POST",
|
|
516
|
+
body: JSON.stringify(input)
|
|
517
|
+
}),
|
|
518
|
+
detachPolicy: (id, policyId) => client.rawRequest(`/api/v1/roles/${id}/policies/${policyId}`, {
|
|
519
|
+
method: "DELETE"
|
|
520
|
+
}),
|
|
521
|
+
assignUser: (id, input) => client.rawRequest(
|
|
522
|
+
`/api/v1/roles/${id}/users`,
|
|
523
|
+
{ method: "POST", body: JSON.stringify(input) }
|
|
524
|
+
),
|
|
525
|
+
removeUser: (id, userId) => client.rawRequest(`/api/v1/roles/${id}/users/${userId}`, {
|
|
526
|
+
method: "DELETE"
|
|
527
|
+
})
|
|
528
|
+
};
|
|
529
|
+
const policies = {
|
|
530
|
+
list: () => client.rawRequest("/api/v1/policies"),
|
|
531
|
+
detail: (id) => client.rawRequest(`/api/v1/policies/${id}`),
|
|
532
|
+
create: (input) => client.rawRequest("/api/v1/policies", {
|
|
533
|
+
method: "POST",
|
|
534
|
+
body: JSON.stringify(input)
|
|
535
|
+
}),
|
|
536
|
+
update: (id, patch) => client.rawRequest(`/api/v1/policies/${id}`, {
|
|
537
|
+
method: "PATCH",
|
|
538
|
+
body: JSON.stringify(patch)
|
|
539
|
+
}),
|
|
540
|
+
delete: (id) => client.rawRequest(`/api/v1/policies/${id}`, { method: "DELETE" }),
|
|
541
|
+
addPermission: (id, input) => client.rawRequest(`/api/v1/policies/${id}/permissions`, {
|
|
542
|
+
method: "POST",
|
|
543
|
+
body: JSON.stringify(input)
|
|
544
|
+
}),
|
|
545
|
+
patchPermission: (id, permId, patch) => client.rawRequest(
|
|
546
|
+
`/api/v1/policies/${id}/permissions/${permId}`,
|
|
547
|
+
{ method: "PATCH", body: JSON.stringify(patch) }
|
|
548
|
+
),
|
|
549
|
+
removePermission: (id, permId) => client.rawRequest(
|
|
550
|
+
`/api/v1/policies/${id}/permissions/${permId}`,
|
|
551
|
+
{ method: "DELETE" }
|
|
552
|
+
),
|
|
553
|
+
attachUser: (id, input) => client.rawRequest(`/api/v1/policies/${id}/users`, {
|
|
554
|
+
method: "POST",
|
|
555
|
+
body: JSON.stringify(input)
|
|
556
|
+
}),
|
|
557
|
+
detachUser: (id, userId) => client.rawRequest(`/api/v1/policies/${id}/users/${userId}`, {
|
|
558
|
+
method: "DELETE"
|
|
559
|
+
})
|
|
560
|
+
};
|
|
561
|
+
const permissions = {
|
|
562
|
+
me: () => client.rawRequest("/api/v1/permissions/me"),
|
|
563
|
+
check: (input) => client.rawRequest("/api/v1/permissions/check", {
|
|
564
|
+
method: "POST",
|
|
565
|
+
body: JSON.stringify(input)
|
|
566
|
+
})
|
|
567
|
+
};
|
|
568
|
+
const presets = {
|
|
569
|
+
list: (collection) => client.rawRequest(`/api/v1/presets${collection ? `?collection=${collection}` : ""}`),
|
|
570
|
+
get: (id) => client.rawRequest(`/api/v1/presets/${id}`),
|
|
571
|
+
create: (input) => client.rawRequest("/api/v1/presets", {
|
|
572
|
+
method: "POST",
|
|
573
|
+
body: JSON.stringify(input)
|
|
574
|
+
}),
|
|
575
|
+
update: (id, patch) => client.rawRequest(`/api/v1/presets/${id}`, {
|
|
576
|
+
method: "PATCH",
|
|
577
|
+
body: JSON.stringify(patch)
|
|
578
|
+
}),
|
|
579
|
+
delete: (id) => client.rawRequest(`/api/v1/presets/${id}`, { method: "DELETE" })
|
|
580
|
+
};
|
|
581
|
+
const translations = {
|
|
582
|
+
list: (params) => {
|
|
583
|
+
const qs = new URLSearchParams();
|
|
584
|
+
if (params?.namespace) qs.set("namespace", params.namespace);
|
|
585
|
+
if (params?.language) qs.set("language", params.language);
|
|
586
|
+
const s = qs.toString();
|
|
587
|
+
return client.rawRequest(`/api/v1/translations${s ? `?${s}` : ""}`);
|
|
588
|
+
},
|
|
589
|
+
get: (id) => client.rawRequest(`/api/v1/translations/${id}`),
|
|
590
|
+
create: (input) => client.rawRequest("/api/v1/translations", {
|
|
591
|
+
method: "POST",
|
|
592
|
+
body: JSON.stringify(input)
|
|
593
|
+
}),
|
|
594
|
+
update: (id, patch) => client.rawRequest(`/api/v1/translations/${id}`, {
|
|
595
|
+
method: "PATCH",
|
|
596
|
+
body: JSON.stringify(patch)
|
|
597
|
+
}),
|
|
598
|
+
delete: (id) => client.rawRequest(`/api/v1/translations/${id}`, { method: "DELETE" })
|
|
599
|
+
};
|
|
600
|
+
const settings = {
|
|
601
|
+
list: (scope) => client.rawRequest(`/api/v1/settings${scope ? `?scope=${scope}` : ""}`),
|
|
602
|
+
get: (key) => client.rawRequest(`/api/v1/settings/${key}`),
|
|
603
|
+
set: (key, value, scope) => client.rawRequest("/api/v1/settings", {
|
|
604
|
+
method: "POST",
|
|
605
|
+
body: JSON.stringify({ key, value, scope })
|
|
606
|
+
}),
|
|
607
|
+
delete: (key) => client.rawRequest(`/api/v1/settings/${key}`, { method: "DELETE" })
|
|
608
|
+
};
|
|
609
|
+
const site = {
|
|
610
|
+
get: () => client.rawRequest("/api/v1/site"),
|
|
611
|
+
update: (patch) => client.rawRequest("/api/v1/site", {
|
|
612
|
+
method: "PATCH",
|
|
613
|
+
body: JSON.stringify(patch)
|
|
614
|
+
})
|
|
615
|
+
};
|
|
616
|
+
const users = {
|
|
617
|
+
list: () => client.rawRequest("/api/v1/users"),
|
|
618
|
+
get: (id) => client.rawRequest(`/api/v1/users/${id}`),
|
|
619
|
+
invite: (input) => client.rawRequest("/api/v1/users/invite", {
|
|
620
|
+
method: "POST",
|
|
621
|
+
body: JSON.stringify(input)
|
|
622
|
+
}),
|
|
623
|
+
update: (id, patch) => client.rawRequest(`/api/v1/users/${id}`, {
|
|
624
|
+
method: "PATCH",
|
|
625
|
+
body: JSON.stringify(patch)
|
|
626
|
+
}),
|
|
627
|
+
delete: (id) => client.rawRequest(`/api/v1/users/${id}`, { method: "DELETE" }),
|
|
628
|
+
impersonate: (id) => client.rawRequest(`/api/v1/users/${id}/impersonate`, { method: "POST" })
|
|
629
|
+
};
|
|
630
|
+
const teams = {
|
|
631
|
+
list: () => client.rawRequest("/api/v1/teams"),
|
|
632
|
+
get: (id) => client.rawRequest(`/api/v1/teams/${id}`),
|
|
633
|
+
create: (input) => client.rawRequest("/api/v1/teams", {
|
|
634
|
+
method: "POST",
|
|
635
|
+
body: JSON.stringify(input)
|
|
636
|
+
}),
|
|
637
|
+
update: (id, patch) => client.rawRequest(`/api/v1/teams/${id}`, {
|
|
638
|
+
method: "PATCH",
|
|
639
|
+
body: JSON.stringify(patch)
|
|
640
|
+
}),
|
|
641
|
+
delete: (id) => client.rawRequest(`/api/v1/teams/${id}`, { method: "DELETE" }),
|
|
642
|
+
members: {
|
|
643
|
+
list: (teamId) => client.rawRequest(`/api/v1/teams/${teamId}/members`),
|
|
644
|
+
add: (teamId, userId) => client.rawRequest(`/api/v1/teams/${teamId}/members`, {
|
|
645
|
+
method: "POST",
|
|
646
|
+
body: JSON.stringify({ userId })
|
|
647
|
+
}),
|
|
648
|
+
remove: (teamId, userId) => client.rawRequest(`/api/v1/teams/${teamId}/members/${userId}`, { method: "DELETE" })
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
const folders = {
|
|
652
|
+
list: () => client.rawRequest("/api/v1/files/folders"),
|
|
653
|
+
create: (input) => client.rawRequest("/api/v1/files/folders", {
|
|
654
|
+
method: "POST",
|
|
655
|
+
body: JSON.stringify(input)
|
|
656
|
+
}),
|
|
657
|
+
update: (id, patch) => client.rawRequest(`/api/v1/files/folders/${id}`, {
|
|
658
|
+
method: "PATCH",
|
|
659
|
+
body: JSON.stringify(patch)
|
|
660
|
+
}),
|
|
661
|
+
delete: (id) => client.rawRequest(`/api/v1/files/folders/${id}`, { method: "DELETE" })
|
|
662
|
+
};
|
|
663
|
+
const files = {
|
|
664
|
+
list: () => client.rawRequest("/api/v1/files"),
|
|
665
|
+
create: (input) => client.rawRequest("/api/v1/files", {
|
|
666
|
+
method: "POST",
|
|
667
|
+
body: JSON.stringify(input)
|
|
668
|
+
}),
|
|
669
|
+
update: (id, patch) => client.rawRequest(`/api/v1/files/${id}`, {
|
|
670
|
+
method: "PATCH",
|
|
671
|
+
body: JSON.stringify(patch)
|
|
672
|
+
}),
|
|
673
|
+
delete: (id) => client.rawRequest(`/api/v1/files/${id}`, { method: "DELETE" }),
|
|
674
|
+
getPresignedUrl: (filename) => client.rawRequest("/api/v1/files/presigned-url", {
|
|
675
|
+
method: "POST",
|
|
676
|
+
body: JSON.stringify({ filename })
|
|
677
|
+
})
|
|
678
|
+
};
|
|
679
|
+
const webhooks = {
|
|
680
|
+
list: () => client.rawRequest("/api/v1/webhooks"),
|
|
681
|
+
create: (input) => client.rawRequest("/api/v1/webhooks", {
|
|
682
|
+
method: "POST",
|
|
683
|
+
body: JSON.stringify(input)
|
|
684
|
+
}),
|
|
685
|
+
update: (id, patch) => client.rawRequest(`/api/v1/webhooks/${id}`, {
|
|
686
|
+
method: "PATCH",
|
|
687
|
+
body: JSON.stringify(patch)
|
|
688
|
+
}),
|
|
689
|
+
delete: (id) => client.rawRequest(`/api/v1/webhooks/${id}`, { method: "DELETE" })
|
|
690
|
+
};
|
|
691
|
+
const activity = {
|
|
692
|
+
list: (params) => {
|
|
693
|
+
const query = new URLSearchParams();
|
|
694
|
+
if (params?.limit) query.append("limit", params.limit.toString());
|
|
695
|
+
if (params?.offset) query.append("offset", params.offset.toString());
|
|
696
|
+
return client.rawRequest(`/api/v1/activity?${query.toString()}`);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
const extensions = {
|
|
700
|
+
list: () => client.rawRequest("/api/v1/extensions"),
|
|
701
|
+
create: (input) => client.rawRequest("/api/v1/extensions", {
|
|
702
|
+
method: "POST",
|
|
703
|
+
body: JSON.stringify(input)
|
|
704
|
+
}),
|
|
705
|
+
update: (id, patch) => client.rawRequest(`/api/v1/extensions/${id}`, {
|
|
706
|
+
method: "PATCH",
|
|
707
|
+
body: JSON.stringify(patch)
|
|
708
|
+
}),
|
|
709
|
+
delete: (id) => client.rawRequest(`/api/v1/extensions/${id}`, { method: "DELETE" })
|
|
710
|
+
};
|
|
711
|
+
const access = {
|
|
712
|
+
checkConflicts: (input) => client.rawRequest("/api/v1/access/conflicts/check", {
|
|
713
|
+
method: "POST",
|
|
714
|
+
body: JSON.stringify(input)
|
|
715
|
+
}),
|
|
716
|
+
exportManifest: () => client.rawRequest("/api/v1/access/export"),
|
|
717
|
+
dryRunImport: (manifest) => client.rawRequest("/api/v1/access/import?dryRun=true", {
|
|
718
|
+
method: "POST",
|
|
719
|
+
body: JSON.stringify(manifest)
|
|
720
|
+
}),
|
|
721
|
+
importManifest: (manifest, options = {}) => {
|
|
722
|
+
const query = options.mode ? `?mode=${encodeURIComponent(options.mode)}` : "";
|
|
723
|
+
return client.rawRequest(`/api/v1/access/import${query}`, {
|
|
724
|
+
method: "POST",
|
|
725
|
+
body: JSON.stringify(manifest)
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
const apiKeys = {
|
|
730
|
+
list: () => client.rawRequest("/api/v1/api-keys"),
|
|
731
|
+
get: (id) => client.rawRequest(`/api/v1/api-keys/${id}`),
|
|
732
|
+
create: (input) => client.rawRequest("/api/v1/api-keys", {
|
|
733
|
+
method: "POST",
|
|
734
|
+
body: JSON.stringify(input)
|
|
735
|
+
}),
|
|
736
|
+
rotate: (id, input = {}) => client.rawRequest(`/api/v1/api-keys/${id}/rotate`, {
|
|
737
|
+
method: "POST",
|
|
738
|
+
body: JSON.stringify(input)
|
|
739
|
+
}),
|
|
740
|
+
revoke: (id) => client.rawRequest(`/api/v1/api-keys/${id}/revoke`, {
|
|
741
|
+
method: "POST"
|
|
742
|
+
}),
|
|
743
|
+
attachRole: (id, input) => client.rawRequest(`/api/v1/api-keys/${id}/roles`, {
|
|
744
|
+
method: "POST",
|
|
745
|
+
body: JSON.stringify(input)
|
|
746
|
+
}),
|
|
747
|
+
detachRole: (id, roleId) => client.rawRequest(`/api/v1/api-keys/${id}/roles/${roleId}`, {
|
|
748
|
+
method: "DELETE"
|
|
749
|
+
}),
|
|
750
|
+
attachPolicy: (id, input) => client.rawRequest(`/api/v1/api-keys/${id}/policies`, {
|
|
751
|
+
method: "POST",
|
|
752
|
+
body: JSON.stringify(input)
|
|
753
|
+
}),
|
|
754
|
+
detachPolicy: (id, policyId) => client.rawRequest(`/api/v1/api-keys/${id}/policies/${policyId}`, {
|
|
755
|
+
method: "DELETE"
|
|
756
|
+
}),
|
|
757
|
+
previewConflicts: (id, input) => access.checkConflicts({
|
|
758
|
+
...input,
|
|
759
|
+
target: { type: "api_key", id }
|
|
760
|
+
})
|
|
761
|
+
};
|
|
762
|
+
const shares = {
|
|
763
|
+
create: (input) => client.rawRequest("/api/v1/shares", {
|
|
764
|
+
method: "POST",
|
|
765
|
+
body: JSON.stringify(input)
|
|
766
|
+
}),
|
|
767
|
+
revoke: (id) => client.rawRequest(`/api/v1/shares/${id}/revoke`, {
|
|
768
|
+
method: "POST"
|
|
769
|
+
})
|
|
770
|
+
};
|
|
771
|
+
return {
|
|
772
|
+
schema,
|
|
773
|
+
items,
|
|
774
|
+
roles,
|
|
775
|
+
policies,
|
|
776
|
+
access,
|
|
777
|
+
apiKeys,
|
|
778
|
+
shares,
|
|
779
|
+
permissions,
|
|
780
|
+
presets,
|
|
781
|
+
translations,
|
|
782
|
+
settings,
|
|
783
|
+
site,
|
|
784
|
+
users,
|
|
785
|
+
teams,
|
|
786
|
+
folders,
|
|
787
|
+
files,
|
|
788
|
+
webhooks,
|
|
789
|
+
activity,
|
|
790
|
+
extensions,
|
|
791
|
+
realtime: {
|
|
792
|
+
/**
|
|
793
|
+
* Create a RealtimeClient for the current site.
|
|
794
|
+
*
|
|
795
|
+
* @param token Bearer token (or dev token) for the WS handshake.
|
|
796
|
+
* @param opts Optional overrides (userId, backoff timing).
|
|
797
|
+
*/
|
|
798
|
+
create: (token, opts) => {
|
|
799
|
+
return new RealtimeClient({
|
|
800
|
+
baseUrl: client.url,
|
|
801
|
+
token,
|
|
802
|
+
siteId: client.siteId ?? "",
|
|
803
|
+
...opts
|
|
804
|
+
});
|
|
805
|
+
},
|
|
806
|
+
/** @deprecated Use .realtime.create() instead. */
|
|
807
|
+
connect: async (siteId) => {
|
|
808
|
+
const res = await client.rawRequest("/api/v1/realtime/ticket", { method: "POST" });
|
|
809
|
+
const ticket = res.data?.ticket;
|
|
810
|
+
if (!ticket) {
|
|
811
|
+
throw new Error("Failed to get realtime ticket");
|
|
812
|
+
}
|
|
813
|
+
const wsUrl = client.url.replace(/^http/, "ws") + "/api/v1/realtime?ticket=" + ticket + "&siteId=" + siteId;
|
|
814
|
+
return new WebSocket(wsUrl);
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
auth: {
|
|
818
|
+
me: () => client.rawRequest("/api/v1/auth/me")
|
|
819
|
+
},
|
|
820
|
+
// Phantom type witness
|
|
821
|
+
_schemaType: void 0,
|
|
822
|
+
// Backward compat request method
|
|
823
|
+
request: client.rawRequest
|
|
824
|
+
};
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// src/rest/index.ts
|
|
829
|
+
function readItems(collection, params) {
|
|
830
|
+
return async (client) => {
|
|
831
|
+
const qs = new URLSearchParams();
|
|
832
|
+
if (params?.fields?.length) qs.set("fields", params.fields.join(","));
|
|
833
|
+
if (params?.filter) qs.set("filter", JSON.stringify(params.filter));
|
|
834
|
+
if (params?.sort?.length) qs.set("sort", params.sort.join(","));
|
|
835
|
+
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
836
|
+
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
837
|
+
if (params?.status) qs.set("status", params.status);
|
|
838
|
+
if (params?.search) qs.set("search", params.search);
|
|
839
|
+
const s = qs.toString();
|
|
840
|
+
const query = s ? `?${s}` : "";
|
|
841
|
+
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
842
|
+
return res;
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function readItem(collection, id, fields) {
|
|
846
|
+
return async (client) => {
|
|
847
|
+
const res = await client.rawRequest(
|
|
848
|
+
`/api/v1/items/${collection}/${id}${fields?.length ? `?fields=${fields.join(",")}` : ""}`
|
|
849
|
+
);
|
|
850
|
+
return res;
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
function exportAccessManifest() {
|
|
854
|
+
return async (client) => {
|
|
855
|
+
const res = await client.rawRequest("/api/v1/access/export");
|
|
856
|
+
return res.data;
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
function dryRunAccessImport(manifest) {
|
|
860
|
+
return async (client) => {
|
|
861
|
+
const res = await client.rawRequest("/api/v1/access/import?dryRun=true", {
|
|
862
|
+
method: "POST",
|
|
863
|
+
body: JSON.stringify(manifest)
|
|
864
|
+
});
|
|
865
|
+
return res.data;
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
function importAccessManifest(manifest, options = {}) {
|
|
869
|
+
return async (client) => {
|
|
870
|
+
const query = options.mode ? `?mode=${encodeURIComponent(options.mode)}` : "";
|
|
871
|
+
const res = await client.rawRequest(`/api/v1/access/import${query}`, {
|
|
872
|
+
method: "POST",
|
|
873
|
+
body: JSON.stringify(manifest)
|
|
874
|
+
});
|
|
875
|
+
return res.data;
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
function createCdcPipeline(input) {
|
|
879
|
+
return async (client) => {
|
|
880
|
+
const res = await client.rawRequest("/api/v1/cdc/pipelines", {
|
|
881
|
+
method: "POST",
|
|
882
|
+
body: JSON.stringify(input)
|
|
883
|
+
});
|
|
884
|
+
return res.data;
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function listCdcPipelines() {
|
|
888
|
+
return async (client) => {
|
|
889
|
+
const res = await client.rawRequest("/api/v1/cdc/pipelines");
|
|
890
|
+
return res.data.pipelines;
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
function readCdcPipeline(id) {
|
|
894
|
+
return async (client) => {
|
|
895
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}`);
|
|
896
|
+
return res.data;
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
function updateCdcPipeline(id, input) {
|
|
900
|
+
return async (client) => {
|
|
901
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}`, {
|
|
902
|
+
method: "PATCH",
|
|
903
|
+
body: JSON.stringify(input)
|
|
904
|
+
});
|
|
905
|
+
return res.data;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
function deleteCdcPipeline(id) {
|
|
909
|
+
return async (client) => {
|
|
910
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}`, {
|
|
911
|
+
method: "DELETE"
|
|
912
|
+
});
|
|
913
|
+
return res.data;
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function startCdcPipeline(id) {
|
|
917
|
+
return async (client) => {
|
|
918
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}/start`, {
|
|
919
|
+
method: "POST"
|
|
920
|
+
});
|
|
921
|
+
return res.data;
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
function stopCdcPipeline(id) {
|
|
925
|
+
return async (client) => {
|
|
926
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}/stop`, {
|
|
927
|
+
method: "POST"
|
|
928
|
+
});
|
|
929
|
+
return res.data;
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function checkCdcPipelineHealth(id) {
|
|
933
|
+
return async (client) => {
|
|
934
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}/health`);
|
|
935
|
+
return res.data;
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function readCdcPipelineMetrics(id) {
|
|
939
|
+
return async (client) => {
|
|
940
|
+
const res = await client.rawRequest(`/api/v1/cdc/pipelines/${id}/metrics`);
|
|
941
|
+
return res.data;
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
function readCdcPipelineMetricHistory(id, since) {
|
|
945
|
+
return async (client) => {
|
|
946
|
+
const value = since instanceof Date ? since.toISOString() : since;
|
|
947
|
+
const query = value ? `?since=${encodeURIComponent(value)}` : "";
|
|
948
|
+
const res = await client.rawRequest(
|
|
949
|
+
`/api/v1/cdc/pipelines/${id}/metrics/history${query}`
|
|
950
|
+
);
|
|
951
|
+
return res.data;
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
function deployCdc(input) {
|
|
955
|
+
return async (client) => {
|
|
956
|
+
const res = await client.rawRequest("/api/v1/cdc/deploy", {
|
|
957
|
+
method: "POST",
|
|
958
|
+
body: JSON.stringify(input)
|
|
959
|
+
});
|
|
960
|
+
return res.data;
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
function validateCdcDeploymentEnv(input) {
|
|
964
|
+
return async (client) => {
|
|
965
|
+
const res = await client.rawRequest("/api/v1/cdc/deploy/validate-env", {
|
|
966
|
+
method: "POST",
|
|
967
|
+
body: JSON.stringify(input)
|
|
968
|
+
});
|
|
969
|
+
return res.data;
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
function rollbackCdcDeployment(id) {
|
|
973
|
+
return async (client) => {
|
|
974
|
+
const res = await client.rawRequest(`/api/v1/cdc/deploy/${id}/rollback`, {
|
|
975
|
+
method: "POST"
|
|
976
|
+
});
|
|
977
|
+
return res.data;
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function listAgentGoals() {
|
|
981
|
+
return async (client) => {
|
|
982
|
+
const res = await client.rawRequest("/api/v1/agent/goals");
|
|
983
|
+
return res.data;
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
function createAgentGoal(input) {
|
|
987
|
+
return async (client) => {
|
|
988
|
+
const res = await client.rawRequest("/api/v1/agent/goals", {
|
|
989
|
+
method: "POST",
|
|
990
|
+
body: JSON.stringify(input)
|
|
991
|
+
});
|
|
992
|
+
return res.data;
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function listAgentRuns() {
|
|
996
|
+
return async (client) => {
|
|
997
|
+
const res = await client.rawRequest("/api/v1/agent/runs");
|
|
998
|
+
return res.data;
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function retryAgentRun(id) {
|
|
1002
|
+
return async (client) => {
|
|
1003
|
+
const res = await client.rawRequest(`/api/v1/agent/runs/${id}/retry`, {
|
|
1004
|
+
method: "POST"
|
|
1005
|
+
});
|
|
1006
|
+
return res.data;
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function listAgentTools() {
|
|
1010
|
+
return async (client) => {
|
|
1011
|
+
const res = await client.rawRequest("/api/v1/agent/tools");
|
|
1012
|
+
return res.data;
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function listAgentApprovals() {
|
|
1016
|
+
return async (client) => {
|
|
1017
|
+
const res = await client.rawRequest("/api/v1/agent/approvals");
|
|
1018
|
+
return res.data;
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function decideAgentApproval(id, decision, reason) {
|
|
1022
|
+
return async (client) => {
|
|
1023
|
+
const res = await client.rawRequest(`/api/v1/agent/approvals/${id}/decide`, {
|
|
1024
|
+
method: "POST",
|
|
1025
|
+
body: JSON.stringify({ decision, reason })
|
|
1026
|
+
});
|
|
1027
|
+
return res.data;
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
function listAgentArtifacts(runId) {
|
|
1031
|
+
return async (client) => {
|
|
1032
|
+
const query = runId ? `?runId=${encodeURIComponent(runId)}` : "";
|
|
1033
|
+
const res = await client.rawRequest(`/api/v1/agent/artifacts${query}`);
|
|
1034
|
+
return res.data;
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
function createAgentArtifact(input) {
|
|
1038
|
+
return async (client) => {
|
|
1039
|
+
const res = await client.rawRequest("/api/v1/agent/artifacts", {
|
|
1040
|
+
method: "POST",
|
|
1041
|
+
body: JSON.stringify(input)
|
|
1042
|
+
});
|
|
1043
|
+
return res.data;
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
function evaluateAgentArtifact(id, runId) {
|
|
1047
|
+
return async (client) => {
|
|
1048
|
+
const res = await client.rawRequest(`/api/v1/agent/artifacts/${id}/evaluate?runId=${encodeURIComponent(runId)}`, {
|
|
1049
|
+
method: "POST"
|
|
1050
|
+
});
|
|
1051
|
+
return res.data;
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
function publishAgentArtifact(id, overrideReason) {
|
|
1055
|
+
return async (client) => {
|
|
1056
|
+
const res = await client.rawRequest(`/api/v1/agent/artifacts/${id}/publish`, {
|
|
1057
|
+
method: "POST",
|
|
1058
|
+
body: JSON.stringify({ overrideReason })
|
|
1059
|
+
});
|
|
1060
|
+
return res.data;
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
function rollbackAgentArtifact(id, reason) {
|
|
1064
|
+
return async (client) => {
|
|
1065
|
+
const res = await client.rawRequest(`/api/v1/agent/artifacts/${id}/rollback`, {
|
|
1066
|
+
method: "POST",
|
|
1067
|
+
body: JSON.stringify({ reason })
|
|
1068
|
+
});
|
|
1069
|
+
return res.data;
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function readAgentMemoryContext(scope, scopeId) {
|
|
1073
|
+
return async (client) => {
|
|
1074
|
+
const qs = new URLSearchParams();
|
|
1075
|
+
if (scope) qs.set("scope", scope);
|
|
1076
|
+
if (scopeId) qs.set("scopeId", scopeId);
|
|
1077
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
1078
|
+
const res = await client.rawRequest(`/api/v1/agent/memory${query}`);
|
|
1079
|
+
return res.data;
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
function writeAgentMemory(input) {
|
|
1083
|
+
return async (client) => {
|
|
1084
|
+
const res = await client.rawRequest("/api/v1/agent/memory", {
|
|
1085
|
+
method: "POST",
|
|
1086
|
+
body: JSON.stringify(input)
|
|
1087
|
+
});
|
|
1088
|
+
return res.data;
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
function generateAgentApp(input) {
|
|
1092
|
+
return async (client) => {
|
|
1093
|
+
const res = await client.rawRequest("/api/v1/agent/generate-app", {
|
|
1094
|
+
method: "POST",
|
|
1095
|
+
body: JSON.stringify(input)
|
|
1096
|
+
});
|
|
1097
|
+
return res.data;
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// src/graphql/index.ts
|
|
1102
|
+
function graphql(endpoint = "/api/v1/graphql") {
|
|
1103
|
+
return (client) => {
|
|
1104
|
+
async function execute(document, variables) {
|
|
1105
|
+
const res = await client.rawRequest(endpoint, {
|
|
1106
|
+
method: "POST",
|
|
1107
|
+
body: JSON.stringify({ query: document, variables })
|
|
1108
|
+
});
|
|
1109
|
+
const body = res;
|
|
1110
|
+
if (body.errors?.length) {
|
|
1111
|
+
const errorBody = {
|
|
1112
|
+
errors: body.errors.map((e) => ({
|
|
1113
|
+
code: typeof e.extensions?.code === "string" ? e.extensions.code : "GRAPHQL_ERROR",
|
|
1114
|
+
message: e.message,
|
|
1115
|
+
path: e.path?.map(String),
|
|
1116
|
+
...e.extensions
|
|
1117
|
+
}))
|
|
1118
|
+
};
|
|
1119
|
+
const status = Number(body.errors[0]?.extensions?.status) || 400;
|
|
1120
|
+
throw new LumiError(status, errorBody);
|
|
1121
|
+
}
|
|
1122
|
+
if (body.data === void 0 || body.data === null) {
|
|
1123
|
+
throw new LumiError(500, {
|
|
1124
|
+
errors: [{ code: "GRAPHQL_EMPTY", message: "GraphQL response contained no data." }]
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
return body.data;
|
|
1128
|
+
}
|
|
1129
|
+
return {
|
|
1130
|
+
query: (document, variables) => execute(document, variables),
|
|
1131
|
+
mutate: (document, variables) => execute(document, variables)
|
|
1132
|
+
};
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// src/typegen/index.ts
|
|
1137
|
+
function generateTypes(manifest, options = {}) {
|
|
1138
|
+
const { format = "single", branded = true } = options;
|
|
1139
|
+
if (format === "single") {
|
|
1140
|
+
return generateSingleFile(manifest, branded);
|
|
1141
|
+
}
|
|
1142
|
+
return generatePerCollection(manifest, branded);
|
|
1143
|
+
}
|
|
1144
|
+
function generateSingleFile(manifest, branded) {
|
|
1145
|
+
const imports = [
|
|
1146
|
+
"import type { ID, Locale } from '@lumibase/sdk';",
|
|
1147
|
+
branded ? "import type { Brand } from '@lumibase/sdk';" : ""
|
|
1148
|
+
].filter(Boolean).join("\n");
|
|
1149
|
+
const collectionInterfaces = manifest.collections.map((coll) => {
|
|
1150
|
+
const base = generateCollectionInterface(coll, branded);
|
|
1151
|
+
const expanded = generateExpandedType(coll);
|
|
1152
|
+
return [base, expanded].filter(Boolean).join("\n\n");
|
|
1153
|
+
}).join("\n\n");
|
|
1154
|
+
const collectionsMap = `export interface LumibaseCollections {
|
|
1155
|
+
${manifest.collections.map((c) => ` ${c.name}: ${capitalize(c.name)};`).join("\n")}
|
|
1156
|
+
}`;
|
|
1157
|
+
const schemaType = "export type LumibaseSchema = LumibaseCollections;";
|
|
1158
|
+
return `${imports}
|
|
1159
|
+
|
|
1160
|
+
${collectionInterfaces}
|
|
1161
|
+
|
|
1162
|
+
${collectionsMap}
|
|
1163
|
+
|
|
1164
|
+
${schemaType}`;
|
|
1165
|
+
}
|
|
1166
|
+
function generatePerCollection(manifest, branded) {
|
|
1167
|
+
return generateSingleFile(manifest, branded);
|
|
1168
|
+
}
|
|
1169
|
+
function generateCollectionInterface(coll, branded) {
|
|
1170
|
+
const fields = coll.fields.map((f) => {
|
|
1171
|
+
const tsType = mapFieldTypeToTs(f, coll, branded);
|
|
1172
|
+
const optional = f.required ? "" : "?";
|
|
1173
|
+
const readonly = f.readonly || f.generated ? "readonly " : "";
|
|
1174
|
+
return ` ${readonly}${f.name}${optional}: ${tsType};`;
|
|
1175
|
+
}).join("\n");
|
|
1176
|
+
return `export interface ${capitalize(coll.name)} {
|
|
1177
|
+
${fields}
|
|
1178
|
+
}`;
|
|
1179
|
+
}
|
|
1180
|
+
function generateExpandedType(coll) {
|
|
1181
|
+
const relations = coll.relations ?? [];
|
|
1182
|
+
if (relations.length === 0) {
|
|
1183
|
+
return `export type ${capitalize(coll.name)}Expanded = ${capitalize(coll.name)};`;
|
|
1184
|
+
}
|
|
1185
|
+
const omittedKeys = relations.map((relation) => quoteProperty(relation.field)).join(" | ");
|
|
1186
|
+
const fields = relations.map((relation) => ` ${relation.field}?: ${expandedRelationType(relation)};`).join("\n");
|
|
1187
|
+
return `export type ${capitalize(coll.name)}Expanded = Omit<${capitalize(coll.name)}, ${omittedKeys}> & {
|
|
1188
|
+
${fields}
|
|
1189
|
+
};`;
|
|
1190
|
+
}
|
|
1191
|
+
function expandedRelationType(relation) {
|
|
1192
|
+
if (relation.kind === "m2o") {
|
|
1193
|
+
return `${capitalize(relation.target)} | ${capitalize(relation.target)}Expanded | null`;
|
|
1194
|
+
}
|
|
1195
|
+
if (relation.kind === "o2m" || relation.kind === "m2m") {
|
|
1196
|
+
return `Array<${capitalize(relation.target)} | ${capitalize(relation.target)}Expanded>`;
|
|
1197
|
+
}
|
|
1198
|
+
return `Array<{ collection: string; item: unknown }>`;
|
|
1199
|
+
}
|
|
1200
|
+
function mapFieldTypeToTs(field, coll, branded) {
|
|
1201
|
+
if (field.kind === "m2o") {
|
|
1202
|
+
return nullable(field, mapScalarFieldType(field, branded));
|
|
1203
|
+
}
|
|
1204
|
+
if (field.kind === "o2m" || field.kind === "m2m") {
|
|
1205
|
+
return `${capitalize(field.target || "unknown")}[]`;
|
|
1206
|
+
}
|
|
1207
|
+
if (field.kind === "m2a") {
|
|
1208
|
+
return `Array<{ collection: string; item: unknown }>`;
|
|
1209
|
+
}
|
|
1210
|
+
if (field.enum && field.enum.length > 0) {
|
|
1211
|
+
return nullable(field, field.enum.map((v) => JSON.stringify(v)).join(" | "));
|
|
1212
|
+
}
|
|
1213
|
+
if (field.primaryKey) {
|
|
1214
|
+
return nullable(
|
|
1215
|
+
field,
|
|
1216
|
+
mapPrimaryKeyType(coll.primaryKeyType ?? "nanoid", branded, field.branded)
|
|
1217
|
+
);
|
|
1218
|
+
}
|
|
1219
|
+
const tsType = mapScalarFieldType(field, branded);
|
|
1220
|
+
return nullable(field, field.encrypted ? `${tsType} | '***'` : tsType);
|
|
1221
|
+
}
|
|
1222
|
+
function mapScalarFieldType(field, branded) {
|
|
1223
|
+
const typeMap = {
|
|
1224
|
+
string: "string",
|
|
1225
|
+
text: "string",
|
|
1226
|
+
hash: "string",
|
|
1227
|
+
csv: "string",
|
|
1228
|
+
integer: "number",
|
|
1229
|
+
bigInteger: "number",
|
|
1230
|
+
decimal: "number",
|
|
1231
|
+
boolean: "boolean",
|
|
1232
|
+
json: "unknown",
|
|
1233
|
+
uuid: mapPrimaryKeyType("uuid", branded, field.branded),
|
|
1234
|
+
date: "string",
|
|
1235
|
+
datetime: "string",
|
|
1236
|
+
time: "string",
|
|
1237
|
+
timestamp: "string",
|
|
1238
|
+
geometry: "GeoJSON.Geometry"
|
|
1239
|
+
};
|
|
1240
|
+
return typeMap[field.type] || "unknown";
|
|
1241
|
+
}
|
|
1242
|
+
function nullable(field, tsType) {
|
|
1243
|
+
if (!field.required || field.nullable) {
|
|
1244
|
+
return `${tsType} | null`;
|
|
1245
|
+
}
|
|
1246
|
+
return tsType;
|
|
1247
|
+
}
|
|
1248
|
+
function mapPrimaryKeyType(primaryKeyType, branded, brand) {
|
|
1249
|
+
if (primaryKeyType === "integer" || primaryKeyType === "bigInteger") return "number";
|
|
1250
|
+
if (branded) return `Brand<'${brand || "ID"}', string>`;
|
|
1251
|
+
return "ID";
|
|
1252
|
+
}
|
|
1253
|
+
function capitalize(str) {
|
|
1254
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1255
|
+
}
|
|
1256
|
+
function quoteProperty(name) {
|
|
1257
|
+
return JSON.stringify(name);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// src/seo.ts
|
|
1261
|
+
function extractSeo(item) {
|
|
1262
|
+
if (!item || typeof item !== "object") return void 0;
|
|
1263
|
+
const seo = item._seo;
|
|
1264
|
+
return seo && typeof seo === "object" ? seo : void 0;
|
|
1265
|
+
}
|
|
1266
|
+
function toNextMetadata(item) {
|
|
1267
|
+
const seo = extractSeo(item);
|
|
1268
|
+
if (!seo) return {};
|
|
1269
|
+
const metadata = {};
|
|
1270
|
+
if (seo.title) metadata.title = seo.title;
|
|
1271
|
+
if (seo.description) metadata.description = seo.description;
|
|
1272
|
+
if (seo.canonical) metadata.alternates = { canonical: seo.canonical };
|
|
1273
|
+
if (seo.openGraph) metadata.openGraph = seo.openGraph;
|
|
1274
|
+
return metadata;
|
|
1275
|
+
}
|
|
1276
|
+
function jsonLdScript(item) {
|
|
1277
|
+
const seo = extractSeo(item);
|
|
1278
|
+
if (!seo?.jsonLd) return void 0;
|
|
1279
|
+
return JSON.stringify(seo.jsonLd);
|
|
1280
|
+
}
|
|
1281
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1282
|
+
0 && (module.exports = {
|
|
1283
|
+
ACCESS_EXPORT_SCHEMA,
|
|
1284
|
+
LumiError,
|
|
1285
|
+
RealtimeClient,
|
|
1286
|
+
checkCdcPipelineHealth,
|
|
1287
|
+
createAgentArtifact,
|
|
1288
|
+
createAgentGoal,
|
|
1289
|
+
createCdcPipeline,
|
|
1290
|
+
createLumiClient,
|
|
1291
|
+
decideAgentApproval,
|
|
1292
|
+
deleteCdcPipeline,
|
|
1293
|
+
deployCdc,
|
|
1294
|
+
dryRunAccessImport,
|
|
1295
|
+
evaluateAgentArtifact,
|
|
1296
|
+
exportAccessManifest,
|
|
1297
|
+
extractSeo,
|
|
1298
|
+
generateAgentApp,
|
|
1299
|
+
generateTypes,
|
|
1300
|
+
graphql,
|
|
1301
|
+
importAccessManifest,
|
|
1302
|
+
jsonLdScript,
|
|
1303
|
+
legacyRest,
|
|
1304
|
+
listAgentApprovals,
|
|
1305
|
+
listAgentArtifacts,
|
|
1306
|
+
listAgentGoals,
|
|
1307
|
+
listAgentRuns,
|
|
1308
|
+
listAgentTools,
|
|
1309
|
+
listCdcPipelines,
|
|
1310
|
+
publishAgentArtifact,
|
|
1311
|
+
readAgentMemoryContext,
|
|
1312
|
+
readCdcPipeline,
|
|
1313
|
+
readCdcPipelineMetricHistory,
|
|
1314
|
+
readCdcPipelineMetrics,
|
|
1315
|
+
readItem,
|
|
1316
|
+
readItems,
|
|
1317
|
+
retryAgentRun,
|
|
1318
|
+
rollbackAgentArtifact,
|
|
1319
|
+
rollbackCdcDeployment,
|
|
1320
|
+
startCdcPipeline,
|
|
1321
|
+
stopCdcPipeline,
|
|
1322
|
+
toNextMetadata,
|
|
1323
|
+
updateCdcPipeline,
|
|
1324
|
+
validateCdcDeploymentEnv,
|
|
1325
|
+
writeAgentMemory
|
|
1326
|
+
});
|