@collective-intelligence/external-apps-server-sdk 0.2.1 → 0.2.2
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/AGENTS.md +1 -1
- package/README.md +8 -12
- package/dist/chunks/{index-8yk07eg5.js → index-4z962jdh.js} +2 -2
- package/dist/chunks/{index-mp74xvyn.js → index-qe1587f9.js} +3 -3
- package/dist/effect/node-postgres.js +1 -1
- package/dist/effect.d.ts +1 -1
- package/dist/effect.js +1 -1
- package/dist/index.js +1 -1
- package/docs/effect.md +2 -2
- package/package.json +4 -22
- package/skills/server-sdk-move-to-effect/SKILL.md +5 -3
- package/dist/chunks/index-ees2k4z3.js +0 -2
- package/dist/chunks/index-pzge02c9.js +0 -2
- package/dist/persistence/drizzle-effect.d.ts +0 -58
- package/dist/persistence/drizzle-effect.js +0 -1
- package/dist/runtime/effect.d.ts +0 -477
- package/dist/runtime/next.d.ts +0 -526
package/dist/runtime/next.d.ts
DELETED
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
|
-
import { Bounds, ConnectorContext, DatasetAggregateOperation, DatasetDefinition, DatasetFilter, DatasetOperation, DatasetOrder, DatasetPredicate, DatasetPredicateOperator, DatasetProviderCapabilities, DatasetProviderError, DatasetProviderResult, DatasetQueryIntent, DatasetRecordPage, DatasetResultPage, DatasetScalarType, DatasetSourceLocation, DatasetTimeBucket, DatasetValue, JsonObject, JsonPrimitive, JsonSchemaDocument, JsonValue, OperationDomainDeclaration, PackageSchemaProjection, PortableOperationAuthorization, PortableOperationDeclaration, PortableOperationDelegatedSubjectPolicy, PortableOperationEffect, PortableOperationExecutionPolicy, PortableOperationIdempotency, PortableOperationLimits, PortableOperationPrincipalKind, PortableOperationRetryPolicy, ProjectionFidelity, QueryInput, SafeDiagnostic } from '@collective-intelligence/extensions-sdk';
|
|
4
|
-
import { EntityCreateInput, EntityDeleteInput, EntityListQuery, EntityMemberValue, EntityOperation, EntityOperationResult, EntityPage, EntityRequest, EntityUpdateInput, EntityUploadInput, EntityUploadSlot, IdempotencyKey, PortableResourceSchema, ResourceCapabilities, ResourceCreateInput, ResourceCreateRequest, ResourceCursor, ResourceDefinition, ResourceError, ResourceErrorCode, ResourceFilter, ResourceGetRequest, ResourceId, ResourceIdentityField, ResourceJsonValue, ResourceLifecycleInput, ResourceLifecycleRequest, ResourceListQuery, ResourceListRequest, ResourceListResult, ResourceMutationInput, ResourcePagination, ResourcePaginationMode, ResourceRecord, ResourceRecordId, ResourceResult, ResourceRevision, ResourceSort, ResourceTransportRequest, ResourceUpdateRequest } from '@collective-intelligence/external-apps-client-sdk/resources';
|
|
5
|
-
import * as Brand from 'effect/Brand';
|
|
6
|
-
import * as Context from 'effect/Context';
|
|
7
|
-
import * as Effect from 'effect/Effect';
|
|
8
|
-
import * as Layer from 'effect/Layer';
|
|
9
|
-
import * as Option$1 from 'effect/Option';
|
|
10
|
-
import * as Redacted from 'effect/Redacted';
|
|
11
|
-
import * as Schema from 'effect/Schema';
|
|
12
|
-
|
|
13
|
-
/** Application login identities are separate from gateway machine callers. */
|
|
14
|
-
export type ApplicationUserIdentity = Readonly<{
|
|
15
|
-
kind: "local_user";
|
|
16
|
-
id: string;
|
|
17
|
-
email: string;
|
|
18
|
-
name: string | null;
|
|
19
|
-
} | {
|
|
20
|
-
kind: "ci_user";
|
|
21
|
-
id: string;
|
|
22
|
-
email: string | null;
|
|
23
|
-
name: string | null;
|
|
24
|
-
issuer: string;
|
|
25
|
-
organizationId: string;
|
|
26
|
-
}>;
|
|
27
|
-
export type ApplicationUserSession = Readonly<{
|
|
28
|
-
identity: ApplicationUserIdentity;
|
|
29
|
-
expiresAt: Date;
|
|
30
|
-
/**
|
|
31
|
-
* The id of the login session, the same for each request of that session.
|
|
32
|
-
* The federated and better-auth adapters give it; the Topic Grant binds to
|
|
33
|
-
* it, or to `identity` without it (Q109).
|
|
34
|
-
*/
|
|
35
|
-
sessionId?: string;
|
|
36
|
-
}>;
|
|
37
|
-
/** Constructed only after user/app/organization authorization at server ingress.
|
|
38
|
-
* Canonical identities survive proxy hops and scope mutation receipts; credentials
|
|
39
|
-
* and request/correlation IDs are deliberately not part of that logical identity.
|
|
40
|
-
*/
|
|
41
|
-
export type EntityInvocationContext = Readonly<{
|
|
42
|
-
/** The App Permissions of the user's effective roles on the app. */
|
|
43
|
-
appPermissions: readonly string[];
|
|
44
|
-
applicationId: string;
|
|
45
|
-
issuer: string;
|
|
46
|
-
organizationId: string;
|
|
47
|
-
resourceId: string;
|
|
48
|
-
/** The user's effective roles on the app, read from CI at this lookup. */
|
|
49
|
-
roles: readonly string[];
|
|
50
|
-
scopes: readonly string[];
|
|
51
|
-
user: ApplicationUserIdentity;
|
|
52
|
-
}>;
|
|
53
|
-
export type ApplicationUserAuth = Readonly<{
|
|
54
|
-
mode: "federated" | "local";
|
|
55
|
-
handler: (request: Request) => Promise<Response>;
|
|
56
|
-
/** Returns null only when the request has no valid application session. */
|
|
57
|
-
getSession: (request: Request) => Promise<ApplicationUserSession | null>;
|
|
58
|
-
/** Server-only current CI authority. The host still owns resource/operation policy.
|
|
59
|
-
* Null means no valid CI session, including a user without a role on the app.
|
|
60
|
-
*/
|
|
61
|
-
getEntityContext: (request: Request, resourceId: string) => Promise<EntityInvocationContext | null>;
|
|
62
|
-
/** Server-only Delegated access token. Absent for local application login. */
|
|
63
|
-
getAccessToken?: (request: Request) => Promise<string | null>;
|
|
64
|
-
}>;
|
|
65
|
-
export interface ExternalApplicationExternalAuditSubject {
|
|
66
|
-
readonly issuer: string;
|
|
67
|
-
readonly mappedUserId?: string;
|
|
68
|
-
readonly subjectId: string;
|
|
69
|
-
}
|
|
70
|
-
/** One tag of the SDK cache tag vocabulary. */
|
|
71
|
-
export type CiTag = string & Brand.Brand<"CiTag">;
|
|
72
|
-
/**
|
|
73
|
-
* The `invalidate` option of a Vanilla Facade: it gets the Entity Tag and the
|
|
74
|
-
* Schema Tag of each record write that CI confirmed. In Next.js, pass
|
|
75
|
-
* `nextInvalidate` of `./next`.
|
|
76
|
-
*/
|
|
77
|
-
export type InvalidateTags = (tags: readonly CiTag[]) => Promise<void> | void;
|
|
78
|
-
/**
|
|
79
|
-
* A client secret: a string at `.`, or the `Redacted` string that Effect
|
|
80
|
-
* `Config.Redacted` reads for the `./effect` layers.
|
|
81
|
-
*/
|
|
82
|
-
export type ClientSecret = Redacted.Redacted<string> | string;
|
|
83
|
-
export interface ConfidentialCredentials<Secret extends ClientSecret = string> {
|
|
84
|
-
readonly clientId: string;
|
|
85
|
-
readonly clientSecret: Secret;
|
|
86
|
-
}
|
|
87
|
-
export interface RotatingConfidentialCredentialProvider {
|
|
88
|
-
readonly getCredentials: () => ConfidentialCredentials | Promise<ConfidentialCredentials>;
|
|
89
|
-
}
|
|
90
|
-
export type ConfidentialCredentialProvider<Secret extends ClientSecret = string> = ConfidentialCredentials<Secret> | RotatingConfidentialCredentialProvider;
|
|
91
|
-
export type ServiceServerAuthentication<Secret extends ClientSecret = string> = Readonly<{
|
|
92
|
-
credentials: ConfidentialCredentialProvider<Secret>;
|
|
93
|
-
mode: "service";
|
|
94
|
-
}>;
|
|
95
|
-
/** Application credentials authorize each call for a required Audit subject in one configured organization. */
|
|
96
|
-
export type ServiceCapabilityAuthorization = Readonly<{
|
|
97
|
-
authentication: ServiceServerAuthentication;
|
|
98
|
-
/**
|
|
99
|
-
* Who makes each forwarded call; defaults to `"service"`. `"anonymous_visitor"`
|
|
100
|
-
* marks each call as made by the anonymous visitor the Audit subject names:
|
|
101
|
-
* the backend then runs only the Agent's own bindings and never the
|
|
102
|
-
* application's service authority. A visitor is never a CI user, so an Audit
|
|
103
|
-
* subject carrying `mappedUserId` is refused with `401`.
|
|
104
|
-
*/
|
|
105
|
-
caller?: "anonymous_visitor" | "service";
|
|
106
|
-
getAuditSubject: (request: Request) => Promise<ExternalApplicationExternalAuditSubject | null>;
|
|
107
|
-
organizationId: string;
|
|
108
|
-
}>;
|
|
109
|
-
export type UserAuthScopePolicy = Readonly<{
|
|
110
|
-
readScope: string;
|
|
111
|
-
writeScope: string;
|
|
112
|
-
}>;
|
|
113
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
114
|
-
export type CiResourceBinding<Value = unknown, Create = Value, Patch = Partial<Value>> = Readonly<{
|
|
115
|
-
definition: ResourceDefinition<Value, Create, Patch>;
|
|
116
|
-
schemaFqn: string;
|
|
117
|
-
}>;
|
|
118
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
119
|
-
export type CiResourcesOptions = Readonly<{
|
|
120
|
-
auth: Pick<ApplicationUserAuth, "getEntityContext">;
|
|
121
|
-
bindings: readonly CiResourceBinding[];
|
|
122
|
-
fetch?: typeof globalThis.fetch;
|
|
123
|
-
/**
|
|
124
|
-
* After CI confirms a create, update, delete or restore of a mount,
|
|
125
|
-
* `invalidate` gets the Entity Tag and the Schema Tag of the record (Q111).
|
|
126
|
-
* In Next.js, pass `nextInvalidate` of `./next`.
|
|
127
|
-
*/
|
|
128
|
-
invalidate?: InvalidateTags;
|
|
129
|
-
organizationId: string;
|
|
130
|
-
policy?: UserAuthScopePolicy;
|
|
131
|
-
tenantUrl: string;
|
|
132
|
-
}>;
|
|
133
|
-
export type RealtimeRevalidateOptions = Readonly<{
|
|
134
|
-
auth: Pick<ApplicationUserAuth, "getSession">;
|
|
135
|
-
/** The `secrets` of the ticket route, the current one first. */
|
|
136
|
-
secrets: readonly string[];
|
|
137
|
-
}>;
|
|
138
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
139
|
-
export type RealtimeTicketOptions = Readonly<{
|
|
140
|
-
/** `getSession` is needed only with `secrets`. */
|
|
141
|
-
auth: Pick<ApplicationUserAuth, "getAccessToken"> & Partial<Pick<ApplicationUserAuth, "getSession">>;
|
|
142
|
-
/** The CI organization the signed-in users belong to. */
|
|
143
|
-
organizationId: string;
|
|
144
|
-
/** The CI origin that mints tickets. */
|
|
145
|
-
tenantUrl: string;
|
|
146
|
-
/** The origin the browser opens the event stream on; defaults to `tenantUrl`. */
|
|
147
|
-
host?: string;
|
|
148
|
-
fetch?: typeof globalThis.fetch;
|
|
149
|
-
/**
|
|
150
|
-
* The session secrets, the current one first; the others still open the
|
|
151
|
-
* tokens that they sealed. With them each answer also holds `grantToken`:
|
|
152
|
-
* the Topic Grant of the ticket for the Revalidate Route.
|
|
153
|
-
*/
|
|
154
|
-
secrets?: readonly string[];
|
|
155
|
-
}>;
|
|
156
|
-
/** The ticket route answer: a single-use ticket and the stream it opens.
|
|
157
|
-
* @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`.
|
|
158
|
-
*/
|
|
159
|
-
export type RealtimeTicketResponse = Readonly<{
|
|
160
|
-
ticket: string;
|
|
161
|
-
expiresAt: string;
|
|
162
|
-
streamUrl: string;
|
|
163
|
-
/**
|
|
164
|
-
* The sealed Topic Grant of the ticket, with `secrets`: the topics CI
|
|
165
|
-
* accepted, the session and an expiry 10 minutes after mint. The tab keeps
|
|
166
|
-
* it in memory and sends it with each revalidate batch.
|
|
167
|
-
*/
|
|
168
|
-
grantToken?: string;
|
|
169
|
-
}>;
|
|
170
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
171
|
-
export type BffResourceMount = Readonly<{
|
|
172
|
-
basePath: string;
|
|
173
|
-
handler: (request: Request) => Promise<Response>;
|
|
174
|
-
}>;
|
|
175
|
-
/** Dedicated Capability forwarding: the user's delegated token by default, or service credentials with an Audit subject. */
|
|
176
|
-
export type ExternalApplicationBffCapabilities = Readonly<{
|
|
177
|
-
basePath?: string;
|
|
178
|
-
fetch?: typeof globalThis.fetch;
|
|
179
|
-
tenantUrl: string;
|
|
180
|
-
}> & (Readonly<{
|
|
181
|
-
authentication?: never;
|
|
182
|
-
}> | ServiceCapabilityAuthorization);
|
|
183
|
-
/**
|
|
184
|
-
* The realtime ticket route `POST {basePath}/realtime/ticket`; `basePath`
|
|
185
|
-
* defaults to `/api`. With `secrets` each ticket answer holds its Topic
|
|
186
|
-
* Grant; `revalidate` (`createRealtimeRevalidateHandler` of `./next`) then
|
|
187
|
-
* mounts the Revalidate Route `POST {basePath}/realtime/revalidate` with them.
|
|
188
|
-
* @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`.
|
|
189
|
-
*/
|
|
190
|
-
export type ExternalApplicationBffRealtime = Omit<RealtimeTicketOptions, "auth" | "secrets"> & Readonly<{
|
|
191
|
-
basePath?: string;
|
|
192
|
-
}> & (Readonly<{
|
|
193
|
-
revalidate?: never;
|
|
194
|
-
secrets?: never;
|
|
195
|
-
}> | Readonly<{
|
|
196
|
-
revalidate?: (options: RealtimeRevalidateOptions) => (request: Request) => Promise<Response>;
|
|
197
|
-
secrets: readonly string[];
|
|
198
|
-
}>);
|
|
199
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
200
|
-
export type ExternalApplicationBffOptions = Readonly<{
|
|
201
|
-
auth: ApplicationUserAuth;
|
|
202
|
-
authBasePath?: string;
|
|
203
|
-
capabilities?: ExternalApplicationBffCapabilities;
|
|
204
|
-
ciResources?: Omit<CiResourcesOptions, "auth">;
|
|
205
|
-
publicOrigin: string;
|
|
206
|
-
realtime?: ExternalApplicationBffRealtime;
|
|
207
|
-
resources?: readonly BffResourceMount[];
|
|
208
|
-
}>;
|
|
209
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
210
|
-
export type ExternalApplicationBff = (request: Request) => Promise<Response>;
|
|
211
|
-
export type PrincipalKind = "detached_user" | "service_principal";
|
|
212
|
-
export type DelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
|
|
213
|
-
export type AuthorizationRequirement = Readonly<{
|
|
214
|
-
delegatedSubject?: DelegatedSubjectPolicy;
|
|
215
|
-
organization: "required";
|
|
216
|
-
principalKinds: readonly PrincipalKind[];
|
|
217
|
-
scopes: readonly string[];
|
|
218
|
-
}>;
|
|
219
|
-
export type ExternalAuditSubject = Readonly<{
|
|
220
|
-
issuer: string;
|
|
221
|
-
mappedCiUserId?: string;
|
|
222
|
-
subject: string;
|
|
223
|
-
}>;
|
|
224
|
-
export type GatewayCallerIdentity = Readonly<{
|
|
225
|
-
audience: readonly string[];
|
|
226
|
-
binding: string;
|
|
227
|
-
expiresAt: number;
|
|
228
|
-
installationId: string;
|
|
229
|
-
issuer: string;
|
|
230
|
-
organizationId: string;
|
|
231
|
-
principalKind: PrincipalKind;
|
|
232
|
-
requestId: string;
|
|
233
|
-
scopes: readonly string[];
|
|
234
|
-
subject: string;
|
|
235
|
-
}>;
|
|
236
|
-
export type GatewayInvocationContext = Readonly<{
|
|
237
|
-
caller: GatewayCallerIdentity;
|
|
238
|
-
correlationId: string;
|
|
239
|
-
externalAuditSubject?: ExternalAuditSubject;
|
|
240
|
-
organizationId: string;
|
|
241
|
-
}>;
|
|
242
|
-
/** Full inventory only: no filters, text search or caller-selected ordering.
|
|
243
|
-
* Continue consecutive pages with the first watermark. A conflict requires restart.
|
|
244
|
-
*/
|
|
245
|
-
export type ResourceInventoryRequest = Readonly<{
|
|
246
|
-
page: number;
|
|
247
|
-
pageSize: number;
|
|
248
|
-
watermark?: string;
|
|
249
|
-
}>;
|
|
250
|
-
/** A configured local or CI-backed binding; no storage policy is exposed to browsers. */
|
|
251
|
-
export type EntityResourceDefinition<Value = unknown, Create = Value, Patch = Partial<Value>> = Readonly<{
|
|
252
|
-
definition: ResourceDefinition<Value, Create, Patch>;
|
|
253
|
-
execute: (request: EntityRequest<Create, Patch>, context: EntityInvocationContext, options?: Readonly<{
|
|
254
|
-
signal?: AbortSignal;
|
|
255
|
-
}>) => Promise<ResourceResult<EntityOperationResult<Value, EntityOperation>>>;
|
|
256
|
-
}>;
|
|
257
|
-
export type GatewayResourceOperation = ResourceTransportRequest["operation"];
|
|
258
|
-
export type GatewayResourceAuthorization = Readonly<Partial<Record<GatewayResourceOperation, AuthorizationRequirement>>>;
|
|
259
|
-
export type GatewayResourceDefinition<Entity = unknown, Create = Entity, Update = Partial<Entity>> = Readonly<{
|
|
260
|
-
authorization: GatewayResourceAuthorization;
|
|
261
|
-
definition: ResourceDefinition<Entity, Create, Update>;
|
|
262
|
-
execute: (request: ResourceTransportRequest, context: GatewayInvocationContext, options?: Readonly<{
|
|
263
|
-
signal?: AbortSignal;
|
|
264
|
-
}>) => Promise<ResourceResult<unknown>>;
|
|
265
|
-
scan?: (request: ResourceInventoryRequest & Readonly<{
|
|
266
|
-
requestId: string;
|
|
267
|
-
resourceId: string;
|
|
268
|
-
}>, context: GatewayInvocationContext, options?: Readonly<{
|
|
269
|
-
signal?: AbortSignal;
|
|
270
|
-
}>) => Promise<ResourceResult<unknown>>;
|
|
271
|
-
changes?: (request: Readonly<{
|
|
272
|
-
cursor?: string;
|
|
273
|
-
limit: number;
|
|
274
|
-
requestId: string;
|
|
275
|
-
resourceId: string;
|
|
276
|
-
}>, context: GatewayInvocationContext, options?: Readonly<{
|
|
277
|
-
signal?: AbortSignal;
|
|
278
|
-
}>) => Promise<ResourceResult<unknown>>;
|
|
279
|
-
}>;
|
|
280
|
-
export type CrudResource<Entity = unknown, Create = Entity, Update = Partial<Entity>> = GatewayResourceDefinition<Entity, Create, Update> & Readonly<{
|
|
281
|
-
executeCrud: (request: ResourceTransportRequest, context: EntityInvocationContext) => Promise<ResourceResult<unknown>>;
|
|
282
|
-
}>;
|
|
283
|
-
export type ResourceHttpHandlerOptions<Value = unknown, Create = Value, Patch = Partial<Value>> = Readonly<{
|
|
284
|
-
resource: CrudResource<Value, Create, Patch> | EntityResourceDefinition<Value, Create, Patch>;
|
|
285
|
-
/** Mount path including the entity name, e.g. /api/leads. */
|
|
286
|
-
basePath: string;
|
|
287
|
-
/** Host verifies the current CI session and resource policy; no browser identity is trusted. */
|
|
288
|
-
authorize: (request: Request, operation: ResourceTransportRequest["operation"] | EntityOperation) => Promise<EntityInvocationContext | Response>;
|
|
289
|
-
maxBodyBytes?: number;
|
|
290
|
-
}>;
|
|
291
|
-
/**
|
|
292
|
-
* Runtime dispatch validates the declared input schema before invoking a
|
|
293
|
-
* handler. The bivariant call signature lets domains retain heterogeneous,
|
|
294
|
-
* strongly typed handlers while exposing one erased operation collection.
|
|
295
|
-
*/
|
|
296
|
-
export type GatewayOperationHandler<Input = unknown, Output = unknown> = {
|
|
297
|
-
bivarianceHack(request: Readonly<{
|
|
298
|
-
context: GatewayInvocationContext;
|
|
299
|
-
/** Validated caller key; the handler owns durable replay storage. */
|
|
300
|
-
idempotencyKey?: string;
|
|
301
|
-
input: Input;
|
|
302
|
-
signal: AbortSignal;
|
|
303
|
-
}>): Promise<Output>;
|
|
304
|
-
}["bivarianceHack"];
|
|
305
|
-
export type GatewayOperationDefinition<Input = unknown, Output = unknown> = Omit<PortableOperationDeclaration, "input" | "output"> & Readonly<{
|
|
306
|
-
handler: GatewayOperationHandler<Input, Output>;
|
|
307
|
-
input: PackageSchemaProjection;
|
|
308
|
-
output: PackageSchemaProjection;
|
|
309
|
-
}>;
|
|
310
|
-
export type GatewayOperationManifest = Omit<GatewayOperationDefinition, "handler"> & Readonly<{
|
|
311
|
-
canonicalReference: string;
|
|
312
|
-
}>;
|
|
313
|
-
export type GatewayOperationDomainDefinition = OperationDomainDeclaration<GatewayOperationDefinition>;
|
|
314
|
-
export type GatewayOperationDomainManifest = OperationDomainDeclaration<GatewayOperationManifest>;
|
|
315
|
-
/** CI destination marker only; source records are shared across all connections. */
|
|
316
|
-
export type OrganizationBinding = Readonly<{
|
|
317
|
-
mode: "installed_organization";
|
|
318
|
-
}>;
|
|
319
|
-
export type GatewayKnowledgeResourceExposure = Readonly<{
|
|
320
|
-
resource: GatewayResourceDefinition;
|
|
321
|
-
access: "read" | "read_write";
|
|
322
|
-
}>;
|
|
323
|
-
export type GatewayDatasetBinding = Readonly<{
|
|
324
|
-
id: string;
|
|
325
|
-
title: string;
|
|
326
|
-
definition: DatasetDefinition;
|
|
327
|
-
authorization: AuthorizationRequirement;
|
|
328
|
-
providerFqn: string;
|
|
329
|
-
query: (input: QueryInput, context: GatewayInvocationContext, options: Readonly<{
|
|
330
|
-
signal: AbortSignal;
|
|
331
|
-
}>) => Promise<DatasetProviderResult<DatasetResultPage>>;
|
|
332
|
-
}>;
|
|
333
|
-
export type GatewayDatasetManifest = Omit<GatewayDatasetBinding, "query"> & Readonly<{
|
|
334
|
-
capabilities: DatasetProviderCapabilities;
|
|
335
|
-
}>;
|
|
336
|
-
export type GatewayDefinitionInput = Readonly<{
|
|
337
|
-
knowledge?: readonly GatewayKnowledgeResourceExposure[];
|
|
338
|
-
datasets?: readonly GatewayDatasetBinding[];
|
|
339
|
-
id: string;
|
|
340
|
-
operationDomains: readonly GatewayOperationDomainDefinition[];
|
|
341
|
-
organizationBinding?: OrganizationBinding;
|
|
342
|
-
protocolVersion?: "2";
|
|
343
|
-
version: string;
|
|
344
|
-
}>;
|
|
345
|
-
export type GatewayManifest = Readonly<{
|
|
346
|
-
capabilities: Readonly<{
|
|
347
|
-
resources: boolean;
|
|
348
|
-
}>;
|
|
349
|
-
datasets: readonly GatewayDatasetManifest[];
|
|
350
|
-
knowledge: readonly Readonly<{
|
|
351
|
-
id: string;
|
|
352
|
-
access: "read" | "read_write";
|
|
353
|
-
definition: GatewayResourceDefinition["definition"];
|
|
354
|
-
fullInventory: boolean;
|
|
355
|
-
incrementalChanges: boolean;
|
|
356
|
-
}>[];
|
|
357
|
-
contentHash: string;
|
|
358
|
-
id: string;
|
|
359
|
-
operationDomains: readonly GatewayOperationDomainManifest[];
|
|
360
|
-
organizationBinding: OrganizationBinding;
|
|
361
|
-
protocolVersion: "2";
|
|
362
|
-
revision: string;
|
|
363
|
-
version: string;
|
|
364
|
-
}>;
|
|
365
|
-
export type GatewayProposal = Readonly<{
|
|
366
|
-
gatewayId: string;
|
|
367
|
-
gatewayVersion: string;
|
|
368
|
-
knowledge: GatewayManifest["knowledge"];
|
|
369
|
-
operationDomains: readonly GatewayOperationDomainManifest[];
|
|
370
|
-
revision: string;
|
|
371
|
-
}>;
|
|
372
|
-
export interface DefinedGateway {
|
|
373
|
-
readonly input: GatewayDefinitionInput;
|
|
374
|
-
readonly resource: (id: string) => GatewayResourceDefinition | undefined;
|
|
375
|
-
readonly dataset: (id: string) => GatewayDatasetBinding | undefined;
|
|
376
|
-
readonly manifest: GatewayManifest;
|
|
377
|
-
readonly proposal: GatewayProposal;
|
|
378
|
-
}
|
|
379
|
-
export interface GatewayKernel {
|
|
380
|
-
readonly handle: (request: Request) => Promise<Response>;
|
|
381
|
-
readonly manifest: DefinedGateway["manifest"];
|
|
382
|
-
}
|
|
383
|
-
export type WorkflowTarget = Readonly<{
|
|
384
|
-
workflowId: string;
|
|
385
|
-
workflowFqn?: never;
|
|
386
|
-
}> | Readonly<{
|
|
387
|
-
workflowFqn: string;
|
|
388
|
-
workflowId?: never;
|
|
389
|
-
}>;
|
|
390
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
391
|
-
export type FixedWorkflowRouteOptions<Input, Params = Record<string, never>> = Readonly<{
|
|
392
|
-
auth: Pick<ApplicationUserAuth, "getAccessToken" | "getEntityContext">;
|
|
393
|
-
fetch?: typeof globalThis.fetch;
|
|
394
|
-
publicOrigin: string;
|
|
395
|
-
tenantUrl: string;
|
|
396
|
-
validate: (body: unknown, params: Params) => Input;
|
|
397
|
-
resourceId: string;
|
|
398
|
-
requiredScopes?: readonly string[];
|
|
399
|
-
idempotencyKey?: (input: Input, context: EntityInvocationContext, request: Request) => string | null;
|
|
400
|
-
authorize?: (request: Request) => Promise<EntityInvocationContext | Response>;
|
|
401
|
-
getAccessToken?: (request: Request) => Promise<string | null>;
|
|
402
|
-
}> & WorkflowTarget;
|
|
403
|
-
export type GatewayWebHandler = (request: Request) => Promise<Response>;
|
|
404
|
-
export type GatewayRuntimeKernel = Pick<GatewayKernel, "handle">;
|
|
405
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
406
|
-
export type GatewayNextRouteHandlers = Readonly<{
|
|
407
|
-
DELETE: GatewayWebHandler;
|
|
408
|
-
GET: GatewayWebHandler;
|
|
409
|
-
PATCH: GatewayWebHandler;
|
|
410
|
-
POST: GatewayWebHandler;
|
|
411
|
-
PUT: GatewayWebHandler;
|
|
412
|
-
}>;
|
|
413
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
414
|
-
export type ResourceNextRouteHandlers = Readonly<{
|
|
415
|
-
DELETE: GatewayWebHandler;
|
|
416
|
-
GET: GatewayWebHandler;
|
|
417
|
-
PATCH: GatewayWebHandler;
|
|
418
|
-
POST: GatewayWebHandler;
|
|
419
|
-
}>;
|
|
420
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
421
|
-
export declare const cookies: (request: Request) => string | null;
|
|
422
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
423
|
-
export declare const createCiResourceMounts: ({ auth, bindings, policy, ...ci }: CiResourcesOptions) => {
|
|
424
|
-
basePath: string;
|
|
425
|
-
handler: (request: Request) => Promise<Response>;
|
|
426
|
-
}[];
|
|
427
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
428
|
-
export declare const createExternalApplicationBff: (options: ExternalApplicationBffOptions) => ExternalApplicationBff;
|
|
429
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
430
|
-
export declare const createExternalApplicationBffNextHandlers: (options: ExternalApplicationBffOptions) => GatewayNextRouteHandlers;
|
|
431
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
432
|
-
export declare const createFixedWorkflowRoute: <Input, Params = Record<string, never>>(options: FixedWorkflowRouteOptions<Input, Params>) => ((request: Request, params: Params) => Promise<Response>);
|
|
433
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
434
|
-
export declare const createRealtimeTicketHandler: (options: RealtimeTicketOptions) => ((request: Request) => Promise<Response>);
|
|
435
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
436
|
-
export declare const createGatewayNextRouteHandlers: (kernel: GatewayRuntimeKernel) => GatewayNextRouteHandlers;
|
|
437
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
438
|
-
export declare const createResourceNextRouteHandlers: <Value, Create = Value, Patch = Partial<Value>>(options: ResourceHttpHandlerOptions<Value, Create, Patch>) => ResourceNextRouteHandlers;
|
|
439
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
440
|
-
export declare const headers: (request: Request) => Headers;
|
|
441
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
442
|
-
export declare const publicOriginFromHeaders: (headerList: Headers, fallbackOrigin: string) => string;
|
|
443
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
|
|
444
|
-
export declare const requestWithPublicOrigin: (request: Request, publicOrigin: string) => Request;
|
|
445
|
-
|
|
446
|
-
export {
|
|
447
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ Bounds,
|
|
448
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ ConnectorContext,
|
|
449
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetAggregateOperation,
|
|
450
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetDefinition,
|
|
451
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetFilter,
|
|
452
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetOperation,
|
|
453
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetOrder,
|
|
454
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetPredicate,
|
|
455
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetPredicateOperator,
|
|
456
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderCapabilities,
|
|
457
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderError,
|
|
458
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderResult,
|
|
459
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetQueryIntent,
|
|
460
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetRecordPage,
|
|
461
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetResultPage,
|
|
462
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetScalarType,
|
|
463
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetSourceLocation,
|
|
464
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetTimeBucket,
|
|
465
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetValue,
|
|
466
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityCreateInput,
|
|
467
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityDeleteInput,
|
|
468
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityListQuery,
|
|
469
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityMemberValue,
|
|
470
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityOperation,
|
|
471
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityOperationResult,
|
|
472
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityPage,
|
|
473
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityRequest,
|
|
474
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUpdateInput,
|
|
475
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUploadInput,
|
|
476
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUploadSlot,
|
|
477
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ IdempotencyKey,
|
|
478
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonObject,
|
|
479
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonPrimitive,
|
|
480
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonSchemaDocument,
|
|
481
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonValue,
|
|
482
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ OperationDomainDeclaration,
|
|
483
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PackageSchemaProjection,
|
|
484
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationAuthorization,
|
|
485
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationDeclaration,
|
|
486
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationDelegatedSubjectPolicy,
|
|
487
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationEffect,
|
|
488
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationExecutionPolicy,
|
|
489
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationIdempotency,
|
|
490
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationLimits,
|
|
491
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationPrincipalKind,
|
|
492
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationRetryPolicy,
|
|
493
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ PortableResourceSchema,
|
|
494
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ ProjectionFidelity,
|
|
495
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ QueryInput,
|
|
496
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCapabilities,
|
|
497
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCreateInput,
|
|
498
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCreateRequest,
|
|
499
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCursor,
|
|
500
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceDefinition,
|
|
501
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceError,
|
|
502
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceErrorCode,
|
|
503
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceFilter,
|
|
504
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceGetRequest,
|
|
505
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceId,
|
|
506
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceIdentityField,
|
|
507
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceJsonValue,
|
|
508
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceLifecycleInput,
|
|
509
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceLifecycleRequest,
|
|
510
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListQuery,
|
|
511
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListRequest,
|
|
512
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListResult,
|
|
513
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceMutationInput,
|
|
514
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourcePagination,
|
|
515
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourcePaginationMode,
|
|
516
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRecord,
|
|
517
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRecordId,
|
|
518
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceResult,
|
|
519
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRevision,
|
|
520
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceSort,
|
|
521
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceTransportRequest,
|
|
522
|
-
/** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceUpdateRequest,
|
|
523
|
-
/** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ SafeDiagnostic,
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
export {};
|