@collective-intelligence/external-apps-server-sdk 0.1.8 → 0.1.9
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 +77 -0
- package/dist/admin.d.ts +75 -13
- package/dist/express.d.ts +5 -1
- package/dist/gateway/contracts.d.ts +5 -1
- package/dist/gateway.d.ts +5 -1
- package/dist/gateway.js +2 -1
- package/dist/index.d.ts +34 -1
- package/dist/index.js +2 -2
- package/dist/knowledge-sources/payload.d.ts +5 -1
- package/dist/knowledge-sources/strapi.d.ts +5 -1
- package/dist/persistence/drizzle.d.ts +3 -1
- package/dist/persistence/drizzle.js +3 -2
- package/dist/resources.d.ts +26 -4
- package/dist/resources.js +1 -1
- package/dist/runtime/effect.d.ts +24 -4
- package/dist/runtime/effect.js +2 -1
- package/dist/runtime/express.d.ts +5 -1
- package/dist/runtime/nestjs.d.ts +24 -4
- package/dist/runtime/nestjs.js +1 -1
- package/dist/runtime/next.d.ts +24 -4
- package/dist/runtime/next.js +1 -1
- package/dist/runtime/web.d.ts +5 -1
- package/dist/runtime/web.js +1 -1
- package/dist/tools/ai-sdk.js +2 -1
- package/package.json +1 -1
package/dist/runtime/next.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export type ResourceCapabilities = Readonly<{
|
|
|
75
75
|
search: true;
|
|
76
76
|
softDelete?: boolean;
|
|
77
77
|
update?: boolean;
|
|
78
|
+
/** File uploads for the File fields of a common entity resource. */
|
|
79
|
+
upload?: boolean;
|
|
78
80
|
}>;
|
|
79
81
|
export type ResourcePaginationMode = "cursor" | "page";
|
|
80
82
|
export type PortableResourceSchema = Readonly<Record<string, ResourceJsonValue>>;
|
|
@@ -164,7 +166,9 @@ export type ResourceListResult<Entity> = Readonly<{
|
|
|
164
166
|
totalItems: number;
|
|
165
167
|
totalPages: number;
|
|
166
168
|
}>;
|
|
167
|
-
export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable"
|
|
169
|
+
export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
|
|
170
|
+
/** The CI Organization storage can not take a presigned File upload. */
|
|
171
|
+
"upload_not_supported";
|
|
168
172
|
export type ResourceError = Readonly<{
|
|
169
173
|
code: ResourceErrorCode;
|
|
170
174
|
/** Client-observed dispatch outcome; uncertainty never proves rollback. */
|
|
@@ -236,7 +240,7 @@ export type ResourceCreateInput<Value> = Readonly<{
|
|
|
236
240
|
value: Value;
|
|
237
241
|
}>;
|
|
238
242
|
/** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
|
|
239
|
-
export type EntityOperation = "list" | "get" | "create" | "update" | "delete";
|
|
243
|
+
export type EntityOperation = "list" | "get" | "create" | "update" | "delete" | "upload";
|
|
240
244
|
export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
|
|
241
245
|
pagination: Extract<ResourcePagination, {
|
|
242
246
|
mode: "page";
|
|
@@ -252,6 +256,19 @@ export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
|
|
|
252
256
|
export type EntityDeleteInput = ResourceLifecycleInput & Readonly<{
|
|
253
257
|
idempotencyKey: IdempotencyKey;
|
|
254
258
|
}>;
|
|
259
|
+
/** A File upload request for one File field of the entity schema. */
|
|
260
|
+
export type EntityUploadInput = Readonly<{
|
|
261
|
+
field: string;
|
|
262
|
+
filename: string;
|
|
263
|
+
mimeType: string;
|
|
264
|
+
}>;
|
|
265
|
+
/** PUT the file bytes to `url` with `headers`; then write `{ upload: uploadId }`. */
|
|
266
|
+
export type EntityUploadSlot = Readonly<{
|
|
267
|
+
headers: Readonly<Record<string, string>>;
|
|
268
|
+
method: "PUT";
|
|
269
|
+
uploadId: string;
|
|
270
|
+
url: string;
|
|
271
|
+
}>;
|
|
255
272
|
export type EntityRequestIdentity = Readonly<{
|
|
256
273
|
requestId: string;
|
|
257
274
|
resourceId: string;
|
|
@@ -268,7 +285,10 @@ export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIden
|
|
|
268
285
|
operation: "update";
|
|
269
286
|
}> & EntityUpdateInput<Patch>) | (Readonly<{
|
|
270
287
|
operation: "delete";
|
|
271
|
-
}> & EntityDeleteInput)
|
|
288
|
+
}> & EntityDeleteInput) | (Readonly<{
|
|
289
|
+
operation: "upload";
|
|
290
|
+
}> & EntityUploadInput));
|
|
291
|
+
export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
|
|
272
292
|
export interface ConfidentialCredentials {
|
|
273
293
|
readonly clientId: string;
|
|
274
294
|
readonly clientSecret: string;
|
|
@@ -376,7 +396,7 @@ export type EntityResourceDefinition<Value = unknown, Create = Value, Patch = Pa
|
|
|
376
396
|
definition: ResourceDefinition<Value, Create, Patch>;
|
|
377
397
|
execute: (request: EntityRequest<Create, Patch>, context: EntityInvocationContext, options?: Readonly<{
|
|
378
398
|
signal?: AbortSignal;
|
|
379
|
-
}>) => Promise<ResourceResult<
|
|
399
|
+
}>) => Promise<ResourceResult<EntityOperationResult<Value, EntityOperation>>>;
|
|
380
400
|
}>;
|
|
381
401
|
export type GatewayResourceOperation = ResourceTransportRequest["operation"];
|
|
382
402
|
export type GatewayResourceAuthorization = Readonly<Partial<Record<GatewayResourceOperation, AuthorizationRequirement>>>;
|