primitive-admin 1.0.49 → 1.0.50
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/README.md +102 -2
- package/assets/skill/skills/primitive-platform/SKILL.md +85 -30
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +66 -1
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +20 -0
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +8 -15
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/databases.d.ts +2 -0
- package/dist/src/commands/databases.js +31 -0
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/env.d.ts +12 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/guides.d.ts +84 -0
- package/dist/src/commands/guides.js +201 -24
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.js +63 -25
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +22 -5
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/rule-sets.d.ts +2 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/sync.d.ts +113 -0
- package/dist/src/commands/sync.js +366 -12
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +104 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +1 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +2 -0
- package/dist/src/commands/workflows.d.ts +49 -0
- package/dist/src/commands/workflows.js +74 -21
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +1244 -0
- package/dist/src/lib/api-client.js +30 -0
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/cli-manifest.d.ts +60 -0
- package/dist/src/lib/cli-manifest.js +70 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/config.d.ts +37 -0
- package/dist/src/lib/confirm-prompt.d.ts +66 -0
- package/dist/src/lib/confirm-prompt.js +85 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +2 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +79 -0
- package/dist/src/lib/csv.d.ts +48 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +111 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +45 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +97 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +31 -10
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +78 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +62 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/init-config.d.ts +46 -0
- package/dist/src/lib/init-config.js +7 -0
- package/dist/src/lib/init-config.js.map +1 -1
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/output.d.ts +49 -0
- package/dist/src/lib/output.js +25 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +33 -0
- package/dist/src/lib/project-config.d.ts +97 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
- package/dist/src/lib/resolve-platform.d.ts +45 -0
- package/dist/src/lib/resolve-platform.js +43 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +23 -0
- package/dist/src/lib/snapshots.d.ts +99 -0
- package/dist/src/lib/snapshots.js +357 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +72 -0
- package/dist/src/lib/sync-paths.js +29 -1
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/template.d.ts +93 -0
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +132 -0
- package/dist/src/lib/toml-params-validator.d.ts +95 -0
- package/dist/src/lib/version-check.d.ts +10 -0
- package/dist/src/lib/workflow-fragments.d.ts +41 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +86 -0
- package/dist/src/lib/workflow-toml-validator.js +31 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +513 -0
- package/dist/src/validators.d.ts +64 -0
- package/dist/src/validators.js +63 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
export declare class ApiError extends Error {
|
|
2
|
+
statusCode: number;
|
|
3
|
+
code?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Structured `details` payload from `corsErrorResponse`.
|
|
6
|
+
*
|
|
7
|
+
* The server's error envelope can emit `details` as either:
|
|
8
|
+
* - an array of validation issues (e.g. `[{ path, message }, ...]`) —
|
|
9
|
+
* this is what most legacy endpoints produce, and what sync.ts walks
|
|
10
|
+
* via `Array.isArray(err.details)` / `for (const detail of ...)`.
|
|
11
|
+
* - a record of structured offender fields (e.g. `{ refs, operations,
|
|
12
|
+
* opCount, line, column, ... }`) — emitted by the issue #666 schema
|
|
13
|
+
* gate and consumed by the typed exception subclasses below.
|
|
14
|
+
*
|
|
15
|
+
* Callers must narrow before use: `Array.isArray(err.details)` for the
|
|
16
|
+
* legacy shape, otherwise treat as `Record<string, any>`.
|
|
17
|
+
*/
|
|
18
|
+
details?: unknown[] | Record<string, any>;
|
|
19
|
+
constructor(message: string, statusCode: number, code?: string, details?: unknown[] | Record<string, any>);
|
|
20
|
+
}
|
|
21
|
+
export declare class ConflictError extends ApiError {
|
|
22
|
+
serverModifiedAt: string;
|
|
23
|
+
expectedModifiedAt: string;
|
|
24
|
+
constructor(message: string, serverModifiedAt: string, expectedModifiedAt: string, details?: Record<string, any>);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parsed shape of a non-OK HTTP response body.
|
|
28
|
+
*
|
|
29
|
+
* The server's standard error envelope (corsErrorResponse, `src/utils.ts:348`)
|
|
30
|
+
* writes the message to `error`. A handful of bespoke endpoints (ConflictError,
|
|
31
|
+
* integrations proxy) use `message`. This helper reads both fields so all CLI
|
|
32
|
+
* call sites surface the real server message instead of `HTTP <status>`.
|
|
33
|
+
*
|
|
34
|
+
* `htmlNotFound` is set when the body looks like an HTML 404 page (typically
|
|
35
|
+
* served when an API path is wrong); callers can use it to throw a clearer
|
|
36
|
+
* "API endpoint not found" message regardless of the original status code.
|
|
37
|
+
*
|
|
38
|
+
* `details` can be either an array (legacy validation-issue list) or a
|
|
39
|
+
* structured record (issue #666 schema gate); the schema-feature errors
|
|
40
|
+
* below need the record shape, while the legacy `for (const detail of ...)`
|
|
41
|
+
* walkers in sync.ts assume the array shape.
|
|
42
|
+
*/
|
|
43
|
+
export interface ParsedErrorResponse {
|
|
44
|
+
message: string;
|
|
45
|
+
code?: string;
|
|
46
|
+
details?: unknown[] | Record<string, any>;
|
|
47
|
+
/** True when the response body is an HTML error page (e.g. wrong API path). */
|
|
48
|
+
htmlNotFound?: boolean;
|
|
49
|
+
/** Raw parsed JSON envelope (or `undefined` for non-JSON bodies). */
|
|
50
|
+
raw?: any;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extract a human-readable error message + structured fields from a non-OK
|
|
54
|
+
* HTTP response body. Single source of truth used by every error-handler call
|
|
55
|
+
* site in this file (see issue #684).
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseErrorResponse(response: {
|
|
58
|
+
status: number;
|
|
59
|
+
}, text: string, path?: string): ParsedErrorResponse;
|
|
60
|
+
/**
|
|
61
|
+
* Typed exception classes for the database-schema feature (issue #666).
|
|
62
|
+
* Each maps 1:1 to a server `code` value emitted from the op-edit or
|
|
63
|
+
* schema-edit gate. They all extend ApiError so existing catch-all paths
|
|
64
|
+
* continue to work; specialized catch blocks can branch on `instanceof`.
|
|
65
|
+
*
|
|
66
|
+
* Per round-2 addendum A1, `details` is always preserved so callers can
|
|
67
|
+
* extract structured offender lists (refs[], operations[], etc.).
|
|
68
|
+
*/
|
|
69
|
+
export declare class SchemaRequiredError extends ApiError {
|
|
70
|
+
constructor(message: string, details?: Record<string, any>);
|
|
71
|
+
}
|
|
72
|
+
export declare class OperationRefError extends ApiError {
|
|
73
|
+
constructor(message: string, details?: Record<string, any>);
|
|
74
|
+
get refs(): Array<{
|
|
75
|
+
ref: string;
|
|
76
|
+
location: string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
export declare class SchemaBreaksOpsError extends ApiError {
|
|
80
|
+
constructor(message: string, details?: Record<string, any>);
|
|
81
|
+
get operations(): Array<{
|
|
82
|
+
operation: string;
|
|
83
|
+
refs: Array<{
|
|
84
|
+
ref: string;
|
|
85
|
+
location: string;
|
|
86
|
+
}>;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
export declare class SchemaHasUncheckableOpsError extends ApiError {
|
|
90
|
+
constructor(message: string, details?: Record<string, any>);
|
|
91
|
+
get operations(): Array<{
|
|
92
|
+
operation: string;
|
|
93
|
+
locations: string[];
|
|
94
|
+
}>;
|
|
95
|
+
}
|
|
96
|
+
export declare class TomlParseError extends ApiError {
|
|
97
|
+
constructor(message: string, details?: Record<string, any>);
|
|
98
|
+
get line(): number | undefined;
|
|
99
|
+
get column(): number | undefined;
|
|
100
|
+
}
|
|
101
|
+
export declare class OpsExistError extends ApiError {
|
|
102
|
+
constructor(message: string, details?: Record<string, any>);
|
|
103
|
+
get opCount(): number;
|
|
104
|
+
}
|
|
105
|
+
interface EmailTemplateSummary {
|
|
106
|
+
emailType: string;
|
|
107
|
+
label: string;
|
|
108
|
+
description: string;
|
|
109
|
+
hasOverride: boolean;
|
|
110
|
+
modifiedAt: string | null;
|
|
111
|
+
}
|
|
112
|
+
interface EmailTemplateDetail {
|
|
113
|
+
emailType: string;
|
|
114
|
+
label: string;
|
|
115
|
+
description: string;
|
|
116
|
+
hasOverride: boolean;
|
|
117
|
+
override: {
|
|
118
|
+
templateId: string;
|
|
119
|
+
subject: string;
|
|
120
|
+
htmlBody: string;
|
|
121
|
+
textBody: string;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
modifiedAt: string;
|
|
124
|
+
} | null;
|
|
125
|
+
default: {
|
|
126
|
+
subject: string;
|
|
127
|
+
htmlBody: string;
|
|
128
|
+
textBody: string;
|
|
129
|
+
};
|
|
130
|
+
variables: {
|
|
131
|
+
name: string;
|
|
132
|
+
required: boolean;
|
|
133
|
+
description: string;
|
|
134
|
+
}[];
|
|
135
|
+
}
|
|
136
|
+
interface EmailTemplateUpsertResult {
|
|
137
|
+
emailType: string;
|
|
138
|
+
templateId: string;
|
|
139
|
+
subject: string;
|
|
140
|
+
htmlBody: string;
|
|
141
|
+
textBody: string;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
modifiedAt: string;
|
|
144
|
+
warnings: string[];
|
|
145
|
+
}
|
|
146
|
+
interface AnalyticsTiming {
|
|
147
|
+
total_ms: number;
|
|
148
|
+
wae_queries: number[];
|
|
149
|
+
}
|
|
150
|
+
interface AnalyticsMetricResponse {
|
|
151
|
+
value: number;
|
|
152
|
+
previous: number;
|
|
153
|
+
deltaPct: number;
|
|
154
|
+
_timing: AnalyticsTiming;
|
|
155
|
+
}
|
|
156
|
+
interface AnalyticsGrowthResponse {
|
|
157
|
+
window_days: number;
|
|
158
|
+
retained_users: number;
|
|
159
|
+
new_users: number;
|
|
160
|
+
reactivated_users: number;
|
|
161
|
+
churned_users: number;
|
|
162
|
+
current_active: number;
|
|
163
|
+
previous_active: number;
|
|
164
|
+
deltaPct: number;
|
|
165
|
+
_timing: AnalyticsTiming;
|
|
166
|
+
}
|
|
167
|
+
interface AnalyticsDailyActivePoint {
|
|
168
|
+
day_ts: number;
|
|
169
|
+
day_label: string;
|
|
170
|
+
active_users: number;
|
|
171
|
+
}
|
|
172
|
+
interface AnalyticsDailyActiveResponse {
|
|
173
|
+
window_days: number;
|
|
174
|
+
rows: AnalyticsDailyActivePoint[];
|
|
175
|
+
_timing: AnalyticsTiming;
|
|
176
|
+
}
|
|
177
|
+
interface AnalyticsCohortRow {
|
|
178
|
+
signup_week: number;
|
|
179
|
+
signup_week_label: string;
|
|
180
|
+
cohort_size: number;
|
|
181
|
+
retention: (number | null)[];
|
|
182
|
+
}
|
|
183
|
+
interface AnalyticsCohortResponse {
|
|
184
|
+
weeks: number[];
|
|
185
|
+
rows: AnalyticsCohortRow[];
|
|
186
|
+
averages: (number | null)[];
|
|
187
|
+
_timing: AnalyticsTiming;
|
|
188
|
+
}
|
|
189
|
+
interface AnalyticsUserSummary {
|
|
190
|
+
userUlid: string;
|
|
191
|
+
email: string | null;
|
|
192
|
+
name: string | null;
|
|
193
|
+
firstSeen: string;
|
|
194
|
+
lastSeen: string;
|
|
195
|
+
eventCount: number;
|
|
196
|
+
}
|
|
197
|
+
interface AnalyticsTopUsersResponse {
|
|
198
|
+
windowDays: number;
|
|
199
|
+
limit: number;
|
|
200
|
+
results: AnalyticsUserSummary[];
|
|
201
|
+
_timing: AnalyticsTiming;
|
|
202
|
+
}
|
|
203
|
+
interface AnalyticsUserSearchResponse {
|
|
204
|
+
query: string;
|
|
205
|
+
limit: number;
|
|
206
|
+
results: AnalyticsUserSummary[];
|
|
207
|
+
}
|
|
208
|
+
interface AnalyticsUserDetailResponse {
|
|
209
|
+
user: {
|
|
210
|
+
user_ulid: string;
|
|
211
|
+
email: string | null;
|
|
212
|
+
name: string | null;
|
|
213
|
+
};
|
|
214
|
+
stats: {
|
|
215
|
+
first_seen: string | null;
|
|
216
|
+
last_active: string | null;
|
|
217
|
+
total_events: number;
|
|
218
|
+
days_active: number;
|
|
219
|
+
};
|
|
220
|
+
events_by_action: Array<{
|
|
221
|
+
action: string;
|
|
222
|
+
event_count: number;
|
|
223
|
+
last_occurred: string;
|
|
224
|
+
}>;
|
|
225
|
+
events_by_feature: Array<{
|
|
226
|
+
feature: string;
|
|
227
|
+
event_count: number;
|
|
228
|
+
pct: number;
|
|
229
|
+
}>;
|
|
230
|
+
_timing: AnalyticsTiming;
|
|
231
|
+
}
|
|
232
|
+
interface AnalyticsUserSnapshotResponse {
|
|
233
|
+
snapshot: {
|
|
234
|
+
timestamp: string;
|
|
235
|
+
values: unknown;
|
|
236
|
+
} | null;
|
|
237
|
+
_timing: AnalyticsTiming;
|
|
238
|
+
}
|
|
239
|
+
interface AnalyticsEventRow {
|
|
240
|
+
timestamp: string;
|
|
241
|
+
user_ulid: string;
|
|
242
|
+
action: string;
|
|
243
|
+
feature: string;
|
|
244
|
+
route: string;
|
|
245
|
+
country: string;
|
|
246
|
+
}
|
|
247
|
+
interface AnalyticsEventsResponse {
|
|
248
|
+
page: number;
|
|
249
|
+
page_size: number;
|
|
250
|
+
total_rows: number;
|
|
251
|
+
rows: AnalyticsEventRow[];
|
|
252
|
+
_timing: AnalyticsTiming;
|
|
253
|
+
}
|
|
254
|
+
interface AnalyticsGroupedRow {
|
|
255
|
+
group_value: string;
|
|
256
|
+
raw_group_value: string;
|
|
257
|
+
events: number;
|
|
258
|
+
unique_users: number;
|
|
259
|
+
}
|
|
260
|
+
interface AnalyticsEventsGroupedResponse {
|
|
261
|
+
group_by: string;
|
|
262
|
+
rows: AnalyticsGroupedRow[];
|
|
263
|
+
_timing: AnalyticsTiming;
|
|
264
|
+
}
|
|
265
|
+
interface AnalyticsIntegrationMetric {
|
|
266
|
+
integrationKey: string;
|
|
267
|
+
invocations: number;
|
|
268
|
+
errorRate: number;
|
|
269
|
+
medianDurationMs: number;
|
|
270
|
+
p95DurationMs: number;
|
|
271
|
+
}
|
|
272
|
+
interface AnalyticsIntegrationMetricsResponse {
|
|
273
|
+
windowDays: number;
|
|
274
|
+
integrations: AnalyticsIntegrationMetric[];
|
|
275
|
+
_timing: AnalyticsTiming;
|
|
276
|
+
}
|
|
277
|
+
interface WorkflowAnalyticsSummary {
|
|
278
|
+
workflowKey: string;
|
|
279
|
+
runs: number;
|
|
280
|
+
successRate: number;
|
|
281
|
+
medianDurationMs: number;
|
|
282
|
+
p95: number;
|
|
283
|
+
totalTokens: number;
|
|
284
|
+
}
|
|
285
|
+
interface TopWorkflowsResponse {
|
|
286
|
+
windowDays: number;
|
|
287
|
+
limit: number;
|
|
288
|
+
workflows: WorkflowAnalyticsSummary[];
|
|
289
|
+
_timing: AnalyticsTiming;
|
|
290
|
+
}
|
|
291
|
+
interface PromptAnalyticsSummary {
|
|
292
|
+
promptKey: string;
|
|
293
|
+
executions: number;
|
|
294
|
+
medianDurationMs: number;
|
|
295
|
+
p95DurationMs: number;
|
|
296
|
+
totalTokens: number;
|
|
297
|
+
}
|
|
298
|
+
interface TopPromptsResponse {
|
|
299
|
+
windowDays: number;
|
|
300
|
+
limit: number;
|
|
301
|
+
prompts: PromptAnalyticsSummary[];
|
|
302
|
+
_timing: AnalyticsTiming;
|
|
303
|
+
}
|
|
304
|
+
export declare class ApiClient {
|
|
305
|
+
private credentials;
|
|
306
|
+
constructor();
|
|
307
|
+
private ensureAuthenticated;
|
|
308
|
+
private refreshToken;
|
|
309
|
+
request<T = any>(path: string, options?: RequestInit): Promise<T>;
|
|
310
|
+
get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
311
|
+
post<T = any>(path: string, body?: any): Promise<T>;
|
|
312
|
+
put<T = any>(path: string, body?: any): Promise<T>;
|
|
313
|
+
patch<T = any>(path: string, body?: any): Promise<T>;
|
|
314
|
+
delete<T = any>(path: string): Promise<T>;
|
|
315
|
+
listApps(): Promise<{
|
|
316
|
+
apps: Array<{
|
|
317
|
+
id: string;
|
|
318
|
+
name: string;
|
|
319
|
+
role?: string;
|
|
320
|
+
}>;
|
|
321
|
+
}>;
|
|
322
|
+
createApp(data: {
|
|
323
|
+
name: string;
|
|
324
|
+
initialAdminEmail?: string;
|
|
325
|
+
}): Promise<any>;
|
|
326
|
+
getApp(appId: string): Promise<{
|
|
327
|
+
id: string;
|
|
328
|
+
name: string;
|
|
329
|
+
}>;
|
|
330
|
+
deleteApp(appId: string): Promise<void>;
|
|
331
|
+
getAppSettings(appId: string): Promise<any>;
|
|
332
|
+
updateAppSettings(appId: string, settings: any): Promise<any>;
|
|
333
|
+
addUserByEmail(appId: string, data: {
|
|
334
|
+
email: string;
|
|
335
|
+
role?: string;
|
|
336
|
+
}): Promise<any>;
|
|
337
|
+
mintTestJwt(appId: string, userId: string, role?: string): Promise<any>;
|
|
338
|
+
rebuildUserSearchText(appId: string): Promise<{
|
|
339
|
+
count: number;
|
|
340
|
+
}>;
|
|
341
|
+
listUsers(appId: string, params?: {
|
|
342
|
+
name?: string;
|
|
343
|
+
email?: string;
|
|
344
|
+
userId?: string;
|
|
345
|
+
limit?: number;
|
|
346
|
+
cursor?: string;
|
|
347
|
+
}): Promise<{
|
|
348
|
+
items: any[];
|
|
349
|
+
nextCursor?: string | null;
|
|
350
|
+
}>;
|
|
351
|
+
removeUser(appId: string, userId: string): Promise<void>;
|
|
352
|
+
updateUserRole(appId: string, userId: string, role: "admin" | "member"): Promise<any>;
|
|
353
|
+
transferOwnership(appId: string, newOwnerEmail: string): Promise<void>;
|
|
354
|
+
transferAdminOwnership(appId: string, adminId: string): Promise<any>;
|
|
355
|
+
listAppAdmins(appId: string): Promise<any[]>;
|
|
356
|
+
addAppAdmin(appId: string, data: {
|
|
357
|
+
adminEmail: string;
|
|
358
|
+
role?: string;
|
|
359
|
+
sendEmail?: boolean;
|
|
360
|
+
loginUrl?: string;
|
|
361
|
+
}): Promise<any>;
|
|
362
|
+
removeAppAdmin(appId: string, adminId: string): Promise<any>;
|
|
363
|
+
listAppAdminInvitations(appId: string): Promise<any[]>;
|
|
364
|
+
deleteAppAdminInvitation(appId: string, invitationId: string): Promise<any>;
|
|
365
|
+
transferDocumentOwnership(appId: string, documentId: string, newOwnerId: string): Promise<void>;
|
|
366
|
+
listInvitations(appId: string, params?: {
|
|
367
|
+
limit?: number;
|
|
368
|
+
cursor?: string;
|
|
369
|
+
}): Promise<{
|
|
370
|
+
items: any[];
|
|
371
|
+
cursor?: string;
|
|
372
|
+
}>;
|
|
373
|
+
createInvitation(appId: string, data: {
|
|
374
|
+
email: string;
|
|
375
|
+
role: "admin" | "member";
|
|
376
|
+
expiresInDays?: number;
|
|
377
|
+
sendEmail?: boolean;
|
|
378
|
+
note?: string;
|
|
379
|
+
}): Promise<any>;
|
|
380
|
+
deleteInvitation(appId: string, invitationId: string): Promise<void>;
|
|
381
|
+
listWaitlist(appId: string): Promise<any[]>;
|
|
382
|
+
inviteWaitlistEntry(appId: string, waitlistId: string, options?: {
|
|
383
|
+
sendEmail?: boolean;
|
|
384
|
+
signupUrl?: string;
|
|
385
|
+
}): Promise<any>;
|
|
386
|
+
bulkInviteWaitlist(appId: string, payload: {
|
|
387
|
+
waitlistIds?: string[];
|
|
388
|
+
count?: number;
|
|
389
|
+
sendEmail?: boolean;
|
|
390
|
+
signupUrl?: string;
|
|
391
|
+
}): Promise<any>;
|
|
392
|
+
removeWaitlistEntry(appId: string, waitlistId: string): Promise<void>;
|
|
393
|
+
listDeferredGrants(appId: string, params?: {
|
|
394
|
+
type?: string;
|
|
395
|
+
email?: string;
|
|
396
|
+
limit?: number;
|
|
397
|
+
}): Promise<{
|
|
398
|
+
grants: any[];
|
|
399
|
+
nextCursor?: string | null;
|
|
400
|
+
}>;
|
|
401
|
+
revokeDeferredGrant(appId: string, deferredId: string, type: string): Promise<any>;
|
|
402
|
+
listIntegrations(appId: string, params?: {
|
|
403
|
+
status?: string;
|
|
404
|
+
cursor?: string;
|
|
405
|
+
limit?: number;
|
|
406
|
+
}): Promise<{
|
|
407
|
+
items: any[];
|
|
408
|
+
nextCursor?: string | null;
|
|
409
|
+
}>;
|
|
410
|
+
getIntegration(appId: string, integrationId: string): Promise<any>;
|
|
411
|
+
createIntegration(appId: string, payload: any): Promise<any>;
|
|
412
|
+
updateIntegration(appId: string, integrationId: string, payload: any, expectedModifiedAt?: string): Promise<any>;
|
|
413
|
+
deleteIntegration(appId: string, integrationId: string, hard?: boolean): Promise<void>;
|
|
414
|
+
testIntegration(appId: string, integrationId: string, payload: any): Promise<any>;
|
|
415
|
+
listIntegrationLogs(appId: string, integrationId: string, params?: {
|
|
416
|
+
limit?: number;
|
|
417
|
+
status?: string;
|
|
418
|
+
from?: string;
|
|
419
|
+
to?: string;
|
|
420
|
+
source?: "user" | "admin" | "test" | "workflow";
|
|
421
|
+
}): Promise<any[]>;
|
|
422
|
+
listWorkflowRunIntegrationLogs(appId: string, runId: string, params?: {
|
|
423
|
+
limit?: number;
|
|
424
|
+
}): Promise<any[]>;
|
|
425
|
+
listIntegrationSecrets(appId: string, integrationId: string, params?: {
|
|
426
|
+
limit?: number;
|
|
427
|
+
}): Promise<any[]>;
|
|
428
|
+
addIntegrationSecret(appId: string, integrationId: string, payload: {
|
|
429
|
+
secretData: any;
|
|
430
|
+
secretSummary?: string;
|
|
431
|
+
}): Promise<any>;
|
|
432
|
+
archiveIntegrationSecret(appId: string, integrationId: string, secretId: string): Promise<any>;
|
|
433
|
+
listAppSecrets(appId: string): Promise<any[]>;
|
|
434
|
+
createAppSecret(appId: string, payload: {
|
|
435
|
+
key: string;
|
|
436
|
+
value: string;
|
|
437
|
+
summary?: string;
|
|
438
|
+
}): Promise<any>;
|
|
439
|
+
updateAppSecret(appId: string, secretId: string, payload: {
|
|
440
|
+
value?: string;
|
|
441
|
+
summary?: string;
|
|
442
|
+
}): Promise<any>;
|
|
443
|
+
upsertAppSecret(appId: string, key: string, payload: {
|
|
444
|
+
value: string;
|
|
445
|
+
summary?: string;
|
|
446
|
+
}): Promise<any>;
|
|
447
|
+
deleteAppSecret(appId: string, secretId: string): Promise<any>;
|
|
448
|
+
listWebhooks(appId: string, params?: {
|
|
449
|
+
status?: string;
|
|
450
|
+
cursor?: string;
|
|
451
|
+
limit?: number;
|
|
452
|
+
}): Promise<{
|
|
453
|
+
items: any[];
|
|
454
|
+
nextCursor?: string | null;
|
|
455
|
+
}>;
|
|
456
|
+
getWebhook(appId: string, webhookId: string): Promise<any>;
|
|
457
|
+
createWebhook(appId: string, payload: any): Promise<any>;
|
|
458
|
+
updateWebhook(appId: string, webhookId: string, payload: any, expectedModifiedAt?: string): Promise<any>;
|
|
459
|
+
deleteWebhook(appId: string, webhookId: string): Promise<void>;
|
|
460
|
+
rotateWebhookSecret(appId: string, webhookId: string, payload: {
|
|
461
|
+
signingSecret: string;
|
|
462
|
+
}): Promise<any>;
|
|
463
|
+
listWebhookEvents(appId: string, webhookId: string, params?: {
|
|
464
|
+
limit?: number;
|
|
465
|
+
}): Promise<any>;
|
|
466
|
+
testWebhook(appId: string, webhookId: string, payload?: any): Promise<any>;
|
|
467
|
+
listCronTriggers(appId: string): Promise<{
|
|
468
|
+
items: any[];
|
|
469
|
+
}>;
|
|
470
|
+
getCronTrigger(appId: string, triggerId: string): Promise<any>;
|
|
471
|
+
createCronTrigger(appId: string, payload: any): Promise<any>;
|
|
472
|
+
updateCronTrigger(appId: string, triggerId: string, payload: any): Promise<any>;
|
|
473
|
+
deleteCronTrigger(appId: string, triggerId: string): Promise<any>;
|
|
474
|
+
pauseCronTrigger(appId: string, triggerId: string): Promise<any>;
|
|
475
|
+
resumeCronTrigger(appId: string, triggerId: string): Promise<any>;
|
|
476
|
+
testCronTrigger(appId: string, triggerId: string): Promise<any>;
|
|
477
|
+
listPrompts(appId: string, params?: {
|
|
478
|
+
status?: string;
|
|
479
|
+
limit?: number;
|
|
480
|
+
cursor?: string;
|
|
481
|
+
}): Promise<{
|
|
482
|
+
items: any[];
|
|
483
|
+
nextCursor?: string | null;
|
|
484
|
+
}>;
|
|
485
|
+
getPrompt(appId: string, promptId: string): Promise<any>;
|
|
486
|
+
createPrompt(appId: string, payload: any): Promise<any>;
|
|
487
|
+
updatePrompt(appId: string, promptId: string, payload: any, expectedModifiedAt?: string): Promise<any>;
|
|
488
|
+
deletePrompt(appId: string, promptId: string, hard?: boolean): Promise<void>;
|
|
489
|
+
executePrompt(appId: string, promptId: string, payload: {
|
|
490
|
+
variables: Record<string, any>;
|
|
491
|
+
modelOverride?: string;
|
|
492
|
+
configId?: string;
|
|
493
|
+
}): Promise<any>;
|
|
494
|
+
previewPrompt(appId: string, promptId: string, payload: {
|
|
495
|
+
variables: Record<string, any>;
|
|
496
|
+
configId?: string;
|
|
497
|
+
}): Promise<any>;
|
|
498
|
+
listPromptConfigs(appId: string, promptId: string): Promise<{
|
|
499
|
+
items: any[];
|
|
500
|
+
}>;
|
|
501
|
+
getPromptConfig(appId: string, promptId: string, configId: string): Promise<any>;
|
|
502
|
+
createPromptConfig(appId: string, promptId: string, payload: any): Promise<any>;
|
|
503
|
+
updatePromptConfig(appId: string, promptId: string, configId: string, payload: any): Promise<any>;
|
|
504
|
+
activatePromptConfig(appId: string, promptId: string, configId: string): Promise<any>;
|
|
505
|
+
duplicatePromptConfig(appId: string, promptId: string, configId: string, payload?: {
|
|
506
|
+
configName?: string;
|
|
507
|
+
description?: string;
|
|
508
|
+
}): Promise<any>;
|
|
509
|
+
listScripts(appId: string): Promise<{
|
|
510
|
+
items: any[];
|
|
511
|
+
}>;
|
|
512
|
+
getScript(appId: string, scriptId: string): Promise<any>;
|
|
513
|
+
createScript(appId: string, payload: {
|
|
514
|
+
name: string;
|
|
515
|
+
body: string;
|
|
516
|
+
}): Promise<any>;
|
|
517
|
+
updateScript(appId: string, scriptId: string, payload: {
|
|
518
|
+
body: string;
|
|
519
|
+
}): Promise<any>;
|
|
520
|
+
deleteScript(appId: string, scriptId: string): Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Issue #973 — staleness discovery for a Rhai script.
|
|
523
|
+
*
|
|
524
|
+
* Given a script and the `contentHash` of the body being pushed, returns
|
|
525
|
+
* the active workflows whose frozen snapshot still pins a DIFFERENT (old)
|
|
526
|
+
* hash for this script — i.e. the workflows that keep running the previous
|
|
527
|
+
* body until republished. Powers the `sync push` staleness warning and its
|
|
528
|
+
* `--dry-run` preview.
|
|
529
|
+
*
|
|
530
|
+
* Returns an empty `staleWorkflows` array when nothing is stale (no-op push,
|
|
531
|
+
* no referencing workflows). On an older server without this route, the
|
|
532
|
+
* caller should treat a failure as "no staleness info available".
|
|
533
|
+
*/
|
|
534
|
+
getStaleWorkflowsForScript(appId: string, scriptId: string, contentHash: string): Promise<{
|
|
535
|
+
scriptName: string;
|
|
536
|
+
staleWorkflows: Array<{
|
|
537
|
+
workflowId: string;
|
|
538
|
+
workflowKey: string | null;
|
|
539
|
+
name: string | null;
|
|
540
|
+
pinnedContentHash: string;
|
|
541
|
+
}>;
|
|
542
|
+
}>;
|
|
543
|
+
getPromptSchema(appId: string, promptId: string): Promise<{
|
|
544
|
+
promptId: string;
|
|
545
|
+
promptKey: string;
|
|
546
|
+
displayName: string;
|
|
547
|
+
inputSchema: any;
|
|
548
|
+
inputVariables: string[];
|
|
549
|
+
outputSchema: any;
|
|
550
|
+
activeConfigId: string | null;
|
|
551
|
+
activeConfigName: string | null;
|
|
552
|
+
}>;
|
|
553
|
+
listTestCases(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string): Promise<{
|
|
554
|
+
items: any[];
|
|
555
|
+
}>;
|
|
556
|
+
getTestCase(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string): Promise<any>;
|
|
557
|
+
createTestCase(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, payload: {
|
|
558
|
+
name: string;
|
|
559
|
+
inputVariables: Record<string, any>;
|
|
560
|
+
expectedOutputPattern?: string;
|
|
561
|
+
expectedOutputContains?: string[];
|
|
562
|
+
expectedJsonSubset?: Record<string, any>;
|
|
563
|
+
configId?: string;
|
|
564
|
+
evaluatorPromptId?: string;
|
|
565
|
+
evaluatorConfigId?: string;
|
|
566
|
+
}): Promise<any>;
|
|
567
|
+
updateTestCase(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string, payload: {
|
|
568
|
+
name?: string;
|
|
569
|
+
inputVariables?: Record<string, any>;
|
|
570
|
+
expectedOutputPattern?: string | null;
|
|
571
|
+
expectedOutputContains?: string[] | null;
|
|
572
|
+
expectedJsonSubset?: Record<string, any> | null;
|
|
573
|
+
configId?: string | null;
|
|
574
|
+
evaluatorPromptId?: string | null;
|
|
575
|
+
evaluatorConfigId?: string | null;
|
|
576
|
+
}): Promise<any>;
|
|
577
|
+
deleteTestCase(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string): Promise<void>;
|
|
578
|
+
listTestCaseAttachments(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string): Promise<{
|
|
579
|
+
attachments: Array<{
|
|
580
|
+
filename: string;
|
|
581
|
+
contentType: string;
|
|
582
|
+
size: number;
|
|
583
|
+
r2Key: string;
|
|
584
|
+
}>;
|
|
585
|
+
}>;
|
|
586
|
+
uploadTestCaseAttachment(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string, filename: string, data: Buffer, contentType: string): Promise<{
|
|
587
|
+
success: boolean;
|
|
588
|
+
attachment: {
|
|
589
|
+
filename: string;
|
|
590
|
+
contentType: string;
|
|
591
|
+
size: number;
|
|
592
|
+
r2Key: string;
|
|
593
|
+
};
|
|
594
|
+
}>;
|
|
595
|
+
downloadTestCaseAttachment(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string, filename: string): Promise<{
|
|
596
|
+
data: Buffer;
|
|
597
|
+
contentType: string;
|
|
598
|
+
}>;
|
|
599
|
+
deleteTestCaseAttachment(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, testCaseId: string, filename: string): Promise<{
|
|
600
|
+
success: boolean;
|
|
601
|
+
deleted: boolean;
|
|
602
|
+
}>;
|
|
603
|
+
executeBlockTest(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, payload: {
|
|
604
|
+
variables?: Record<string, any>;
|
|
605
|
+
testCaseId?: string;
|
|
606
|
+
configId?: string;
|
|
607
|
+
comparisonGroup?: string;
|
|
608
|
+
}): Promise<any>;
|
|
609
|
+
runAllTestCases(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, payload?: {
|
|
610
|
+
overrideConfigId?: string;
|
|
611
|
+
comparisonGroup?: string;
|
|
612
|
+
testCaseIds?: string[];
|
|
613
|
+
}): Promise<any>;
|
|
614
|
+
listTestRuns(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, params?: {
|
|
615
|
+
limit?: number;
|
|
616
|
+
comparisonGroup?: string;
|
|
617
|
+
}): Promise<{
|
|
618
|
+
items: any[];
|
|
619
|
+
}>;
|
|
620
|
+
listWorkflows(appId: string, params?: {
|
|
621
|
+
status?: string;
|
|
622
|
+
limit?: number;
|
|
623
|
+
cursor?: string;
|
|
624
|
+
}): Promise<{
|
|
625
|
+
items: any[];
|
|
626
|
+
nextCursor?: string | null;
|
|
627
|
+
}>;
|
|
628
|
+
getWorkflow(appId: string, workflowId: string): Promise<any>;
|
|
629
|
+
createWorkflow(appId: string, payload: any): Promise<any>;
|
|
630
|
+
updateWorkflow(appId: string, workflowId: string, payload: any, expectedModifiedAt?: string): Promise<any>;
|
|
631
|
+
deleteWorkflow(appId: string, workflowId: string): Promise<void>;
|
|
632
|
+
updateWorkflowDraft(appId: string, workflowId: string, payload: any): Promise<any>;
|
|
633
|
+
publishWorkflow(appId: string, workflowId: string): Promise<any>;
|
|
634
|
+
previewWorkflow(appId: string, workflowId: string, payload: {
|
|
635
|
+
rootInput?: object;
|
|
636
|
+
meta?: object;
|
|
637
|
+
configId?: string;
|
|
638
|
+
useDraft?: boolean;
|
|
639
|
+
preferActive?: boolean;
|
|
640
|
+
}): Promise<{
|
|
641
|
+
instanceId: string;
|
|
642
|
+
usingDraft?: boolean;
|
|
643
|
+
source?: "config" | "active" | "draft" | null;
|
|
644
|
+
configName?: string | null;
|
|
645
|
+
configId?: string | null;
|
|
646
|
+
warning?: string;
|
|
647
|
+
}>;
|
|
648
|
+
getPreviewStatus(appId: string, workflowId: string, instanceId: string): Promise<any>;
|
|
649
|
+
listWorkflowRuns(appId: string, workflowId: string, params?: {
|
|
650
|
+
status?: string;
|
|
651
|
+
limit?: number;
|
|
652
|
+
cursor?: string;
|
|
653
|
+
forward?: boolean;
|
|
654
|
+
}): Promise<{
|
|
655
|
+
items: any[];
|
|
656
|
+
cursor?: string | null;
|
|
657
|
+
}>;
|
|
658
|
+
getWorkflowRunStatus(appId: string, workflowId: string, runId: string): Promise<any>;
|
|
659
|
+
getWorkflowStepRuns(appId: string, workflowId: string, runId: string): Promise<{
|
|
660
|
+
items: any[];
|
|
661
|
+
}>;
|
|
662
|
+
getWorkflowAnalytics(appId: string, params?: {
|
|
663
|
+
windowDays?: number;
|
|
664
|
+
}): Promise<any>;
|
|
665
|
+
getTopWorkflows(appId: string, params?: {
|
|
666
|
+
windowDays?: number;
|
|
667
|
+
limit?: number;
|
|
668
|
+
}): Promise<any>;
|
|
669
|
+
listWorkflowConfigs(appId: string, workflowId: string): Promise<{
|
|
670
|
+
items: any[];
|
|
671
|
+
}>;
|
|
672
|
+
getWorkflowConfig(appId: string, workflowId: string, configId: string): Promise<any>;
|
|
673
|
+
createWorkflowConfig(appId: string, workflowId: string, payload: {
|
|
674
|
+
configName: string;
|
|
675
|
+
description?: string;
|
|
676
|
+
steps: any[];
|
|
677
|
+
}): Promise<any>;
|
|
678
|
+
updateWorkflowConfig(appId: string, workflowId: string, configId: string, payload: {
|
|
679
|
+
configName?: string;
|
|
680
|
+
description?: string;
|
|
681
|
+
steps?: any[];
|
|
682
|
+
status?: string;
|
|
683
|
+
}): Promise<any>;
|
|
684
|
+
archiveWorkflowConfig(appId: string, workflowId: string, configId: string): Promise<any>;
|
|
685
|
+
activateWorkflowConfig(appId: string, workflowId: string, configId: string): Promise<any>;
|
|
686
|
+
duplicateWorkflowConfig(appId: string, workflowId: string, configId: string, payload?: {
|
|
687
|
+
configName?: string;
|
|
688
|
+
}): Promise<any>;
|
|
689
|
+
getAnalyticsTopUsers(appId: string, params?: {
|
|
690
|
+
windowDays?: number;
|
|
691
|
+
limit?: number;
|
|
692
|
+
}): Promise<AnalyticsTopUsersResponse>;
|
|
693
|
+
getAnalyticsIntegrationMetrics(appId: string, params?: {
|
|
694
|
+
windowDays?: number;
|
|
695
|
+
}): Promise<AnalyticsIntegrationMetricsResponse>;
|
|
696
|
+
getAnalyticsOverviewDau(appId: string): Promise<AnalyticsMetricResponse>;
|
|
697
|
+
getAnalyticsOverviewWau(appId: string): Promise<AnalyticsMetricResponse>;
|
|
698
|
+
getAnalyticsOverviewMau(appId: string): Promise<AnalyticsMetricResponse>;
|
|
699
|
+
getAnalyticsOverviewGrowth(appId: string, params?: {
|
|
700
|
+
windowDays?: number;
|
|
701
|
+
}): Promise<AnalyticsGrowthResponse>;
|
|
702
|
+
getAnalyticsDailyActive(appId: string, params?: {
|
|
703
|
+
windowDays?: number;
|
|
704
|
+
}): Promise<AnalyticsDailyActiveResponse>;
|
|
705
|
+
getAnalyticsRollingActive(appId: string, params?: {
|
|
706
|
+
windowDays?: number;
|
|
707
|
+
}): Promise<AnalyticsDailyActiveResponse>;
|
|
708
|
+
getAnalyticsCohortRetention(appId: string): Promise<AnalyticsCohortResponse>;
|
|
709
|
+
getAnalyticsUserSearch(appId: string, params: {
|
|
710
|
+
q: string;
|
|
711
|
+
limit?: number;
|
|
712
|
+
}): Promise<AnalyticsUserSearchResponse>;
|
|
713
|
+
getAnalyticsUserDetail(appId: string, userUlid: string): Promise<AnalyticsUserDetailResponse>;
|
|
714
|
+
getAnalyticsUserSnapshot(appId: string, userUlid: string): Promise<AnalyticsUserSnapshotResponse>;
|
|
715
|
+
getAnalyticsEvents(appId: string, params?: {
|
|
716
|
+
windowDays?: number;
|
|
717
|
+
page?: number;
|
|
718
|
+
[key: string]: any;
|
|
719
|
+
}): Promise<AnalyticsEventsResponse>;
|
|
720
|
+
getAnalyticsEventsGrouped(appId: string, params?: {
|
|
721
|
+
groupBy?: string;
|
|
722
|
+
windowDays?: number;
|
|
723
|
+
[key: string]: any;
|
|
724
|
+
}): Promise<AnalyticsEventsGroupedResponse>;
|
|
725
|
+
getAnalyticsTopWorkflows(appId: string, params?: {
|
|
726
|
+
windowDays?: number;
|
|
727
|
+
limit?: number;
|
|
728
|
+
}): Promise<TopWorkflowsResponse>;
|
|
729
|
+
getAnalyticsTopPrompts(appId: string, params?: {
|
|
730
|
+
windowDays?: number;
|
|
731
|
+
limit?: number;
|
|
732
|
+
}): Promise<TopPromptsResponse>;
|
|
733
|
+
listAllAdmins(params?: {
|
|
734
|
+
limit?: number;
|
|
735
|
+
cursor?: string;
|
|
736
|
+
}): Promise<any>;
|
|
737
|
+
searchAdminByEmail(email: string): Promise<any>;
|
|
738
|
+
getAdminApps(email: string): Promise<any>;
|
|
739
|
+
updateAdminSettings(adminId: string, data: {
|
|
740
|
+
appCreationLimit?: number;
|
|
741
|
+
disabled?: boolean;
|
|
742
|
+
role?: "admin" | "super-admin";
|
|
743
|
+
}): Promise<any>;
|
|
744
|
+
reindexAdmin(adminId: string): Promise<void>;
|
|
745
|
+
listAllAdminInvitations(): Promise<any[]>;
|
|
746
|
+
createGlobalAdminInvitation(data: {
|
|
747
|
+
email: string;
|
|
748
|
+
appCreationLimit?: number;
|
|
749
|
+
expiresInDays?: number;
|
|
750
|
+
}): Promise<any>;
|
|
751
|
+
deleteGlobalAdminInvitation(invitationId: string): Promise<void>;
|
|
752
|
+
listPromptCatalog(params?: {
|
|
753
|
+
status?: string;
|
|
754
|
+
limit?: number;
|
|
755
|
+
cursor?: string;
|
|
756
|
+
}): Promise<any>;
|
|
757
|
+
getPromptCatalogItem(catalogId: string): Promise<any>;
|
|
758
|
+
createPromptCatalogItem(payload: any): Promise<any>;
|
|
759
|
+
updatePromptCatalogItem(catalogId: string, payload: any): Promise<any>;
|
|
760
|
+
deletePromptCatalogItem(catalogId: string): Promise<void>;
|
|
761
|
+
listIntegrationCatalog(params?: {
|
|
762
|
+
status?: string;
|
|
763
|
+
limit?: number;
|
|
764
|
+
cursor?: string;
|
|
765
|
+
}): Promise<any>;
|
|
766
|
+
getIntegrationCatalogItem(catalogId: string): Promise<any>;
|
|
767
|
+
createIntegrationCatalogItem(payload: any): Promise<any>;
|
|
768
|
+
updateIntegrationCatalogItem(catalogId: string, payload: any): Promise<any>;
|
|
769
|
+
deleteIntegrationCatalogItem(catalogId: string): Promise<void>;
|
|
770
|
+
listLlmModels(provider?: string): Promise<{
|
|
771
|
+
models: Array<{
|
|
772
|
+
id: string;
|
|
773
|
+
name: string;
|
|
774
|
+
context_length?: number;
|
|
775
|
+
pricing?: any;
|
|
776
|
+
}>;
|
|
777
|
+
defaultModel?: string;
|
|
778
|
+
cachedAt?: string;
|
|
779
|
+
}>;
|
|
780
|
+
generatePrompt(payload: {
|
|
781
|
+
description: string;
|
|
782
|
+
generateOutputSchema?: boolean;
|
|
783
|
+
}): Promise<any>;
|
|
784
|
+
generateEvaluator(payload: {
|
|
785
|
+
appId: string;
|
|
786
|
+
promptId: string;
|
|
787
|
+
}): Promise<any>;
|
|
788
|
+
generateWorkflowEvaluator(payload: {
|
|
789
|
+
appId: string;
|
|
790
|
+
workflowId: string;
|
|
791
|
+
}): Promise<any>;
|
|
792
|
+
startBatchTests(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, payload?: {
|
|
793
|
+
comparisonGroup?: string;
|
|
794
|
+
overrideConfigId?: string;
|
|
795
|
+
testCaseIds?: string[];
|
|
796
|
+
}): Promise<{
|
|
797
|
+
batchId: string;
|
|
798
|
+
totalTests: number;
|
|
799
|
+
instanceIds: string[];
|
|
800
|
+
errors?: any[];
|
|
801
|
+
}>;
|
|
802
|
+
getBatchTestStatus(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, batchId: string): Promise<{
|
|
803
|
+
status: string;
|
|
804
|
+
batchId: string;
|
|
805
|
+
completed: number;
|
|
806
|
+
passed: number;
|
|
807
|
+
failed: number;
|
|
808
|
+
results: Array<{
|
|
809
|
+
testCaseId: string;
|
|
810
|
+
runId: string;
|
|
811
|
+
status: string;
|
|
812
|
+
verificationPassed: boolean;
|
|
813
|
+
durationMs?: number;
|
|
814
|
+
verificationDetails?: any;
|
|
815
|
+
startedAt?: string;
|
|
816
|
+
endedAt?: string;
|
|
817
|
+
}>;
|
|
818
|
+
}>;
|
|
819
|
+
cancelBatchTests(appId: string, blockType: "prompt" | "integration" | "workflow", blockId: string, batchId: string, instanceIds: string[]): Promise<{
|
|
820
|
+
batchId: string;
|
|
821
|
+
terminated: string[];
|
|
822
|
+
errors?: any[];
|
|
823
|
+
}>;
|
|
824
|
+
getComparisonGroup(appId: string, group: string): Promise<{
|
|
825
|
+
comparisonGroup: string;
|
|
826
|
+
runs: any[];
|
|
827
|
+
}>;
|
|
828
|
+
listEmailTemplates(appId: string): Promise<{
|
|
829
|
+
templates: EmailTemplateSummary[];
|
|
830
|
+
}>;
|
|
831
|
+
getEmailTemplate(appId: string, emailType: string): Promise<EmailTemplateDetail>;
|
|
832
|
+
upsertEmailTemplate(appId: string, emailType: string, payload: {
|
|
833
|
+
subject: string;
|
|
834
|
+
htmlBody: string;
|
|
835
|
+
textBody: string;
|
|
836
|
+
}): Promise<EmailTemplateUpsertResult>;
|
|
837
|
+
deleteEmailTemplate(appId: string, emailType: string): Promise<{
|
|
838
|
+
success: boolean;
|
|
839
|
+
}>;
|
|
840
|
+
testEmailTemplate(appId: string, emailType: string, payload?: {
|
|
841
|
+
subject: string;
|
|
842
|
+
htmlBody: string;
|
|
843
|
+
textBody: string;
|
|
844
|
+
}): Promise<{
|
|
845
|
+
success: boolean;
|
|
846
|
+
sentTo: string;
|
|
847
|
+
error?: string;
|
|
848
|
+
}>;
|
|
849
|
+
createToken(appId: string, data: {
|
|
850
|
+
name: string;
|
|
851
|
+
ttl?: string;
|
|
852
|
+
userId?: string;
|
|
853
|
+
}): Promise<{
|
|
854
|
+
token: string;
|
|
855
|
+
tokenId: string;
|
|
856
|
+
name: string;
|
|
857
|
+
expiresAt: string | null;
|
|
858
|
+
createdAt: string;
|
|
859
|
+
warning: string;
|
|
860
|
+
}>;
|
|
861
|
+
listTokens(appId: string, params?: {
|
|
862
|
+
userId?: string;
|
|
863
|
+
}): Promise<Array<{
|
|
864
|
+
tokenId: string;
|
|
865
|
+
name: string;
|
|
866
|
+
userId: string;
|
|
867
|
+
expiresAt: string | null;
|
|
868
|
+
lastUsedAt: string | null;
|
|
869
|
+
createdAt: string;
|
|
870
|
+
createdBy: string;
|
|
871
|
+
}>>;
|
|
872
|
+
getToken(appId: string, tokenId: string): Promise<{
|
|
873
|
+
tokenId: string;
|
|
874
|
+
name: string;
|
|
875
|
+
userId: string;
|
|
876
|
+
expiresAt: string | null;
|
|
877
|
+
lastUsedAt: string | null;
|
|
878
|
+
createdAt: string;
|
|
879
|
+
createdBy: string;
|
|
880
|
+
revokedAt: string | null;
|
|
881
|
+
}>;
|
|
882
|
+
revokeToken(appId: string, tokenId: string): Promise<{
|
|
883
|
+
success: boolean;
|
|
884
|
+
message: string;
|
|
885
|
+
}>;
|
|
886
|
+
listDatabases(appId: string): Promise<any[]>;
|
|
887
|
+
createDatabase(appId: string, data: {
|
|
888
|
+
title: string;
|
|
889
|
+
databaseType?: string;
|
|
890
|
+
metadata?: Record<string, any> | string;
|
|
891
|
+
}): Promise<any>;
|
|
892
|
+
getDatabase(appId: string, databaseId: string): Promise<any>;
|
|
893
|
+
updateDatabase(appId: string, databaseId: string, data: Record<string, any>): Promise<any>;
|
|
894
|
+
deleteDatabase(appId: string, databaseId: string): Promise<void>;
|
|
895
|
+
/**
|
|
896
|
+
* Read a database's CEL context dict.
|
|
897
|
+
*
|
|
898
|
+
* The HTTP path stays `/metadata` because the wire field name is still
|
|
899
|
+
* `metadata`; only the client/CLI-facing helper names were reframed.
|
|
900
|
+
*/
|
|
901
|
+
getDatabaseCelContext(appId: string, databaseId: string): Promise<any>;
|
|
902
|
+
/** Update a database's CEL context dict (merge with existing). */
|
|
903
|
+
updateDatabaseCelContext(appId: string, databaseId: string, celContext: Record<string, any>): Promise<any>;
|
|
904
|
+
/** @deprecated Use {@link getDatabaseCelContext} instead. */
|
|
905
|
+
getDatabaseMetadata(appId: string, databaseId: string): Promise<any>;
|
|
906
|
+
/** @deprecated Use {@link updateDatabaseCelContext} instead. */
|
|
907
|
+
updateDatabaseMetadata(appId: string, databaseId: string, metadata: Record<string, any>): Promise<any>;
|
|
908
|
+
listDatabasePermissions(appId: string, databaseId: string): Promise<any[]>;
|
|
909
|
+
addDatabaseManager(appId: string, databaseId: string, userId: string): Promise<any>;
|
|
910
|
+
removeDatabaseManager(appId: string, databaseId: string, userId: string): Promise<any>;
|
|
911
|
+
/** @deprecated Use {@link addDatabaseManager} instead. */
|
|
912
|
+
grantDatabasePermission(appId: string, databaseId: string, data: {
|
|
913
|
+
userId: string;
|
|
914
|
+
permission: "manager";
|
|
915
|
+
}): Promise<any>;
|
|
916
|
+
/** @deprecated Use {@link removeDatabaseManager} instead. */
|
|
917
|
+
revokeDatabasePermission(appId: string, databaseId: string, userId: string): Promise<any>;
|
|
918
|
+
listDatabaseModels(appId: string, databaseId: string): Promise<any>;
|
|
919
|
+
describeDatabaseModel(appId: string, databaseId: string, modelName: string): Promise<any>;
|
|
920
|
+
queryDatabaseRecords(appId: string, databaseId: string, modelName: string, queryOptions?: {
|
|
921
|
+
filter?: Record<string, any>;
|
|
922
|
+
limit?: number;
|
|
923
|
+
cursor?: string;
|
|
924
|
+
}): Promise<any>;
|
|
925
|
+
listDatabaseOperations(appId: string, databaseId: string): Promise<any[]>;
|
|
926
|
+
executeDatabaseOperation(appId: string, databaseId: string, operationName: string, data?: {
|
|
927
|
+
params?: Record<string, any>;
|
|
928
|
+
limit?: number;
|
|
929
|
+
cursor?: string;
|
|
930
|
+
direction?: number;
|
|
931
|
+
}, token?: string, options?: {
|
|
932
|
+
timing?: boolean;
|
|
933
|
+
}): Promise<any>;
|
|
934
|
+
/**
|
|
935
|
+
* Execute a registered batch (bulk) database operation. Posts a chunk of
|
|
936
|
+
* items to the canonical `operations/:name/batch` endpoint (the same one the
|
|
937
|
+
* client library's `executeBatch` uses — NOT the deprecated `import-bulk`
|
|
938
|
+
* alias). Used by `databases import-csv`.
|
|
939
|
+
*
|
|
940
|
+
* @returns `{ imported, failed }` — DO-level write outcome counts. Per-item
|
|
941
|
+
* validation/access failures abort the whole chunk with a 4xx (thrown).
|
|
942
|
+
*/
|
|
943
|
+
executeBatch(appId: string, databaseId: string, operationName: string, batch: Array<{
|
|
944
|
+
params: Record<string, any>;
|
|
945
|
+
}>): Promise<{
|
|
946
|
+
imported: number;
|
|
947
|
+
failed: number;
|
|
948
|
+
}>;
|
|
949
|
+
/**
|
|
950
|
+
* Make a request using a specific JWT token instead of the CLI's credentials.
|
|
951
|
+
* Used for executing operations as a different user.
|
|
952
|
+
*/
|
|
953
|
+
requestWithToken<T = any>(path: string, token: string, options?: RequestInit): Promise<T>;
|
|
954
|
+
listDatabaseIndexes(appId: string, databaseId: string, modelName?: string): Promise<any>;
|
|
955
|
+
registerDatabaseIndex(appId: string, databaseId: string, data: {
|
|
956
|
+
modelName: string;
|
|
957
|
+
fieldName: string;
|
|
958
|
+
fieldType: string;
|
|
959
|
+
unique?: boolean;
|
|
960
|
+
}): Promise<any>;
|
|
961
|
+
dropDatabaseIndex(appId: string, databaseId: string, data: {
|
|
962
|
+
modelName: string;
|
|
963
|
+
fieldName: string;
|
|
964
|
+
}): Promise<any>;
|
|
965
|
+
/**
|
|
966
|
+
* Issue #974: back-provision an existing database instance's schema-declared
|
|
967
|
+
* unique indexes by reading its type schema and registering any declared-but-
|
|
968
|
+
* missing unique index. Idempotent.
|
|
969
|
+
*/
|
|
970
|
+
reindexDatabaseFromSchema(appId: string, databaseId: string): Promise<{
|
|
971
|
+
ok: boolean;
|
|
972
|
+
registered: number;
|
|
973
|
+
skipped?: boolean;
|
|
974
|
+
reason?: string;
|
|
975
|
+
databaseType?: string;
|
|
976
|
+
}>;
|
|
977
|
+
listDatabaseTypeConfigs(appId: string): Promise<any[]>;
|
|
978
|
+
getDatabaseTypeConfig(appId: string, databaseType: string): Promise<any>;
|
|
979
|
+
createDatabaseTypeConfig(appId: string, data: {
|
|
980
|
+
databaseType: string;
|
|
981
|
+
ruleSetId?: string | null;
|
|
982
|
+
triggers?: Record<string, any> | null;
|
|
983
|
+
metadataAccess?: string | null;
|
|
984
|
+
defaultAccess?: string | null;
|
|
985
|
+
autoPopulatedFields?: Record<string, any> | null;
|
|
986
|
+
timestamps?: Record<string, any> | null;
|
|
987
|
+
schema?: string | null;
|
|
988
|
+
}): Promise<any>;
|
|
989
|
+
updateDatabaseTypeConfig(appId: string, databaseType: string, data: {
|
|
990
|
+
ruleSetId?: string | null;
|
|
991
|
+
triggers?: Record<string, any> | null;
|
|
992
|
+
metadataAccess?: string | null;
|
|
993
|
+
defaultAccess?: string | null;
|
|
994
|
+
autoPopulatedFields?: Record<string, any> | null;
|
|
995
|
+
timestamps?: Record<string, any> | null;
|
|
996
|
+
schema?: string | null;
|
|
997
|
+
pendingOpDeletes?: string[];
|
|
998
|
+
finalOpNames?: string[];
|
|
999
|
+
}, expectedModifiedAt?: string, options?: {
|
|
1000
|
+
dryRun?: boolean;
|
|
1001
|
+
acceptWarnings?: boolean;
|
|
1002
|
+
}): Promise<any>;
|
|
1003
|
+
deleteDatabaseTypeConfig(appId: string, databaseType: string): Promise<any>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Issue #666 Phase 3: ask the server to scaffold a TOML schema from
|
|
1006
|
+
* existing ops + DO field introspection. Read-only — does NOT persist.
|
|
1007
|
+
*/
|
|
1008
|
+
scaffoldDatabaseTypeSchema(appId: string, databaseType: string): Promise<{
|
|
1009
|
+
schema: string;
|
|
1010
|
+
}>;
|
|
1011
|
+
listDatabaseTypeOperations(appId: string, databaseType: string): Promise<any[]>;
|
|
1012
|
+
getDatabaseTypeOperation(appId: string, databaseType: string, name: string): Promise<any>;
|
|
1013
|
+
createDatabaseTypeOperation(appId: string, databaseType: string, data: {
|
|
1014
|
+
name: string;
|
|
1015
|
+
type: string;
|
|
1016
|
+
modelName: string;
|
|
1017
|
+
access?: string | null;
|
|
1018
|
+
definition: Record<string, any>;
|
|
1019
|
+
params?: Record<string, any> | null;
|
|
1020
|
+
}, options?: {
|
|
1021
|
+
dryRun?: boolean;
|
|
1022
|
+
schemaOverride?: string | null;
|
|
1023
|
+
}): Promise<any>;
|
|
1024
|
+
updateDatabaseTypeOperation(appId: string, databaseType: string, name: string, data: Record<string, any>, expectedModifiedAt?: string, options?: {
|
|
1025
|
+
dryRun?: boolean;
|
|
1026
|
+
schemaOverride?: string | null;
|
|
1027
|
+
}): Promise<any>;
|
|
1028
|
+
deleteDatabaseTypeOperation(appId: string, databaseType: string, name: string): Promise<any>;
|
|
1029
|
+
listDatabaseTypeSubscriptions(appId: string, databaseType: string): Promise<any[]>;
|
|
1030
|
+
getDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string): Promise<any>;
|
|
1031
|
+
createDatabaseTypeSubscription(appId: string, databaseType: string, data: {
|
|
1032
|
+
subscriptionKey: string;
|
|
1033
|
+
displayName: string;
|
|
1034
|
+
modelName: string;
|
|
1035
|
+
filter: string;
|
|
1036
|
+
access: string;
|
|
1037
|
+
description?: string | null;
|
|
1038
|
+
select?: string[] | null;
|
|
1039
|
+
emit?: string[] | null;
|
|
1040
|
+
params?: Record<string, any> | null;
|
|
1041
|
+
status?: string;
|
|
1042
|
+
}): Promise<any>;
|
|
1043
|
+
updateDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string, data: Record<string, any>): Promise<any>;
|
|
1044
|
+
deleteDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string): Promise<any>;
|
|
1045
|
+
listGroups(appId: string, params?: {
|
|
1046
|
+
type?: string;
|
|
1047
|
+
limit?: number;
|
|
1048
|
+
cursor?: string;
|
|
1049
|
+
}): Promise<{
|
|
1050
|
+
items: any[];
|
|
1051
|
+
cursor?: string;
|
|
1052
|
+
}>;
|
|
1053
|
+
createGroup(appId: string, data: {
|
|
1054
|
+
groupType: string;
|
|
1055
|
+
groupId: string;
|
|
1056
|
+
name: string;
|
|
1057
|
+
description?: string;
|
|
1058
|
+
}): Promise<any>;
|
|
1059
|
+
getGroup(appId: string, groupType: string, groupId: string): Promise<any>;
|
|
1060
|
+
updateGroup(appId: string, groupType: string, groupId: string, data: {
|
|
1061
|
+
name?: string;
|
|
1062
|
+
description?: string;
|
|
1063
|
+
}): Promise<any>;
|
|
1064
|
+
deleteGroup(appId: string, groupType: string, groupId: string): Promise<any>;
|
|
1065
|
+
listGroupMembers(appId: string, groupType: string, groupId: string): Promise<{
|
|
1066
|
+
items: any[];
|
|
1067
|
+
cursor?: string;
|
|
1068
|
+
}>;
|
|
1069
|
+
addGroupMember(appId: string, groupType: string, groupId: string, data: {
|
|
1070
|
+
userId: string;
|
|
1071
|
+
}): Promise<any>;
|
|
1072
|
+
removeGroupMember(appId: string, groupType: string, groupId: string, userId: string): Promise<any>;
|
|
1073
|
+
listGroupDocuments(appId: string, groupType: string, groupId: string): Promise<any[]>;
|
|
1074
|
+
listUserMemberships(appId: string, userId: string): Promise<any[]>;
|
|
1075
|
+
listDocumentGroupPermissions(appId: string, documentId: string): Promise<any[]>;
|
|
1076
|
+
grantDocumentGroupPermission(appId: string, documentId: string, data: {
|
|
1077
|
+
groupType: string;
|
|
1078
|
+
groupId: string;
|
|
1079
|
+
permission: string;
|
|
1080
|
+
}): Promise<any>;
|
|
1081
|
+
revokeDocumentGroupPermission(appId: string, documentId: string, groupType: string, groupId: string): Promise<any>;
|
|
1082
|
+
listCollections(appId: string, params?: {
|
|
1083
|
+
limit?: number;
|
|
1084
|
+
cursor?: string;
|
|
1085
|
+
}): Promise<{
|
|
1086
|
+
items: any[];
|
|
1087
|
+
nextCursor?: string | null;
|
|
1088
|
+
}>;
|
|
1089
|
+
listAllCollections(appId: string, params?: {
|
|
1090
|
+
limit?: number;
|
|
1091
|
+
cursor?: string;
|
|
1092
|
+
}): Promise<{
|
|
1093
|
+
items: any[];
|
|
1094
|
+
nextCursor?: string | null;
|
|
1095
|
+
}>;
|
|
1096
|
+
createCollection(appId: string, data: {
|
|
1097
|
+
name: string;
|
|
1098
|
+
description?: string;
|
|
1099
|
+
}): Promise<any>;
|
|
1100
|
+
getCollection(appId: string, collectionId: string): Promise<any>;
|
|
1101
|
+
updateCollection(appId: string, collectionId: string, data: {
|
|
1102
|
+
name?: string;
|
|
1103
|
+
description?: string;
|
|
1104
|
+
}): Promise<any>;
|
|
1105
|
+
deleteCollection(appId: string, collectionId: string): Promise<any>;
|
|
1106
|
+
listCollectionDocuments(appId: string, collectionId: string, params?: {
|
|
1107
|
+
limit?: number;
|
|
1108
|
+
cursor?: string;
|
|
1109
|
+
}): Promise<{
|
|
1110
|
+
items: any[];
|
|
1111
|
+
nextCursor?: string | null;
|
|
1112
|
+
}>;
|
|
1113
|
+
addCollectionDocument(appId: string, collectionId: string, data: {
|
|
1114
|
+
documentId: string;
|
|
1115
|
+
}): Promise<any>;
|
|
1116
|
+
removeCollectionDocument(appId: string, collectionId: string, documentId: string): Promise<any>;
|
|
1117
|
+
listCollectionsForDocument(appId: string, documentId: string, params?: {
|
|
1118
|
+
limit?: number;
|
|
1119
|
+
cursor?: string;
|
|
1120
|
+
}): Promise<{
|
|
1121
|
+
items: any[];
|
|
1122
|
+
nextCursor?: string | null;
|
|
1123
|
+
}>;
|
|
1124
|
+
getCollectionAccess(appId: string, collectionId: string): Promise<any>;
|
|
1125
|
+
grantCollectionGroupPermission(appId: string, collectionId: string, data: {
|
|
1126
|
+
groupType: string;
|
|
1127
|
+
groupId: string;
|
|
1128
|
+
permission: string;
|
|
1129
|
+
}): Promise<any>;
|
|
1130
|
+
revokeCollectionGroupPermission(appId: string, collectionId: string, groupType: string, groupId: string): Promise<any>;
|
|
1131
|
+
addCollectionMember(appId: string, collectionId: string, data: {
|
|
1132
|
+
userId: string;
|
|
1133
|
+
permission: string;
|
|
1134
|
+
}): Promise<any>;
|
|
1135
|
+
removeCollectionMember(appId: string, collectionId: string, userId: string): Promise<any>;
|
|
1136
|
+
listCollectionTypeConfigs(appId: string): Promise<any[]>;
|
|
1137
|
+
getCollectionTypeConfig(appId: string, collectionType: string): Promise<any>;
|
|
1138
|
+
createCollectionTypeConfig(appId: string, data: {
|
|
1139
|
+
collectionType: string;
|
|
1140
|
+
ruleSetId?: string;
|
|
1141
|
+
}): Promise<any>;
|
|
1142
|
+
updateCollectionTypeConfig(appId: string, collectionType: string, data: {
|
|
1143
|
+
ruleSetId?: string | null;
|
|
1144
|
+
}, expectedModifiedAt?: string): Promise<any>;
|
|
1145
|
+
deleteCollectionTypeConfig(appId: string, collectionType: string): Promise<any>;
|
|
1146
|
+
listRuleSets(appId: string, params?: {
|
|
1147
|
+
resourceType?: string;
|
|
1148
|
+
}): Promise<any[]>;
|
|
1149
|
+
createRuleSet(appId: string, data: {
|
|
1150
|
+
name: string;
|
|
1151
|
+
resourceType: string;
|
|
1152
|
+
rules: Record<string, any>;
|
|
1153
|
+
description?: string;
|
|
1154
|
+
}): Promise<any>;
|
|
1155
|
+
getRuleSet(appId: string, ruleSetId: string): Promise<any>;
|
|
1156
|
+
updateRuleSet(appId: string, ruleSetId: string, data: {
|
|
1157
|
+
name?: string;
|
|
1158
|
+
description?: string;
|
|
1159
|
+
rules?: Record<string, any>;
|
|
1160
|
+
}, expectedModifiedAt?: string): Promise<any>;
|
|
1161
|
+
deleteRuleSet(appId: string, ruleSetId: string): Promise<any>;
|
|
1162
|
+
getRuleSetSchema(appId: string): Promise<any>;
|
|
1163
|
+
testRuleSet(appId: string, ruleSetId: string, data: any): Promise<any>;
|
|
1164
|
+
debugRuleSet(appId: string, data: any): Promise<any>;
|
|
1165
|
+
listGroupTypeConfigs(appId: string): Promise<any[]>;
|
|
1166
|
+
getGroupTypeConfig(appId: string, groupType: string): Promise<any>;
|
|
1167
|
+
createGroupTypeConfig(appId: string, data: {
|
|
1168
|
+
groupType: string;
|
|
1169
|
+
ruleSetId?: string;
|
|
1170
|
+
autoAddCreator?: boolean;
|
|
1171
|
+
}): Promise<any>;
|
|
1172
|
+
updateGroupTypeConfig(appId: string, groupType: string, data: {
|
|
1173
|
+
ruleSetId?: string | null;
|
|
1174
|
+
autoAddCreator?: boolean;
|
|
1175
|
+
}, expectedModifiedAt?: string): Promise<any>;
|
|
1176
|
+
deleteGroupTypeConfig(appId: string, groupType: string): Promise<any>;
|
|
1177
|
+
exportDocumentState(appId: string, documentId: string): Promise<{
|
|
1178
|
+
state: string;
|
|
1179
|
+
byteLength: number;
|
|
1180
|
+
documentId: string;
|
|
1181
|
+
}>;
|
|
1182
|
+
importDocumentState(appId: string, documentId: string, stateBase64: string): Promise<any>;
|
|
1183
|
+
getDocument(appId: string, documentId: string): Promise<any>;
|
|
1184
|
+
createDocument(appId: string, data: {
|
|
1185
|
+
title: string;
|
|
1186
|
+
documentId?: string;
|
|
1187
|
+
tags?: string[];
|
|
1188
|
+
createdBy?: string;
|
|
1189
|
+
}): Promise<any>;
|
|
1190
|
+
listDocumentPermissions(appId: string, documentId: string): Promise<any[]>;
|
|
1191
|
+
grantDocumentPermission(appId: string, documentId: string, permissions: Array<{
|
|
1192
|
+
userId: string;
|
|
1193
|
+
permission: string;
|
|
1194
|
+
}>): Promise<any>;
|
|
1195
|
+
listDocumentInvitations(appId: string, documentId: string): Promise<any[]>;
|
|
1196
|
+
listDocumentBlobs(appId: string, documentId: string): Promise<any[]>;
|
|
1197
|
+
downloadBlob(appId: string, documentId: string, blobId: string): Promise<Buffer>;
|
|
1198
|
+
uploadBlob(appId: string, documentId: string, blobId: string, data: Buffer, meta: {
|
|
1199
|
+
filename: string;
|
|
1200
|
+
contentType: string;
|
|
1201
|
+
sha256: string;
|
|
1202
|
+
}): Promise<any>;
|
|
1203
|
+
listDocumentAliases(appId: string, documentId: string): Promise<any[]>;
|
|
1204
|
+
setDocumentAlias(appId: string, aliasScope: string, aliasKey: string, documentId: string, ownerUserId?: string, mustNotExist?: boolean): Promise<any>;
|
|
1205
|
+
findUserByEmail(appId: string, email: string): Promise<any | null>;
|
|
1206
|
+
listAdminDocuments(appId: string, userId: string): Promise<any[]>;
|
|
1207
|
+
saveDatabaseRecord(appId: string, databaseId: string, modelName: string, id: string, data: any): Promise<any>;
|
|
1208
|
+
batchDatabaseRecords(appId: string, databaseId: string, operations: any[]): Promise<any>;
|
|
1209
|
+
deleteDatabaseRecord(appId: string, databaseId: string, modelName: string, id: string): Promise<any>;
|
|
1210
|
+
batchDeleteDatabaseRecords(appId: string, databaseId: string, operations: {
|
|
1211
|
+
op: "delete";
|
|
1212
|
+
modelName: string;
|
|
1213
|
+
id: string;
|
|
1214
|
+
}[]): Promise<any>;
|
|
1215
|
+
listDatabaseUniqueConstraints(appId: string, databaseId: string): Promise<any[]>;
|
|
1216
|
+
registerDatabaseUniqueConstraint(appId: string, databaseId: string, constraint: {
|
|
1217
|
+
modelName: string;
|
|
1218
|
+
constraintName: string;
|
|
1219
|
+
fields: string[];
|
|
1220
|
+
}): Promise<any>;
|
|
1221
|
+
listBlobBuckets(appId: string): Promise<{
|
|
1222
|
+
items: any[];
|
|
1223
|
+
}>;
|
|
1224
|
+
createBlobBucket(appId: string, payload: any): Promise<any>;
|
|
1225
|
+
getBlobBucket(appId: string, bucketIdOrKey: string): Promise<any>;
|
|
1226
|
+
deleteBlobBucket(appId: string, bucketIdOrKey: string): Promise<any>;
|
|
1227
|
+
listBucketBlobs(appId: string, bucketIdOrKey: string, params?: {
|
|
1228
|
+
cursor?: string;
|
|
1229
|
+
limit?: number;
|
|
1230
|
+
}): Promise<{
|
|
1231
|
+
items: any[];
|
|
1232
|
+
cursor?: string;
|
|
1233
|
+
}>;
|
|
1234
|
+
uploadBucketBlob(appId: string, bucketIdOrKey: string, data: Buffer, meta: {
|
|
1235
|
+
filename: string;
|
|
1236
|
+
contentType: string;
|
|
1237
|
+
tags?: string[];
|
|
1238
|
+
}): Promise<any>;
|
|
1239
|
+
downloadBucketBlob(appId: string, bucketIdOrKey: string, blobId: string): Promise<Buffer>;
|
|
1240
|
+
deleteBucketBlob(appId: string, bucketIdOrKey: string, blobId: string): Promise<any>;
|
|
1241
|
+
getBucketBlobSignedUrl(appId: string, bucketIdOrKey: string, blobId: string, expiresInSeconds?: number): Promise<any>;
|
|
1242
|
+
}
|
|
1243
|
+
export declare const apiClient: ApiClient;
|
|
1244
|
+
export {};
|