@collective-intelligence/external-apps-server-sdk 0.1.10 → 0.1.12
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 +58 -39
- package/dist/admin.d.ts +190 -308
- package/dist/admin.js +1 -1
- package/dist/auth/better-auth.d.ts +4 -2
- package/dist/auth/federated.d.ts +17 -7
- package/dist/auth/federated.js +1 -1
- package/dist/auth.d.ts +3 -1
- package/dist/gateway.js +2 -2
- package/dist/index.d.ts +156 -76
- package/dist/index.js +2 -2
- package/dist/persistence/drizzle.d.ts +4 -2
- package/dist/persistence/drizzle.js +3 -3
- package/dist/resources.d.ts +15 -3
- package/dist/resources.js +2 -2
- package/dist/runtime/effect.d.ts +12 -3
- package/dist/runtime/effect.js +3 -3
- package/dist/runtime/nestjs.d.ts +12 -3
- package/dist/runtime/nestjs.js +2 -2
- package/dist/runtime/next.d.ts +13 -4
- package/dist/runtime/next.js +2 -2
- package/dist/runtime/web.d.ts +4 -2
- package/dist/runtime/web.js +2 -2
- package/dist/tools/ai-sdk.js +2 -2
- package/package.json +3 -3
package/dist/runtime/next.d.ts
CHANGED
|
@@ -23,13 +23,15 @@ export type ApplicationUserSession = Readonly<{
|
|
|
23
23
|
* and request/correlation IDs are deliberately not part of that logical identity.
|
|
24
24
|
*/
|
|
25
25
|
export type EntityInvocationContext = Readonly<{
|
|
26
|
+
/** The App Permissions of the user's effective roles on the app. */
|
|
27
|
+
appPermissions: readonly string[];
|
|
26
28
|
applicationId: string;
|
|
27
29
|
issuer: string;
|
|
28
30
|
organizationId: string;
|
|
29
31
|
resourceId: string;
|
|
32
|
+
/** The user's effective roles on the app, read from CI at this lookup. */
|
|
30
33
|
roles: readonly string[];
|
|
31
34
|
scopes: readonly string[];
|
|
32
|
-
groupIds: readonly string[];
|
|
33
35
|
user: ApplicationUserIdentity;
|
|
34
36
|
}>;
|
|
35
37
|
export type ApplicationUserAuth = Readonly<{
|
|
@@ -38,7 +40,7 @@ export type ApplicationUserAuth = Readonly<{
|
|
|
38
40
|
/** Returns null only when the request has no valid application session. */
|
|
39
41
|
getSession: (request: Request) => Promise<ApplicationUserSession | null>;
|
|
40
42
|
/** Server-only current CI authority. The host still owns resource/operation policy.
|
|
41
|
-
* Null means no valid CI session
|
|
43
|
+
* Null means no valid CI session, including a user without a role on the app.
|
|
42
44
|
*/
|
|
43
45
|
getEntityContext: (request: Request, resourceId: string) => Promise<EntityInvocationContext | null>;
|
|
44
46
|
/** Server-only Delegated access token. Absent for local application login. */
|
|
@@ -261,7 +263,7 @@ export type ResourceCreateInput<Value> = Readonly<{
|
|
|
261
263
|
value: Value;
|
|
262
264
|
}>;
|
|
263
265
|
/** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
|
|
264
|
-
export type EntityOperation = "list" | "get" | "create" | "update" | "delete" | "upload";
|
|
266
|
+
export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
|
|
265
267
|
export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
|
|
266
268
|
pagination: Extract<ResourcePagination, {
|
|
267
269
|
mode: "page";
|
|
@@ -270,6 +272,8 @@ export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDel
|
|
|
270
272
|
export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
|
|
271
273
|
pagination: "page";
|
|
272
274
|
}>;
|
|
275
|
+
/** Member schemas are resolved by CI, independently of the parent resource. */
|
|
276
|
+
export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
|
|
273
277
|
export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
|
|
274
278
|
export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
|
|
275
279
|
idempotencyKey: IdempotencyKey;
|
|
@@ -297,6 +301,11 @@ export type EntityRequestIdentity = Readonly<{
|
|
|
297
301
|
export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIdentity & (Readonly<{
|
|
298
302
|
operation: "list";
|
|
299
303
|
query: EntityListQuery;
|
|
304
|
+
}> | Readonly<{
|
|
305
|
+
operation: "list_members";
|
|
306
|
+
parentId: ResourceRecordId;
|
|
307
|
+
field: string;
|
|
308
|
+
query: EntityListQuery;
|
|
300
309
|
}> | Readonly<{
|
|
301
310
|
operation: "get";
|
|
302
311
|
id: ResourceRecordId;
|
|
@@ -310,7 +319,7 @@ export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIden
|
|
|
310
319
|
}> & EntityDeleteInput) | (Readonly<{
|
|
311
320
|
operation: "upload";
|
|
312
321
|
}> & EntityUploadInput));
|
|
313
|
-
export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
|
|
322
|
+
export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list_members" ? EntityPage<EntityMemberValue> : Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
|
|
314
323
|
export interface ConfidentialCredentials {
|
|
315
324
|
readonly clientId: string;
|
|
316
325
|
readonly clientSecret: string;
|