@collective-intelligence/external-apps-server-sdk 0.1.9 → 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.
- package/README.md +131 -39
- package/dist/admin.d.ts +537 -319
- 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/express.d.ts +15 -2
- package/dist/gateway/contracts.d.ts +15 -2
- package/dist/gateway.d.ts +15 -2
- package/dist/gateway.js +2 -2
- package/dist/index.d.ts +232 -73
- package/dist/index.js +3 -3
- package/dist/knowledge-sources/payload.d.ts +23 -2
- package/dist/knowledge-sources/strapi.d.ts +23 -2
- package/dist/persistence/drizzle.d.ts +43 -4
- package/dist/persistence/drizzle.js +4 -4
- package/dist/resources.d.ts +39 -5
- package/dist/resources.js +3 -3
- package/dist/runtime/effect.d.ts +93 -5
- package/dist/runtime/effect.js +4 -4
- package/dist/runtime/express.d.ts +15 -2
- package/dist/runtime/nestjs.d.ts +36 -5
- package/dist/runtime/nestjs.js +2 -2
- package/dist/runtime/next.d.ts +37 -6
- package/dist/runtime/next.js +2 -2
- package/dist/runtime/web.d.ts +19 -4
- package/dist/runtime/web.js +2 -2
- package/dist/tools/ai-sdk.js +2 -2
- package/package.json +3 -3
package/dist/runtime/web.d.ts
CHANGED
|
@@ -424,13 +424,21 @@ export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>
|
|
|
424
424
|
}>;
|
|
425
425
|
}>;
|
|
426
426
|
export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
|
|
427
|
+
/**
|
|
428
|
+
* A filter predicate. `field` names a declared filterable field, or a path
|
|
429
|
+
* through at most three fields that hold Entity References to a field of
|
|
430
|
+
* the last target, such as `company.industry` or
|
|
431
|
+
* `contacts.company.parent.industry`. On a field that holds Entity
|
|
432
|
+
* References, `is_empty` means no reference, and `contains_any` and
|
|
433
|
+
* `contains_all` compare the ids of a field that holds many.
|
|
434
|
+
*/
|
|
427
435
|
export type ResourceFilter = Readonly<{
|
|
428
436
|
field: string;
|
|
429
|
-
operator: "contains" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
|
|
437
|
+
operator: "contains" | "contains_all" | "contains_any" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
|
|
430
438
|
value: FilterValue;
|
|
431
439
|
}> | Readonly<{
|
|
432
440
|
field: string;
|
|
433
|
-
operator: "is_not_null" | "is_null";
|
|
441
|
+
operator: "is_empty" | "is_not_null" | "is_null";
|
|
434
442
|
}> | Readonly<{
|
|
435
443
|
filters: readonly ResourceFilter[];
|
|
436
444
|
operator: "and" | "or";
|
|
@@ -453,6 +461,11 @@ export type ResourcePagination = Readonly<{
|
|
|
453
461
|
}>;
|
|
454
462
|
export type ResourceListQuery = Readonly<{
|
|
455
463
|
filter?: ResourceFilter;
|
|
464
|
+
/**
|
|
465
|
+
* Include Paths, such as `["company", "contacts.company"]`: relation
|
|
466
|
+
* fields whose records each item carries in `included`.
|
|
467
|
+
*/
|
|
468
|
+
include?: readonly string[];
|
|
456
469
|
includeDeleted?: boolean;
|
|
457
470
|
pagination: ResourcePagination;
|
|
458
471
|
sort?: readonly ResourceSort[];
|
|
@@ -539,13 +552,15 @@ export type ApplicationUserSession = Readonly<{
|
|
|
539
552
|
* and request/correlation IDs are deliberately not part of that logical identity.
|
|
540
553
|
*/
|
|
541
554
|
export type EntityInvocationContext = Readonly<{
|
|
555
|
+
/** The App Permissions of the user's effective roles on the app. */
|
|
556
|
+
appPermissions: readonly string[];
|
|
542
557
|
applicationId: string;
|
|
543
558
|
issuer: string;
|
|
544
559
|
organizationId: string;
|
|
545
560
|
resourceId: string;
|
|
561
|
+
/** The user's effective roles on the app, read from CI at this lookup. */
|
|
546
562
|
roles: readonly string[];
|
|
547
563
|
scopes: readonly string[];
|
|
548
|
-
groupIds: readonly string[];
|
|
549
564
|
user: ApplicationUserIdentity;
|
|
550
565
|
}>;
|
|
551
566
|
export type ApplicationUserAuth = Readonly<{
|
|
@@ -554,7 +569,7 @@ export type ApplicationUserAuth = Readonly<{
|
|
|
554
569
|
/** Returns null only when the request has no valid application session. */
|
|
555
570
|
getSession: (request: Request) => Promise<ApplicationUserSession | null>;
|
|
556
571
|
/** Server-only current CI authority. The host still owns resource/operation policy.
|
|
557
|
-
* Null means no valid CI session
|
|
572
|
+
* Null means no valid CI session, including a user without a role on the app.
|
|
558
573
|
*/
|
|
559
574
|
getEntityContext: (request: Request, resourceId: string) => Promise<EntityInvocationContext | null>;
|
|
560
575
|
/** Server-only Delegated access token. Absent for local application login. */
|