@collective-intelligence/external-apps-server-sdk 0.1.35 → 0.1.37
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 +13 -3
- package/dist/admin.d.ts +13 -73
- package/dist/effect.d.ts +3 -0
- package/dist/effect.js +0 -0
- package/dist/express.d.ts +66 -500
- package/dist/gateway/contracts.d.ts +67 -500
- package/dist/gateway.d.ts +67 -500
- package/dist/gateway.js +1 -2
- package/dist/index.d.ts +5 -16
- package/dist/knowledge-sources/payload.d.ts +31 -187
- package/dist/knowledge-sources/strapi.d.ts +31 -187
- package/dist/persistence/drizzle.d.ts +51 -196
- package/dist/persistence/drizzle.js +1 -9
- package/dist/resources.d.ts +45 -274
- package/dist/resources.js +4 -11
- package/dist/runtime/effect.d.ts +99 -776
- package/dist/runtime/effect.js +4 -12
- package/dist/runtime/express.d.ts +66 -500
- package/dist/runtime/nestjs.d.ts +82 -599
- package/dist/runtime/nestjs.js +1 -8
- package/dist/runtime/next.d.ts +83 -599
- package/dist/runtime/next.js +1 -8
- package/dist/runtime/web.d.ts +67 -500
- package/dist/runtime/web.js +1 -8
- package/dist/tools/ai-sdk.d.ts +19 -110
- package/dist/tools/ai-sdk.js +1 -2
- package/package.json +10 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
import { EntityCreateInput, EntityDeleteInput, EntityListQuery, EntityOperation, EntityPage, EntityUpdateInput, IdempotencyKey, PortableResourceSchema, ResourceCapabilities, ResourceCreateInput, ResourceCursor, ResourceDefinition, ResourceFilter, ResourceId, ResourceIdentityField, ResourceJsonValue, ResourceLifecycleInput, ResourceListQuery, ResourceListResult, ResourceMutationInput, ResourcePagination, ResourcePaginationMode, ResourceRecord, ResourceRecordId, ResourceRevision, ResourceSort } from '@collective-intelligence/external-apps-client-sdk/resources';
|
|
3
4
|
import { InferInsertModel, InferSelectModel, SQL } from 'drizzle-orm';
|
|
4
5
|
import { PgColumn, PgQueryResultHKT, PgTable } from 'drizzle-orm/pg-core';
|
|
5
6
|
import { PgAsyncDatabase } from 'drizzle-orm/pg-core/async';
|
|
@@ -37,178 +38,6 @@ export type FederatedSessionStore = Readonly<{
|
|
|
37
38
|
/** Atomically removes and returns the previous record, including any pending login. */
|
|
38
39
|
remove: (id: string) => Promise<FederatedSessionRecord | null>;
|
|
39
40
|
}>;
|
|
40
|
-
export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
|
|
41
|
-
[key: string]: ResourceJsonValue;
|
|
42
|
-
}>;
|
|
43
|
-
/** Opaque wire identity. Callers must not infer or concatenate its internals. */
|
|
44
|
-
export type ResourceId = string;
|
|
45
|
-
export type ResourceRecordId = ResourceId;
|
|
46
|
-
/** Opaque concurrency token independent from source timestamps. */
|
|
47
|
-
export type ResourceRevision = string;
|
|
48
|
-
/** Opaque pagination position issued and consumed only by a resource adapter. */
|
|
49
|
-
export type ResourceCursor = string;
|
|
50
|
-
export type IdempotencyKey = string;
|
|
51
|
-
export type ResourceIdentityField = Readonly<{
|
|
52
|
-
name: string;
|
|
53
|
-
type: "number" | "string";
|
|
54
|
-
}>;
|
|
55
|
-
export type ResourceCapabilities = Readonly<{
|
|
56
|
-
create?: boolean;
|
|
57
|
-
/** Common entity deletion is always soft deletion. */
|
|
58
|
-
delete?: boolean;
|
|
59
|
-
get?: boolean;
|
|
60
|
-
hardDelete?: boolean;
|
|
61
|
-
includeDeleted?: boolean;
|
|
62
|
-
restore?: boolean;
|
|
63
|
-
search: true;
|
|
64
|
-
softDelete?: boolean;
|
|
65
|
-
update?: boolean;
|
|
66
|
-
/** File uploads for the File fields of a common entity resource. */
|
|
67
|
-
upload?: boolean;
|
|
68
|
-
}>;
|
|
69
|
-
export type ResourcePaginationMode = "cursor" | "page";
|
|
70
|
-
export type PortableResourceSchema = Readonly<Record<string, ResourceJsonValue>>;
|
|
71
|
-
export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>> = Readonly<{
|
|
72
|
-
capabilities: ResourceCapabilities;
|
|
73
|
-
concurrency: "revision";
|
|
74
|
-
id: string;
|
|
75
|
-
identity: Readonly<{
|
|
76
|
-
fields: readonly [
|
|
77
|
-
ResourceIdentityField,
|
|
78
|
-
...ResourceIdentityField[]
|
|
79
|
-
];
|
|
80
|
-
}>;
|
|
81
|
-
query: Readonly<{
|
|
82
|
-
filterableFields: readonly string[];
|
|
83
|
-
pagination: Readonly<{
|
|
84
|
-
modes: readonly ResourcePaginationMode[];
|
|
85
|
-
}>;
|
|
86
|
-
sortableFields: readonly string[];
|
|
87
|
-
textSearchFields?: readonly string[];
|
|
88
|
-
}>;
|
|
89
|
-
schemas: Readonly<{
|
|
90
|
-
create?: PortableResourceSchema;
|
|
91
|
-
entity: PortableResourceSchema;
|
|
92
|
-
update?: PortableResourceSchema;
|
|
93
|
-
}>;
|
|
94
|
-
version: string;
|
|
95
|
-
/** Portable UI metadata; required/enum/nullability remain in schemas. */
|
|
96
|
-
metadata?: Readonly<Record<string, ResourceJsonValue>>;
|
|
97
|
-
/** Type-only slots keep definition values portable and serializable. */
|
|
98
|
-
readonly __types?: Readonly<{
|
|
99
|
-
create: Create;
|
|
100
|
-
entity: Entity;
|
|
101
|
-
update: Update;
|
|
102
|
-
}>;
|
|
103
|
-
}>;
|
|
104
|
-
export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
|
|
105
|
-
/**
|
|
106
|
-
* A filter predicate. `field` names a declared filterable field, or a path
|
|
107
|
-
* through at most three fields that hold Entity References to a field of
|
|
108
|
-
* the last target, such as `company.industry` or
|
|
109
|
-
* `contacts.company.parent.industry`. On a field that holds Entity
|
|
110
|
-
* References, `is_empty` means no reference. User fields accept identity
|
|
111
|
-
* predicates for one ID and `contains_any`, `contains_all`, `contains_none`
|
|
112
|
-
* for multiple IDs, plus empty/not-empty aliases. CI validates operators
|
|
113
|
-
* against the actual field semantic; UUID shape alone does not declare User.
|
|
114
|
-
*/
|
|
115
|
-
export type ResourceFilter = Readonly<{
|
|
116
|
-
field: string;
|
|
117
|
-
operator: "contains" | "contains_all" | "contains_any" | "contains_none" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
|
|
118
|
-
value: FilterValue;
|
|
119
|
-
}> | Readonly<{
|
|
120
|
-
field: string;
|
|
121
|
-
operator: "is_empty" | "is_not_empty" | "is_not_null" | "is_null";
|
|
122
|
-
}> | Readonly<{
|
|
123
|
-
filters: readonly ResourceFilter[];
|
|
124
|
-
operator: "and" | "or";
|
|
125
|
-
}> | Readonly<{
|
|
126
|
-
filter: ResourceFilter;
|
|
127
|
-
operator: "not";
|
|
128
|
-
}>;
|
|
129
|
-
export type ResourceSort = Readonly<{
|
|
130
|
-
direction: "asc" | "desc";
|
|
131
|
-
field: string;
|
|
132
|
-
}>;
|
|
133
|
-
export type ResourcePagination = Readonly<{
|
|
134
|
-
mode: "cursor";
|
|
135
|
-
cursor?: ResourceCursor;
|
|
136
|
-
limit: number;
|
|
137
|
-
}> | Readonly<{
|
|
138
|
-
mode: "page";
|
|
139
|
-
page: number;
|
|
140
|
-
pageSize: number;
|
|
141
|
-
}>;
|
|
142
|
-
export type ResourceListQuery = Readonly<{
|
|
143
|
-
filter?: ResourceFilter;
|
|
144
|
-
/**
|
|
145
|
-
* Include Paths, such as `["company", "contacts.company"]`: relation
|
|
146
|
-
* fields whose records each item carries in `included`.
|
|
147
|
-
*/
|
|
148
|
-
include?: readonly string[];
|
|
149
|
-
includeDeleted?: boolean;
|
|
150
|
-
pagination: ResourcePagination;
|
|
151
|
-
sort?: readonly ResourceSort[];
|
|
152
|
-
textSearch?: string;
|
|
153
|
-
}>;
|
|
154
|
-
export type ResourceRecord<Entity> = Readonly<{
|
|
155
|
-
deletedAt?: string;
|
|
156
|
-
id: ResourceRecordId;
|
|
157
|
-
/**
|
|
158
|
-
* The records of the read's Include Paths by relation field key: one
|
|
159
|
-
* record, or the records of a `many` field in reference order. Untyped:
|
|
160
|
-
* the target schemas are CI's.
|
|
161
|
-
*/
|
|
162
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
163
|
-
revision: ResourceRevision;
|
|
164
|
-
/** The keys whose included records were cut to the first 100. */
|
|
165
|
-
truncated?: readonly string[];
|
|
166
|
-
value: Entity;
|
|
167
|
-
}>;
|
|
168
|
-
export type ResourceListResult<Entity> = Readonly<{
|
|
169
|
-
items: readonly ResourceRecord<Entity>[];
|
|
170
|
-
nextCursor?: ResourceCursor;
|
|
171
|
-
pagination: "cursor";
|
|
172
|
-
}> | Readonly<{
|
|
173
|
-
items: readonly ResourceRecord<Entity>[];
|
|
174
|
-
page: number;
|
|
175
|
-
pageSize: number;
|
|
176
|
-
pagination: "page";
|
|
177
|
-
totalItems: number;
|
|
178
|
-
totalPages: number;
|
|
179
|
-
}>;
|
|
180
|
-
export type ResourceMutationInput<Value> = Readonly<{
|
|
181
|
-
expectedRevision: ResourceRevision;
|
|
182
|
-
id: ResourceRecordId;
|
|
183
|
-
idempotencyKey?: IdempotencyKey;
|
|
184
|
-
value: Value;
|
|
185
|
-
}>;
|
|
186
|
-
export type ResourceLifecycleInput = Readonly<{
|
|
187
|
-
expectedRevision: ResourceRevision;
|
|
188
|
-
id: ResourceRecordId;
|
|
189
|
-
idempotencyKey?: IdempotencyKey;
|
|
190
|
-
}>;
|
|
191
|
-
export type ResourceCreateInput<Value> = Readonly<{
|
|
192
|
-
idempotencyKey: IdempotencyKey;
|
|
193
|
-
value: Value;
|
|
194
|
-
}>;
|
|
195
|
-
/** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
|
|
196
|
-
export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
|
|
197
|
-
export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
|
|
198
|
-
pagination: Extract<ResourcePagination, {
|
|
199
|
-
mode: "page";
|
|
200
|
-
}>;
|
|
201
|
-
}>;
|
|
202
|
-
export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
|
|
203
|
-
pagination: "page";
|
|
204
|
-
}>;
|
|
205
|
-
export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
|
|
206
|
-
export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
|
|
207
|
-
idempotencyKey: IdempotencyKey;
|
|
208
|
-
}>;
|
|
209
|
-
export type EntityDeleteInput = ResourceLifecycleInput & Readonly<{
|
|
210
|
-
idempotencyKey: IdempotencyKey;
|
|
211
|
-
}>;
|
|
212
41
|
/** Application login identities are separate from gateway machine callers. */
|
|
213
42
|
export type ApplicationUserIdentity = Readonly<{
|
|
214
43
|
kind: "local_user";
|
|
@@ -677,9 +506,9 @@ declare const definePlatformTables: (options?: PlatformTablesOptions) => {
|
|
|
677
506
|
}>;
|
|
678
507
|
result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
|
|
679
508
|
deletedAt?: string;
|
|
680
|
-
id: ResourceRecordId;
|
|
681
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
682
|
-
revision: ResourceRevision;
|
|
509
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
510
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
511
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
683
512
|
truncated?: readonly string[];
|
|
684
513
|
value: unknown;
|
|
685
514
|
}>>>, {
|
|
@@ -688,9 +517,9 @@ declare const definePlatformTables: (options?: PlatformTablesOptions) => {
|
|
|
688
517
|
dataType: "object json";
|
|
689
518
|
data: Readonly<{
|
|
690
519
|
deletedAt?: string;
|
|
691
|
-
id: ResourceRecordId;
|
|
692
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
693
|
-
revision: ResourceRevision;
|
|
520
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
521
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
522
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
694
523
|
truncated?: readonly string[];
|
|
695
524
|
value: unknown;
|
|
696
525
|
}>;
|
|
@@ -921,9 +750,9 @@ declare const makePlatformPersistence: (options: PlatformPersistenceOptions) =>
|
|
|
921
750
|
}>;
|
|
922
751
|
result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
|
|
923
752
|
deletedAt?: string;
|
|
924
|
-
id: ResourceRecordId;
|
|
925
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
926
|
-
revision: ResourceRevision;
|
|
753
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
754
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
755
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
927
756
|
truncated?: readonly string[];
|
|
928
757
|
value: unknown;
|
|
929
758
|
}>>>, {
|
|
@@ -932,9 +761,9 @@ declare const makePlatformPersistence: (options: PlatformPersistenceOptions) =>
|
|
|
932
761
|
dataType: "object json";
|
|
933
762
|
data: Readonly<{
|
|
934
763
|
deletedAt?: string;
|
|
935
|
-
id: ResourceRecordId;
|
|
936
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
937
|
-
revision: ResourceRevision;
|
|
764
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
765
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
766
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
938
767
|
truncated?: readonly string[];
|
|
939
768
|
value: unknown;
|
|
940
769
|
}>;
|
|
@@ -1352,9 +1181,9 @@ declare const definePlatformTables$1: (options?: PlatformTablesOptions) => {
|
|
|
1352
1181
|
}>;
|
|
1353
1182
|
result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
|
|
1354
1183
|
deletedAt?: string;
|
|
1355
|
-
id: ResourceRecordId;
|
|
1356
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
1357
|
-
revision: ResourceRevision;
|
|
1184
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
1185
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
1186
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
1358
1187
|
truncated?: readonly string[];
|
|
1359
1188
|
value: unknown;
|
|
1360
1189
|
}>>>, {
|
|
@@ -1363,9 +1192,9 @@ declare const definePlatformTables$1: (options?: PlatformTablesOptions) => {
|
|
|
1363
1192
|
dataType: "object json";
|
|
1364
1193
|
data: Readonly<{
|
|
1365
1194
|
deletedAt?: string;
|
|
1366
|
-
id: ResourceRecordId;
|
|
1367
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
1368
|
-
revision: ResourceRevision;
|
|
1195
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
1196
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
1197
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
1369
1198
|
truncated?: readonly string[];
|
|
1370
1199
|
value: unknown;
|
|
1371
1200
|
}>;
|
|
@@ -1518,9 +1347,9 @@ declare const makePlatformPersistence$1: (options: PlatformPersistenceOptions) =
|
|
|
1518
1347
|
}>;
|
|
1519
1348
|
result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
|
|
1520
1349
|
deletedAt?: string;
|
|
1521
|
-
id: ResourceRecordId;
|
|
1522
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
1523
|
-
revision: ResourceRevision;
|
|
1350
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
1351
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
1352
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
1524
1353
|
truncated?: readonly string[];
|
|
1525
1354
|
value: unknown;
|
|
1526
1355
|
}>>>, {
|
|
@@ -1529,9 +1358,9 @@ declare const makePlatformPersistence$1: (options: PlatformPersistenceOptions) =
|
|
|
1529
1358
|
dataType: "object json";
|
|
1530
1359
|
data: Readonly<{
|
|
1531
1360
|
deletedAt?: string;
|
|
1532
|
-
id: ResourceRecordId;
|
|
1533
|
-
included?: Readonly<Record<string, ResourceJsonValue>>;
|
|
1534
|
-
revision: ResourceRevision;
|
|
1361
|
+
id: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRecordId;
|
|
1362
|
+
included?: Readonly<Record<string, import("@collective-intelligence/external-apps-client-sdk/resources").ResourceJsonValue>>;
|
|
1363
|
+
revision: import("@collective-intelligence/external-apps-client-sdk/resources").ResourceRevision;
|
|
1535
1364
|
truncated?: readonly string[];
|
|
1536
1365
|
value: unknown;
|
|
1537
1366
|
}>;
|
|
@@ -1554,6 +1383,32 @@ type DrizzlePostgresRepository$1<Table extends PgTable, Entity = InferSelectMode
|
|
|
1554
1383
|
|
|
1555
1384
|
export {
|
|
1556
1385
|
DrizzlePostgresRepository$1 as DrizzlePostgresRepository,
|
|
1386
|
+
EntityCreateInput,
|
|
1387
|
+
EntityDeleteInput,
|
|
1388
|
+
EntityListQuery,
|
|
1389
|
+
EntityOperation,
|
|
1390
|
+
EntityPage,
|
|
1391
|
+
EntityUpdateInput,
|
|
1392
|
+
IdempotencyKey,
|
|
1393
|
+
PortableResourceSchema,
|
|
1394
|
+
ResourceCapabilities,
|
|
1395
|
+
ResourceCreateInput,
|
|
1396
|
+
ResourceCursor,
|
|
1397
|
+
ResourceDefinition,
|
|
1398
|
+
ResourceFilter,
|
|
1399
|
+
ResourceId,
|
|
1400
|
+
ResourceIdentityField,
|
|
1401
|
+
ResourceJsonValue,
|
|
1402
|
+
ResourceLifecycleInput,
|
|
1403
|
+
ResourceListQuery,
|
|
1404
|
+
ResourceListResult,
|
|
1405
|
+
ResourceMutationInput,
|
|
1406
|
+
ResourcePagination,
|
|
1407
|
+
ResourcePaginationMode,
|
|
1408
|
+
ResourceRecord,
|
|
1409
|
+
ResourceRecordId,
|
|
1410
|
+
ResourceRevision,
|
|
1411
|
+
ResourceSort,
|
|
1557
1412
|
definePlatformTables$1 as definePlatformTables,
|
|
1558
1413
|
makePlatformPersistence$1 as makePlatformPersistence,
|
|
1559
1414
|
};
|