@collective-intelligence/external-apps-client-sdk-react 0.1.35 → 0.1.36
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 +105 -22
- package/dist/effect.d.ts +60 -0
- package/dist/effect.js +2 -0
- package/dist/index-6ra894v2.js +2 -0
- package/dist/index-bjd4xpqf.js +2 -0
- package/dist/index.d.ts +104 -925
- package/dist/index.js +1 -1
- package/dist/resources.d.ts +79 -337
- package/dist/resources.js +1 -1
- package/package.json +20 -6
- package/dist/index-m8zsc3k7.js +0 -49
package/dist/index.d.ts
CHANGED
|
@@ -1,894 +1,11 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
import { CiError as CiErrorEnvelope, CiErrorCode, CiResult, CiStreamPage, ClientDomains, ClientFetch, ClientOperationDefinition, ClientOperationId, ClientOperationInput, ClientOperationMap, ClientOperationOutput, ClientSdkClient, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, FederatedAuthState, FederatedSessionIdentity, FollowRunOptions, JsonValue, KnowledgeQuery, OperationExecutionOptions, OrganizationClient, QueryFilter, RealtimeChange, RealtimeClient, RealtimeClientOptions, RealtimeClientState, RealtimeClientStatus, RealtimeTopic, RealtimeTopicFilter, SearchQuery, TypedOperationExecutor, WorkflowInvokeTarget } from '@collective-intelligence/external-apps-client-sdk';
|
|
4
|
+
import { EntityClient, EntityCreateInput, EntityDeleteInput, EntityListQuery, EntityMemberValue, EntityPage, EntityUpdateInput, EntityUploadInput, EntityUploadSlot, IdempotencyKey, PortableResourceSchema, ResourceCapabilities, ResourceCreateInput, ResourceCursor, ResourceDefinition, ResourceError, ResourceErrorCode, ResourceFilter, ResourceId, ResourceIdentityField, ResourceJsonValue, ResourceLifecycleInput, ResourceListQuery, ResourceListResult, ResourceMutationInput, ResourcePagination, ResourcePaginationMode, ResourceRecord, ResourceRecordId, ResourceRequestOptions, ResourceResult, ResourceRevision, ResourceSort } from '@collective-intelligence/external-apps-client-sdk/resources';
|
|
5
|
+
import { ResourceField, ResourceFieldControlProps, ResourceObject, ResourceValue } from '@collective-intelligence/ui-react/resources';
|
|
6
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
7
|
import { CSSProperties, ElementType, ReactNode } from 'react';
|
|
4
8
|
|
|
5
|
-
export type FederatedAuthErrorCode = "configuration_error" | "invalid_return_target" | "invalid_callback" | "invalid_state" | "transaction_expired" | "authorization_failed" | "token_exchange_failed" | "reauthorization_required";
|
|
6
|
-
declare class FederatedAuthError extends Error {
|
|
7
|
-
readonly code: FederatedAuthErrorCode;
|
|
8
|
-
constructor(code: FederatedAuthErrorCode, message: string);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The signed-in CI user as the application's BFF reports it: the fields of
|
|
12
|
-
* CI's `/oauth/identity`, read live by the server, plus email and name.
|
|
13
|
-
*/
|
|
14
|
-
export type FederatedSessionIdentity = Readonly<{
|
|
15
|
-
appId: string;
|
|
16
|
-
/** The App Permissions of the user's effective roles. */
|
|
17
|
-
appPermissions: readonly string[];
|
|
18
|
-
email: string | null;
|
|
19
|
-
/** A person is a member or an External App User of one Organization, never both. */
|
|
20
|
-
kind: "member" | "external_app_user";
|
|
21
|
-
name: string | null;
|
|
22
|
-
organizationId: string;
|
|
23
|
-
/** The user's effective roles on the app. */
|
|
24
|
-
roles: readonly string[];
|
|
25
|
-
userId: string;
|
|
26
|
-
}>;
|
|
27
|
-
export type FederatedAuthState = Readonly<{
|
|
28
|
-
status: "anonymous";
|
|
29
|
-
}> | Readonly<{
|
|
30
|
-
status: "redirecting";
|
|
31
|
-
}> | Readonly<{
|
|
32
|
-
expiresAt: number;
|
|
33
|
-
identity?: FederatedSessionIdentity;
|
|
34
|
-
status: "authenticated";
|
|
35
|
-
}> | Readonly<{
|
|
36
|
-
status: "expired";
|
|
37
|
-
}> | Readonly<{
|
|
38
|
-
error: FederatedAuthError;
|
|
39
|
-
status: "error";
|
|
40
|
-
}>;
|
|
41
|
-
export type FederatedAuth = Readonly<{
|
|
42
|
-
beginLogin: (options: Readonly<{
|
|
43
|
-
returnTo: string;
|
|
44
|
-
}>) => Promise<string>;
|
|
45
|
-
completeLogin: (callbackUrl: string) => Promise<Readonly<{
|
|
46
|
-
returnTo: string;
|
|
47
|
-
}>>;
|
|
48
|
-
getAccessToken: () => Promise<string>;
|
|
49
|
-
getState: () => FederatedAuthState;
|
|
50
|
-
logout: () => Promise<void>;
|
|
51
|
-
reauthorize: (options?: Readonly<{
|
|
52
|
-
returnTo?: string;
|
|
53
|
-
}>) => Promise<string>;
|
|
54
|
-
subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
|
|
55
|
-
}>;
|
|
56
|
-
export type ClientFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
57
|
-
export type ExternalApplicationsListAppUsersResponses = {
|
|
58
|
-
/**
|
|
59
|
-
* Success
|
|
60
|
-
*/
|
|
61
|
-
200: {
|
|
62
|
-
correlationId: string;
|
|
63
|
-
result: {
|
|
64
|
-
items: Array<{
|
|
65
|
-
email: string | null;
|
|
66
|
-
name: string | null;
|
|
67
|
-
userId: string;
|
|
68
|
-
}>;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export type ExternalApplicationsListAppUsersResponse = ExternalApplicationsListAppUsersResponses[keyof ExternalApplicationsListAppUsersResponses];
|
|
73
|
-
export type ExternalApplicationsCreateOrGetAppUserData = {
|
|
74
|
-
body: {
|
|
75
|
-
email: string;
|
|
76
|
-
name: string;
|
|
77
|
-
roles: Array<string>;
|
|
78
|
-
};
|
|
79
|
-
headers: {
|
|
80
|
-
authorization?: string;
|
|
81
|
-
"x-organization-id": string;
|
|
82
|
-
"x-correlation-id"?: string;
|
|
83
|
-
"x-external-audit-issuer"?: string;
|
|
84
|
-
"x-external-audit-subject"?: string;
|
|
85
|
-
"x-external-caller-kind"?: "anonymous_visitor";
|
|
86
|
-
"x-external-ci-user-id"?: string;
|
|
87
|
-
"x-external-server-role"?: string;
|
|
88
|
-
};
|
|
89
|
-
path?: never;
|
|
90
|
-
query?: never;
|
|
91
|
-
url: "/application/v1/users";
|
|
92
|
-
};
|
|
93
|
-
export type ExternalApplicationsCreateOrGetAppUserResponses = {
|
|
94
|
-
/**
|
|
95
|
-
* Success
|
|
96
|
-
*/
|
|
97
|
-
200: {
|
|
98
|
-
correlationId: string;
|
|
99
|
-
result: {
|
|
100
|
-
email: string | null;
|
|
101
|
-
name: string | null;
|
|
102
|
-
userId: string;
|
|
103
|
-
created: boolean;
|
|
104
|
-
kind: "member" | "external_app_user";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
export type ExternalApplicationsCreateOrGetAppUserResponse = ExternalApplicationsCreateOrGetAppUserResponses[keyof ExternalApplicationsCreateOrGetAppUserResponses];
|
|
109
|
-
export type ExternalApplicationsCheckAppUserEmailData = {
|
|
110
|
-
body: {
|
|
111
|
-
email: string;
|
|
112
|
-
};
|
|
113
|
-
headers: {
|
|
114
|
-
authorization?: string;
|
|
115
|
-
"x-organization-id": string;
|
|
116
|
-
"x-correlation-id"?: string;
|
|
117
|
-
"x-external-audit-issuer"?: string;
|
|
118
|
-
"x-external-audit-subject"?: string;
|
|
119
|
-
"x-external-caller-kind"?: "anonymous_visitor";
|
|
120
|
-
"x-external-ci-user-id"?: string;
|
|
121
|
-
"x-external-server-role"?: string;
|
|
122
|
-
};
|
|
123
|
-
path?: never;
|
|
124
|
-
query?: never;
|
|
125
|
-
url: "/application/v1/users/check-email";
|
|
126
|
-
};
|
|
127
|
-
export type ExternalApplicationsCheckAppUserEmailResponses = {
|
|
128
|
-
/**
|
|
129
|
-
* Success
|
|
130
|
-
*/
|
|
131
|
-
200: {
|
|
132
|
-
correlationId: string;
|
|
133
|
-
result: {
|
|
134
|
-
usable: true;
|
|
135
|
-
} | {
|
|
136
|
-
reason: "user_unavailable" | "target_inactive";
|
|
137
|
-
usable: false;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
export type ExternalApplicationsCheckAppUserEmailResponse = ExternalApplicationsCheckAppUserEmailResponses[keyof ExternalApplicationsCheckAppUserEmailResponses];
|
|
142
|
-
export type ExternalApplicationsGetAppUserResponses = {
|
|
143
|
-
/**
|
|
144
|
-
* Success
|
|
145
|
-
*/
|
|
146
|
-
200: {
|
|
147
|
-
correlationId: string;
|
|
148
|
-
result: {
|
|
149
|
-
email: string | null;
|
|
150
|
-
name: string | null;
|
|
151
|
-
userId: string;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
export type ExternalApplicationsGetAppUserResponse = ExternalApplicationsGetAppUserResponses[keyof ExternalApplicationsGetAppUserResponses];
|
|
156
|
-
export type ExternalApplicationsListAppRolesResponses = {
|
|
157
|
-
/**
|
|
158
|
-
* Success
|
|
159
|
-
*/
|
|
160
|
-
200: {
|
|
161
|
-
correlationId: string;
|
|
162
|
-
result: {
|
|
163
|
-
items: Array<{
|
|
164
|
-
id: string;
|
|
165
|
-
key: string;
|
|
166
|
-
}>;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
export type ExternalApplicationsListAppRolesResponse = ExternalApplicationsListAppRolesResponses[keyof ExternalApplicationsListAppRolesResponses];
|
|
171
|
-
export type JsonValue$1 = boolean | null | number | readonly JsonValue$1[] | Readonly<{
|
|
172
|
-
readonly [key: string]: JsonValue$1;
|
|
173
|
-
}> | string;
|
|
174
|
-
export type JsonObject = Readonly<Record<string, JsonValue$1>>;
|
|
175
|
-
export type WorkflowInvokeTarget = {
|
|
176
|
-
workflowId: string;
|
|
177
|
-
workflowFqn?: never;
|
|
178
|
-
} | {
|
|
179
|
-
workflowFqn: string;
|
|
180
|
-
workflowId?: never;
|
|
181
|
-
};
|
|
182
|
-
/** Addresses an Agent by its UUID or its in-organization FQN. */
|
|
183
|
-
export type AgentInvokeTarget = {
|
|
184
|
-
agentId: string;
|
|
185
|
-
agentFqn?: never;
|
|
186
|
-
} | {
|
|
187
|
-
agentFqn: string;
|
|
188
|
-
agentId?: never;
|
|
189
|
-
};
|
|
190
|
-
/** Starts a conversation with an Agent, or continues an existing one. */
|
|
191
|
-
export type ConversationContinueTarget = (AgentInvokeTarget & {
|
|
192
|
-
conversationId?: never;
|
|
193
|
-
}) | {
|
|
194
|
-
agentFqn?: never;
|
|
195
|
-
agentId?: never;
|
|
196
|
-
conversationId: string;
|
|
197
|
-
};
|
|
198
|
-
export type ConversationTurnStatus = "accepted" | "cancelled" | "failed" | "running" | "succeeded";
|
|
199
|
-
/**
|
|
200
|
-
* One conversation turn: the application's input, the Agent's final message
|
|
201
|
-
* once its run succeeded, and the Agent Output the run saved, if any.
|
|
202
|
-
* `runId` identifies the turn and its producing run.
|
|
203
|
-
*/
|
|
204
|
-
export interface ConversationTurn {
|
|
205
|
-
completedAt: string | null;
|
|
206
|
-
createdAt: string;
|
|
207
|
-
input: unknown;
|
|
208
|
-
message: string | null;
|
|
209
|
-
output?: unknown;
|
|
210
|
-
runId: string;
|
|
211
|
-
status: ConversationTurnStatus;
|
|
212
|
-
}
|
|
213
|
-
export interface ConversationHistory {
|
|
214
|
-
agentId: string;
|
|
215
|
-
conversationId: string;
|
|
216
|
-
createdAt: string;
|
|
217
|
-
turns: ConversationTurn[];
|
|
218
|
-
}
|
|
219
|
-
export interface QueryFilter {
|
|
220
|
-
caseSensitive?: boolean;
|
|
221
|
-
field: string;
|
|
222
|
-
op: "eq" | "neq" | "in" | "contains" | "gt" | "gte" | "lt" | "lte" | "exists";
|
|
223
|
-
value?: unknown;
|
|
224
|
-
}
|
|
225
|
-
export interface SearchQuery {
|
|
226
|
-
cursor?: string;
|
|
227
|
-
entitySchemaId: string;
|
|
228
|
-
fields?: string[];
|
|
229
|
-
filters?: QueryFilter[];
|
|
230
|
-
limit?: number;
|
|
231
|
-
text?: string;
|
|
232
|
-
}
|
|
233
|
-
export type KnowledgeQuery = {
|
|
234
|
-
entityId: string;
|
|
235
|
-
op: "get";
|
|
236
|
-
} | (SearchQuery & {
|
|
237
|
-
op: "search";
|
|
238
|
-
}) | {
|
|
239
|
-
entitySchemaId: string;
|
|
240
|
-
fields: string[];
|
|
241
|
-
filters?: QueryFilter[];
|
|
242
|
-
op: "facets";
|
|
243
|
-
text?: string;
|
|
244
|
-
} | (SearchQuery & {
|
|
245
|
-
op: "autocomplete";
|
|
246
|
-
});
|
|
247
|
-
export type ExternalApplicationOperationRequest = {
|
|
248
|
-
input: {
|
|
249
|
-
userId: string;
|
|
250
|
-
};
|
|
251
|
-
operationId: "users_get";
|
|
252
|
-
} | {
|
|
253
|
-
input: {
|
|
254
|
-
page?: number;
|
|
255
|
-
pageSize?: number;
|
|
256
|
-
};
|
|
257
|
-
operationId: "users_list";
|
|
258
|
-
} | {
|
|
259
|
-
input: {
|
|
260
|
-
userId: string;
|
|
261
|
-
};
|
|
262
|
-
operationId: "users_deactivate";
|
|
263
|
-
} | {
|
|
264
|
-
input: Record<string, never>;
|
|
265
|
-
operationId: "roles_list";
|
|
266
|
-
} | {
|
|
267
|
-
input: {
|
|
268
|
-
userId: string;
|
|
269
|
-
roles: string[];
|
|
270
|
-
};
|
|
271
|
-
operationId: "roles_assign";
|
|
272
|
-
} | {
|
|
273
|
-
input: {
|
|
274
|
-
userId: string;
|
|
275
|
-
roles: string[];
|
|
276
|
-
};
|
|
277
|
-
operationId: "roles_revoke";
|
|
278
|
-
} | {
|
|
279
|
-
input: ExternalApplicationsCreateOrGetAppUserData["body"];
|
|
280
|
-
operationId: "users_create_or_get";
|
|
281
|
-
} | {
|
|
282
|
-
input: JsonObject | unknown[];
|
|
283
|
-
operationId: "context_get";
|
|
284
|
-
} | {
|
|
285
|
-
input: {
|
|
286
|
-
query: KnowledgeQuery;
|
|
287
|
-
};
|
|
288
|
-
operationId: "knowledge_query";
|
|
289
|
-
} | {
|
|
290
|
-
input: {
|
|
291
|
-
schemaId: string;
|
|
292
|
-
};
|
|
293
|
-
operationId: "knowledge_get_entity_schema_snapshot";
|
|
294
|
-
} | {
|
|
295
|
-
input: SearchQuery;
|
|
296
|
-
operationId: "knowledge_search_entities";
|
|
297
|
-
} | {
|
|
298
|
-
input: {
|
|
299
|
-
entitySchemaId: string;
|
|
300
|
-
fields: string[];
|
|
301
|
-
filters?: QueryFilter[];
|
|
302
|
-
text?: string;
|
|
303
|
-
};
|
|
304
|
-
operationId: "knowledge_facets";
|
|
305
|
-
} | {
|
|
306
|
-
input: {
|
|
307
|
-
entitySchemaId: string;
|
|
308
|
-
};
|
|
309
|
-
operationId: "knowledge_get_schema_query_context";
|
|
310
|
-
} | {
|
|
311
|
-
input: SearchQuery;
|
|
312
|
-
operationId: "knowledge_autocomplete";
|
|
313
|
-
} | {
|
|
314
|
-
input: {
|
|
315
|
-
entityId: string;
|
|
316
|
-
};
|
|
317
|
-
operationId: "knowledge_get_entity";
|
|
318
|
-
} | {
|
|
319
|
-
input: {
|
|
320
|
-
entity: {
|
|
321
|
-
data: JsonObject;
|
|
322
|
-
description?: string;
|
|
323
|
-
entitySchemaId: string;
|
|
324
|
-
name: string;
|
|
325
|
-
};
|
|
326
|
-
idempotencyKey: string;
|
|
327
|
-
};
|
|
328
|
-
operationId: "knowledge_create_entity";
|
|
329
|
-
} | {
|
|
330
|
-
input: {
|
|
331
|
-
entity: {
|
|
332
|
-
data?: JsonObject;
|
|
333
|
-
description?: string;
|
|
334
|
-
name?: string;
|
|
335
|
-
};
|
|
336
|
-
entityId: string;
|
|
337
|
-
expectedVersion: number;
|
|
338
|
-
idempotencyKey: string;
|
|
339
|
-
};
|
|
340
|
-
operationId: "knowledge_update_entity";
|
|
341
|
-
} | {
|
|
342
|
-
input: {
|
|
343
|
-
entity: {
|
|
344
|
-
data: JsonObject;
|
|
345
|
-
description?: string;
|
|
346
|
-
entitySchemaId: string;
|
|
347
|
-
name: string;
|
|
348
|
-
};
|
|
349
|
-
entitySchemaId: string;
|
|
350
|
-
externalIdentity: {
|
|
351
|
-
source: string;
|
|
352
|
-
value: string;
|
|
353
|
-
};
|
|
354
|
-
idempotencyKey: string;
|
|
355
|
-
};
|
|
356
|
-
operationId: "knowledge_upsert_entity";
|
|
357
|
-
} | {
|
|
358
|
-
input: {
|
|
359
|
-
entityId: string;
|
|
360
|
-
expectedVersion: number;
|
|
361
|
-
idempotencyKey: string;
|
|
362
|
-
};
|
|
363
|
-
operationId: "knowledge_delete_entity";
|
|
364
|
-
} | {
|
|
365
|
-
input: {
|
|
366
|
-
filter?: JsonObject;
|
|
367
|
-
};
|
|
368
|
-
operationId: "agents_list";
|
|
369
|
-
} | {
|
|
370
|
-
input: {
|
|
371
|
-
idempotencyKey: string;
|
|
372
|
-
input: unknown;
|
|
373
|
-
} & AgentInvokeTarget;
|
|
374
|
-
operationId: "agents_invoke";
|
|
375
|
-
} | {
|
|
376
|
-
input: {
|
|
377
|
-
filter?: JsonObject;
|
|
378
|
-
};
|
|
379
|
-
operationId: "skills_list";
|
|
380
|
-
} | {
|
|
381
|
-
input: {
|
|
382
|
-
idempotencyKey: string;
|
|
383
|
-
input: unknown;
|
|
384
|
-
skillId: string;
|
|
385
|
-
};
|
|
386
|
-
operationId: "skills_invoke";
|
|
387
|
-
} | {
|
|
388
|
-
input: {
|
|
389
|
-
filter?: JsonObject;
|
|
390
|
-
};
|
|
391
|
-
operationId: "workflows_list";
|
|
392
|
-
} | {
|
|
393
|
-
input: {
|
|
394
|
-
idempotencyKey: string;
|
|
395
|
-
input: unknown;
|
|
396
|
-
} & WorkflowInvokeTarget;
|
|
397
|
-
operationId: "workflows_invoke";
|
|
398
|
-
} | {
|
|
399
|
-
input: {
|
|
400
|
-
runId: string;
|
|
401
|
-
};
|
|
402
|
-
operationId: "runs_get";
|
|
403
|
-
} | {
|
|
404
|
-
input: {
|
|
405
|
-
afterCursor?: string;
|
|
406
|
-
runId: string;
|
|
407
|
-
};
|
|
408
|
-
operationId: "runs_stream";
|
|
409
|
-
} | {
|
|
410
|
-
input: {
|
|
411
|
-
runId: string;
|
|
412
|
-
};
|
|
413
|
-
operationId: "runs_cancel";
|
|
414
|
-
} | {
|
|
415
|
-
input: {
|
|
416
|
-
contentBase64: string;
|
|
417
|
-
contentType: string;
|
|
418
|
-
fileName: string;
|
|
419
|
-
runId: string;
|
|
420
|
-
sizeBytes: number;
|
|
421
|
-
};
|
|
422
|
-
operationId: "attachments_upload";
|
|
423
|
-
} | {
|
|
424
|
-
input: {
|
|
425
|
-
attachmentId: string;
|
|
426
|
-
runId: string;
|
|
427
|
-
};
|
|
428
|
-
operationId: "attachments_download_url";
|
|
429
|
-
} | {
|
|
430
|
-
input: {
|
|
431
|
-
idempotencyKey: string;
|
|
432
|
-
input: unknown;
|
|
433
|
-
} & ConversationContinueTarget;
|
|
434
|
-
operationId: "conversations_continue";
|
|
435
|
-
} | {
|
|
436
|
-
input: {
|
|
437
|
-
conversationId: string;
|
|
438
|
-
};
|
|
439
|
-
operationId: "conversations_history";
|
|
440
|
-
};
|
|
441
|
-
export interface EnvelopeSuccess<Id extends string, Result> {
|
|
442
|
-
correlationId: string;
|
|
443
|
-
operationId: Id;
|
|
444
|
-
result: Result;
|
|
445
|
-
}
|
|
446
|
-
export type ExternalApplicationOperationSuccess = EnvelopeSuccess<"users_get", ApplicationUser> | EnvelopeSuccess<"users_list", ApplicationUserPage> | EnvelopeSuccess<"users_deactivate", {
|
|
447
|
-
userId: string;
|
|
448
|
-
}> | EnvelopeSuccess<"roles_list", {
|
|
449
|
-
items: ApplicationRole[];
|
|
450
|
-
}> | EnvelopeSuccess<"roles_assign", {
|
|
451
|
-
userId: string;
|
|
452
|
-
}> | EnvelopeSuccess<"roles_revoke", {
|
|
453
|
-
userId: string;
|
|
454
|
-
}> | EnvelopeSuccess<"users_create_or_get", ApplicationUserResolution> | EnvelopeSuccess<"context_get", JsonObject> | EnvelopeSuccess<"knowledge_query", JsonObject> | EnvelopeSuccess<"knowledge_get_entity_schema_snapshot", JsonObject> | EnvelopeSuccess<"knowledge_search_entities", JsonObject> | EnvelopeSuccess<"knowledge_facets", JsonObject> | EnvelopeSuccess<"knowledge_get_schema_query_context", JsonObject> | EnvelopeSuccess<"knowledge_autocomplete", JsonObject> | EnvelopeSuccess<"knowledge_get_entity", JsonObject> | EnvelopeSuccess<"knowledge_create_entity", JsonObject> | EnvelopeSuccess<"knowledge_update_entity", JsonObject> | EnvelopeSuccess<"knowledge_upsert_entity", JsonObject> | EnvelopeSuccess<"knowledge_delete_entity", JsonObject> | EnvelopeSuccess<"agents_list", JsonObject> | EnvelopeSuccess<"agents_invoke", {
|
|
455
|
-
runId: string;
|
|
456
|
-
}> | EnvelopeSuccess<"skills_list", JsonObject> | EnvelopeSuccess<"skills_invoke", {
|
|
457
|
-
runId: string;
|
|
458
|
-
}> | EnvelopeSuccess<"workflows_list", JsonObject> | EnvelopeSuccess<"workflows_invoke", {
|
|
459
|
-
runId: string;
|
|
460
|
-
}> | EnvelopeSuccess<"runs_get", JsonObject> | EnvelopeSuccess<"runs_stream", {
|
|
461
|
-
events: JsonObject[];
|
|
462
|
-
nextCursor: string | null;
|
|
463
|
-
}> | EnvelopeSuccess<"runs_cancel", JsonObject> | EnvelopeSuccess<"attachments_upload", {
|
|
464
|
-
attachmentId: string;
|
|
465
|
-
}> | EnvelopeSuccess<"attachments_download_url", {
|
|
466
|
-
expiresAt: string;
|
|
467
|
-
url: string;
|
|
468
|
-
}> | EnvelopeSuccess<"conversations_continue", {
|
|
469
|
-
conversationId: string;
|
|
470
|
-
runId: string;
|
|
471
|
-
}> | EnvelopeSuccess<"conversations_history", ConversationHistory>;
|
|
472
|
-
/** User details returned by the application's user-management gateway. */
|
|
473
|
-
export type ApplicationUser = ExternalApplicationsGetAppUserResponse["result"];
|
|
474
|
-
export type ApplicationUserResolution = ExternalApplicationsCreateOrGetAppUserResponse["result"];
|
|
475
|
-
export type ApplicationUserPage = ExternalApplicationsListAppUsersResponse["result"];
|
|
476
|
-
export type ApplicationRole = ExternalApplicationsListAppRolesResponse["result"]["items"][number];
|
|
477
|
-
declare const storageFileIdBrand: unique symbol;
|
|
478
|
-
/** A durable private file of the application's Organization. */
|
|
479
|
-
export type StorageFileId = string & Readonly<{
|
|
480
|
-
[storageFileIdBrand]: "StorageFileId";
|
|
481
|
-
}>;
|
|
482
|
-
/**
|
|
483
|
-
* One file of up to 10 MiB, base64-encoded. CI accepts the content types
|
|
484
|
-
* `application/pdf`, `image/jpeg` and `image/png`.
|
|
485
|
-
*/
|
|
486
|
-
export interface DurableFileUpload {
|
|
487
|
-
contentBase64: string;
|
|
488
|
-
contentType: string;
|
|
489
|
-
fileName: string;
|
|
490
|
-
sizeBytes: number;
|
|
491
|
-
}
|
|
492
|
-
export type ExternalApplicationServiceOperationRequest = {
|
|
493
|
-
input: ExternalApplicationsCheckAppUserEmailData["body"];
|
|
494
|
-
operationId: "users_check_email";
|
|
495
|
-
} | {
|
|
496
|
-
input: DurableFileUpload;
|
|
497
|
-
operationId: "files_upload";
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* Whether `users_create_or_get` would accept an email, checked without
|
|
501
|
-
* creating anything; an unknown email is usable.
|
|
502
|
-
*/
|
|
503
|
-
export type ApplicationUserEmailCheck = ExternalApplicationsCheckAppUserEmailResponse["result"];
|
|
504
|
-
export type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"users_check_email", ApplicationUserEmailCheck> | EnvelopeSuccess<"files_upload", {
|
|
505
|
-
storageFileId: StorageFileId;
|
|
506
|
-
}>;
|
|
507
|
-
/** Every operation a confidential server client may invoke. */
|
|
508
|
-
export type ExternalApplicationServerOperationRequest = ExternalApplicationOperationRequest | ExternalApplicationServiceOperationRequest;
|
|
509
|
-
export type ExternalApplicationOperationId = ExternalApplicationOperationRequest["operationId"];
|
|
510
|
-
export type ExternalApplicationServerOperationId = ExternalApplicationServerOperationRequest["operationId"];
|
|
511
|
-
export type ExternalApplicationOperationRequestFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationServerOperationRequest, {
|
|
512
|
-
operationId: Id;
|
|
513
|
-
}>;
|
|
514
|
-
export type ExternalApplicationOperationSuccessFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationOperationSuccess | ExternalApplicationServiceOperationSuccess, {
|
|
515
|
-
operationId: Id;
|
|
516
|
-
}>;
|
|
517
|
-
export type ClientOperationId = ExternalApplicationOperationId;
|
|
518
|
-
export interface ClientOperationDefinition<Input, Output> {
|
|
519
|
-
readonly input: Input;
|
|
520
|
-
readonly output: Output;
|
|
521
|
-
}
|
|
522
|
-
export type ClientOperationMap = Readonly<{
|
|
523
|
-
[Id in ClientOperationId]: ClientOperationDefinition<ExternalApplicationOperationRequestFor<Id>["input"], ExternalApplicationOperationSuccessFor<Id>["result"]>;
|
|
524
|
-
}>;
|
|
525
|
-
export type ClientOperationInput<Operations extends ClientOperationMap, Id extends ClientOperationId> = Operations[Id]["input"];
|
|
526
|
-
export type ClientOperationOutput<Operations extends ClientOperationMap, Id extends ClientOperationId> = Operations[Id]["output"];
|
|
527
|
-
export type OperationExecutionOptions = Readonly<{
|
|
528
|
-
organizationId: string;
|
|
529
|
-
signal?: AbortSignal;
|
|
530
|
-
}>;
|
|
531
|
-
export interface TypedOperationExecutor<Operations extends ClientOperationMap> {
|
|
532
|
-
readonly execute: <Id extends ClientOperationId>(operationId: Id, input: ClientOperationInput<Operations, Id>, options?: OperationExecutionOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
533
|
-
}
|
|
534
|
-
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | Readonly<{
|
|
535
|
-
[key: string]: JsonValue;
|
|
536
|
-
}>;
|
|
537
|
-
export type CiErrorCode = "unauthenticated" | "forbidden" | "not_found" | "conflict" | "invalid_request" | "rate_limited" | "unavailable" | "internal";
|
|
538
|
-
export type CiError = Readonly<{
|
|
539
|
-
code: CiErrorCode;
|
|
540
|
-
message: string;
|
|
541
|
-
retryable: boolean;
|
|
542
|
-
details?: Readonly<Record<string, JsonValue>>;
|
|
543
|
-
}>;
|
|
544
|
-
export type CiResult<Value> = Readonly<{
|
|
545
|
-
correlationId: string;
|
|
546
|
-
ok: true;
|
|
547
|
-
value: Value;
|
|
548
|
-
}> | Readonly<{
|
|
549
|
-
correlationId: string;
|
|
550
|
-
error: CiError;
|
|
551
|
-
ok: false;
|
|
552
|
-
}>;
|
|
553
|
-
export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
|
|
554
|
-
[key: string]: ResourceJsonValue;
|
|
555
|
-
}>;
|
|
556
|
-
/** Opaque wire identity. Callers must not infer or concatenate its internals. */
|
|
557
|
-
export type ResourceId = string;
|
|
558
|
-
export type ResourceRecordId = ResourceId;
|
|
559
|
-
/** Opaque concurrency token independent from source timestamps. */
|
|
560
|
-
export type ResourceRevision = string;
|
|
561
|
-
/** Opaque pagination position issued and consumed only by a resource adapter. */
|
|
562
|
-
export type ResourceCursor = string;
|
|
563
|
-
export type IdempotencyKey = string;
|
|
564
|
-
export type ResourceIdentityField = Readonly<{
|
|
565
|
-
name: string;
|
|
566
|
-
type: "number" | "string";
|
|
567
|
-
}>;
|
|
568
|
-
export type ResourceCapabilities = Readonly<{
|
|
569
|
-
create?: boolean;
|
|
570
|
-
/** Common entity deletion is always soft deletion. */
|
|
571
|
-
delete?: boolean;
|
|
572
|
-
get?: boolean;
|
|
573
|
-
hardDelete?: boolean;
|
|
574
|
-
includeDeleted?: boolean;
|
|
575
|
-
restore?: boolean;
|
|
576
|
-
search: true;
|
|
577
|
-
softDelete?: boolean;
|
|
578
|
-
update?: boolean;
|
|
579
|
-
/** File uploads for the File fields of a common entity resource. */
|
|
580
|
-
upload?: boolean;
|
|
581
|
-
}>;
|
|
582
|
-
export type ResourcePaginationMode = "cursor" | "page";
|
|
583
|
-
export type PortableResourceSchema = Readonly<Record<string, ResourceJsonValue>>;
|
|
584
|
-
export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>> = Readonly<{
|
|
585
|
-
capabilities: ResourceCapabilities;
|
|
586
|
-
concurrency: "revision";
|
|
587
|
-
id: string;
|
|
588
|
-
identity: Readonly<{
|
|
589
|
-
fields: readonly [
|
|
590
|
-
ResourceIdentityField,
|
|
591
|
-
...ResourceIdentityField[]
|
|
592
|
-
];
|
|
593
|
-
}>;
|
|
594
|
-
query: Readonly<{
|
|
595
|
-
filterableFields: readonly string[];
|
|
596
|
-
pagination: Readonly<{
|
|
597
|
-
modes: readonly ResourcePaginationMode[];
|
|
598
|
-
}>;
|
|
599
|
-
sortableFields: readonly string[];
|
|
600
|
-
textSearchFields?: readonly string[];
|
|
601
|
-
}>;
|
|
602
|
-
schemas: Readonly<{
|
|
603
|
-
create?: PortableResourceSchema;
|
|
604
|
-
entity: PortableResourceSchema;
|
|
605
|
-
update?: PortableResourceSchema;
|
|
606
|
-
}>;
|
|
607
|
-
version: string;
|
|
608
|
-
/** Portable UI metadata; required/enum/nullability remain in schemas. */
|
|
609
|
-
metadata?: Readonly<Record<string, ResourceJsonValue>>;
|
|
610
|
-
/** Type-only slots keep definition values portable and serializable. */
|
|
611
|
-
readonly __types?: Readonly<{
|
|
612
|
-
create: Create;
|
|
613
|
-
entity: Entity;
|
|
614
|
-
update: Update;
|
|
615
|
-
}>;
|
|
616
|
-
}>;
|
|
617
|
-
export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
|
|
618
|
-
/**
|
|
619
|
-
* A filter predicate. `field` names a declared filterable field, or a path
|
|
620
|
-
* through at most three fields that hold Entity References to a field of
|
|
621
|
-
* the last target, such as `company.industry` or
|
|
622
|
-
* `contacts.company.parent.industry`. On a field that holds Entity
|
|
623
|
-
* References, `is_empty` means no reference. User fields accept identity
|
|
624
|
-
* predicates for one ID and `contains_any`, `contains_all`, `contains_none`
|
|
625
|
-
* for multiple IDs, plus empty/not-empty aliases. CI validates operators
|
|
626
|
-
* against the actual field semantic; UUID shape alone does not declare User.
|
|
627
|
-
*/
|
|
628
|
-
export type ResourceFilter = Readonly<{
|
|
629
|
-
field: string;
|
|
630
|
-
operator: "contains" | "contains_all" | "contains_any" | "contains_none" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
|
|
631
|
-
value: FilterValue;
|
|
632
|
-
}> | Readonly<{
|
|
633
|
-
field: string;
|
|
634
|
-
operator: "is_empty" | "is_not_empty" | "is_not_null" | "is_null";
|
|
635
|
-
}> | Readonly<{
|
|
636
|
-
filters: readonly ResourceFilter[];
|
|
637
|
-
operator: "and" | "or";
|
|
638
|
-
}> | Readonly<{
|
|
639
|
-
filter: ResourceFilter;
|
|
640
|
-
operator: "not";
|
|
641
|
-
}>;
|
|
642
|
-
export type ResourceSort = Readonly<{
|
|
643
|
-
direction: "asc" | "desc";
|
|
644
|
-
field: string;
|
|
645
|
-
}>;
|
|
646
|
-
export type ResourcePagination = Readonly<{
|
|
647
|
-
mode: "cursor";
|
|
648
|
-
cursor?: ResourceCursor;
|
|
649
|
-
limit: number;
|
|
650
|
-
}> | Readonly<{
|
|
651
|
-
mode: "page";
|
|
652
|
-
page: number;
|
|
653
|
-
pageSize: number;
|
|
654
|
-
}>;
|
|
655
|
-
export type ResourceListQuery = Readonly<{
|
|
656
|
-
filter?: ResourceFilter;
|
|
657
|
-
/**
|
|
658
|
-
* Include Paths, such as `["company", "contacts.company"]`: relation
|
|
659
|
-
* fields whose records each item carries in `included`.
|
|
660
|
-
*/
|
|
661
|
-
include?: readonly string[];
|
|
662
|
-
includeDeleted?: boolean;
|
|
663
|
-
pagination: ResourcePagination;
|
|
664
|
-
sort?: readonly ResourceSort[];
|
|
665
|
-
textSearch?: string;
|
|
666
|
-
}>;
|
|
667
|
-
export type ResourceRecord<Entity> = Readonly<{
|
|
668
|
-
deletedAt?: string;
|
|
669
|
-
id: ResourceRecordId;
|
|
670
|
-
/**
|
|
671
|
-
* The records of the read's Include Paths by relation field key: one
|
|
672
|
-
* record, or the records of a `many` field in reference order. Untyped:
|
|
673
|
-
* the target schemas are CI's.
|
|
674
|
-
*/
|
|
675
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
676
|
-
revision: ResourceRevision;
|
|
677
|
-
/** The keys whose included records were cut to the first 100. */
|
|
678
|
-
truncated?: readonly string[];
|
|
679
|
-
value: Entity;
|
|
680
|
-
}>;
|
|
681
|
-
export type ResourceListResult<Entity> = Readonly<{
|
|
682
|
-
items: readonly ResourceRecord<Entity>[];
|
|
683
|
-
nextCursor?: ResourceCursor;
|
|
684
|
-
pagination: "cursor";
|
|
685
|
-
}> | Readonly<{
|
|
686
|
-
items: readonly ResourceRecord<Entity>[];
|
|
687
|
-
page: number;
|
|
688
|
-
pageSize: number;
|
|
689
|
-
pagination: "page";
|
|
690
|
-
totalItems: number;
|
|
691
|
-
totalPages: number;
|
|
692
|
-
}>;
|
|
693
|
-
export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
|
|
694
|
-
/** The CI Organization storage can not take a presigned File upload. */
|
|
695
|
-
"upload_not_supported";
|
|
696
|
-
export type ResourceError = Readonly<{
|
|
697
|
-
code: ResourceErrorCode;
|
|
698
|
-
/** Client-observed dispatch outcome; uncertainty never proves rollback. */
|
|
699
|
-
outcome?: "not_dispatched" | "rejected" | "uncertain";
|
|
700
|
-
details?: Readonly<Record<string, ResourceJsonValue>>;
|
|
701
|
-
message: string;
|
|
702
|
-
retryable: boolean;
|
|
703
|
-
}>;
|
|
704
|
-
export type ResourceResult<Value> = Readonly<{
|
|
705
|
-
correlationId: string;
|
|
706
|
-
ok: true;
|
|
707
|
-
value: Value;
|
|
708
|
-
}> | Readonly<{
|
|
709
|
-
correlationId: string;
|
|
710
|
-
error: ResourceError;
|
|
711
|
-
ok: false;
|
|
712
|
-
}>;
|
|
713
|
-
export type ResourceRequestOptions = Readonly<{
|
|
714
|
-
signal?: AbortSignal;
|
|
715
|
-
}>;
|
|
716
|
-
export type ResourceMutationInput<Value> = Readonly<{
|
|
717
|
-
expectedRevision: ResourceRevision;
|
|
718
|
-
id: ResourceRecordId;
|
|
719
|
-
idempotencyKey?: IdempotencyKey;
|
|
720
|
-
value: Value;
|
|
721
|
-
}>;
|
|
722
|
-
export type ResourceLifecycleInput = Readonly<{
|
|
723
|
-
expectedRevision: ResourceRevision;
|
|
724
|
-
id: ResourceRecordId;
|
|
725
|
-
idempotencyKey?: IdempotencyKey;
|
|
726
|
-
}>;
|
|
727
|
-
export type ResourceCreateInput<Value> = Readonly<{
|
|
728
|
-
idempotencyKey: IdempotencyKey;
|
|
729
|
-
value: Value;
|
|
730
|
-
}>;
|
|
731
|
-
export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
|
|
732
|
-
pagination: Extract<ResourcePagination, {
|
|
733
|
-
mode: "page";
|
|
734
|
-
}>;
|
|
735
|
-
}>;
|
|
736
|
-
export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
|
|
737
|
-
pagination: "page";
|
|
738
|
-
}>;
|
|
739
|
-
/** Member schemas are resolved by CI, independently of the parent resource. */
|
|
740
|
-
export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
|
|
741
|
-
export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
|
|
742
|
-
export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
|
|
743
|
-
idempotencyKey: IdempotencyKey;
|
|
744
|
-
}>;
|
|
745
|
-
export type EntityDeleteInput = ResourceLifecycleInput & Readonly<{
|
|
746
|
-
idempotencyKey: IdempotencyKey;
|
|
747
|
-
}>;
|
|
748
|
-
/** A File upload request for one File field of the entity schema. */
|
|
749
|
-
export type EntityUploadInput = Readonly<{
|
|
750
|
-
field: string;
|
|
751
|
-
filename: string;
|
|
752
|
-
mimeType: string;
|
|
753
|
-
}>;
|
|
754
|
-
/** PUT the file bytes to `url` with `headers`; then write `{ upload: uploadId }`. */
|
|
755
|
-
export type EntityUploadSlot = Readonly<{
|
|
756
|
-
headers: Readonly<Record<string, string>>;
|
|
757
|
-
method: "PUT";
|
|
758
|
-
uploadId: string;
|
|
759
|
-
url: string;
|
|
760
|
-
}>;
|
|
761
|
-
/** A logical write retains its key, payload and edited revision on explicit resubmission. */
|
|
762
|
-
export interface EntityClient<Value, Create = Value, Patch = Partial<Value>> {
|
|
763
|
-
/** Filter, sort and page the resolved member schema; includes remain bounded. */
|
|
764
|
-
readonly listMembers: (parentId: ResourceRecordId, field: string, query: EntityListQuery, options?: ResourceRequestOptions) => Promise<ResourceResult<EntityPage<EntityMemberValue>>>;
|
|
765
|
-
readonly definition: ResourceDefinition<Value, Create, Patch>;
|
|
766
|
-
readonly list: (query: EntityListQuery, options?: ResourceRequestOptions) => Promise<ResourceResult<EntityPage<Value>>>;
|
|
767
|
-
readonly get: (input: Readonly<{
|
|
768
|
-
id: ResourceRecordId;
|
|
769
|
-
include?: readonly string[];
|
|
770
|
-
}>, options?: ResourceRequestOptions) => Promise<ResourceResult<ResourceRecord<Value>>>;
|
|
771
|
-
readonly create: (input: EntityCreateInput<Create>) => Promise<ResourceResult<ResourceRecord<Value>>>;
|
|
772
|
-
readonly update: (input: EntityUpdateInput<Patch>) => Promise<ResourceResult<ResourceRecord<Value>>>;
|
|
773
|
-
readonly delete: (input: EntityDeleteInput) => Promise<ResourceResult<ResourceRecord<Value>>>;
|
|
774
|
-
/** A single-use File upload slot; requires the `upload` capability. */
|
|
775
|
-
readonly upload: (input: EntityUploadInput, options?: ResourceRequestOptions) => Promise<ResourceResult<EntityUploadSlot>>;
|
|
776
|
-
}
|
|
777
|
-
export type CiStreamPage = ClientOperationOutput<ClientOperationMap, "runs_stream">;
|
|
778
|
-
export type FollowRunOptions = Readonly<{
|
|
779
|
-
/**
|
|
780
|
-
* Total wait before `followRun` throws "Run did not finish". Defaults to
|
|
781
|
-
* {@link DEFAULT_FOLLOW_RUN_DEADLINE_MS}.
|
|
782
|
-
*/
|
|
783
|
-
deadlineMs?: number;
|
|
784
|
-
/**
|
|
785
|
-
* First wait between polls in milliseconds (default 50). It doubles while
|
|
786
|
-
* no new event arrives, up to one second or `idleMs` if larger.
|
|
787
|
-
*/
|
|
788
|
-
idleMs?: number;
|
|
789
|
-
now?: () => number;
|
|
790
|
-
runId: string;
|
|
791
|
-
/** Stops following and cancels in-flight requests made by `runs.follow`. */
|
|
792
|
-
signal?: AbortSignal;
|
|
793
|
-
sleep?: (ms: number) => Promise<void>;
|
|
794
|
-
}>;
|
|
795
|
-
declare const clientSdkProtocolVersion: "v1";
|
|
796
|
-
export type SignalOptions = Readonly<{
|
|
797
|
-
signal?: AbortSignal;
|
|
798
|
-
}>;
|
|
799
|
-
export type FollowRunCall<Scoped extends boolean> = Scoped extends true ? (options: FollowRunOptions) => Promise<CiStreamPage> : (options: FollowRunOptions & Readonly<{
|
|
800
|
-
organizationId: string;
|
|
801
|
-
}>) => Promise<CiStreamPage>;
|
|
802
|
-
export type ScopedOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
803
|
-
export type RootOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id> & Readonly<{
|
|
804
|
-
organizationId: string;
|
|
805
|
-
}>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
806
|
-
export type DomainOperation<Operations extends ClientOperationMap, Id extends ClientOperationId, Scoped extends boolean> = Scoped extends true ? ScopedOperation<Operations, Id> : RootOperation<Operations, Id>;
|
|
807
|
-
export type ClientDomains<Operations extends ClientOperationMap, Scoped extends boolean> = Readonly<{
|
|
808
|
-
agents: Readonly<{
|
|
809
|
-
invoke: DomainOperation<Operations, "agents_invoke", Scoped>;
|
|
810
|
-
list: DomainOperation<Operations, "agents_list", Scoped>;
|
|
811
|
-
}>;
|
|
812
|
-
attachments: Readonly<{
|
|
813
|
-
downloadUrl: DomainOperation<Operations, "attachments_download_url", Scoped>;
|
|
814
|
-
upload: DomainOperation<Operations, "attachments_upload", Scoped>;
|
|
815
|
-
}>;
|
|
816
|
-
context: Readonly<{
|
|
817
|
-
get: DomainOperation<Operations, "context_get", Scoped>;
|
|
818
|
-
}>;
|
|
819
|
-
knowledge: Readonly<{
|
|
820
|
-
autocomplete: DomainOperation<Operations, "knowledge_autocomplete", Scoped>;
|
|
821
|
-
createEntity: DomainOperation<Operations, "knowledge_create_entity", Scoped>;
|
|
822
|
-
deleteEntity: DomainOperation<Operations, "knowledge_delete_entity", Scoped>;
|
|
823
|
-
facets: DomainOperation<Operations, "knowledge_facets", Scoped>;
|
|
824
|
-
getEntity: DomainOperation<Operations, "knowledge_get_entity", Scoped>;
|
|
825
|
-
getEntitySchemaSnapshot: DomainOperation<Operations, "knowledge_get_entity_schema_snapshot", Scoped>;
|
|
826
|
-
getSchemaQueryContext: DomainOperation<Operations, "knowledge_get_schema_query_context", Scoped>;
|
|
827
|
-
query: DomainOperation<Operations, "knowledge_query", Scoped>;
|
|
828
|
-
searchEntities: DomainOperation<Operations, "knowledge_search_entities", Scoped>;
|
|
829
|
-
updateEntity: DomainOperation<Operations, "knowledge_update_entity", Scoped>;
|
|
830
|
-
upsertEntity: DomainOperation<Operations, "knowledge_upsert_entity", Scoped>;
|
|
831
|
-
}>;
|
|
832
|
-
runs: Readonly<{
|
|
833
|
-
cancel: DomainOperation<Operations, "runs_cancel", Scoped>;
|
|
834
|
-
follow: FollowRunCall<Scoped>;
|
|
835
|
-
get: DomainOperation<Operations, "runs_get", Scoped>;
|
|
836
|
-
stream: DomainOperation<Operations, "runs_stream", Scoped>;
|
|
837
|
-
}>;
|
|
838
|
-
skills: Readonly<{
|
|
839
|
-
invoke: DomainOperation<Operations, "skills_invoke", Scoped>;
|
|
840
|
-
list: DomainOperation<Operations, "skills_list", Scoped>;
|
|
841
|
-
}>;
|
|
842
|
-
workflows: Readonly<{
|
|
843
|
-
invoke: DomainOperation<Operations, "workflows_invoke", Scoped>;
|
|
844
|
-
list: DomainOperation<Operations, "workflows_list", Scoped>;
|
|
845
|
-
}>;
|
|
846
|
-
}>;
|
|
847
|
-
export type OrganizationClient<Operations extends ClientOperationMap> = ClientDomains<Operations, true> & Readonly<{
|
|
848
|
-
organizationId: string;
|
|
849
|
-
}>;
|
|
850
|
-
export type ClientSdkClient<Operations extends ClientOperationMap> = Omit<ClientDomains<Operations, false>, "context"> & TypedOperationExecutor<Operations> & Readonly<{
|
|
851
|
-
context: ClientDomains<Operations, false>["context"] & Readonly<{
|
|
852
|
-
forOrganization: (organizationId: string) => OrganizationClient<Operations>;
|
|
853
|
-
}>;
|
|
854
|
-
forOrganization: (organizationId: string) => OrganizationClient<Operations>;
|
|
855
|
-
protocolVersion: typeof clientSdkProtocolVersion;
|
|
856
|
-
}>;
|
|
857
|
-
/** One equality filter on a dotted data path of a topic's records. */
|
|
858
|
-
export type RealtimeTopicFilter = Readonly<{
|
|
859
|
-
field: string;
|
|
860
|
-
eq: string | number | boolean | null;
|
|
861
|
-
}>;
|
|
862
|
-
/** The records of one entity schema, named by FQN or id, optionally filtered. */
|
|
863
|
-
export type RealtimeTopic = Readonly<{
|
|
864
|
-
schema: string;
|
|
865
|
-
filter?: RealtimeTopicFilter;
|
|
866
|
-
}>;
|
|
867
|
-
/** A record of a subscribed topic changed; refetch it, the event carries ids only. */
|
|
868
|
-
export type RealtimeChange = Readonly<{
|
|
869
|
-
id: string;
|
|
870
|
-
op: "create" | "update" | "delete";
|
|
871
|
-
revision: string;
|
|
872
|
-
topic: RealtimeTopic;
|
|
873
|
-
}>;
|
|
874
|
-
export type RealtimeClientStatus = "idle" | "connecting" | "open" | "backoff";
|
|
875
|
-
export type RealtimeClientState = Readonly<{
|
|
876
|
-
status: RealtimeClientStatus;
|
|
877
|
-
/** Open or opening connections of this client: 0 or 1. */
|
|
878
|
-
connections: number;
|
|
879
|
-
topics: readonly RealtimeTopic[];
|
|
880
|
-
lastEventId: string | undefined;
|
|
881
|
-
}>;
|
|
882
|
-
export type RealtimeClient = Readonly<{
|
|
883
|
-
/**
|
|
884
|
-
* Listens to one topic; the result stops listening. Changes arrive in
|
|
885
|
-
* batches, one change per record: the latest, in order of arrival.
|
|
886
|
-
*/
|
|
887
|
-
subscribe: (topic: RealtimeTopic, onChanges: (changes: readonly RealtimeChange[]) => void) => () => void;
|
|
888
|
-
getState: () => RealtimeClientState;
|
|
889
|
-
/** Closes the connection and stops reacting to the page. */
|
|
890
|
-
close: () => void;
|
|
891
|
-
}>;
|
|
892
9
|
export type PromptKeyEvent = Readonly<{
|
|
893
10
|
isComposing: boolean;
|
|
894
11
|
key: string;
|
|
@@ -996,6 +113,8 @@ export type Client = ClientSdkClient<ClientOperationMap>;
|
|
|
996
113
|
export type Organization = OrganizationClient<ClientOperationMap>;
|
|
997
114
|
export type CollectiveIntelligenceProviderProps = Readonly<{
|
|
998
115
|
entitySource?: EntitySource | undefined;
|
|
116
|
+
/** The app's QueryClient; without it the provider owns one for its lifetime. */
|
|
117
|
+
queryClient?: QueryClient | undefined;
|
|
999
118
|
} & ({
|
|
1000
119
|
children: ReactNode;
|
|
1001
120
|
client: Client;
|
|
@@ -1067,44 +186,29 @@ export type SessionGateProps = Readonly<{
|
|
|
1067
186
|
export declare const useSession: () => FederatedAuthState;
|
|
1068
187
|
/** Renders children only when the BFF sealed-cookie session is authenticated. */
|
|
1069
188
|
export declare const SessionGate: ({ children, fallback }: SessionGateProps) => ReactNode;
|
|
1070
|
-
export type RealtimeProviderProps = Readonly<{
|
|
189
|
+
export type RealtimeProviderProps = Readonly<RealtimeClientOptions & {
|
|
1071
190
|
children: ReactNode;
|
|
1072
|
-
/** One client per tab; it holds the tab's single realtime connection. */
|
|
1073
|
-
client: RealtimeClient;
|
|
1074
191
|
}>;
|
|
1075
|
-
|
|
1076
|
-
export
|
|
192
|
+
/** The client of a provider tree, as its hooks use it: the provider closes it. */
|
|
193
|
+
export type TreeClient = Omit<RealtimeClient, "close">;
|
|
194
|
+
/**
|
|
195
|
+
* Gives its tree one realtime client of the client SDK, and so one connection.
|
|
196
|
+
* It creates the client in the browser when it mounts or a hook subscribes,
|
|
197
|
+
* and closes it when the tree unmounts. `onReset` and `onAccessChanged` are
|
|
198
|
+
* the app's callbacks; the client calls the ones of the latest render. Only a
|
|
199
|
+
* client with `onReset` resyncs, so a render that adds or removes `onReset`
|
|
200
|
+
* replaces the client, and with it the stream. It reads the other options
|
|
201
|
+
* once, when it creates the client.
|
|
202
|
+
*/
|
|
203
|
+
export declare const RealtimeProvider: ({ children, ...options }: RealtimeProviderProps) => import("react").JSX.Element;
|
|
204
|
+
/** The client of the nearest `RealtimeProvider`; a subscription holds it open. */
|
|
205
|
+
export declare const useRealtimeClient: () => TreeClient;
|
|
1077
206
|
/**
|
|
1078
207
|
* Calls `onChanges` with each batch of changes of `topic` while the component
|
|
1079
208
|
* is mounted; `null` listens to nothing. Equal topics share one subscription
|
|
1080
209
|
* key, so a new topic object on each render does not resubscribe.
|
|
1081
210
|
*/
|
|
1082
211
|
export declare const useRealtimeTopic: (topic: RealtimeTopic | null, onChanges: (changes: readonly RealtimeChange[]) => void) => void;
|
|
1083
|
-
export type ResourceValue = string | number | boolean | null | readonly ResourceValue[] | ResourceObject;
|
|
1084
|
-
export interface ResourceObject {
|
|
1085
|
-
readonly [key: string]: ResourceValue;
|
|
1086
|
-
}
|
|
1087
|
-
/** Display-ready controls. Schema inference and registry selection belong to the consumer. */
|
|
1088
|
-
export type ResourceField = Readonly<{
|
|
1089
|
-
name: string;
|
|
1090
|
-
label: string;
|
|
1091
|
-
control: "text" | "email" | "number" | "checkbox" | "date" | "datetime-local" | "select" | "custom";
|
|
1092
|
-
required?: boolean;
|
|
1093
|
-
readOnly?: boolean;
|
|
1094
|
-
nullable?: boolean;
|
|
1095
|
-
options?: readonly Readonly<{
|
|
1096
|
-
label: string;
|
|
1097
|
-
value: string | number | boolean;
|
|
1098
|
-
}>[];
|
|
1099
|
-
}>;
|
|
1100
|
-
export type ResourceFieldControlProps = Readonly<{
|
|
1101
|
-
field: ResourceField;
|
|
1102
|
-
id: string;
|
|
1103
|
-
value: ResourceValue | undefined;
|
|
1104
|
-
disabled: boolean;
|
|
1105
|
-
errorId?: string | undefined;
|
|
1106
|
-
onChange: (value: ResourceValue) => void;
|
|
1107
|
-
}>;
|
|
1108
212
|
export type EntityFieldKey<Value> = Extract<keyof Value, string>;
|
|
1109
213
|
export type EntityFieldConfig = Readonly<{
|
|
1110
214
|
control?: ResourceField["control"] | string;
|
|
@@ -1146,7 +250,7 @@ export type EntityRendererRegistry<Value> = Readonly<Record<string, (input: Read
|
|
|
1146
250
|
export declare const defineEntity: <Value extends {
|
|
1147
251
|
readonly [Key in keyof Value]: ResourceJsonValue;
|
|
1148
252
|
}, Create, Patch>(declaration: EntityDeclaration<Value, Create, Patch>) => EntityDeclaration<Value, Create, Patch>;
|
|
1149
|
-
type JsonObject
|
|
253
|
+
export type JsonObject<Value = Readonly<Record<string, ResourceJsonValue>>> = {
|
|
1150
254
|
readonly [Key in keyof Value]: ResourceJsonValue;
|
|
1151
255
|
};
|
|
1152
256
|
export type ViewStateProps = Readonly<{
|
|
@@ -1163,24 +267,24 @@ export type SharedViewProps<Value, Create, Patch> = Readonly<{
|
|
|
1163
267
|
renderers?: EntityRendererRegistry<Value>;
|
|
1164
268
|
variant?: string;
|
|
1165
269
|
}>;
|
|
1166
|
-
export type EntityTableProps<Value extends JsonObject
|
|
1167
|
-
export type EntityListProps<Value extends JsonObject
|
|
1168
|
-
export declare const EntityTable: <Value extends JsonObject
|
|
1169
|
-
export declare const EntityList: <Value extends JsonObject
|
|
1170
|
-
export type SharedEntityFormProps<Value extends JsonObject
|
|
270
|
+
export type EntityTableProps<Value extends JsonObject<Value>, Create, Patch> = SharedViewProps<Value, Create, Patch> & ViewStateProps;
|
|
271
|
+
export type EntityListProps<Value extends JsonObject<Value>, Create, Patch> = SharedViewProps<Value, Create, Patch> & ViewStateProps;
|
|
272
|
+
export declare const EntityTable: <Value extends JsonObject<Value>, Create, Patch>(props: EntityTableProps<Value, Create, Patch>) => import("react").JSX.Element;
|
|
273
|
+
export declare const EntityList: <Value extends JsonObject<Value>, Create, Patch>(props: EntityListProps<Value, Create, Patch>) => import("react").JSX.Element;
|
|
274
|
+
export type SharedEntityFormProps<Value extends JsonObject<Value>, Create, Patch> = Readonly<{
|
|
1171
275
|
controls?: EntityControlRegistry;
|
|
1172
276
|
entity: EntityDeclaration<Value, Create, Patch>;
|
|
1173
277
|
initialValues?: Readonly<Record<string, ResourceValue>>;
|
|
1174
278
|
onCancel?: () => void;
|
|
1175
279
|
onSuccess?: (record: ResourceRecord<Value>) => void;
|
|
1176
280
|
}>;
|
|
1177
|
-
export type EntityFormProps<Value extends JsonObject
|
|
281
|
+
export type EntityFormProps<Value extends JsonObject<Value>, Create, Patch> = (SharedEntityFormProps<Value, Create, Patch> & Readonly<{
|
|
1178
282
|
mode: "create";
|
|
1179
283
|
}>) | (SharedEntityFormProps<Value, Create, Patch> & Readonly<{
|
|
1180
284
|
mode: "update";
|
|
1181
285
|
record: ResourceRecord<Value>;
|
|
1182
286
|
}>);
|
|
1183
|
-
export declare const EntityForm: <Value extends JsonObject
|
|
287
|
+
export declare const EntityForm: <Value extends JsonObject<Value>, Create, Patch>(props: EntityFormProps<Value, Create, Patch>) => import("react").JSX.Element;
|
|
1184
288
|
export type EntityViewOptions = Readonly<{
|
|
1185
289
|
contract?: ResourceDefinition<unknown, unknown, unknown>;
|
|
1186
290
|
pageSize?: number;
|
|
@@ -1206,5 +310,80 @@ export declare const useMemoryEntityViewState: (input?: Readonly<{
|
|
|
1206
310
|
pageSize?: number;
|
|
1207
311
|
}>) => EntityViewStateController;
|
|
1208
312
|
export declare const clientSdkReactEntrypoint: "react";
|
|
313
|
+
/**
|
|
314
|
+
* The envelope of an Expected Error. The client SDK also exports a `CiError`
|
|
315
|
+
* class; this entrypoint exports no class at run time, so only the type.
|
|
316
|
+
*/
|
|
317
|
+
export type CiError = CiErrorEnvelope;
|
|
318
|
+
|
|
319
|
+
export {
|
|
320
|
+
CiErrorCode,
|
|
321
|
+
CiResult,
|
|
322
|
+
CiStreamPage,
|
|
323
|
+
ClientDomains,
|
|
324
|
+
ClientFetch,
|
|
325
|
+
ClientOperationDefinition,
|
|
326
|
+
ClientOperationId,
|
|
327
|
+
ClientOperationInput,
|
|
328
|
+
ClientOperationMap,
|
|
329
|
+
ClientOperationOutput,
|
|
330
|
+
ClientSdkClient,
|
|
331
|
+
EntityClient,
|
|
332
|
+
EntityCreateInput,
|
|
333
|
+
EntityDeleteInput,
|
|
334
|
+
EntityListQuery,
|
|
335
|
+
EntityMemberValue,
|
|
336
|
+
EntityPage,
|
|
337
|
+
EntityUpdateInput,
|
|
338
|
+
EntityUploadInput,
|
|
339
|
+
EntityUploadSlot,
|
|
340
|
+
FederatedAuth,
|
|
341
|
+
FederatedAuthErrorCode,
|
|
342
|
+
FederatedAuthState,
|
|
343
|
+
FederatedSessionIdentity,
|
|
344
|
+
FollowRunOptions,
|
|
345
|
+
IdempotencyKey,
|
|
346
|
+
JsonValue,
|
|
347
|
+
KnowledgeQuery,
|
|
348
|
+
OperationExecutionOptions,
|
|
349
|
+
OrganizationClient,
|
|
350
|
+
PortableResourceSchema,
|
|
351
|
+
QueryFilter,
|
|
352
|
+
RealtimeChange,
|
|
353
|
+
RealtimeClient,
|
|
354
|
+
RealtimeClientState,
|
|
355
|
+
RealtimeClientStatus,
|
|
356
|
+
RealtimeTopic,
|
|
357
|
+
RealtimeTopicFilter,
|
|
358
|
+
ResourceCapabilities,
|
|
359
|
+
ResourceCreateInput,
|
|
360
|
+
ResourceCursor,
|
|
361
|
+
ResourceDefinition,
|
|
362
|
+
ResourceError,
|
|
363
|
+
ResourceErrorCode,
|
|
364
|
+
ResourceField,
|
|
365
|
+
ResourceFieldControlProps,
|
|
366
|
+
ResourceFilter,
|
|
367
|
+
ResourceId,
|
|
368
|
+
ResourceIdentityField,
|
|
369
|
+
ResourceJsonValue,
|
|
370
|
+
ResourceLifecycleInput,
|
|
371
|
+
ResourceListQuery,
|
|
372
|
+
ResourceListResult,
|
|
373
|
+
ResourceMutationInput,
|
|
374
|
+
ResourceObject,
|
|
375
|
+
ResourcePagination,
|
|
376
|
+
ResourcePaginationMode,
|
|
377
|
+
ResourceRecord,
|
|
378
|
+
ResourceRecordId,
|
|
379
|
+
ResourceRequestOptions,
|
|
380
|
+
ResourceResult,
|
|
381
|
+
ResourceRevision,
|
|
382
|
+
ResourceSort,
|
|
383
|
+
ResourceValue,
|
|
384
|
+
SearchQuery,
|
|
385
|
+
TypedOperationExecutor,
|
|
386
|
+
WorkflowInvokeTarget,
|
|
387
|
+
};
|
|
1209
388
|
|
|
1210
389
|
export {};
|