@collective-intelligence/external-apps-server-sdk 0.1.36 → 0.1.38

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.
@@ -1,5 +1,9 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
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 Redacted from 'effect/Redacted';
6
+
3
7
  /** Application login identities are separate from gateway machine callers. */
4
8
  export type ApplicationUserIdentity = Readonly<{
5
9
  kind: "local_user";
@@ -51,287 +55,21 @@ export interface ExternalApplicationExternalAuditSubject {
51
55
  readonly mappedUserId?: string;
52
56
  readonly subjectId: string;
53
57
  }
54
- export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
55
- [key: string]: ResourceJsonValue;
56
- }>;
57
- /** Opaque wire identity. Callers must not infer or concatenate its internals. */
58
- export type ResourceId = string;
59
- export type ResourceRecordId = ResourceId;
60
- /** Opaque concurrency token independent from source timestamps. */
61
- export type ResourceRevision = string;
62
- /** Opaque pagination position issued and consumed only by a resource adapter. */
63
- export type ResourceCursor = string;
64
- export type IdempotencyKey = string;
65
- export type ResourceIdentityField = Readonly<{
66
- name: string;
67
- type: "number" | "string";
68
- }>;
69
- export type ResourceCapabilities = Readonly<{
70
- create?: boolean;
71
- /** Common entity deletion is always soft deletion. */
72
- delete?: boolean;
73
- get?: boolean;
74
- hardDelete?: boolean;
75
- includeDeleted?: boolean;
76
- restore?: boolean;
77
- search: true;
78
- softDelete?: boolean;
79
- update?: boolean;
80
- /** File uploads for the File fields of a common entity resource. */
81
- upload?: boolean;
82
- }>;
83
- export type ResourcePaginationMode = "cursor" | "page";
84
- export type PortableResourceSchema = Readonly<Record<string, ResourceJsonValue>>;
85
- export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>> = Readonly<{
86
- capabilities: ResourceCapabilities;
87
- concurrency: "revision";
88
- id: string;
89
- identity: Readonly<{
90
- fields: readonly [
91
- ResourceIdentityField,
92
- ...ResourceIdentityField[]
93
- ];
94
- }>;
95
- query: Readonly<{
96
- filterableFields: readonly string[];
97
- pagination: Readonly<{
98
- modes: readonly ResourcePaginationMode[];
99
- }>;
100
- sortableFields: readonly string[];
101
- textSearchFields?: readonly string[];
102
- }>;
103
- schemas: Readonly<{
104
- create?: PortableResourceSchema;
105
- entity: PortableResourceSchema;
106
- update?: PortableResourceSchema;
107
- }>;
108
- version: string;
109
- /** Portable UI metadata; required/enum/nullability remain in schemas. */
110
- metadata?: Readonly<Record<string, ResourceJsonValue>>;
111
- /** Type-only slots keep definition values portable and serializable. */
112
- readonly __types?: Readonly<{
113
- create: Create;
114
- entity: Entity;
115
- update: Update;
116
- }>;
117
- }>;
118
- export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
119
58
  /**
120
- * A filter predicate. `field` names a declared filterable field, or a path
121
- * through at most three fields that hold Entity References to a field of
122
- * the last target, such as `company.industry` or
123
- * `contacts.company.parent.industry`. On a field that holds Entity
124
- * References, `is_empty` means no reference. User fields accept identity
125
- * predicates for one ID and `contains_any`, `contains_all`, `contains_none`
126
- * for multiple IDs, plus empty/not-empty aliases. CI validates operators
127
- * against the actual field semantic; UUID shape alone does not declare User.
59
+ * A client secret: a string at `.`, or the `Redacted` string that Effect
60
+ * `Config.Redacted` reads for the `./effect` layers.
128
61
  */
