@collective-intelligence/external-apps-server-sdk 0.1.10 → 0.1.11

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.
@@ -22,13 +22,15 @@ export type ApplicationUserIdentity = Readonly<{
22
22
  * and request/correlation IDs are deliberately not part of that logical identity.
23
23
  */
24
24
  export type EntityInvocationContext = Readonly<{
25
+ /** The App Permissions of the user's effective roles on the app. */
26
+ appPermissions: readonly string[];
25
27
  applicationId: string;
26
28
  issuer: string;
27
29
  organizationId: string;
28
30
  resourceId: string;
31
+ /** The user's effective roles on the app, read from CI at this lookup. */
29
32
  roles: readonly string[];
30
33
  scopes: readonly string[];
31
- groupIds: readonly string[];
32
34
  user: ApplicationUserIdentity;
33
35
  }>;
34
36
  export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
@@ -243,7 +245,7 @@ export type ResourceCreateInput<Value> = Readonly<{
243
245
  value: Value;
244
246
  }>;
245
247
  /** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
246
- export type EntityOperation = "list" | "get" | "create" | "update" | "delete" | "upload";
248
+ export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
247
249
  export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
248
250
  pagination: Extract<ResourcePagination, {
249
251
  mode: "page";
@@ -252,6 +254,8 @@ export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDel
252
254
  export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
253
255
  pagination: "page";
254
256
  }>;
257
+ /** Member schemas are resolved by CI, independently of the parent resource. */
258
+ export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
255
259
  export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
256
260
  export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
257
261
  idempotencyKey: IdempotencyKey;
@@ -279,6 +283,11 @@ export type EntityRequestIdentity = Readonly<{
279
283
  export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIdentity & (Readonly<{
280
284
  operation: "list";
281
285
  query: EntityListQuery;
286
+ }> | Readonly<{
287
+ operation: "list_members";
288
+ parentId: ResourceRecordId;
289
+ field: string;
290
+ query: EntityListQuery;
282
291
  }> | Readonly<{
283
292
  operation: "get";
284
293
  id: ResourceRecordId;
@@ -292,7 +301,7 @@ export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIden
292
301
  }> & EntityDeleteInput) | (Readonly<{
293
302
  operation: "upload";
294
303
  }> & EntityUploadInput));
295
- export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
304
+ export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list_members" ? EntityPage<EntityMemberValue> : Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
296
305
  export type PrincipalKind = "detached_user" | "service_principal";
297
306
  export type DelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
298
307
  export type AuthorizationRequirement = Readonly<{