@bemaestro/sdk 0.1.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 +193 -0
- package/README.md +78 -0
- package/dist/generator/generate-sdk.d.ts +14 -0
- package/dist/generator/generate-sdk.d.ts.map +1 -0
- package/dist/generator/generate-sdk.js +64 -0
- package/dist/generator/generate-sdk.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/openapi/build-openapi.d.ts +3 -0
- package/dist/openapi/build-openapi.d.ts.map +1 -0
- package/dist/openapi/build-openapi.js +386 -0
- package/dist/openapi/build-openapi.js.map +1 -0
- package/dist/openapi/schema-mapping.d.ts +9 -0
- package/dist/openapi/schema-mapping.d.ts.map +1 -0
- package/dist/openapi/schema-mapping.js +120 -0
- package/dist/openapi/schema-mapping.js.map +1 -0
- package/dist/openapi/types.d.ts +37 -0
- package/dist/openapi/types.d.ts.map +1 -0
- package/dist/openapi/types.js +2 -0
- package/dist/openapi/types.js.map +1 -0
- package/dist/runtime/client.d.ts +495 -0
- package/dist/runtime/client.d.ts.map +1 -0
- package/dist/runtime/client.js +46 -0
- package/dist/runtime/client.js.map +1 -0
- package/dist/runtime/http.d.ts +11 -0
- package/dist/runtime/http.d.ts.map +1 -0
- package/dist/runtime/http.js +120 -0
- package/dist/runtime/http.js.map +1 -0
- package/dist/runtime/index.d.ts +7 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/modules.d.ts +623 -0
- package/dist/runtime/modules.d.ts.map +1 -0
- package/dist/runtime/modules.js +694 -0
- package/dist/runtime/modules.js.map +1 -0
- package/dist/runtime/types.d.ts +72 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +11 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/webhook-verify.d.ts +31 -0
- package/dist/runtime/webhook-verify.d.ts.map +1 -0
- package/dist/runtime/webhook-verify.js +51 -0
- package/dist/runtime/webhook-verify.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import type { CollectionSchema } from '@bemaestro/schema-engine';
|
|
2
|
+
import type { MaestroClientConfig } from './types.js';
|
|
3
|
+
export declare function createMaestroClient(config: MaestroClientConfig): {
|
|
4
|
+
app: string;
|
|
5
|
+
http: import("./types.js").MaestroHttpClient;
|
|
6
|
+
auth: {
|
|
7
|
+
login(input: import("./modules.js").AuthLoginInput): Promise<import("./modules.js").AuthLoginResult>;
|
|
8
|
+
refresh(refreshToken: string): Promise<import("./types.js").TokenPair>;
|
|
9
|
+
logout(refreshToken: string): Promise<void>;
|
|
10
|
+
switchOrg(orgId: string): Promise<import("./modules.js").AuthLoginResult>;
|
|
11
|
+
register(input: {
|
|
12
|
+
email: string;
|
|
13
|
+
password: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
id: string;
|
|
17
|
+
email: string;
|
|
18
|
+
name: string;
|
|
19
|
+
message?: string;
|
|
20
|
+
}>;
|
|
21
|
+
forgotPassword(email: string): Promise<{
|
|
22
|
+
message: string;
|
|
23
|
+
}>;
|
|
24
|
+
resetPassword(input: {
|
|
25
|
+
token: string;
|
|
26
|
+
password: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
verifyEmail(token: string): Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
capabilities: {
|
|
31
|
+
get(): Promise<import("./modules.js").CapabilitiesResponse>;
|
|
32
|
+
};
|
|
33
|
+
orgs: {
|
|
34
|
+
me(): Promise<{
|
|
35
|
+
id: string;
|
|
36
|
+
email: string;
|
|
37
|
+
name: string;
|
|
38
|
+
emailVerifiedAt?: string | null;
|
|
39
|
+
accountKinds?: "individuals" | "organizations" | "both";
|
|
40
|
+
}>;
|
|
41
|
+
myOrgs(): Promise<{
|
|
42
|
+
data: import("./modules.js").AuthLoginResult["orgs"];
|
|
43
|
+
}>;
|
|
44
|
+
create(input: string | {
|
|
45
|
+
name?: string;
|
|
46
|
+
kind?: "individual" | "organization";
|
|
47
|
+
}): Promise<{
|
|
48
|
+
org: Record<string, unknown>;
|
|
49
|
+
accessToken?: string;
|
|
50
|
+
refreshToken?: string;
|
|
51
|
+
}>;
|
|
52
|
+
get(orgId: string): Promise<import("./modules.js").OrgRecord>;
|
|
53
|
+
rename(orgId: string, name: string): Promise<import("./modules.js").OrgRecord>;
|
|
54
|
+
listMembers(orgId: string): Promise<{
|
|
55
|
+
userId: string;
|
|
56
|
+
email: string;
|
|
57
|
+
name: string;
|
|
58
|
+
role: string;
|
|
59
|
+
status: string;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
}[]>;
|
|
62
|
+
inviteMember(orgId: string, input: {
|
|
63
|
+
email: string;
|
|
64
|
+
role: string;
|
|
65
|
+
}): Promise<Record<string, unknown>>;
|
|
66
|
+
updateMemberRole(orgId: string, userId: string, role: string): Promise<void>;
|
|
67
|
+
removeMember(orgId: string, userId: string): Promise<void>;
|
|
68
|
+
acceptInvitation(token: string): Promise<{
|
|
69
|
+
orgId: string;
|
|
70
|
+
role: string;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
billing: {
|
|
74
|
+
listPlans(): Promise<Record<string, unknown>[]>;
|
|
75
|
+
usage(orgId: string): Promise<Record<string, unknown>>;
|
|
76
|
+
subscribe(orgId: string, planKey: string): Promise<Record<string, unknown>>;
|
|
77
|
+
portal(orgId: string): Promise<{
|
|
78
|
+
url: string;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
files: {
|
|
82
|
+
sign(input: {
|
|
83
|
+
filename: string;
|
|
84
|
+
mime: string;
|
|
85
|
+
size: number;
|
|
86
|
+
}): Promise<{
|
|
87
|
+
fileId: string;
|
|
88
|
+
uploadUrl: string;
|
|
89
|
+
headers?: Record<string, string>;
|
|
90
|
+
}>;
|
|
91
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<Record<string, unknown>>>;
|
|
92
|
+
get(id: string): Promise<Record<string, unknown>>;
|
|
93
|
+
remove(id: string, force?: boolean): Promise<void>;
|
|
94
|
+
};
|
|
95
|
+
webhooks: {
|
|
96
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").WebhookSubscription>>;
|
|
97
|
+
create(input: {
|
|
98
|
+
url: string;
|
|
99
|
+
events: string[];
|
|
100
|
+
orgId?: string;
|
|
101
|
+
secret?: string;
|
|
102
|
+
}): Promise<import("./modules.js").WebhookSubscription & {
|
|
103
|
+
secret?: string;
|
|
104
|
+
}>;
|
|
105
|
+
get(id: string): Promise<import("./modules.js").WebhookSubscription>;
|
|
106
|
+
patch(id: string, input: Partial<{
|
|
107
|
+
url: string;
|
|
108
|
+
events: string[];
|
|
109
|
+
active: boolean;
|
|
110
|
+
}>): Promise<import("./modules.js").WebhookSubscription>;
|
|
111
|
+
remove(id: string): Promise<{
|
|
112
|
+
ok: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
listDeliveries(id: string, params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").WebhookDelivery>>;
|
|
115
|
+
replayDelivery(webhookId: string, deliveryId: string): Promise<import("./modules.js").WebhookDeliveryResult>;
|
|
116
|
+
sendTest(id: string): Promise<import("./modules.js").WebhookDeliveryResult>;
|
|
117
|
+
};
|
|
118
|
+
flows: {
|
|
119
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").FlowSummary>>;
|
|
120
|
+
create(input: import("./modules.js").FlowDefinitionInput): Promise<import("./modules.js").FlowSummary>;
|
|
121
|
+
get(id: string): Promise<import("./modules.js").FlowSummary>;
|
|
122
|
+
patch(id: string, input: Partial<import("./modules.js").FlowDefinitionInput>): Promise<import("./modules.js").FlowSummary>;
|
|
123
|
+
remove(id: string): Promise<{
|
|
124
|
+
ok: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
listRuns(id: string, params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").FlowRunSummary>>;
|
|
127
|
+
};
|
|
128
|
+
schema: {
|
|
129
|
+
listCollections(): Promise<import("./types.js").ListResponse<import("./modules.js").SchemaCollectionDetail>>;
|
|
130
|
+
getCollection(key: string): Promise<import("./modules.js").SchemaCollectionDetail>;
|
|
131
|
+
createCollection(input: import("./modules.js").SchemaCollectionInput): Promise<import("./modules.js").SchemaMutationResult>;
|
|
132
|
+
patchCollection(key: string, input: Partial<import("./modules.js").SchemaCollectionInput>, options?: {
|
|
133
|
+
confirmDestructive?: boolean;
|
|
134
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
135
|
+
planChange(key: string, input: Partial<import("./modules.js").SchemaCollectionInput>): Promise<import("./modules.js").SchemaPlanPreview>;
|
|
136
|
+
deleteCollection(key: string, options?: {
|
|
137
|
+
confirmDestructive?: boolean;
|
|
138
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
139
|
+
listMigrationStatus(): Promise<import("./types.js").ListResponse<import("./modules.js").SchemaMigrationStatus>>;
|
|
140
|
+
reconcile(): Promise<import("./modules.js").SchemaReconcileResult>;
|
|
141
|
+
};
|
|
142
|
+
ai: {
|
|
143
|
+
proposeSchema(prompt: string, collectionKey?: string): Promise<import("./modules.js").AiSchemaProposal>;
|
|
144
|
+
applySchema(definition: import("./modules.js").SchemaCollectionInput, options?: {
|
|
145
|
+
confirmDestructive?: boolean;
|
|
146
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
147
|
+
listAssistants(): Promise<import("./types.js").ListResponse<import("./modules.js").AssistantSummary>>;
|
|
148
|
+
upsertAssistant(input: import("./modules.js").AssistantInput): Promise<import("./modules.js").AssistantSummary>;
|
|
149
|
+
};
|
|
150
|
+
apiKeys: {
|
|
151
|
+
list(): Promise<import("./types.js").ListResponse<import("./modules.js").ApiKeySummary>>;
|
|
152
|
+
issue(input: {
|
|
153
|
+
name: string;
|
|
154
|
+
scope: string[];
|
|
155
|
+
}): Promise<import("./modules.js").ApiKeySummary & {
|
|
156
|
+
key: string;
|
|
157
|
+
}>;
|
|
158
|
+
revoke(id: string): Promise<void>;
|
|
159
|
+
};
|
|
160
|
+
conversations: {
|
|
161
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").ConversationSummary>>;
|
|
162
|
+
get(id: string): Promise<import("./modules.js").ConversationDetail>;
|
|
163
|
+
remove(id: string): Promise<{
|
|
164
|
+
deleted: true;
|
|
165
|
+
id: string;
|
|
166
|
+
}>;
|
|
167
|
+
};
|
|
168
|
+
mcp: {
|
|
169
|
+
listTools(): Promise<import("./modules.js").McpToolsResponse>;
|
|
170
|
+
};
|
|
171
|
+
events: {
|
|
172
|
+
list(params?: {
|
|
173
|
+
action?: string;
|
|
174
|
+
limit?: number;
|
|
175
|
+
offset?: number;
|
|
176
|
+
}): Promise<import("./types.js").ListResponse<import("./modules.js").AuditEvent>>;
|
|
177
|
+
};
|
|
178
|
+
notifications: {
|
|
179
|
+
list(params?: {
|
|
180
|
+
unread?: boolean;
|
|
181
|
+
limit?: number;
|
|
182
|
+
offset?: number;
|
|
183
|
+
}): Promise<import("./modules.js").NotificationListResponse>;
|
|
184
|
+
markRead(id: string): Promise<import("./modules.js").NotificationItem>;
|
|
185
|
+
preferences(): Promise<{
|
|
186
|
+
data: Array<Record<string, unknown>>;
|
|
187
|
+
}>;
|
|
188
|
+
setPreference(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
189
|
+
};
|
|
190
|
+
views: {
|
|
191
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").ViewSummary>>;
|
|
192
|
+
create(input: import("./modules.js").ViewDefinitionInput): Promise<{
|
|
193
|
+
data: import("./modules.js").ViewSummary;
|
|
194
|
+
}>;
|
|
195
|
+
get(key: string): Promise<{
|
|
196
|
+
data: import("./modules.js").ViewSummary;
|
|
197
|
+
}>;
|
|
198
|
+
patch(key: string, input: Partial<import("./modules.js").ViewDefinitionInput>): Promise<{
|
|
199
|
+
data: import("./modules.js").ViewSummary;
|
|
200
|
+
}>;
|
|
201
|
+
remove(key: string): Promise<{
|
|
202
|
+
data: {
|
|
203
|
+
key: string;
|
|
204
|
+
deleted: true;
|
|
205
|
+
};
|
|
206
|
+
}>;
|
|
207
|
+
};
|
|
208
|
+
surfaces: {
|
|
209
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").SurfaceSummary>>;
|
|
210
|
+
create(input: import("./modules.js").SurfaceDefinitionInput): Promise<{
|
|
211
|
+
data: import("./modules.js").SurfaceSummary;
|
|
212
|
+
}>;
|
|
213
|
+
get(key: string): Promise<{
|
|
214
|
+
data: import("./modules.js").SurfaceSummary;
|
|
215
|
+
}>;
|
|
216
|
+
patch(key: string, input: Partial<import("./modules.js").SurfaceDefinitionInput>): Promise<{
|
|
217
|
+
data: import("./modules.js").SurfaceSummary;
|
|
218
|
+
}>;
|
|
219
|
+
remove(key: string): Promise<{
|
|
220
|
+
data: {
|
|
221
|
+
key: string;
|
|
222
|
+
deleted: true;
|
|
223
|
+
};
|
|
224
|
+
}>;
|
|
225
|
+
runtime(): Promise<{
|
|
226
|
+
data: import("./modules.js").RuntimeResponse;
|
|
227
|
+
}>;
|
|
228
|
+
};
|
|
229
|
+
public: {
|
|
230
|
+
collection<TRecord extends Record<string, unknown>>(orgId: string, collectionKey: string): {
|
|
231
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
232
|
+
get(id: string, params?: Pick<import("./types.js").ListParams, "expand" | "fields">): Promise<TRecord>;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
collection<TRecord extends Record<string, unknown>>(collectionKey: string): {
|
|
236
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
237
|
+
get(id: string, params?: Pick<import("./types.js").ListParams, "expand" | "fields" | "withDeleted">): Promise<TRecord>;
|
|
238
|
+
create(body: Partial<TRecord>): Promise<TRecord>;
|
|
239
|
+
patch(id: string, body: Partial<TRecord>): Promise<TRecord>;
|
|
240
|
+
put(id: string, body: Partial<TRecord>): Promise<TRecord>;
|
|
241
|
+
delete(id: string): Promise<void>;
|
|
242
|
+
search(query: string, params?: Omit<import("./types.js").ListParams, "search">): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
243
|
+
bulk(items: Partial<TRecord>[], partial?: boolean): Promise<{
|
|
244
|
+
data: TRecord[];
|
|
245
|
+
}>;
|
|
246
|
+
};
|
|
247
|
+
withCollections(collections: CollectionSchema[]): {
|
|
248
|
+
app: string;
|
|
249
|
+
http: import("./types.js").MaestroHttpClient;
|
|
250
|
+
auth: {
|
|
251
|
+
login(input: import("./modules.js").AuthLoginInput): Promise<import("./modules.js").AuthLoginResult>;
|
|
252
|
+
refresh(refreshToken: string): Promise<import("./types.js").TokenPair>;
|
|
253
|
+
logout(refreshToken: string): Promise<void>;
|
|
254
|
+
switchOrg(orgId: string): Promise<import("./modules.js").AuthLoginResult>;
|
|
255
|
+
register(input: {
|
|
256
|
+
email: string;
|
|
257
|
+
password: string;
|
|
258
|
+
name: string;
|
|
259
|
+
}): Promise<{
|
|
260
|
+
id: string;
|
|
261
|
+
email: string;
|
|
262
|
+
name: string;
|
|
263
|
+
message?: string;
|
|
264
|
+
}>;
|
|
265
|
+
forgotPassword(email: string): Promise<{
|
|
266
|
+
message: string;
|
|
267
|
+
}>;
|
|
268
|
+
resetPassword(input: {
|
|
269
|
+
token: string;
|
|
270
|
+
password: string;
|
|
271
|
+
}): Promise<void>;
|
|
272
|
+
verifyEmail(token: string): Promise<void>;
|
|
273
|
+
};
|
|
274
|
+
capabilities: {
|
|
275
|
+
get(): Promise<import("./modules.js").CapabilitiesResponse>;
|
|
276
|
+
};
|
|
277
|
+
orgs: {
|
|
278
|
+
me(): Promise<{
|
|
279
|
+
id: string;
|
|
280
|
+
email: string;
|
|
281
|
+
name: string;
|
|
282
|
+
emailVerifiedAt?: string | null;
|
|
283
|
+
accountKinds?: "individuals" | "organizations" | "both";
|
|
284
|
+
}>;
|
|
285
|
+
myOrgs(): Promise<{
|
|
286
|
+
data: import("./modules.js").AuthLoginResult["orgs"];
|
|
287
|
+
}>;
|
|
288
|
+
create(input: string | {
|
|
289
|
+
name?: string;
|
|
290
|
+
kind?: "individual" | "organization";
|
|
291
|
+
}): Promise<{
|
|
292
|
+
org: Record<string, unknown>;
|
|
293
|
+
accessToken?: string;
|
|
294
|
+
refreshToken?: string;
|
|
295
|
+
}>;
|
|
296
|
+
get(orgId: string): Promise<import("./modules.js").OrgRecord>;
|
|
297
|
+
rename(orgId: string, name: string): Promise<import("./modules.js").OrgRecord>;
|
|
298
|
+
listMembers(orgId: string): Promise<{
|
|
299
|
+
userId: string;
|
|
300
|
+
email: string;
|
|
301
|
+
name: string;
|
|
302
|
+
role: string;
|
|
303
|
+
status: string;
|
|
304
|
+
createdAt: string;
|
|
305
|
+
}[]>;
|
|
306
|
+
inviteMember(orgId: string, input: {
|
|
307
|
+
email: string;
|
|
308
|
+
role: string;
|
|
309
|
+
}): Promise<Record<string, unknown>>;
|
|
310
|
+
updateMemberRole(orgId: string, userId: string, role: string): Promise<void>;
|
|
311
|
+
removeMember(orgId: string, userId: string): Promise<void>;
|
|
312
|
+
acceptInvitation(token: string): Promise<{
|
|
313
|
+
orgId: string;
|
|
314
|
+
role: string;
|
|
315
|
+
}>;
|
|
316
|
+
};
|
|
317
|
+
billing: {
|
|
318
|
+
listPlans(): Promise<Record<string, unknown>[]>;
|
|
319
|
+
usage(orgId: string): Promise<Record<string, unknown>>;
|
|
320
|
+
subscribe(orgId: string, planKey: string): Promise<Record<string, unknown>>;
|
|
321
|
+
portal(orgId: string): Promise<{
|
|
322
|
+
url: string;
|
|
323
|
+
}>;
|
|
324
|
+
};
|
|
325
|
+
files: {
|
|
326
|
+
sign(input: {
|
|
327
|
+
filename: string;
|
|
328
|
+
mime: string;
|
|
329
|
+
size: number;
|
|
330
|
+
}): Promise<{
|
|
331
|
+
fileId: string;
|
|
332
|
+
uploadUrl: string;
|
|
333
|
+
headers?: Record<string, string>;
|
|
334
|
+
}>;
|
|
335
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<Record<string, unknown>>>;
|
|
336
|
+
get(id: string): Promise<Record<string, unknown>>;
|
|
337
|
+
remove(id: string, force?: boolean): Promise<void>;
|
|
338
|
+
};
|
|
339
|
+
webhooks: {
|
|
340
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").WebhookSubscription>>;
|
|
341
|
+
create(input: {
|
|
342
|
+
url: string;
|
|
343
|
+
events: string[];
|
|
344
|
+
orgId?: string;
|
|
345
|
+
secret?: string;
|
|
346
|
+
}): Promise<import("./modules.js").WebhookSubscription & {
|
|
347
|
+
secret?: string;
|
|
348
|
+
}>;
|
|
349
|
+
get(id: string): Promise<import("./modules.js").WebhookSubscription>;
|
|
350
|
+
patch(id: string, input: Partial<{
|
|
351
|
+
url: string;
|
|
352
|
+
events: string[];
|
|
353
|
+
active: boolean;
|
|
354
|
+
}>): Promise<import("./modules.js").WebhookSubscription>;
|
|
355
|
+
remove(id: string): Promise<{
|
|
356
|
+
ok: boolean;
|
|
357
|
+
}>;
|
|
358
|
+
listDeliveries(id: string, params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").WebhookDelivery>>;
|
|
359
|
+
replayDelivery(webhookId: string, deliveryId: string): Promise<import("./modules.js").WebhookDeliveryResult>;
|
|
360
|
+
sendTest(id: string): Promise<import("./modules.js").WebhookDeliveryResult>;
|
|
361
|
+
};
|
|
362
|
+
flows: {
|
|
363
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").FlowSummary>>;
|
|
364
|
+
create(input: import("./modules.js").FlowDefinitionInput): Promise<import("./modules.js").FlowSummary>;
|
|
365
|
+
get(id: string): Promise<import("./modules.js").FlowSummary>;
|
|
366
|
+
patch(id: string, input: Partial<import("./modules.js").FlowDefinitionInput>): Promise<import("./modules.js").FlowSummary>;
|
|
367
|
+
remove(id: string): Promise<{
|
|
368
|
+
ok: boolean;
|
|
369
|
+
}>;
|
|
370
|
+
listRuns(id: string, params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").FlowRunSummary>>;
|
|
371
|
+
};
|
|
372
|
+
schema: {
|
|
373
|
+
listCollections(): Promise<import("./types.js").ListResponse<import("./modules.js").SchemaCollectionDetail>>;
|
|
374
|
+
getCollection(key: string): Promise<import("./modules.js").SchemaCollectionDetail>;
|
|
375
|
+
createCollection(input: import("./modules.js").SchemaCollectionInput): Promise<import("./modules.js").SchemaMutationResult>;
|
|
376
|
+
patchCollection(key: string, input: Partial<import("./modules.js").SchemaCollectionInput>, options?: {
|
|
377
|
+
confirmDestructive?: boolean;
|
|
378
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
379
|
+
planChange(key: string, input: Partial<import("./modules.js").SchemaCollectionInput>): Promise<import("./modules.js").SchemaPlanPreview>;
|
|
380
|
+
deleteCollection(key: string, options?: {
|
|
381
|
+
confirmDestructive?: boolean;
|
|
382
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
383
|
+
listMigrationStatus(): Promise<import("./types.js").ListResponse<import("./modules.js").SchemaMigrationStatus>>;
|
|
384
|
+
reconcile(): Promise<import("./modules.js").SchemaReconcileResult>;
|
|
385
|
+
};
|
|
386
|
+
ai: {
|
|
387
|
+
proposeSchema(prompt: string, collectionKey?: string): Promise<import("./modules.js").AiSchemaProposal>;
|
|
388
|
+
applySchema(definition: import("./modules.js").SchemaCollectionInput, options?: {
|
|
389
|
+
confirmDestructive?: boolean;
|
|
390
|
+
}): Promise<import("./modules.js").SchemaMutationResult>;
|
|
391
|
+
listAssistants(): Promise<import("./types.js").ListResponse<import("./modules.js").AssistantSummary>>;
|
|
392
|
+
upsertAssistant(input: import("./modules.js").AssistantInput): Promise<import("./modules.js").AssistantSummary>;
|
|
393
|
+
};
|
|
394
|
+
apiKeys: {
|
|
395
|
+
list(): Promise<import("./types.js").ListResponse<import("./modules.js").ApiKeySummary>>;
|
|
396
|
+
issue(input: {
|
|
397
|
+
name: string;
|
|
398
|
+
scope: string[];
|
|
399
|
+
}): Promise<import("./modules.js").ApiKeySummary & {
|
|
400
|
+
key: string;
|
|
401
|
+
}>;
|
|
402
|
+
revoke(id: string): Promise<void>;
|
|
403
|
+
};
|
|
404
|
+
conversations: {
|
|
405
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").ConversationSummary>>;
|
|
406
|
+
get(id: string): Promise<import("./modules.js").ConversationDetail>;
|
|
407
|
+
remove(id: string): Promise<{
|
|
408
|
+
deleted: true;
|
|
409
|
+
id: string;
|
|
410
|
+
}>;
|
|
411
|
+
};
|
|
412
|
+
mcp: {
|
|
413
|
+
listTools(): Promise<import("./modules.js").McpToolsResponse>;
|
|
414
|
+
};
|
|
415
|
+
events: {
|
|
416
|
+
list(params?: {
|
|
417
|
+
action?: string;
|
|
418
|
+
limit?: number;
|
|
419
|
+
offset?: number;
|
|
420
|
+
}): Promise<import("./types.js").ListResponse<import("./modules.js").AuditEvent>>;
|
|
421
|
+
};
|
|
422
|
+
notifications: {
|
|
423
|
+
list(params?: {
|
|
424
|
+
unread?: boolean;
|
|
425
|
+
limit?: number;
|
|
426
|
+
offset?: number;
|
|
427
|
+
}): Promise<import("./modules.js").NotificationListResponse>;
|
|
428
|
+
markRead(id: string): Promise<import("./modules.js").NotificationItem>;
|
|
429
|
+
preferences(): Promise<{
|
|
430
|
+
data: Array<Record<string, unknown>>;
|
|
431
|
+
}>;
|
|
432
|
+
setPreference(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
433
|
+
};
|
|
434
|
+
views: {
|
|
435
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").ViewSummary>>;
|
|
436
|
+
create(input: import("./modules.js").ViewDefinitionInput): Promise<{
|
|
437
|
+
data: import("./modules.js").ViewSummary;
|
|
438
|
+
}>;
|
|
439
|
+
get(key: string): Promise<{
|
|
440
|
+
data: import("./modules.js").ViewSummary;
|
|
441
|
+
}>;
|
|
442
|
+
patch(key: string, input: Partial<import("./modules.js").ViewDefinitionInput>): Promise<{
|
|
443
|
+
data: import("./modules.js").ViewSummary;
|
|
444
|
+
}>;
|
|
445
|
+
remove(key: string): Promise<{
|
|
446
|
+
data: {
|
|
447
|
+
key: string;
|
|
448
|
+
deleted: true;
|
|
449
|
+
};
|
|
450
|
+
}>;
|
|
451
|
+
};
|
|
452
|
+
surfaces: {
|
|
453
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<import("./modules.js").SurfaceSummary>>;
|
|
454
|
+
create(input: import("./modules.js").SurfaceDefinitionInput): Promise<{
|
|
455
|
+
data: import("./modules.js").SurfaceSummary;
|
|
456
|
+
}>;
|
|
457
|
+
get(key: string): Promise<{
|
|
458
|
+
data: import("./modules.js").SurfaceSummary;
|
|
459
|
+
}>;
|
|
460
|
+
patch(key: string, input: Partial<import("./modules.js").SurfaceDefinitionInput>): Promise<{
|
|
461
|
+
data: import("./modules.js").SurfaceSummary;
|
|
462
|
+
}>;
|
|
463
|
+
remove(key: string): Promise<{
|
|
464
|
+
data: {
|
|
465
|
+
key: string;
|
|
466
|
+
deleted: true;
|
|
467
|
+
};
|
|
468
|
+
}>;
|
|
469
|
+
runtime(): Promise<{
|
|
470
|
+
data: import("./modules.js").RuntimeResponse;
|
|
471
|
+
}>;
|
|
472
|
+
};
|
|
473
|
+
public: {
|
|
474
|
+
collection<TRecord extends Record<string, unknown>>(orgId: string, collectionKey: string): {
|
|
475
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
476
|
+
get(id: string, params?: Pick<import("./types.js").ListParams, "expand" | "fields">): Promise<TRecord>;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
collection<TRecord extends Record<string, unknown>>(collectionKey: string): {
|
|
480
|
+
list(params?: import("./types.js").ListParams): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
481
|
+
get(id: string, params?: Pick<import("./types.js").ListParams, "expand" | "fields" | "withDeleted">): Promise<TRecord>;
|
|
482
|
+
create(body: Partial<TRecord>): Promise<TRecord>;
|
|
483
|
+
patch(id: string, body: Partial<TRecord>): Promise<TRecord>;
|
|
484
|
+
put(id: string, body: Partial<TRecord>): Promise<TRecord>;
|
|
485
|
+
delete(id: string): Promise<void>;
|
|
486
|
+
search(query: string, params?: Omit<import("./types.js").ListParams, "search">): Promise<import("./types.js").ListResponse<TRecord>>;
|
|
487
|
+
bulk(items: Partial<TRecord>[], partial?: boolean): Promise<{
|
|
488
|
+
data: TRecord[];
|
|
489
|
+
}>;
|
|
490
|
+
};
|
|
491
|
+
withCollections(collections: CollectionSchema[]): /*elided*/ any;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
export type MaestroClient = ReturnType<typeof createMaestroClient>;
|
|
495
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/runtime/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAsBjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAkD6vB,CAAC;gBAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAi0X,CAAC;kBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAAzgD,CAAC;;;;8BAA8jB,CAAC;;;;;;;;8BAA3+F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAl3H,CAAC;iBAAe,CAAC;kBAAgB,CAAC;;;;;kBAAs1oB,CAAC;iBAAgB,CAAC;kBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eApBtwyB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,MAAM;;;;;;;;;;;;iCAG5C,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiBywB,CAAC;oBAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAi0X,CAAC;sBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAzgD,CAAC;;;;kCAA8jB,CAAC;;;;;;;;kCAA3+F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAl3H,CAAC;qBAAe,CAAC;sBAAgB,CAAC;;;;;sBAAs1oB,CAAC;qBAAgB,CAAC;sBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBApBtwyB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,MAAM;;;;;;;;;;;;qCAG5C,gBAAgB,EAAE;;EAclD;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createHttpClient } from './http.js';
|
|
2
|
+
import { createAiModule, createApiKeysModule, createAuthModule, createBillingModule, createCapabilitiesModule, createCollectionModule, createConversationsModule, createEventsModule, createFilesModule, createFlowsModule, createMcpModule, createNotificationsModule, createOrgsModule, createSchemaModule, createSurfacesModule, createViewsModule, createWebhooksModule, createPublicModule, } from './modules.js';
|
|
3
|
+
import { toCamelCase } from '../openapi/schema-mapping.js';
|
|
4
|
+
export function createMaestroClient(config) {
|
|
5
|
+
const http = createHttpClient({
|
|
6
|
+
baseUrl: config.baseUrl.replace(/\/$/, ''),
|
|
7
|
+
app: config.app,
|
|
8
|
+
auth: config.auth,
|
|
9
|
+
orgId: config.orgId,
|
|
10
|
+
fetchImpl: config.fetch,
|
|
11
|
+
onDeprecationWarning: config.onDeprecationWarning,
|
|
12
|
+
});
|
|
13
|
+
const client = {
|
|
14
|
+
app: config.app,
|
|
15
|
+
http,
|
|
16
|
+
auth: createAuthModule(http, config.app),
|
|
17
|
+
capabilities: createCapabilitiesModule(http, config.app),
|
|
18
|
+
orgs: createOrgsModule(http, config.app),
|
|
19
|
+
billing: createBillingModule(http, config.app),
|
|
20
|
+
files: createFilesModule(http, config.app),
|
|
21
|
+
webhooks: createWebhooksModule(http, config.app),
|
|
22
|
+
flows: createFlowsModule(http, config.app),
|
|
23
|
+
schema: createSchemaModule(http, config.app),
|
|
24
|
+
ai: createAiModule(http, config.app),
|
|
25
|
+
apiKeys: createApiKeysModule(http, config.app),
|
|
26
|
+
conversations: createConversationsModule(http, config.app),
|
|
27
|
+
mcp: createMcpModule(http, config.app),
|
|
28
|
+
events: createEventsModule(http, config.app),
|
|
29
|
+
notifications: createNotificationsModule(http, config.app),
|
|
30
|
+
views: createViewsModule(http, config.app),
|
|
31
|
+
surfaces: createSurfacesModule(http, config.app),
|
|
32
|
+
public: createPublicModule(http, config.app),
|
|
33
|
+
collection(collectionKey) {
|
|
34
|
+
return createCollectionModule(http, config.app, collectionKey);
|
|
35
|
+
},
|
|
36
|
+
withCollections(collections) {
|
|
37
|
+
const dynamic = {};
|
|
38
|
+
for (const collection of collections) {
|
|
39
|
+
dynamic[toCamelCase(collection.key)] = createCollectionModule(http, config.app, collection.key);
|
|
40
|
+
}
|
|
41
|
+
return { ...client, ...dynamic };
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
return client;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/runtime/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AuthConfig, type DeprecationWarning, type MaestroHttpClient } from './types.js';
|
|
2
|
+
export interface CreateHttpClientOptions {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
app: string;
|
|
5
|
+
auth?: AuthConfig;
|
|
6
|
+
orgId?: string;
|
|
7
|
+
fetchImpl?: typeof fetch;
|
|
8
|
+
onDeprecationWarning?: (warning: DeprecationWarning) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createHttpClient(options: CreateHttpClientOptions): MaestroHttpClient;
|
|
11
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/runtime/http.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAIvB,MAAM,YAAY,CAAC;AA+CpB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC9D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,iBAAiB,CA8EpF"}
|