129
- export type ResourceFilter = Readonly<{
130
- field: string;
131
- operator: "contains" | "contains_all" | "contains_any" | "contains_none" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
132
- value: FilterValue;
133
- }> | Readonly<{
134
- field: string;
135
- operator: "is_empty" | "is_not_empty" | "is_not_null" | "is_null";
136
- }> | Readonly<{
137
- filters: readonly ResourceFilter[];
138
- operator: "and" | "or";
139
- }> | Readonly<{
140
- filter: ResourceFilter;
141
- operator: "not";
142
- }>;
143
- export type ResourceSort = Readonly<{
144
- direction: "asc" | "desc";
145
- field: string;
146
- }>;
147
- export type ResourcePagination = Readonly<{
148
- mode: "cursor";
149
- cursor?: ResourceCursor;
150
- limit: number;
151
- }> | Readonly<{
152
- mode: "page";
153
- page: number;
154
- pageSize: number;
155
- }>;
156
- export type ResourceListQuery = Readonly<{
157
- filter?: ResourceFilter;
158
- /**
159
- * Include Paths, such as `["company", "contacts.company"]`: relation
160
- * fields whose records each item carries in `included`.
161
- */
162
- include?: readonly string[];
163
- includeDeleted?: boolean;
164
- pagination: ResourcePagination;
165
- sort?: readonly ResourceSort[];
166
- textSearch?: string;
167
- }>;
168
- export type ResourceRecord<Entity> = Readonly<{
169
- deletedAt?: string;
170
- id: ResourceRecordId;
171
- /**
172
- * The records of the read's Include Paths by relation field key: one
173
- * record, or the records of a `many` field in reference order. Untyped:
174
- * the target schemas are CI's.
175
- */
176
- included?: Readonly<Record<string, ResourceJsonValue>>;
177
- revision: ResourceRevision;
178
- /** The keys whose included records were cut to the first 100. */
179
- truncated?: readonly string[];
180
- value: Entity;
181
- }>;
182
- export type ResourceListResult<Entity> = Readonly<{
183
- items: readonly ResourceRecord<Entity>[];
184
- nextCursor?: ResourceCursor;
185
- pagination: "cursor";
186
- }> | Readonly<{
187
- items: readonly ResourceRecord<Entity>[];
188
- page: number;
189
- pageSize: number;
190
- pagination: "page";
191
- totalItems: number;
192
- totalPages: number;
193
- }>;
194
- export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
195
- /** The CI Organization storage can not take a presigned File upload. */
196
- "upload_not_supported";
197
- export type ResourceError = Readonly<{
198
- code: ResourceErrorCode;
199
- /** Client-observed dispatch outcome; uncertainty never proves rollback. */
200
- outcome?: "not_dispatched" | "rejected" | "uncertain";
201
- details?: Readonly<Record<string, ResourceJsonValue>>;
202
- message: string;
203
- retryable: boolean;
204
- }>;
205
- export type ResourceResult<Value> = Readonly<{
206
- correlationId: string;
207
- ok: true;
208
- value: Value;
209
- }> | Readonly<{
210
- correlationId: string;
211
- error: ResourceError;
212
- ok: false;
213
- }>;
214
- export type ResourceListRequest = Readonly<{
215
- operation: "list";
216
- query: ResourceListQuery;
217
- requestId: string;
218
- resourceId: string;
219
- }>;
220
- export type ResourceGetRequest = Readonly<{
221
- id: ResourceRecordId;
222
- includeDeleted?: boolean;
223
- operation: "get";
224
- requestId: string;
225
- resourceId: string;
226
- }>;
227
- export type ResourceCreateRequest<Create> = Readonly<{
228
- idempotencyKey: IdempotencyKey;
229
- operation: "create";
230
- requestId: string;
231
- resourceId: string;
232
- value: Create;
233
- }>;
234
- export type ResourceUpdateRequest<Update> = Readonly<{
235
- expectedRevision: ResourceRevision;
236
- id: ResourceRecordId;
237
- idempotencyKey?: IdempotencyKey;
238
- operation: "update";
239
- requestId: string;
240
- resourceId: string;
241
- value: Update;
242
- }>;
243
- export type ResourceLifecycleRequest = Readonly<{
244
- expectedRevision: ResourceRevision;
245
- id: ResourceRecordId;
246
- idempotencyKey?: IdempotencyKey;
247
- operation: "hard_delete" | "restore" | "soft_delete";
248
- requestId: string;
249
- resourceId: string;
250
- }>;
251
- export type ResourceTransportRequest = ResourceCreateRequest<unknown> | ResourceGetRequest | ResourceLifecycleRequest | ResourceListRequest | ResourceUpdateRequest<unknown>;
252
- export type ResourceMutationInput<Value> = Readonly<{
253
- expectedRevision: ResourceRevision;
254
- id: ResourceRecordId;
255
- idempotencyKey?: IdempotencyKey;
256
- value: Value;
257
- }>;
258
- export type ResourceLifecycleInput = Readonly<{
259
- expectedRevision: ResourceRevision;
260
- id: ResourceRecordId;
261
- idempotencyKey?: IdempotencyKey;
262
- }>;
263
- export type ResourceCreateInput<Value> = Readonly<{
264
- idempotencyKey: IdempotencyKey;
265
- value: Value;
266
- }>;
267
- /** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
268
- export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
269
- export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
270
- pagination: Extract<ResourcePagination, {
271
- mode: "page";
272
- }>;
273
- }>;
274
- export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
275
- pagination: "page";
276
- }>;
277
- /** Member schemas are resolved by CI, independently of the parent resource. */
278
- export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
279
- export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
280
- export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
281
- idempotencyKey: IdempotencyKey;
282
- }>;
283
- export type EntityDeleteInput = ResourceLifecycleInput & Readonly<{
284
- idempotencyKey: IdempotencyKey;
285
- }>;
286
- /** A File upload request for one File field of the entity schema. */
287
- export type EntityUploadInput = Readonly<{
288
- field: string;
289
- filename: string;
290
- mimeType: string;
291
- }>;
292
- /** PUT the file bytes to `url` with `headers`; then write `{ upload: uploadId }`. */
293
- export type EntityUploadSlot = Readonly<{
294
- headers: Readonly<Record<string, string>>;
295
- method: "PUT";
296
- uploadId: string;
297
- url: string;
298
- }>;
299
- export type EntityRequestIdentity = Readonly<{
300
- requestId: string;
301
- resourceId: string;
302
- }>;
303
- export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIdentity & (Readonly<{
304
- operation: "list";
305
- query: EntityListQuery;
306
- }> | Readonly<{
307
- operation: "list_members";
308
- parentId: ResourceRecordId;
309
- field: string;
310
- query: EntityListQuery;
311
- }> | Readonly<{
312
- operation: "get";
313
- id: ResourceRecordId;
314
- include?: readonly string[];
315
- }> | (Readonly<{
316
- operation: "create";
317
- }> & EntityCreateInput<Create>) | (Readonly<{
318
- operation: "update";
319
- }> & EntityUpdateInput<Patch>) | (Readonly<{
320
- operation: "delete";
321
- }> & EntityDeleteInput) | (Readonly<{
322
- operation: "upload";
323
- }> & EntityUploadInput));
324
- export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list_members" ? EntityPage<EntityMemberValue> : Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
325
- export interface ConfidentialCredentials {
62
+ export type ClientSecret = Redacted.Redacted<string> | string;
63
+ export interface ConfidentialCredentials<Secret extends ClientSecret = string> {
326
64
  readonly clientId: string;
327
- readonly clientSecret: string;
65
+ readonly clientSecret: Secret;
328
66
  }
329
67
  export interface RotatingConfidentialCredentialProvider {
330
68
  readonly getCredentials: () => ConfidentialCredentials | Promise<ConfidentialCredentials>;
331
69
  }
332
- export type ConfidentialCredentialProvider = ConfidentialCredentials | RotatingConfidentialCredentialProvider;
333
- export type ServiceServerAuthentication = Readonly<{
334
- credentials: ConfidentialCredentialProvider;
70
+ export type ConfidentialCredentialProvider<Secret extends ClientSecret = string> = ConfidentialCredentials<Secret> | RotatingConfidentialCredentialProvider;
71
+ export type ServiceServerAuthentication<Secret extends ClientSecret = string> = Readonly<{
72
+ credentials: ConfidentialCredentialProvider<Secret>;
335
73
  mode: "service";
336
74
  }>;
337
75
  /** Application credentials authorize each call for a required Audit subject in one configured organization. */
@@ -352,10 +90,12 @@ export type UserAuthScopePolicy = Readonly<{
352
90
  readScope: string;
353
91
  writeScope: string;
354
92
  }>;
93
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
355
94
  export type CiResourceBinding<Value = unknown, Create = Value, Patch = Partial<Value>> = Readonly<{
356
95
  definition: ResourceDefinition<Value, Create, Patch>;
357
96
  schemaFqn: string;
358
97
  }>;
98
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
359
99
  export type CiResourcesOptions = Readonly<{
360
100
  auth: Pick<ApplicationUserAuth, "getEntityContext">;
361
101
  bindings: readonly CiResourceBinding[];
@@ -364,6 +104,7 @@ export type CiResourcesOptions = Readonly<{
364
104
  policy?: UserAuthScopePolicy;
365
105
  tenantUrl: string;
366
106
  }>;
107
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
367
108
  export type RealtimeTicketOptions = Readonly<{
368
109
  auth: Pick<ApplicationUserAuth, "getAccessToken">;
369
110
  /** The CI organization the signed-in users belong to. */
@@ -374,12 +115,15 @@ export type RealtimeTicketOptions = Readonly<{
374
115
  host?: string;
375
116
  fetch?: typeof globalThis.fetch;
376
117
  }>;
377
- /** The ticket route answer: a single-use ticket and the stream it opens. */
118
+ /** The ticket route answer: a single-use ticket and the stream it opens.
119
+ * @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`.
120
+ */
378
121
  export type RealtimeTicketResponse = Readonly<{
379
122
  ticket: string;
380
123
  expiresAt: string;
381
124
  streamUrl: string;
382
125
  }>;
126
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
383
127
  export type BffResourceMount = Readonly<{
384
128
  basePath: string;
385
129
  handler: (request: Request) => Promise<Response>;
@@ -392,10 +136,13 @@ export type ExternalApplicationBffCapabilities = Readonly<{
392
136
  }> & (Readonly<{
393
137
  authentication?: never;
394
138
  }> | ServiceCapabilityAuthorization);
395
- /** The realtime ticket route `POST {basePath}/realtime/ticket`; `basePath` defaults to `/api`. */
139
+ /** The realtime ticket route `POST {basePath}/realtime/ticket`; `basePath` defaults to `/api`.
140
+ * @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`.
141
+ */
396
142
  export type ExternalApplicationBffRealtime = Omit<RealtimeTicketOptions, "auth"> & Readonly<{
397
143
  basePath?: string;
398
144
  }>;
145
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
399
146
  export type ExternalApplicationBffOptions = Readonly<{
400
147
  auth: ApplicationUserAuth;
401
148
  authBasePath?: string;
@@ -405,6 +152,7 @@ export type ExternalApplicationBffOptions = Readonly<{
405
152
  realtime?: ExternalApplicationBffRealtime;
406
153
  resources?: readonly BffResourceMount[];
407
154
  }>;
155
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
408
156
  export type ExternalApplicationBff = (request: Request) => Promise<Response>;
409
157
  export type PrincipalKind = "detached_user" | "service_principal";
410
158
  export type DelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
@@ -486,334 +234,6 @@ export type ResourceHttpHandlerOptions<Value = unknown, Create = Value, Patch =
486
234
  authorize: (request: Request, operation: ResourceTransportRequest["operation"] | EntityOperation) => Promise<EntityInvocationContext | Response>;
487
235
  maxBodyBytes?: number;
488
236
  }>;
489
- export type JsonPrimitive = boolean | null | number | string;
490
- export type JsonValue = JsonObject | JsonPrimitive | readonly JsonValue[];
491
- export interface JsonObject {
492
- readonly [key: string]: JsonValue;
493
- }
494
- declare const Draft202012Dialect: "https://json-schema.org/draft/2020-12/schema";
495
- /** JSON-compatible Draft 2020-12 vocabulary used for portable manifests. */
496
- export type JsonSchemaDocument = JsonObject & Readonly<{
497
- $anchor?: string;
498
- $comment?: string;
499
- $defs?: Readonly<Record<string, JsonSchemaDocument>>;
500
- $dynamicAnchor?: string;
501
- $dynamicRef?: string;
502
- $id?: string;
503
- $ref?: string;
504
- $schema?: typeof Draft202012Dialect;
505
- additionalProperties?: boolean | JsonSchemaDocument;
506
- allOf?: readonly JsonSchemaDocument[];
507
- anyOf?: readonly JsonSchemaDocument[];
508
- const?: JsonValue;
509
- contains?: JsonSchemaDocument;
510
- default?: JsonValue;
511
- dependentRequired?: Readonly<Record<string, readonly string[]>>;
512
- description?: string;
513
- else?: JsonSchemaDocument;
514
- enum?: readonly JsonValue[];
515
- exclusiveMaximum?: number;
516
- exclusiveMinimum?: number;
517
- format?: string;
518
- if?: JsonSchemaDocument;
519
- items?: JsonSchemaDocument;
520
- maxItems?: number;
521
- maxLength?: number;
522
- maxProperties?: number;
523
- maximum?: number;
524
- minItems?: number;
525
- minLength?: number;
526
- minProperties?: number;
527
- minimum?: number;
528
- multipleOf?: number;
529
- not?: JsonSchemaDocument;
530
- oneOf?: readonly JsonSchemaDocument[];
531
- pattern?: string;
532
- patternProperties?: Readonly<Record<string, JsonSchemaDocument>>;
533
- prefixItems?: readonly JsonSchemaDocument[];
534
- properties?: Readonly<Record<string, JsonSchemaDocument>>;
535
- required?: readonly string[];
536
- then?: JsonSchemaDocument;
537
- title?: string;
538
- type?: "array" | "boolean" | "integer" | "null" | "number" | "object" | "string" | readonly ("array" | "boolean" | "integer" | "null" | "number" | "object" | "string")[];
539
- unevaluatedItems?: boolean | JsonSchemaDocument;
540
- unevaluatedProperties?: boolean | JsonSchemaDocument;
541
- uniqueItems?: boolean;
542
- }>;
543
- export type ProjectionFidelity = "exact" | "structural";
544
- export type PackageSchemaProjection = Readonly<{
545
- dialect: typeof Draft202012Dialect;
546
- document: JsonSchemaDocument;
547
- fidelity: ProjectionFidelity;
548
- }>;
549
- export type DatasetProviderResult<Value> = Readonly<{
550
- status: "success";
551
- value: Value;
552
- }> | Readonly<{
553
- status: "failure";
554
- error: DatasetProviderError;
555
- }>;
556
- export type DatasetScalarType = "boolean" | "string" | "int64" | "float64" | "decimal" | "date" | "timestamp" | "duration" | "json";
557
- export type DatasetValue = Readonly<{
558
- kind: "null";
559
- }> | Readonly<{
560
- kind: "boolean";
561
- value: boolean;
562
- }> | Readonly<{
563
- kind: "string";
564
- value: string;
565
- }> | Readonly<{
566
- kind: "int64";
567
- value: string;
568
- }> | Readonly<{
569
- kind: "float64";
570
- value: number;
571
- }> | Readonly<{
572
- kind: "decimal";
573
- value: string;
574
- }> | Readonly<{
575
- kind: "date";
576
- value: string;
577
- }> | Readonly<{
578
- kind: "timestamp";
579
- value: string;
580
- }> | Readonly<{
581
- kind: "duration";
582
- value: string;
583
- }> | Readonly<{
584
- kind: "json";
585
- value: JsonValue;
586
- }>;
587
- export type DatasetPredicateOperator = "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "is_null" | "is_not_null" | "contains" | "starts_with";
588
- export type DatasetAggregateOperation = "count" | "count_distinct" | "sum" | "min" | "max" | "avg";
589
- export type DatasetQueryIntent = "records" | "aggregate" | "time_series";
590
- export type DatasetTimeBucket = "hour" | "day" | "week" | "month";
591
- export type DatasetPredicate = Readonly<{
592
- kind: "predicate";
593
- fieldId: string;
594
- operator: DatasetPredicateOperator;
595
- values: readonly DatasetValue[];
596
- }>;
597
- export type DatasetFilter = DatasetPredicate | Readonly<{
598
- kind: "and" | "or";
599
- filters: readonly DatasetFilter[];
600
- }> | Readonly<{
601
- kind: "not";
602
- filter: DatasetFilter;
603
- }>;
604
- export type DatasetOrder = Readonly<{
605
- fieldOrAlias: string;
606
- direction: "asc" | "desc";
607
- }>;
608
- export type DatasetOperation = Readonly<{
609
- kind: "records";
610
- projection: readonly string[];
611
- filter?: DatasetFilter;
612
- orderBy: readonly DatasetOrder[];
613
- cursor?: string;
614
- }> | Readonly<{
615
- kind: "aggregate";
616
- filter?: DatasetFilter;
617
- groupBy: readonly string[];
618
- measures: readonly Readonly<{
619
- alias: string;
620
- operation: DatasetAggregateOperation;
621
- fieldId?: string;
622
- }>[];
623
- orderBy: readonly DatasetOrder[];
624
- cursor?: string;
625
- }> | Readonly<{
626
- kind: "time_series";
627
- timeFieldId: string;
628
- measure: Readonly<{
629
- alias: string;
630
- operation: DatasetAggregateOperation;
631
- fieldId?: string;
632
- }>;
633
- bucket: DatasetTimeBucket;
634
- order: "asc" | "desc";
635
- filter?: DatasetFilter;
636
- cursor?: string;
637
- }>;
638
- export type DatasetProviderCapabilities = Readonly<{
639
- intents: readonly DatasetQueryIntent[];
640
- predicates: readonly DatasetPredicateOperator[];
641
- aggregates: readonly DatasetAggregateOperation[];
642
- grouping: boolean;
643
- ordering: boolean;
644
- pagination: boolean;
645
- definitionRefresh: boolean;
646
- limits: Readonly<{
647
- maxRows: number;
648
- maxBytes: number;
649
- timeoutMs: number;
650
- maxPageRows: number;
651
- }>;
652
- }>;
653
- export type SafeDiagnostic = Readonly<{
654
- code: string;
655
- message: string;
656
- fieldId?: string;
657
- }>;
658
- export type ConnectorContext = Readonly<{
659
- correlationId: string;
660
- deadlineEpochMs: number;
661
- }>;
662
- export type DatasetSourceLocation = Readonly<{
663
- segments: readonly [
664
- Readonly<{
665
- kind: "container";
666
- opaqueId: string;
667
- label: string;
668
- }>,
669
- ...Readonly<{
670
- kind: "container" | "dataset";
671
- opaqueId: string;
672
- label: string;
673
- }>[]
674
- ];
675
- }>;
676
- export type DatasetDefinition = Readonly<{
677
- version: 1;
678
- fields: readonly Readonly<{
679
- id: string;
680
- name: string;
681
- type: DatasetScalarType;
682
- nullable: boolean;
683
- semantic?: string;
684
- }>[];
685
- measures: readonly Readonly<{
686
- id: string;
687
- name: string;
688
- resultType: DatasetScalarType;
689
- }>[];
690
- relationships: readonly Readonly<{
691
- id: string;
692
- fromFieldId: string;
693
- toFieldId: string;
694
- cardinality: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
695
- }>[];
696
- }>;
697
- export type Bounds = Readonly<{
698
- maxRows: number;
699
- maxBytes: number;
700
- timeoutMs: number;
701
- }>;
702
- export type QueryInput = ConnectorContext & Readonly<{
703
- location: DatasetSourceLocation;
704
- definitionRevisionId: string;
705
- definition: DatasetDefinition;
706
- operation: DatasetOperation;
707
- bounds: Bounds;
708
- }>;
709
- export type DatasetRecordPage = Readonly<{
710
- columns: readonly Readonly<{
711
- fieldId: string;
712
- type: DatasetScalarType;
713
- }>[];
714
- rows: readonly (readonly DatasetValue[])[];
715
- nextCursor?: string;
716
- rowCount: number;
717
- byteCount: number;
718
- observedAt: string;
719
- }>;
720
- export type DatasetResultPage = (Readonly<{
721
- kind: "records";
722
- }> & DatasetRecordPage) | Readonly<{
723
- kind: "aggregate";
724
- columns: readonly Readonly<{
725
- alias: string;
726
- type: DatasetScalarType;
727
- }>[];
728
- rows: readonly (readonly DatasetValue[])[];
729
- nextCursor?: string;
730
- rowCount: number;
731
- byteCount: number;
732
- observedAt: string;
733
- }> | Readonly<{
734
- kind: "time_series";
735
- valueType: DatasetScalarType;
736
- points: readonly Readonly<{
737
- time: string;
738
- value: DatasetValue;
739
- }>[];
740
- nextCursor?: string;
741
- pointCount: number;
742
- byteCount: number;
743
- observedAt: string;
744
- }>;
745
- export type DatasetProviderError = Readonly<{
746
- kind: "not_ready" | "incompatible_source" | "unsupported_operation" | "policy_not_pushable" | "invalid_cursor" | "timeout" | "permission_denied" | "provider_unavailable" | "provider_rejected" | "invalid_provider_response";
747
- diagnostics: readonly SafeDiagnostic[];
748
- }> | Readonly<{
749
- kind: "limit_exceeded";
750
- limit: "rows" | "bytes" | "timeout";
751
- diagnostics: readonly SafeDiagnostic[];
752
- }> | Readonly<{
753
- kind: "throttled";
754
- retryAfterMs?: number;
755
- diagnostics: readonly SafeDiagnostic[];
756
- }>;
757
- /** Closed public principal vocabulary accepted by a gateway operation. */
758
- export type PortableOperationPrincipalKind = "detached_user" | "service_principal";
759
- /** Explicit delegated-subject requirement reviewed with an operation. */
760
- export type PortableOperationDelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
761
- /** Fully materialized authorization policy for one exposed operation. */
762
- export type PortableOperationAuthorization = Readonly<{
763
- delegatedSubject: PortableOperationDelegatedSubjectPolicy;
764
- organization: "required";
765
- principalKinds: readonly PortableOperationPrincipalKind[];
766
- scopes: readonly string[];
767
- }>;
768
- /** Observable side-effect class reviewed before an operation becomes a tool. */
769
- export type PortableOperationEffect = "external_side_effect" | "read" | "write";
770
- /** The replay guarantee supplied by the operation implementation. */
771
- export type PortableOperationIdempotency = "idempotent" | "requires_key" | "safe";
772
- /** Explicit, bounded retry permission for callers of the operation. */
773
- export type PortableOperationRetryPolicy = Readonly<{
774
- mode: "never";
775
- }> | Readonly<{
776
- maxAttempts: number;
777
- mode: "idempotent_only";
778
- }>;
779
- /** Execution lifecycle and maximum wall-clock duration. */
780
- export type PortableOperationExecutionPolicy = Readonly<{
781
- mode: "synchronous";
782
- timeoutMs: number;
783
- }>;
784
- /** Per-invocation transport bounds. */
785
- export type PortableOperationLimits = Readonly<{
786
- maxRequestBytes: number;
787
- maxResponseBytes: number;
788
- }>;
789
- /**
790
- * Complete JSON-only operation contract reviewed by a host. Executable
791
- * handlers remain in a server runtime sidecar and never enter this descriptor.
792
- */
793
- export type PortableOperationDeclaration = Readonly<{
794
- authorization: PortableOperationAuthorization;
795
- description: string;
796
- effects: PortableOperationEffect;
797
- execution: PortableOperationExecutionPolicy;
798
- id: string;
799
- idempotency: PortableOperationIdempotency;
800
- input: PackageSchemaProjection;
801
- limits: PortableOperationLimits;
802
- output: PackageSchemaProjection;
803
- retry: PortableOperationRetryPolicy;
804
- title: string;
805
- version: string;
806
- }>;
807
- /** One catalog and identity namespace for an ordered operation list. */
808
- export type OperationDomainDeclaration<Operation extends PortableOperationDeclaration = PortableOperationDeclaration> = Readonly<{
809
- description?: string;
810
- displayOrder?: number;
811
- icon?: string;
812
- id: string;
813
- operations: readonly Operation[];
814
- tags?: readonly string[];
815
- title: string;
816
- }>;
817
237
  /**
818
238
  * Runtime dispatch validates the declared input schema before invoking a
819
239
  * handler. The bivariant call signature lets domains retain heterogeneous,
@@ -913,6 +333,7 @@ export type WorkflowTarget = Readonly<{
913
333
  workflowFqn: string;
914
334
  workflowId?: never;
915
335
  }>;
336
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
916
337
  export type FixedWorkflowRouteOptions<Input, Params = Record<string, never>> = Readonly<{
917
338
  auth: Pick<ApplicationUserAuth, "getAccessToken" | "getEntityContext">;
918
339
  fetch?: typeof globalThis.fetch;
@@ -927,6 +348,7 @@ export type FixedWorkflowRouteOptions<Input, Params = Record<string, never>> = R
927
348
  }> & WorkflowTarget;
928
349
  export type GatewayWebHandler = (request: Request) => Promise<Response>;
929
350
  export type GatewayRuntimeKernel = Pick<GatewayKernel, "handle">;
351
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
930
352
  export type GatewayNextRouteHandlers = Readonly<{
931
353
  DELETE: GatewayWebHandler;
932
354
  GET: GatewayWebHandler;
@@ -934,15 +356,117 @@ export type GatewayNextRouteHandlers = Readonly<{
934
356
  POST: GatewayWebHandler;
935
357
  PUT: GatewayWebHandler;
936
358
  }>;
359
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
937
360
  export type ResourceNextRouteHandlers = Readonly<{
938
361
  DELETE: GatewayWebHandler;
939
362
  GET: GatewayWebHandler;
940
363
  PATCH: GatewayWebHandler;
941
364
  POST: GatewayWebHandler;
942
365
  }>;
943
- export declare const cookies: (request: Request) => string | null, createCiResourceMounts: (options: CiResourcesOptions) => {
366
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
367
+ export declare const cookies: (request: Request) => string | null;
368
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
369
+ export declare const createCiResourceMounts: (options: CiResourcesOptions) => {
944
370
  basePath: string;
945
371
  handler: (request: Request) => Promise<Response>;
946
- }[], createExternalApplicationBff: (options: ExternalApplicationBffOptions) => ExternalApplicationBff, createExternalApplicationBffNextHandlers: (options: ExternalApplicationBffOptions) => GatewayNextRouteHandlers, createFixedWorkflowRoute: <Input, Params = Record<string, never>>(options: FixedWorkflowRouteOptions<Input, Params>) => ((request: Request, params: Params) => Promise<Response>), createRealtimeTicketHandler: (options: RealtimeTicketOptions) => ((request: Request) => Promise<Response>), createGatewayNextRouteHandlers: (kernel: GatewayRuntimeKernel) => GatewayNextRouteHandlers, createResourceNextRouteHandlers: <Value, Create = Value, Patch = Partial<Value>>(options: ResourceHttpHandlerOptions<Value, Create, Patch>) => ResourceNextRouteHandlers, headers: (request: Request) => Headers, publicOriginFromHeaders: (headerList: Headers, fallbackOrigin: string) => string, requestWithPublicOrigin: (request: Request, publicOrigin: string) => Request;
372
+ }[];
373
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
374
+ export declare const createExternalApplicationBff: (options: ExternalApplicationBffOptions) => ExternalApplicationBff;
375
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
376
+ export declare const createExternalApplicationBffNextHandlers: (options: ExternalApplicationBffOptions) => GatewayNextRouteHandlers;
377
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
378
+ export declare const createFixedWorkflowRoute: <Input, Params = Record<string, never>>(options: FixedWorkflowRouteOptions<Input, Params>) => ((request: Request, params: Params) => Promise<Response>);
379
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
380
+ export declare const createRealtimeTicketHandler: (options: RealtimeTicketOptions) => ((request: Request) => Promise<Response>);
381
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
382
+ export declare const createGatewayNextRouteHandlers: (kernel: GatewayRuntimeKernel) => GatewayNextRouteHandlers;
383
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
384
+ export declare const createResourceNextRouteHandlers: <Value, Create = Value, Patch = Partial<Value>>(options: ResourceHttpHandlerOptions<Value, Create, Patch>) => ResourceNextRouteHandlers;
385
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
386
+ export declare const headers: (request: Request) => Headers;
387
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
388
+ export declare const publicOriginFromHeaders: (headerList: Headers, fallbackOrigin: string) => string;
389
+ /** @deprecated Import it from `@collective-intelligence/external-apps-server-sdk/next`. */
390
+ export declare const requestWithPublicOrigin: (request: Request, publicOrigin: string) => Request;
391
+
392
+ export {
393
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ Bounds,
394
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ ConnectorContext,
395
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetAggregateOperation,
396
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetDefinition,
397
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetFilter,
398
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetOperation,
399
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetOrder,
400
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetPredicate,
401
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetPredicateOperator,
402
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderCapabilities,
403
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderError,
404
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetProviderResult,
405
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetQueryIntent,
406
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetRecordPage,
407
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetResultPage,
408
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetScalarType,
409
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetSourceLocation,
410
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetTimeBucket,
411
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ DatasetValue,
412
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityCreateInput,
413
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityDeleteInput,
414
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityListQuery,
415
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityMemberValue,
416
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityOperation,
417
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityOperationResult,
418
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityPage,
419
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityRequest,
420
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUpdateInput,
421
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUploadInput,
422
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ EntityUploadSlot,
423
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ IdempotencyKey,
424
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonObject,
425
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonPrimitive,
426
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonSchemaDocument,
427
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ JsonValue,
428
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ OperationDomainDeclaration,
429
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PackageSchemaProjection,
430
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationAuthorization,
431
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationDeclaration,
432
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationDelegatedSubjectPolicy,
433
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationEffect,
434
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationExecutionPolicy,
435
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationIdempotency,
436
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationLimits,
437
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationPrincipalKind,
438
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ PortableOperationRetryPolicy,
439
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ PortableResourceSchema,
440
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ ProjectionFidelity,
441
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ QueryInput,
442
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCapabilities,
443
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCreateInput,
444
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCreateRequest,
445
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceCursor,
446
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceDefinition,
447
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceError,
448
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceErrorCode,
449
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceFilter,
450
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceGetRequest,
451
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceId,
452
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceIdentityField,
453
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceJsonValue,
454
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceLifecycleInput,
455
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceLifecycleRequest,
456
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListQuery,
457
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListRequest,
458
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceListResult,
459
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceMutationInput,
460
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourcePagination,
461
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourcePaginationMode,
462
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRecord,
463
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRecordId,
464
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceResult,
465
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceRevision,
466
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceSort,
467
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceTransportRequest,
468
+ /** @deprecated Import it from `@collective-intelligence/external-apps-client-sdk/resources`. */ ResourceUpdateRequest,
469
+ /** @deprecated Import it from `@collective-intelligence/extensions-sdk`. */ SafeDiagnostic,
470
+ };
947
471
 
948
472
  export {};