@mdbase-dev/connect-protocol 0.1.0-beta.100
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/LICENSE +21 -0
- package/dist/application-authorization.d.ts +32 -0
- package/dist/application-authorization.js +207 -0
- package/dist/capabilities.d.ts +73 -0
- package/dist/capabilities.js +92 -0
- package/dist/collection-setup.d.ts +90 -0
- package/dist/collection-setup.js +1 -0
- package/dist/compatibility.d.ts +37 -0
- package/dist/compatibility.js +65 -0
- package/dist/connect-problems.generated.d.ts +1388 -0
- package/dist/connect-problems.generated.js +574 -0
- package/dist/files.d.ts +269 -0
- package/dist/files.js +426 -0
- package/dist/index.d.ts +878 -0
- package/dist/index.js +94 -0
- package/dist/manifest.d.ts +62 -0
- package/dist/manifest.js +527 -0
- package/dist/mutation-fingerprint.d.ts +6 -0
- package/dist/mutation-fingerprint.js +116 -0
- package/dist/operations.d.ts +15 -0
- package/dist/operations.js +194 -0
- package/dist/type-packs.d.ts +133 -0
- package/dist/type-packs.js +30 -0
- package/package.json +42 -0
- package/schemas/application-capability-catalog.v1.json +40 -0
- package/schemas/application-capability-catalog.v2.json +68 -0
- package/schemas/catalog.json +17 -0
- package/schemas/connect-problem.v1.schema.json +5132 -0
- package/schemas/connect-problems.v1.catalog.json +351 -0
- package/schemas/connect-protocol.v1.schema.json +800 -0
- package/schemas/data-contract.schema.json +163 -0
- package/schemas/encrypted-relay.v1.schema.json +63 -0
- package/schemas/encrypted-relay.v2.schema.json +63 -0
- package/schemas/encrypted-relay.v3.schema.json +64 -0
- package/schemas/files.v1.schema.json +507 -0
- package/schemas/interop/v0.1/action-cancellation.schema.json +6 -0
- package/schemas/interop/v0.1/action-invocation.schema.json +6 -0
- package/schemas/interop/v0.1/action-outcome.schema.json +6 -0
- package/schemas/interop/v0.1/action-provider-declaration.schema.json +6 -0
- package/schemas/interop/v0.1/action-request.schema.json +6 -0
- package/schemas/interop/v0.1/conformance-claim.schema.json +6 -0
- package/schemas/interop/v0.1/event-source-declaration.schema.json +6 -0
- package/schemas/interop/v0.1/event.schema.json +6 -0
- package/schemas/interop/v0.1/profile.schema.json +456 -0
- package/schemas/mdbase-app.legacy-v1.schema.json +405 -0
- package/schemas/mdbase-app.schema.json +381 -0
- package/schemas/mdbase-query.v0.3.schema.json +171 -0
- package/schemas/notification-webhook.v1.schema.json +56 -0
- package/schemas/operation-catalog.v1.json +42 -0
- package/schemas/operation-mutation-classification.v1.json +537 -0
- package/schemas/sync.v1.schema.json +483 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
import type { ConnectProblem } from "./connect-problems.generated.js";
|
|
2
|
+
import type { ApplicationFileRequirement, LegacyApplicationFileRequirement, CollectionFileDescriptor, FileCapability } from "./files.js";
|
|
3
|
+
import type { CollectionOperation } from "./operations.js";
|
|
4
|
+
import type { ApplicationCapabilityRequirements, LegacyApplicationCapabilityRequirements } from "./capabilities.js";
|
|
5
|
+
import type { ContractRequirement, ContractSetupChoice, TypePackProvision } from "./type-packs.js";
|
|
6
|
+
import type { ConfigurationProvision, ConfigurationRequirement } from "./collection-setup.js";
|
|
7
|
+
import type { ApplicationAuthorizationProof } from "./application-authorization.js";
|
|
8
|
+
export * from "./connect-problems.generated.js";
|
|
9
|
+
export * from "./files.js";
|
|
10
|
+
export * from "./operations.js";
|
|
11
|
+
export * from "./mutation-fingerprint.js";
|
|
12
|
+
export * from "./compatibility.js";
|
|
13
|
+
export * from "./capabilities.js";
|
|
14
|
+
export * from "./application-authorization.js";
|
|
15
|
+
export * from "./type-packs.js";
|
|
16
|
+
export * from "./collection-setup.js";
|
|
17
|
+
export declare const CONTROL_PROTOCOL_VERSION: 1;
|
|
18
|
+
export { AUTHORIZATION_BINDING_PROTOCOL_VERSION as APPLICATION_AUTHORIZATION_PROTOCOL_VERSION } from "./compatibility.js";
|
|
19
|
+
export declare const LOOPBACK_PROTOCOL_VERSION: 1;
|
|
20
|
+
export declare const DEFAULT_LOOPBACK_PORT: 28485;
|
|
21
|
+
export declare const RELAY_ENCRYPTION_SUITE: "P256-HKDF-SHA256-AES256GCM";
|
|
22
|
+
export declare const GRANT_ENCRYPTION_PROTOCOL_VERSION: 1;
|
|
23
|
+
export declare const SYNC_PROTOCOL_VERSION: 1;
|
|
24
|
+
export declare const CONTRACT_SETUP_CAPABILITY: "contract-setup-v1";
|
|
25
|
+
export declare const FILE_RELAY_CAPABILITY: "file-relay-v1";
|
|
26
|
+
export declare const PROTOCOL_USAGE_REPORT_CAPABILITY: "protocol-usage-report-v1";
|
|
27
|
+
export declare const POLICY_FRESHNESS_LEASE_CAPABILITY: "policy-freshness-lease-v1";
|
|
28
|
+
/** Advertised beta capabilities are intentionally broader than the beta baseline. */
|
|
29
|
+
export declare const RELAY_REQUIRED_CAPABILITIES: readonly ["application-authorization-v4", "authorization-activation", "encrypted-relay", "policy-ack"];
|
|
30
|
+
export declare const MINIMUM_CONNECTOR_VERSION: "0.1.0-beta.33";
|
|
31
|
+
export declare const POLICY_FRESHNESS_LEASE_MINIMUM_CONNECTOR_VERSION: "0.1.0-beta.91";
|
|
32
|
+
export declare const HOSTED_PROVIDER_REQUIRED_CAPABILITIES: readonly ["durable-mutation-journal-v1", "durable-file-lifecycle-v1"];
|
|
33
|
+
export declare const HOSTED_CANDIDATE_B_ACTIVATION_CAPABILITY: "candidate-b-activation-v1";
|
|
34
|
+
export declare const HOSTED_PROVIDER_CAPABILITIES: readonly [...string[], "durable-mutation-journal-v1", "durable-file-lifecycle-v1", "mutation-replay-after-credential-retirement-v1", "candidate-b-activation-v1"];
|
|
35
|
+
export declare const APPLICATION_DECLARATION_EVIDENCE_CAPABILITY: "application-declaration-evidence-v1";
|
|
36
|
+
export declare const RELAY_CAPABILITIES: readonly [...string[], "application-declaration-evidence-v1", "application-authorization-v4", "authorization-activation", "encrypted-relay", "policy-ack", "policy-freshness-lease-v1", "application-authorization-v5", "contract-setup-v1", "file-relay-v1", "protocol-usage-report-v1"];
|
|
37
|
+
export declare const AUTHORITY_PROOF_VERSION: 1;
|
|
38
|
+
export declare const AUTHORITY_PROOF_ALGORITHM: "P256-SHA256";
|
|
39
|
+
export declare const AUTHORITY_PROOF_DOMAIN: "mdbase-authority-request-proof-v1";
|
|
40
|
+
export declare const AUTHORITY_PROOF_HEADERS: {
|
|
41
|
+
readonly version: "x-mdbase-proof-version";
|
|
42
|
+
readonly timestamp: "x-mdbase-proof-timestamp";
|
|
43
|
+
readonly nonce: "x-mdbase-proof-nonce";
|
|
44
|
+
readonly signature: "x-mdbase-proof-signature";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Validate a native OAuth callback against the publisher of its web manifest.
|
|
48
|
+
* Reverse-domain private-use schemes keep native app identity tied to the
|
|
49
|
+
* manifest origin; PKCE remains mandatory at the authorization boundary.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isNativeRedirectUri(url: URL, publisherHostname?: string): boolean;
|
|
52
|
+
export declare const CONNECT_SCHEMA_IDS: {
|
|
53
|
+
readonly appManifest: "https://mdbase.dev/connect/schemas/mdbase-app.v1.json";
|
|
54
|
+
readonly notificationWebhook: "https://mdbase.dev/connect/schemas/notification-webhook.v1.json";
|
|
55
|
+
readonly dataContract: "https://mdbase.dev/schemas/v0.3/data-contract.schema.json";
|
|
56
|
+
readonly eventActionInterop: "https://mdbase.dev/schemas/interop/v0.1/profile.schema.json";
|
|
57
|
+
readonly protocol: "https://mdbase.dev/connect/schemas/connect-protocol.v1.json";
|
|
58
|
+
readonly encryptedRelay: "https://mdbase.dev/connect/schemas/encrypted-relay.v3.json";
|
|
59
|
+
readonly files: "https://mdbase.dev/connect/schemas/files.v1.json";
|
|
60
|
+
readonly sync: "https://mdbase.dev/connect/schemas/sync.v1.json";
|
|
61
|
+
};
|
|
62
|
+
export interface NotificationCriterion {
|
|
63
|
+
/** Stable, manifest-owned identifier selected by an installation. */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Runtime event contract evaluated at the collection authority. */
|
|
66
|
+
event: ContractRequirement;
|
|
67
|
+
/** Canonical mdbase CEL. Event content never leaves the authority for evaluation. */
|
|
68
|
+
if?: {
|
|
69
|
+
$expr: string;
|
|
70
|
+
};
|
|
71
|
+
debounce?: string;
|
|
72
|
+
minimum_interval?: string;
|
|
73
|
+
/** Static Web Push copy. Dynamic record content is intentionally unsupported. */
|
|
74
|
+
presentation: {
|
|
75
|
+
title: string;
|
|
76
|
+
body?: string;
|
|
77
|
+
tag?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export type NativeNotificationDelivery = {
|
|
81
|
+
/**
|
|
82
|
+
* Connect sends through FCM using revocable, least-privilege authority
|
|
83
|
+
* granted by the application's Firebase project.
|
|
84
|
+
*/
|
|
85
|
+
mode: "managed_fcm";
|
|
86
|
+
firebase_project_id: string;
|
|
87
|
+
} | {
|
|
88
|
+
/**
|
|
89
|
+
* Connect sends a signed, content-free signal to infrastructure operated
|
|
90
|
+
* by the application developer. That infrastructure owns APNs/FCM.
|
|
91
|
+
*/
|
|
92
|
+
mode: "webhook";
|
|
93
|
+
url: string;
|
|
94
|
+
};
|
|
95
|
+
export interface ApplicationNotifications {
|
|
96
|
+
criteria: NotificationCriterion[];
|
|
97
|
+
/** Optional native delivery route. Web Push registration remains independent. */
|
|
98
|
+
native_delivery?: NativeNotificationDelivery;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The declaration bundled with an application build and registered inline.
|
|
102
|
+
*
|
|
103
|
+
* `id` is stable presentation metadata rather than proof of a publisher. Each
|
|
104
|
+
* exact declaration is independently identified and authorized by Connect.
|
|
105
|
+
*/
|
|
106
|
+
export type CanonicalApplicationRequirements = Omit<ApplicationRequirements, "access" | "contracts"> & {
|
|
107
|
+
access: "full_collection";
|
|
108
|
+
contracts: [];
|
|
109
|
+
};
|
|
110
|
+
interface MdbaseAppManifestBase {
|
|
111
|
+
manifest_version: 1;
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
requirements: CanonicalApplicationRequirements;
|
|
115
|
+
provisions?: ApplicationProvisions;
|
|
116
|
+
notifications?: ApplicationNotifications;
|
|
117
|
+
}
|
|
118
|
+
export interface MdbaseWebAppManifest extends MdbaseAppManifestBase {
|
|
119
|
+
/** Omitted by existing v1 declarations; explicit `web` is equivalent. */
|
|
120
|
+
distribution?: "web";
|
|
121
|
+
homepage: string;
|
|
122
|
+
icon?: string;
|
|
123
|
+
redirect_uris: string[];
|
|
124
|
+
}
|
|
125
|
+
export interface MdbasePortableAppManifest extends MdbaseAppManifestBase {
|
|
126
|
+
/**
|
|
127
|
+
* A downloaded, publisher-unverified application opened from a local file.
|
|
128
|
+
* Portable declarations use device authorization and never claim a web origin.
|
|
129
|
+
*/
|
|
130
|
+
distribution: "portable";
|
|
131
|
+
/** Optional HTTPS page where the user can inspect the project or source. */
|
|
132
|
+
project_url?: string;
|
|
133
|
+
/** Optional HTTPS icon on the project URL's origin. */
|
|
134
|
+
icon?: string;
|
|
135
|
+
}
|
|
136
|
+
export type MdbaseAppManifest = MdbaseWebAppManifest | MdbasePortableAppManifest;
|
|
137
|
+
export interface NotificationSignal {
|
|
138
|
+
/** Stable idempotency key generated by the collection authority. */
|
|
139
|
+
signal_id: string;
|
|
140
|
+
grant_id: string;
|
|
141
|
+
criterion_id: string;
|
|
142
|
+
/** Opaque authority cursor used by the app to retrieve current state after waking. */
|
|
143
|
+
cursor: string;
|
|
144
|
+
}
|
|
145
|
+
export interface NotificationPresentation {
|
|
146
|
+
title: string;
|
|
147
|
+
body?: string;
|
|
148
|
+
tag?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface MdbaseNotification {
|
|
151
|
+
type: "mdbase.notification";
|
|
152
|
+
version: 1;
|
|
153
|
+
signal_id: string;
|
|
154
|
+
criterion_id: string;
|
|
155
|
+
cursor: string;
|
|
156
|
+
presentation: NotificationPresentation;
|
|
157
|
+
}
|
|
158
|
+
export interface NotificationWebhook {
|
|
159
|
+
type: "mdbase.notification.webhook";
|
|
160
|
+
version: 1;
|
|
161
|
+
delivery_id: string;
|
|
162
|
+
/** Opaque application grant reference returned during authorization. */
|
|
163
|
+
connection_id: string;
|
|
164
|
+
notification: MdbaseNotification;
|
|
165
|
+
}
|
|
166
|
+
export interface ApplicationRequirements {
|
|
167
|
+
contracts: ContractRequirement[];
|
|
168
|
+
/** Collection extension values required before the application is ready. */
|
|
169
|
+
configuration?: ConfigurationRequirement[];
|
|
170
|
+
/** Versioned semantic intent compiled by Connect into exact operations. */
|
|
171
|
+
capabilities?: ApplicationCapabilityRequirements;
|
|
172
|
+
/**
|
|
173
|
+
* Collection boundary request. New declarations must explicitly use
|
|
174
|
+
* `full_collection`; omitted and `contract` remain parseable only for legacy
|
|
175
|
+
* diagnosis and reauthorization.
|
|
176
|
+
*/
|
|
177
|
+
access?: "contract" | "full_collection";
|
|
178
|
+
/** Restrict authorization to durable provider-backed collections. */
|
|
179
|
+
collection_kind?: "hosted";
|
|
180
|
+
/** First-class non-Markdown file access requested independently of records. */
|
|
181
|
+
files?: ApplicationFileRequirement;
|
|
182
|
+
}
|
|
183
|
+
export type LegacyApplicationRequirements = Omit<ApplicationRequirements, "capabilities" | "files" | "access"> & {
|
|
184
|
+
access: "full_collection";
|
|
185
|
+
capabilities?: LegacyApplicationCapabilityRequirements;
|
|
186
|
+
files?: LegacyApplicationFileRequirement;
|
|
187
|
+
};
|
|
188
|
+
export type LegacyMdbaseWebAppManifest = Omit<MdbaseWebAppManifest, "requirements"> & {
|
|
189
|
+
requirements: LegacyApplicationRequirements;
|
|
190
|
+
};
|
|
191
|
+
export type LegacyMdbasePortableAppManifest = Omit<MdbasePortableAppManifest, "requirements"> & {
|
|
192
|
+
requirements: LegacyApplicationRequirements;
|
|
193
|
+
};
|
|
194
|
+
export type LegacyMdbaseAppManifest = LegacyMdbaseWebAppManifest | LegacyMdbasePortableAppManifest;
|
|
195
|
+
export interface ApplicationProvisions {
|
|
196
|
+
type_packs: TypePackProvision[];
|
|
197
|
+
/** Narrow semantic changes that may satisfy configuration requirements. */
|
|
198
|
+
configuration?: ConfigurationProvision[];
|
|
199
|
+
}
|
|
200
|
+
export interface GrantScope {
|
|
201
|
+
/**
|
|
202
|
+
* Legacy semantic scope payload retained for wire/storage compatibility.
|
|
203
|
+
* Canonical application grants use an empty array; contracts remain available
|
|
204
|
+
* through collection resources and operation-level semantic selectors.
|
|
205
|
+
*/
|
|
206
|
+
contracts: CollectionContractDescriptor[];
|
|
207
|
+
/** New authority must be `full_collection`; `contract` is legacy-only. */
|
|
208
|
+
access: "contract" | "full_collection";
|
|
209
|
+
}
|
|
210
|
+
export interface RelayOperationRequest {
|
|
211
|
+
type: "operation_request";
|
|
212
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
213
|
+
request_id: string;
|
|
214
|
+
grant_id: string;
|
|
215
|
+
collection_id: string;
|
|
216
|
+
application_id: string;
|
|
217
|
+
operation: CollectionOperation;
|
|
218
|
+
input: unknown;
|
|
219
|
+
}
|
|
220
|
+
export type RelayOperationResponse = {
|
|
221
|
+
type: "operation_response";
|
|
222
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
223
|
+
request_id: string;
|
|
224
|
+
ok: true;
|
|
225
|
+
result: unknown;
|
|
226
|
+
} | {
|
|
227
|
+
type: "operation_response";
|
|
228
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
229
|
+
request_id: string;
|
|
230
|
+
ok: false;
|
|
231
|
+
problem: ConnectProblem;
|
|
232
|
+
};
|
|
233
|
+
export interface MdbaseOperationRequest<Input = unknown> {
|
|
234
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
235
|
+
request_id: string;
|
|
236
|
+
input: Input;
|
|
237
|
+
}
|
|
238
|
+
export type MdbaseOperationResponse<Result = unknown> = {
|
|
239
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
240
|
+
request_id: string;
|
|
241
|
+
ok: true;
|
|
242
|
+
result: Result;
|
|
243
|
+
} | {
|
|
244
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
245
|
+
request_id: string;
|
|
246
|
+
ok: false;
|
|
247
|
+
problem: ConnectProblem;
|
|
248
|
+
};
|
|
249
|
+
export interface GrantPolicy {
|
|
250
|
+
/** Complete normalized JSON evidence; never independent operation authority. */
|
|
251
|
+
application_declaration?: unknown;
|
|
252
|
+
id: string;
|
|
253
|
+
application_id: string;
|
|
254
|
+
/** Stable declaration identity bound into the exact application authorization. */
|
|
255
|
+
application_declaration_id: string;
|
|
256
|
+
/** Unprefixed SHA-256 digest of the exact approved application manifest. */
|
|
257
|
+
application_manifest_digest: string;
|
|
258
|
+
collection_id: string;
|
|
259
|
+
operations: CollectionOperation[];
|
|
260
|
+
scope: GrantScope;
|
|
261
|
+
application_name: string;
|
|
262
|
+
/** Distribution profile used when the exact application manifest was approved. */
|
|
263
|
+
application_distribution?: "web" | "portable";
|
|
264
|
+
application_homepage: string;
|
|
265
|
+
/** Informational HTTPS project page for a downloaded portable application. */
|
|
266
|
+
application_project_url?: string;
|
|
267
|
+
/** Exact browser origin authorized to use this grant over loopback. */
|
|
268
|
+
application_origin?: string;
|
|
269
|
+
application_icon?: string;
|
|
270
|
+
collection_name: string;
|
|
271
|
+
/** Approval-time criterion snapshot evaluated only by this collection authority. */
|
|
272
|
+
notification_criteria?: NotificationCriterion[];
|
|
273
|
+
created_at: string;
|
|
274
|
+
encryption?: GrantEncryption;
|
|
275
|
+
file_capability?: FileCapability;
|
|
276
|
+
application_authorization: ApplicationAuthorizationProof;
|
|
277
|
+
}
|
|
278
|
+
/** Presentation-only grant shape used outside a local authorization boundary. */
|
|
279
|
+
export type GrantSummary = Omit<GrantPolicy, "application_authorization"> & {
|
|
280
|
+
contracts: import("./compatibility.js").ConnectContractRequirements;
|
|
281
|
+
};
|
|
282
|
+
export interface GrantEncryption {
|
|
283
|
+
protocol_version: 1;
|
|
284
|
+
suite: typeof RELAY_ENCRYPTION_SUITE;
|
|
285
|
+
key_id: string;
|
|
286
|
+
scope_epoch: number;
|
|
287
|
+
connector_id: string;
|
|
288
|
+
collection_id: string;
|
|
289
|
+
application_agreement_public_key: string;
|
|
290
|
+
connector_agreement_public_key: string;
|
|
291
|
+
}
|
|
292
|
+
export interface EncryptedRelayEnvelope {
|
|
293
|
+
protocol_version: import("./compatibility.js").OperationTransportProtocolVersion;
|
|
294
|
+
suite: typeof RELAY_ENCRYPTION_SUITE;
|
|
295
|
+
request_id: string;
|
|
296
|
+
grant_id: string;
|
|
297
|
+
application_id: string;
|
|
298
|
+
connector_id: string;
|
|
299
|
+
collection_id: string;
|
|
300
|
+
operation: EncryptedRelayOperation;
|
|
301
|
+
scope_epoch: number;
|
|
302
|
+
key_id: string;
|
|
303
|
+
counter: string;
|
|
304
|
+
/** Untrusted scheduling hint; an authority may use it only to shorten work. */
|
|
305
|
+
deadline_unix_ms?: number;
|
|
306
|
+
ciphertext: string;
|
|
307
|
+
}
|
|
308
|
+
/** Encrypted control namespaces share grant authentication but not record permissions. */
|
|
309
|
+
export type EncryptedRelayOperation = CollectionOperation | "file_control";
|
|
310
|
+
export interface SyncRecord<Frontmatter extends JsonObject = JsonObject> {
|
|
311
|
+
record_id: string;
|
|
312
|
+
path: string;
|
|
313
|
+
/** Exact authoritative Markdown bytes. `revision` is the SHA-256 digest of this value. */
|
|
314
|
+
document: string;
|
|
315
|
+
revision: string;
|
|
316
|
+
/** Derived query projection. It never participates in mirror materialization. */
|
|
317
|
+
frontmatter: Frontmatter;
|
|
318
|
+
/** Derived query projection. It never participates in mirror materialization. */
|
|
319
|
+
body: string;
|
|
320
|
+
/** Derived authority projection used for scope checks. */
|
|
321
|
+
types: string[];
|
|
322
|
+
}
|
|
323
|
+
export interface SyncCollectionResources {
|
|
324
|
+
revision: string;
|
|
325
|
+
spec_version: string;
|
|
326
|
+
types: CollectionTypeDescriptor[];
|
|
327
|
+
contracts: CollectionContractDescriptor[];
|
|
328
|
+
documents?: SyncResourceDocument[];
|
|
329
|
+
}
|
|
330
|
+
export interface SyncResourceDocument {
|
|
331
|
+
path: string;
|
|
332
|
+
kind: "configuration" | "lock" | "type" | "contract" | "schema" | "view";
|
|
333
|
+
/** SHA-256 revision of the exact UTF-8 document (`sha256:<lowercase hex>`). */
|
|
334
|
+
revision: string;
|
|
335
|
+
document: string;
|
|
336
|
+
}
|
|
337
|
+
export type AuthoritySnapshotRecord<Frontmatter extends JsonObject = JsonObject> = SyncRecord<Frontmatter>;
|
|
338
|
+
export interface AuthoritySnapshot<Frontmatter extends JsonObject = JsonObject> {
|
|
339
|
+
protocol_version: 1;
|
|
340
|
+
collection_id: string;
|
|
341
|
+
source_head: number;
|
|
342
|
+
source_revision: string;
|
|
343
|
+
manifest_digest: string;
|
|
344
|
+
resources: SyncCollectionResources;
|
|
345
|
+
records: Array<AuthoritySnapshotRecord<Frontmatter>>;
|
|
346
|
+
files: CollectionFileDescriptor[];
|
|
347
|
+
}
|
|
348
|
+
export interface AuthorityImportManifest {
|
|
349
|
+
protocol_version: 1;
|
|
350
|
+
collection_id: string;
|
|
351
|
+
source_head: number;
|
|
352
|
+
source_revision: string;
|
|
353
|
+
manifest_digest: string;
|
|
354
|
+
resources: SyncCollectionResources;
|
|
355
|
+
record_count: number;
|
|
356
|
+
file_count: number;
|
|
357
|
+
files: CollectionFileDescriptor[];
|
|
358
|
+
}
|
|
359
|
+
export interface AuthorityImportRecord {
|
|
360
|
+
record_id: string;
|
|
361
|
+
path: string;
|
|
362
|
+
document: string;
|
|
363
|
+
}
|
|
364
|
+
export interface AuthorityImportSnapshot {
|
|
365
|
+
protocol_version: 1;
|
|
366
|
+
collection_id: string;
|
|
367
|
+
source_head: number;
|
|
368
|
+
source_revision: string;
|
|
369
|
+
manifest_digest: string;
|
|
370
|
+
resources: SyncCollectionResources;
|
|
371
|
+
records: AuthorityImportRecord[];
|
|
372
|
+
files: CollectionFileDescriptor[];
|
|
373
|
+
}
|
|
374
|
+
export interface AuthorityImportRecordPage {
|
|
375
|
+
protocol_version: 1;
|
|
376
|
+
page: number;
|
|
377
|
+
records: AuthorityImportRecord[];
|
|
378
|
+
}
|
|
379
|
+
export interface SyncSession {
|
|
380
|
+
protocol_version: 1;
|
|
381
|
+
/** Exact-document prerelease v1. Missing or different profiles are incompatible. */
|
|
382
|
+
protocol_profile: "exact_document_v1";
|
|
383
|
+
session_id: string;
|
|
384
|
+
replica_id: string;
|
|
385
|
+
collection_id: string;
|
|
386
|
+
mode: "read_only" | "read_write";
|
|
387
|
+
scope_epoch: number;
|
|
388
|
+
retained_after: number;
|
|
389
|
+
head: number;
|
|
390
|
+
snapshot_id: string;
|
|
391
|
+
resources: SyncCollectionResources;
|
|
392
|
+
}
|
|
393
|
+
export interface SyncSnapshotPage<Frontmatter extends JsonObject = JsonObject> {
|
|
394
|
+
protocol_version: 1;
|
|
395
|
+
snapshot_id: string;
|
|
396
|
+
scope_epoch: number;
|
|
397
|
+
cursor: number;
|
|
398
|
+
records: Array<SyncSnapshotRecord<Frontmatter>>;
|
|
399
|
+
next_page?: string;
|
|
400
|
+
}
|
|
401
|
+
export type SyncSnapshotRecord<Frontmatter extends JsonObject = JsonObject> = SyncRecord<Frontmatter>;
|
|
402
|
+
/** Manifest-only snapshot page. File bytes are fetched by digest via the file data plane. */
|
|
403
|
+
export interface SyncFileSnapshotPage {
|
|
404
|
+
protocol_version: 1;
|
|
405
|
+
type: "file_snapshot_page";
|
|
406
|
+
snapshot_id: string;
|
|
407
|
+
scope_epoch: number;
|
|
408
|
+
cursor: number;
|
|
409
|
+
files: CollectionFileDescriptor[];
|
|
410
|
+
next_page?: string;
|
|
411
|
+
}
|
|
412
|
+
export type SyncChange<Frontmatter extends JsonObject = JsonObject> = {
|
|
413
|
+
sequence: number;
|
|
414
|
+
type: "put";
|
|
415
|
+
record: SyncRecord<Frontmatter>;
|
|
416
|
+
} | {
|
|
417
|
+
sequence: number;
|
|
418
|
+
type: "remove";
|
|
419
|
+
record_id: string;
|
|
420
|
+
previous_path: string;
|
|
421
|
+
revision: string;
|
|
422
|
+
} | {
|
|
423
|
+
sequence: number;
|
|
424
|
+
type: "file_put";
|
|
425
|
+
file: CollectionFileDescriptor;
|
|
426
|
+
} | {
|
|
427
|
+
sequence: number;
|
|
428
|
+
type: "file_remove";
|
|
429
|
+
file_id: string;
|
|
430
|
+
previous_path: string;
|
|
431
|
+
revision: string;
|
|
432
|
+
};
|
|
433
|
+
export interface SyncChangesPage<Frontmatter extends JsonObject = JsonObject> {
|
|
434
|
+
protocol_version: 1;
|
|
435
|
+
scope_epoch: number;
|
|
436
|
+
events: Array<SyncChange<Frontmatter>>;
|
|
437
|
+
cursor: number;
|
|
438
|
+
head: number;
|
|
439
|
+
has_more: boolean;
|
|
440
|
+
reset_required: boolean;
|
|
441
|
+
}
|
|
442
|
+
interface SyncMutationBase {
|
|
443
|
+
mutation_id: string;
|
|
444
|
+
replica_id: string;
|
|
445
|
+
scope_epoch: number;
|
|
446
|
+
record_id: string;
|
|
447
|
+
created_at: string;
|
|
448
|
+
causal_predecessor?: string;
|
|
449
|
+
}
|
|
450
|
+
export type SyncMutation = (SyncMutationBase & {
|
|
451
|
+
operation: "put";
|
|
452
|
+
/** Omitted only when creating this stable identity. */
|
|
453
|
+
base_revision?: string;
|
|
454
|
+
path: string;
|
|
455
|
+
document: string;
|
|
456
|
+
}) | (SyncMutationBase & {
|
|
457
|
+
operation: "move";
|
|
458
|
+
base_revision: string;
|
|
459
|
+
path: string;
|
|
460
|
+
}) | (SyncMutationBase & {
|
|
461
|
+
operation: "delete";
|
|
462
|
+
base_revision: string;
|
|
463
|
+
});
|
|
464
|
+
interface SyncFileMutationBase {
|
|
465
|
+
mutation_id: string;
|
|
466
|
+
replica_id: string;
|
|
467
|
+
scope_epoch: number;
|
|
468
|
+
file_id: string;
|
|
469
|
+
created_at: string;
|
|
470
|
+
causal_predecessor?: string;
|
|
471
|
+
}
|
|
472
|
+
export type SyncFileMutation = (SyncFileMutationBase & {
|
|
473
|
+
operation: "file_put";
|
|
474
|
+
base_revision?: string;
|
|
475
|
+
path: string;
|
|
476
|
+
transfer_id: string;
|
|
477
|
+
content_digest: `sha256:${string}`;
|
|
478
|
+
size: number;
|
|
479
|
+
media_type?: string;
|
|
480
|
+
}) | (SyncFileMutationBase & {
|
|
481
|
+
operation: "file_move";
|
|
482
|
+
base_revision: string;
|
|
483
|
+
path: string;
|
|
484
|
+
update_references: boolean;
|
|
485
|
+
}) | (SyncFileMutationBase & {
|
|
486
|
+
operation: "file_delete";
|
|
487
|
+
base_revision: string;
|
|
488
|
+
});
|
|
489
|
+
export interface SyncConflict<Frontmatter extends JsonObject = JsonObject> {
|
|
490
|
+
record_id: string;
|
|
491
|
+
mutation: SyncMutation;
|
|
492
|
+
current?: SyncRecord<Frontmatter>;
|
|
493
|
+
current_revision?: string;
|
|
494
|
+
}
|
|
495
|
+
export type SyncMutationReceipt<Frontmatter extends JsonObject = JsonObject> = {
|
|
496
|
+
mutation_id: string;
|
|
497
|
+
status: "applied" | "previously_applied";
|
|
498
|
+
sequence: number;
|
|
499
|
+
record?: SyncRecord<Frontmatter>;
|
|
500
|
+
} | {
|
|
501
|
+
mutation_id: string;
|
|
502
|
+
status: "conflicted";
|
|
503
|
+
conflict: SyncConflict<Frontmatter>;
|
|
504
|
+
} | {
|
|
505
|
+
mutation_id: string;
|
|
506
|
+
status: "rejected";
|
|
507
|
+
error: {
|
|
508
|
+
code: string;
|
|
509
|
+
message: string;
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
export interface SyncFileConflict {
|
|
513
|
+
file_id: string;
|
|
514
|
+
mutation: SyncFileMutation;
|
|
515
|
+
current?: CollectionFileDescriptor;
|
|
516
|
+
current_revision?: string;
|
|
517
|
+
}
|
|
518
|
+
export type SyncFileMutationReceipt = {
|
|
519
|
+
mutation_id: string;
|
|
520
|
+
status: "file_applied" | "file_previously_applied";
|
|
521
|
+
sequence: number;
|
|
522
|
+
file?: CollectionFileDescriptor;
|
|
523
|
+
} | {
|
|
524
|
+
mutation_id: string;
|
|
525
|
+
status: "file_conflicted";
|
|
526
|
+
conflict: SyncFileConflict;
|
|
527
|
+
} | {
|
|
528
|
+
mutation_id: string;
|
|
529
|
+
status: "file_rejected";
|
|
530
|
+
error: {
|
|
531
|
+
code: string;
|
|
532
|
+
message: string;
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
export type EncryptedRelayOperationRequest = EncryptedRelayEnvelope & {
|
|
536
|
+
type: "encrypted_operation_request";
|
|
537
|
+
};
|
|
538
|
+
export type EncryptedRelayOperationResponse = EncryptedRelayEnvelope & {
|
|
539
|
+
type: "encrypted_operation_response";
|
|
540
|
+
};
|
|
541
|
+
export interface RelayPolicySnapshot {
|
|
542
|
+
type: "policy_snapshot";
|
|
543
|
+
protocol_version: 1;
|
|
544
|
+
request_id: string;
|
|
545
|
+
revision: string;
|
|
546
|
+
/** Lease fields are absent on legacy N-1 grants-only snapshots. */
|
|
547
|
+
connector_id?: string;
|
|
548
|
+
sequence?: number;
|
|
549
|
+
lease_issued_at_ms?: number;
|
|
550
|
+
lease_expires_at_ms?: number;
|
|
551
|
+
grants: GrantPolicy[];
|
|
552
|
+
}
|
|
553
|
+
export interface RelayHello {
|
|
554
|
+
type: "relay_hello";
|
|
555
|
+
protocol_version: 1;
|
|
556
|
+
connector_version: string;
|
|
557
|
+
capabilities: string[];
|
|
558
|
+
contract_support: import("./compatibility.js").ConnectContractSupport;
|
|
559
|
+
}
|
|
560
|
+
export interface RelayWelcome {
|
|
561
|
+
type: "relay_welcome";
|
|
562
|
+
protocol_version: 1;
|
|
563
|
+
session_id: string;
|
|
564
|
+
capabilities: string[];
|
|
565
|
+
contract_support: import("./compatibility.js").ConnectContractSupport;
|
|
566
|
+
}
|
|
567
|
+
export interface RelayIncompatible {
|
|
568
|
+
type: "relay_incompatible";
|
|
569
|
+
protocol_version: 1;
|
|
570
|
+
code: "connector_upgrade_required" | "transport_protocol_incompatible" | "authorization_binding_incompatible" | "capability_contract_incompatible" | "durable_mutation_unsupported";
|
|
571
|
+
message: string;
|
|
572
|
+
details?: import("./connect-problems.generated.js").ConnectProblemDetailsByCode["transport_protocol_incompatible" | "authorization_binding_incompatible" | "capability_contract_incompatible" | "durable_mutation_unsupported"];
|
|
573
|
+
minimum_connector_version: string;
|
|
574
|
+
update_url: string;
|
|
575
|
+
}
|
|
576
|
+
export interface RelayPolicyApplied {
|
|
577
|
+
type: "policy_applied";
|
|
578
|
+
protocol_version: 1;
|
|
579
|
+
request_id: string;
|
|
580
|
+
revision: string;
|
|
581
|
+
ok: boolean;
|
|
582
|
+
error?: {
|
|
583
|
+
code: string;
|
|
584
|
+
message: string;
|
|
585
|
+
details?: unknown;
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
export interface ProtocolUsageReport {
|
|
589
|
+
type: "protocol_usage_report";
|
|
590
|
+
protocol_version: 1;
|
|
591
|
+
entries: Array<{
|
|
592
|
+
axis: "operation_transport";
|
|
593
|
+
version: number;
|
|
594
|
+
count: number;
|
|
595
|
+
}>;
|
|
596
|
+
}
|
|
597
|
+
export interface AuthorizationCollectionOffer {
|
|
598
|
+
collection_id: string;
|
|
599
|
+
display_name: string;
|
|
600
|
+
spec_version: string;
|
|
601
|
+
contracts: CollectionContractDescriptor[];
|
|
602
|
+
/** Minimal schema metadata; type source and collection paths never leave the authority. */
|
|
603
|
+
types: CollectionTypeDescriptor[];
|
|
604
|
+
}
|
|
605
|
+
export interface AuthorizationOfferResponse {
|
|
606
|
+
type: "authorization_offer_response";
|
|
607
|
+
protocol_version: 1;
|
|
608
|
+
request_id: string;
|
|
609
|
+
paused: boolean;
|
|
610
|
+
collections: AuthorizationCollectionOffer[];
|
|
611
|
+
}
|
|
612
|
+
export interface AuthorizationActivationResponse {
|
|
613
|
+
type: "authorization_activation_response";
|
|
614
|
+
protocol_version: 1;
|
|
615
|
+
request_id: string;
|
|
616
|
+
ok: boolean;
|
|
617
|
+
contracts: CollectionContractDescriptor[];
|
|
618
|
+
/** Exact setup plan applied by the authority. */
|
|
619
|
+
contract_setups: ContractSetupChoice[];
|
|
620
|
+
setup_assessment?: unknown;
|
|
621
|
+
provision_receipt?: unknown;
|
|
622
|
+
error?: {
|
|
623
|
+
code: string;
|
|
624
|
+
message: string;
|
|
625
|
+
details?: unknown;
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
export interface ConnectorCollection {
|
|
629
|
+
id: string;
|
|
630
|
+
display_name: string;
|
|
631
|
+
spec_version: string;
|
|
632
|
+
enabled: boolean;
|
|
633
|
+
contracts: CollectionContractDescriptor[];
|
|
634
|
+
}
|
|
635
|
+
export type JsonObject = Record<string, unknown>;
|
|
636
|
+
export interface MdbaseDiagnostic {
|
|
637
|
+
[key: string]: unknown;
|
|
638
|
+
severity: "error" | "warning" | "info";
|
|
639
|
+
code: string;
|
|
640
|
+
message: string;
|
|
641
|
+
path?: string;
|
|
642
|
+
field?: string;
|
|
643
|
+
type?: string;
|
|
644
|
+
schema_location?: string;
|
|
645
|
+
details?: unknown;
|
|
646
|
+
}
|
|
647
|
+
export interface MdbaseOperationEnvelope<Result = JsonObject> {
|
|
648
|
+
valid: boolean;
|
|
649
|
+
result: Result;
|
|
650
|
+
diagnostics: MdbaseDiagnostic[];
|
|
651
|
+
}
|
|
652
|
+
export interface SavedViewPresentation extends JsonObject {
|
|
653
|
+
type: string;
|
|
654
|
+
fallback?: string;
|
|
655
|
+
mappings?: Record<string, string>;
|
|
656
|
+
options?: JsonObject;
|
|
657
|
+
}
|
|
658
|
+
export interface SavedViewSource {
|
|
659
|
+
path: string;
|
|
660
|
+
format: string;
|
|
661
|
+
revision: string;
|
|
662
|
+
writable: boolean;
|
|
663
|
+
}
|
|
664
|
+
export interface SavedNamedView {
|
|
665
|
+
id: string;
|
|
666
|
+
name: string;
|
|
667
|
+
properties: SavedViewProperty[];
|
|
668
|
+
presentation?: SavedViewPresentation;
|
|
669
|
+
}
|
|
670
|
+
export interface SavedViewProperty {
|
|
671
|
+
key: string;
|
|
672
|
+
label?: string;
|
|
673
|
+
description?: string;
|
|
674
|
+
format?: string;
|
|
675
|
+
hidden?: boolean;
|
|
676
|
+
}
|
|
677
|
+
export interface SavedViewDocument {
|
|
678
|
+
id: string;
|
|
679
|
+
name: string;
|
|
680
|
+
source: SavedViewSource;
|
|
681
|
+
views: SavedNamedView[];
|
|
682
|
+
}
|
|
683
|
+
export interface SavedViewList {
|
|
684
|
+
views: SavedViewDocument[];
|
|
685
|
+
meta: {
|
|
686
|
+
total_count: number;
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
export interface SavedViewSourceDocument {
|
|
690
|
+
path: string;
|
|
691
|
+
format: string;
|
|
692
|
+
revision: string;
|
|
693
|
+
document: string;
|
|
694
|
+
}
|
|
695
|
+
export interface ReadViewSourceInput {
|
|
696
|
+
path: string;
|
|
697
|
+
}
|
|
698
|
+
export interface CreateViewSourceInput {
|
|
699
|
+
document: string;
|
|
700
|
+
path?: string;
|
|
701
|
+
format?: string;
|
|
702
|
+
name?: string;
|
|
703
|
+
}
|
|
704
|
+
export interface UpdateViewSourceInput {
|
|
705
|
+
path: string;
|
|
706
|
+
document: string;
|
|
707
|
+
if_revision?: string;
|
|
708
|
+
}
|
|
709
|
+
export interface DeleteViewSourceInput {
|
|
710
|
+
path: string;
|
|
711
|
+
if_revision?: string;
|
|
712
|
+
}
|
|
713
|
+
export interface DeleteViewSourceResult {
|
|
714
|
+
path: string;
|
|
715
|
+
deleted: boolean;
|
|
716
|
+
}
|
|
717
|
+
export interface ExecuteViewInput {
|
|
718
|
+
path: string;
|
|
719
|
+
view: string;
|
|
720
|
+
timezone?: string;
|
|
721
|
+
context?: {
|
|
722
|
+
path: string;
|
|
723
|
+
} | null;
|
|
724
|
+
limit?: number;
|
|
725
|
+
offset?: number;
|
|
726
|
+
/** Opaque, single-use token returned for the next snapshot-pinned page. */
|
|
727
|
+
cursor?: string;
|
|
728
|
+
render?: boolean;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* A saved-view row always includes the canonical frontmatter used to evaluate
|
|
732
|
+
* the view. Empty-frontmatter Markdown is represented by an empty object.
|
|
733
|
+
*/
|
|
734
|
+
export interface SavedViewRecord<Frontmatter extends JsonObject = JsonObject> extends Omit<QueryRecord<Frontmatter>, "effective_frontmatter"> {
|
|
735
|
+
effective_frontmatter: Frontmatter;
|
|
736
|
+
values?: JsonObject;
|
|
737
|
+
}
|
|
738
|
+
export interface SavedViewExecution<Frontmatter extends JsonObject = JsonObject> {
|
|
739
|
+
results: Array<SavedViewRecord<Frontmatter>>;
|
|
740
|
+
meta: {
|
|
741
|
+
total_count: number;
|
|
742
|
+
has_more: boolean;
|
|
743
|
+
cursor?: string;
|
|
744
|
+
view: {
|
|
745
|
+
path: string;
|
|
746
|
+
id: string;
|
|
747
|
+
};
|
|
748
|
+
context?: {
|
|
749
|
+
path: string;
|
|
750
|
+
};
|
|
751
|
+
groups?: Array<{
|
|
752
|
+
values: JsonObject;
|
|
753
|
+
count: number;
|
|
754
|
+
summaries: JsonObject;
|
|
755
|
+
}>;
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
export interface CollectionFileMetadata extends JsonObject {
|
|
759
|
+
name: string;
|
|
760
|
+
folder: string;
|
|
761
|
+
size: number;
|
|
762
|
+
mtime: string;
|
|
763
|
+
tags?: string[];
|
|
764
|
+
links?: unknown[];
|
|
765
|
+
embeds?: unknown[];
|
|
766
|
+
}
|
|
767
|
+
export interface DataContractViewIdentity {
|
|
768
|
+
id: string;
|
|
769
|
+
version: string;
|
|
770
|
+
digest: string;
|
|
771
|
+
type: string;
|
|
772
|
+
implementation_digest: string;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* A projected query row. Frontmatter members are optional because
|
|
776
|
+
* `frontmatter_mode` selects which fixed-semantics representation is returned.
|
|
777
|
+
*/
|
|
778
|
+
export interface QueryRecord<Frontmatter extends JsonObject = JsonObject> {
|
|
779
|
+
path: string;
|
|
780
|
+
frontmatter?: Frontmatter;
|
|
781
|
+
effective_frontmatter?: Frontmatter;
|
|
782
|
+
body?: string;
|
|
783
|
+
types: string[];
|
|
784
|
+
file: Partial<CollectionFileMetadata> & {
|
|
785
|
+
path?: string;
|
|
786
|
+
};
|
|
787
|
+
/** Present when the authority returned a normalized contract projection. */
|
|
788
|
+
contract?: DataContractViewIdentity;
|
|
789
|
+
}
|
|
790
|
+
/** An authoritative record or a field-limited data-contract projection. */
|
|
791
|
+
export interface RecordDocument<Frontmatter extends JsonObject = JsonObject> {
|
|
792
|
+
path: string;
|
|
793
|
+
revision: string;
|
|
794
|
+
types: string[];
|
|
795
|
+
frontmatter: Frontmatter;
|
|
796
|
+
effective_frontmatter: Frontmatter;
|
|
797
|
+
/** Omitted from contract-scoped results. */
|
|
798
|
+
body?: string;
|
|
799
|
+
/**
|
|
800
|
+
* The exact UTF-8 Markdown source, including frontmatter delimiters,
|
|
801
|
+
* comments, quoting, whitespace, line endings, and trailing newline.
|
|
802
|
+
* Returned only when the operation requests it.
|
|
803
|
+
*/
|
|
804
|
+
document?: string;
|
|
805
|
+
file: Partial<CollectionFileMetadata> & {
|
|
806
|
+
path?: string;
|
|
807
|
+
};
|
|
808
|
+
/** Present when the authority returned a normalized contract projection. */
|
|
809
|
+
contract?: DataContractViewIdentity;
|
|
810
|
+
}
|
|
811
|
+
export interface CollectionTypeDescriptor {
|
|
812
|
+
name: string;
|
|
813
|
+
version?: number;
|
|
814
|
+
description?: string;
|
|
815
|
+
/** Digest of the exact type source used as a setup precondition. */
|
|
816
|
+
revision?: string;
|
|
817
|
+
/** Collection-relative source path. */
|
|
818
|
+
path?: string;
|
|
819
|
+
/** Complete portable type frontmatter, including extension declarations. */
|
|
820
|
+
definition?: JsonObject;
|
|
821
|
+
schema: JsonObject;
|
|
822
|
+
collection?: JsonObject;
|
|
823
|
+
lifecycle?: JsonObject;
|
|
824
|
+
extensions: Record<string, unknown>;
|
|
825
|
+
}
|
|
826
|
+
export interface CollectionTypeDocument {
|
|
827
|
+
name: string;
|
|
828
|
+
path: string;
|
|
829
|
+
revision: string;
|
|
830
|
+
document: string;
|
|
831
|
+
}
|
|
832
|
+
export interface CollectionContractDescriptor {
|
|
833
|
+
/** Collection operations expose only record contracts. */
|
|
834
|
+
contract_type: "record";
|
|
835
|
+
id: string;
|
|
836
|
+
version: string;
|
|
837
|
+
/** Digest of the resolved contract schemas and metadata. */
|
|
838
|
+
digest: string;
|
|
839
|
+
/** Resolved portable record-view schema. */
|
|
840
|
+
schema: JsonObject;
|
|
841
|
+
/** Resolved implementation-binding schema, when the contract declares one. */
|
|
842
|
+
binding_schema?: JsonObject;
|
|
843
|
+
/** Every type currently implementing this exact contract, sorted by type name. */
|
|
844
|
+
implementations: CollectionContractImplementationDescriptor[];
|
|
845
|
+
}
|
|
846
|
+
export interface CollectionContractImplementationDescriptor {
|
|
847
|
+
type_name: string;
|
|
848
|
+
type_version: number;
|
|
849
|
+
type_path?: string;
|
|
850
|
+
/** Digest of the contract digest, type schema, fields, and binding. */
|
|
851
|
+
digest: string;
|
|
852
|
+
fields: Record<string, string>;
|
|
853
|
+
binding?: JsonObject;
|
|
854
|
+
}
|
|
855
|
+
export interface CollectionDescription {
|
|
856
|
+
protocol_version: 1;
|
|
857
|
+
collection_id: string;
|
|
858
|
+
display_name: string;
|
|
859
|
+
spec_version: string;
|
|
860
|
+
operations: CollectionOperation[];
|
|
861
|
+
change_cursor: number;
|
|
862
|
+
types: CollectionTypeDescriptor[];
|
|
863
|
+
contracts: CollectionContractDescriptor[];
|
|
864
|
+
/** Canonical collection settings; extension and implementation-specific values are omitted. */
|
|
865
|
+
configuration?: JsonObject;
|
|
866
|
+
}
|
|
867
|
+
export interface CollectionChange {
|
|
868
|
+
cursor: number;
|
|
869
|
+
type: string;
|
|
870
|
+
occurred_at: string;
|
|
871
|
+
payload: JsonObject;
|
|
872
|
+
}
|
|
873
|
+
export interface CollectionChangesPage {
|
|
874
|
+
events: CollectionChange[];
|
|
875
|
+
cursor: number;
|
|
876
|
+
has_more: boolean;
|
|
877
|
+
reset: boolean;
|
|
878
|
+
}
|