@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.
@@ -214,7 +214,7 @@ export type ResourceCreateInput<Value> = Readonly<{
214
214
  value: Value;
215
215
  }>;
216
216
  /** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
217
- export type EntityOperation = "list" | "get" | "create" | "update" | "delete" | "upload";
217
+ export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
218
218
  export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
219
219
  pagination: Extract<ResourcePagination, {
220
220
  mode: "page";
@@ -223,6 +223,8 @@ export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDel
223
223
  export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
224
224
  pagination: "page";
225
225
  }>;
226
+ /** Member schemas are resolved by CI, independently of the parent resource. */
227
+ export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
226
228
  export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
227
229
  export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
228
230
  idempotencyKey: IdempotencyKey;
@@ -250,6 +252,11 @@ export type EntityRequestIdentity = Readonly<{
250
252
  export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIdentity & (Readonly<{
251
253
  operation: "list";
252
254
  query: EntityListQuery;
255
+ }> | Readonly<{
256
+ operation: "list_members";
257
+ parentId: ResourceRecordId;
258
+ field: string;
259
+ query: EntityListQuery;
253
260
  }> | Readonly<{
254
261
  operation: "get";
255
262
  id: ResourceRecordId;
@@ -263,7 +270,7 @@ export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIden
263
270
  }> & EntityDeleteInput) | (Readonly<{
264
271
  operation: "upload";
265
272
  }> & EntityUploadInput));
266
- export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
273
+ export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list_members" ? EntityPage<EntityMemberValue> : Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
267
274
  /** Application login identities are separate from gateway machine callers. */
268
275
  export type ApplicationUserIdentity = Readonly<{
269
276
  kind: "local_user";
@@ -283,13 +290,15 @@ export type ApplicationUserIdentity = Readonly<{
283
290
  * and request/correlation IDs are deliberately not part of that logical identity.
284
291
  */
285
292
  export type EntityInvocationContext = Readonly<{
293
+ /** The App Permissions of the user's effective roles on the app. */
294
+ appPermissions: readonly string[];
286
295
  applicationId: string;
287
296
  issuer: string;
288
297
  organizationId: string;
289
298
  resourceId: string;
299
+ /** The user's effective roles on the app, read from CI at this lookup. */
290
300
  roles: readonly string[];
291
301
  scopes: readonly string[];
292
- groupIds: readonly string[];
293
302
  user: ApplicationUserIdentity;
294
303
  }>;
295
304
  export type PrincipalKind = "detached_user" | "service_principal";