@mdbase-dev/connect 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/README.md +696 -0
- package/dist/advanced.d.ts +9 -0
- package/dist/advanced.js +6 -0
- package/dist/application-contract.d.ts +22 -0
- package/dist/application-contract.js +75 -0
- package/dist/application-identity.d.ts +34 -0
- package/dist/application-identity.js +148 -0
- package/dist/application-session.d.ts +167 -0
- package/dist/application-session.js +722 -0
- package/dist/async.d.ts +1 -0
- package/dist/async.js +19 -0
- package/dist/authority-proof.d.ts +3 -0
- package/dist/authority-proof.js +24 -0
- package/dist/authority-sync-request.d.ts +3 -0
- package/dist/authority-sync-request.js +20 -0
- package/dist/authorization-refresh.d.ts +14 -0
- package/dist/authorization-refresh.js +41 -0
- package/dist/authorization-types.d.ts +7 -0
- package/dist/authorization-types.js +1 -0
- package/dist/authorization-url.d.ts +5 -0
- package/dist/authorization-url.js +34 -0
- package/dist/base64.d.ts +3 -0
- package/dist/base64.js +21 -0
- package/dist/browser/integrity.json +4 -0
- package/dist/browser/mdbase-connect.min.js +3 -0
- package/dist/browser/mdbase-connect.min.js.sha384 +1 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +5 -0
- package/dist/capabilities.d.ts +24 -0
- package/dist/capabilities.js +91 -0
- package/dist/collection-client.d.ts +66 -0
- package/dist/collection-client.js +686 -0
- package/dist/connect-authorization-helpers.d.ts +4 -0
- package/dist/connect-authorization-helpers.js +25 -0
- package/dist/connect-options.d.ts +35 -0
- package/dist/connect-options.js +1 -0
- package/dist/connect.d.ts +66 -0
- package/dist/connect.js +711 -0
- package/dist/connection-file-transport.d.ts +34 -0
- package/dist/connection-file-transport.js +85 -0
- package/dist/connection-index.d.ts +3 -0
- package/dist/connection-index.js +20 -0
- package/dist/connection-notifications.d.ts +31 -0
- package/dist/connection-notifications.js +197 -0
- package/dist/connection-transport-internals.d.ts +24 -0
- package/dist/connection-transport-internals.js +1 -0
- package/dist/connection-transport.d.ts +64 -0
- package/dist/connection-transport.js +725 -0
- package/dist/connection-types.d.ts +38 -0
- package/dist/connection-types.js +1 -0
- package/dist/connection.d.ts +175 -0
- package/dist/connection.js +606 -0
- package/dist/crypto-entry.d.ts +7 -0
- package/dist/crypto-entry.js +4 -0
- package/dist/crypto.d.ts +63 -0
- package/dist/crypto.js +409 -0
- package/dist/direct-access.d.ts +3 -0
- package/dist/direct-access.js +29 -0
- package/dist/errors.d.ts +45 -0
- package/dist/errors.js +142 -0
- package/dist/external-store.d.ts +10 -0
- package/dist/external-store.js +10 -0
- package/dist/file-crypto.d.ts +25 -0
- package/dist/file-crypto.js +132 -0
- package/dist/file-sha256.d.ts +12 -0
- package/dist/file-sha256.js +143 -0
- package/dist/file-stream-source.d.ts +17 -0
- package/dist/file-stream-source.js +157 -0
- package/dist/file-transfer-internals.d.ts +23 -0
- package/dist/file-transfer-internals.js +228 -0
- package/dist/files.d.ts +115 -0
- package/dist/files.js +563 -0
- package/dist/fresh-encrypted-request.d.ts +4 -0
- package/dist/fresh-encrypted-request.js +28 -0
- package/dist/grant-key-leases.d.ts +24 -0
- package/dist/grant-key-leases.js +144 -0
- package/dist/hosted-file-request.d.ts +6 -0
- package/dist/hosted-file-request.js +63 -0
- package/dist/hosted-operation-response.d.ts +5 -0
- package/dist/hosted-operation-response.js +26 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +10 -0
- package/dist/internal-types.d.ts +100 -0
- package/dist/internal-types.js +1 -0
- package/dist/local-file-transport.d.ts +37 -0
- package/dist/local-file-transport.js +457 -0
- package/dist/mdbase-connect.d.ts +28 -0
- package/dist/mdbase-connect.js +53 -0
- package/dist/notifications.d.ts +48 -0
- package/dist/notifications.js +52 -0
- package/dist/operation-helpers.d.ts +27 -0
- package/dist/operation-helpers.js +144 -0
- package/dist/operation-types.d.ts +707 -0
- package/dist/operation-types.js +1 -0
- package/dist/outcomes.d.ts +51 -0
- package/dist/outcomes.js +194 -0
- package/dist/pending-mutation-store.d.ts +13 -0
- package/dist/pending-mutation-store.js +64 -0
- package/dist/pending-recovery-transports.d.ts +5 -0
- package/dist/pending-recovery-transports.js +52 -0
- package/dist/popup-authorization.d.ts +31 -0
- package/dist/popup-authorization.js +100 -0
- package/dist/query-pagination.d.ts +6 -0
- package/dist/query-pagination.js +119 -0
- package/dist/request-budget.d.ts +34 -0
- package/dist/request-budget.js +104 -0
- package/dist/request-coordinator.d.ts +29 -0
- package/dist/request-coordinator.js +213 -0
- package/dist/retired-grant-keys.d.ts +9 -0
- package/dist/retired-grant-keys.js +56 -0
- package/dist/runtime-utils.d.ts +52 -0
- package/dist/runtime-utils.js +368 -0
- package/dist/saved-view-pagination.d.ts +6 -0
- package/dist/saved-view-pagination.js +76 -0
- package/dist/selection.d.ts +48 -0
- package/dist/selection.js +112 -0
- package/dist/session.d.ts +114 -0
- package/dist/session.js +569 -0
- package/dist/shared-operation.d.ts +7 -0
- package/dist/shared-operation.js +41 -0
- package/dist/stored-token.d.ts +10 -0
- package/dist/stored-token.js +64 -0
- package/dist/structured-readiness.d.ts +77 -0
- package/dist/structured-readiness.js +126 -0
- package/dist/token-response.d.ts +12 -0
- package/dist/token-response.js +81 -0
- package/dist/transient-retry.d.ts +22 -0
- package/dist/transient-retry.js +59 -0
- package/dist/watch-policy.d.ts +8 -0
- package/dist/watch-policy.js +12 -0
- package/package.json +51 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import type { CollectionOperation, ConnectProblem, ContractRequirement, JsonObject, MutationOperationIdentifier, TypePackProvision } from "@mdbase-dev/connect-protocol";
|
|
2
|
+
export interface MdbaseDesiredTimer {
|
|
3
|
+
/** Stable within the timer namespace. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** RFC 3339 instant at which the authority should fire the timer. */
|
|
6
|
+
fireAt: string;
|
|
7
|
+
/** Private application data retained by the collection authority. */
|
|
8
|
+
data?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface MdbaseTimer extends MdbaseDesiredTimer {
|
|
11
|
+
criterionId: string;
|
|
12
|
+
generation: number;
|
|
13
|
+
status: "scheduled" | "firing" | "fired" | "cancelled";
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
firedAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface MdbaseTimerList {
|
|
19
|
+
namespace: string;
|
|
20
|
+
timers: MdbaseTimer[];
|
|
21
|
+
}
|
|
22
|
+
export interface MdbaseTimerReconciliation extends MdbaseTimerList {
|
|
23
|
+
cancelledIds: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface ReadInput {
|
|
26
|
+
path: string;
|
|
27
|
+
/** Select an exact approved contract view when more than one is possible. */
|
|
28
|
+
contract?: DataContractSelector;
|
|
29
|
+
/** Include the exact UTF-8 Markdown source; requires full-collection access. */
|
|
30
|
+
includeDocument?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface DataContractSelector {
|
|
33
|
+
id: string;
|
|
34
|
+
version: string;
|
|
35
|
+
/** Required when several approved types implement the selected contract. */
|
|
36
|
+
type?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CollectionFileMetadata extends JsonObject {
|
|
39
|
+
name: string;
|
|
40
|
+
folder: string;
|
|
41
|
+
size: number;
|
|
42
|
+
mtime: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
links?: unknown[];
|
|
45
|
+
embeds?: unknown[];
|
|
46
|
+
}
|
|
47
|
+
export interface DataContractViewIdentity {
|
|
48
|
+
id: string;
|
|
49
|
+
version: string;
|
|
50
|
+
digest: string;
|
|
51
|
+
type: string;
|
|
52
|
+
implementationDigest: string;
|
|
53
|
+
}
|
|
54
|
+
export interface QueryRecord<Frontmatter extends JsonObject = JsonObject> {
|
|
55
|
+
path: string;
|
|
56
|
+
frontmatter?: Frontmatter;
|
|
57
|
+
effectiveFrontmatter?: Frontmatter;
|
|
58
|
+
body?: string;
|
|
59
|
+
types: string[];
|
|
60
|
+
file: Partial<CollectionFileMetadata> & {
|
|
61
|
+
path?: string;
|
|
62
|
+
};
|
|
63
|
+
contract?: DataContractViewIdentity;
|
|
64
|
+
}
|
|
65
|
+
export interface RecordDocument<Frontmatter extends JsonObject = JsonObject> {
|
|
66
|
+
path: string;
|
|
67
|
+
revision: string;
|
|
68
|
+
types: string[];
|
|
69
|
+
frontmatter: Frontmatter;
|
|
70
|
+
effectiveFrontmatter: Frontmatter;
|
|
71
|
+
body?: string;
|
|
72
|
+
document?: string;
|
|
73
|
+
file: Partial<CollectionFileMetadata> & {
|
|
74
|
+
path?: string;
|
|
75
|
+
};
|
|
76
|
+
contract?: DataContractViewIdentity;
|
|
77
|
+
}
|
|
78
|
+
export interface CollectionTypeDescriptor {
|
|
79
|
+
name: string;
|
|
80
|
+
version?: number;
|
|
81
|
+
description?: string;
|
|
82
|
+
revision?: string;
|
|
83
|
+
path?: string;
|
|
84
|
+
definition?: JsonObject;
|
|
85
|
+
schema: JsonObject;
|
|
86
|
+
collection?: JsonObject;
|
|
87
|
+
lifecycle?: JsonObject;
|
|
88
|
+
extensions: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
export interface CollectionContractImplementationDescriptor {
|
|
91
|
+
typeName: string;
|
|
92
|
+
typeVersion: number;
|
|
93
|
+
typePath?: string;
|
|
94
|
+
digest: string;
|
|
95
|
+
fields: Record<string, string>;
|
|
96
|
+
binding?: JsonObject;
|
|
97
|
+
}
|
|
98
|
+
export interface CollectionContractDescriptor {
|
|
99
|
+
contractType: "record";
|
|
100
|
+
id: string;
|
|
101
|
+
version: string;
|
|
102
|
+
digest: string;
|
|
103
|
+
schema: JsonObject;
|
|
104
|
+
bindingSchema?: JsonObject;
|
|
105
|
+
implementations: CollectionContractImplementationDescriptor[];
|
|
106
|
+
}
|
|
107
|
+
export interface CollectionDescription {
|
|
108
|
+
protocolVersion: 1;
|
|
109
|
+
collectionId: string;
|
|
110
|
+
displayName: string;
|
|
111
|
+
specVersion: string;
|
|
112
|
+
operations: CollectionOperation[];
|
|
113
|
+
changeCursor: number;
|
|
114
|
+
types: CollectionTypeDescriptor[];
|
|
115
|
+
contracts: CollectionContractDescriptor[];
|
|
116
|
+
configuration?: JsonObject;
|
|
117
|
+
}
|
|
118
|
+
export interface QueryProjection {
|
|
119
|
+
expression: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface QuerySelectionExpression {
|
|
123
|
+
name: string;
|
|
124
|
+
expression: string;
|
|
125
|
+
label?: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface QueryOrder {
|
|
129
|
+
field: string;
|
|
130
|
+
direction?: "asc" | "desc";
|
|
131
|
+
}
|
|
132
|
+
export interface QuerySummary {
|
|
133
|
+
field: string;
|
|
134
|
+
function: string;
|
|
135
|
+
name?: string;
|
|
136
|
+
label?: string;
|
|
137
|
+
}
|
|
138
|
+
/** Application-facing form of the canonical mdbase v0.3 query schema. */
|
|
139
|
+
export interface QueryInput {
|
|
140
|
+
/**
|
|
141
|
+
* Queries using a semantic contract view accept only `types`, `timezone`,
|
|
142
|
+
* pagination, `frontmatterMode`, and `contract`; filter normalized fields in
|
|
143
|
+
* the app.
|
|
144
|
+
*/
|
|
145
|
+
types?: string[];
|
|
146
|
+
/** IANA timezone used for calendar semantics in this invocation. */
|
|
147
|
+
timezone?: string;
|
|
148
|
+
context?: {
|
|
149
|
+
this: {
|
|
150
|
+
path: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
projections?: Record<string, QueryProjection>;
|
|
154
|
+
where?: string;
|
|
155
|
+
select?: Array<string | QuerySelectionExpression>;
|
|
156
|
+
orderBy?: QueryOrder[];
|
|
157
|
+
groupBy?: QueryOrder[];
|
|
158
|
+
summaryFunctions?: Record<string, QueryProjection>;
|
|
159
|
+
summaries?: QuerySummary[];
|
|
160
|
+
limit?: number;
|
|
161
|
+
offset?: number;
|
|
162
|
+
/** Request generation-pinned cursor pagination from a supporting authority. */
|
|
163
|
+
pagination?: "cursor";
|
|
164
|
+
/** Opaque, single-use token returned for the next generation-pinned page. */
|
|
165
|
+
cursor?: string;
|
|
166
|
+
/** Legacy stable-query token used by older authorities. */
|
|
167
|
+
snapshot?: string;
|
|
168
|
+
includeBody?: boolean;
|
|
169
|
+
frontmatterMode?: "effective" | "persisted" | "both";
|
|
170
|
+
/** Select one exact semantic contract/provider view for this query. */
|
|
171
|
+
contract?: DataContractSelector;
|
|
172
|
+
}
|
|
173
|
+
export interface QueryResult<Record extends JsonObject = JsonObject> {
|
|
174
|
+
results: Array<QueryRecord<Record>>;
|
|
175
|
+
meta?: {
|
|
176
|
+
/** Exact total when it is available within the page summary budget. */
|
|
177
|
+
totalCount?: number;
|
|
178
|
+
/** Typed successful outcome when exact counting is deferred for paging. */
|
|
179
|
+
totalCountOutcome?: {
|
|
180
|
+
status: "deferred";
|
|
181
|
+
budget: "eager_summary_rows";
|
|
182
|
+
limit: number;
|
|
183
|
+
};
|
|
184
|
+
hasMore: boolean;
|
|
185
|
+
cursor?: string;
|
|
186
|
+
snapshot?: string;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export interface QueryPagesOptions<Record extends JsonObject = JsonObject> {
|
|
190
|
+
/** Initial page size. Cursor authorities pin this size for the query lifetime. */
|
|
191
|
+
firstPageSize?: number;
|
|
192
|
+
/** Also sets the initial size unless firstPageSize is explicit; authorities may cap it. */
|
|
193
|
+
pageSize?: number;
|
|
194
|
+
signal?: AbortSignal;
|
|
195
|
+
/** Independent budget for each page requested by this caller-driven iterator. */
|
|
196
|
+
pageTimeoutMs?: number | null;
|
|
197
|
+
coordination?: RequestCoordinationOptions;
|
|
198
|
+
onProgress?: (page: QueryPage<Record>) => void;
|
|
199
|
+
}
|
|
200
|
+
export interface QueryAllOptions<Record extends JsonObject = JsonObject> extends ConnectRequestOptions {
|
|
201
|
+
/** Initial page size. Cursor authorities pin this size for the query lifetime. */
|
|
202
|
+
firstPageSize?: number;
|
|
203
|
+
/** Also sets the initial size unless firstPageSize is explicit; authorities may cap it. */
|
|
204
|
+
pageSize?: number;
|
|
205
|
+
onProgress?: (page: QueryPage<Record>) => void;
|
|
206
|
+
}
|
|
207
|
+
export interface QueryPage<Record extends JsonObject = JsonObject> {
|
|
208
|
+
results: QueryResult<Record>["results"];
|
|
209
|
+
meta?: QueryResult<Record>["meta"];
|
|
210
|
+
page: number;
|
|
211
|
+
offset: number;
|
|
212
|
+
loaded: number;
|
|
213
|
+
complete: boolean;
|
|
214
|
+
/** Opaque token for the next page while this iterator remains open. */
|
|
215
|
+
cursor?: string;
|
|
216
|
+
snapshot?: string;
|
|
217
|
+
}
|
|
218
|
+
export interface ConnectRequestOptions {
|
|
219
|
+
signal?: AbortSignal;
|
|
220
|
+
/** Relative request budget. `null` deliberately disables the SDK default. */
|
|
221
|
+
timeoutMs?: number | null;
|
|
222
|
+
/** Optional coordination for replaceable reads on this selected connection. */
|
|
223
|
+
coordination?: RequestCoordinationOptions;
|
|
224
|
+
}
|
|
225
|
+
export interface RequestCoordinationOptions {
|
|
226
|
+
/**
|
|
227
|
+
* Stable UI/request family. Required when `latestWins` is enabled; a newer
|
|
228
|
+
* request in the same family cancels the older read or query.
|
|
229
|
+
*/
|
|
230
|
+
family?: string;
|
|
231
|
+
/** Explicitly cancel older work in this family. Mutations never allow this. */
|
|
232
|
+
latestWins?: boolean;
|
|
233
|
+
/** Disable automatic coalescing of identical signal-free reads. */
|
|
234
|
+
coalesce?: boolean;
|
|
235
|
+
}
|
|
236
|
+
export interface MutationEstimate {
|
|
237
|
+
/** Records whose links may be affected, excluding the record being mutated. */
|
|
238
|
+
affectedRecords: number;
|
|
239
|
+
/** Estimated atomic changes: the mutation itself plus known reference updates. */
|
|
240
|
+
totalUnits: number;
|
|
241
|
+
warnings: number;
|
|
242
|
+
}
|
|
243
|
+
export type MutationProgressState = "preflighting" | "ready" | "applying" | "completed" | "cancelled";
|
|
244
|
+
export interface MutationProgress {
|
|
245
|
+
operation: "rename" | "delete";
|
|
246
|
+
state: MutationProgressState;
|
|
247
|
+
elapsedMs: number;
|
|
248
|
+
cancellable: boolean;
|
|
249
|
+
resumed: boolean;
|
|
250
|
+
completedUnits: number;
|
|
251
|
+
estimate?: MutationEstimate;
|
|
252
|
+
}
|
|
253
|
+
export interface MutationProgressOptions extends ConnectRequestOptions {
|
|
254
|
+
onProgress?: (progress: MutationProgress) => void;
|
|
255
|
+
}
|
|
256
|
+
export interface RenameProgressOptions extends MutationProgressOptions {
|
|
257
|
+
/** Reuse an authoritative preview already shown to the user. */
|
|
258
|
+
preflight?: RenamePreflightResult;
|
|
259
|
+
}
|
|
260
|
+
export interface DeleteProgressOptions extends MutationProgressOptions {
|
|
261
|
+
/** Reuse an authoritative preview already shown to the user. */
|
|
262
|
+
preflight?: DeletePreflightResult;
|
|
263
|
+
}
|
|
264
|
+
export interface PendingMutationSummary {
|
|
265
|
+
requestId: string;
|
|
266
|
+
operation: MutationOperationIdentifier;
|
|
267
|
+
fingerprint: string;
|
|
268
|
+
status: "pending" | "recovering" | "outcome_unknown";
|
|
269
|
+
createdAt: string;
|
|
270
|
+
}
|
|
271
|
+
export interface PendingMutation<Result = unknown> extends PendingMutationSummary {
|
|
272
|
+
recover(options?: ConnectRequestOptions): Promise<import("./outcomes.js").ConnectOutcome<Result>>;
|
|
273
|
+
}
|
|
274
|
+
export interface CreateInput<Frontmatter extends JsonObject = JsonObject> {
|
|
275
|
+
path?: string;
|
|
276
|
+
type?: string;
|
|
277
|
+
contract?: DataContractSelector;
|
|
278
|
+
frontmatter?: Partial<Frontmatter> & JsonObject;
|
|
279
|
+
/** Requires full-collection access; contract creates are frontmatter-only. */
|
|
280
|
+
body?: string;
|
|
281
|
+
ifRevision?: string;
|
|
282
|
+
/** Include the resulting exact Markdown source in `result.document`. */
|
|
283
|
+
includeDocument?: boolean;
|
|
284
|
+
}
|
|
285
|
+
interface UpdateInputBase {
|
|
286
|
+
path: string;
|
|
287
|
+
contract?: DataContractSelector;
|
|
288
|
+
ifRevision?: string;
|
|
289
|
+
/** Include the resulting exact Markdown source; requires full-collection access. */
|
|
290
|
+
includeDocument?: boolean;
|
|
291
|
+
}
|
|
292
|
+
export type UpdateInput<Frontmatter extends JsonObject = JsonObject> = UpdateInputBase & ({
|
|
293
|
+
patch: Partial<Frontmatter> & JsonObject;
|
|
294
|
+
body?: string;
|
|
295
|
+
document?: never;
|
|
296
|
+
} | {
|
|
297
|
+
/**
|
|
298
|
+
* Replace the complete Markdown source. This is mutually exclusive with
|
|
299
|
+
* `patch` and `body`, and implies `includeDocument`.
|
|
300
|
+
*/
|
|
301
|
+
document: string;
|
|
302
|
+
patch?: never;
|
|
303
|
+
body?: never;
|
|
304
|
+
});
|
|
305
|
+
export interface DeleteInput {
|
|
306
|
+
path: string;
|
|
307
|
+
contract?: DataContractSelector;
|
|
308
|
+
checkBacklinks?: boolean;
|
|
309
|
+
ifRevision?: string;
|
|
310
|
+
}
|
|
311
|
+
export interface DeleteResult {
|
|
312
|
+
path: string;
|
|
313
|
+
deleted: boolean;
|
|
314
|
+
brokenLinks?: Array<{
|
|
315
|
+
path: string;
|
|
316
|
+
}>;
|
|
317
|
+
}
|
|
318
|
+
export interface DeletePreflightResult {
|
|
319
|
+
path: string;
|
|
320
|
+
deleted: false;
|
|
321
|
+
dryRun: true;
|
|
322
|
+
wouldDelete: true;
|
|
323
|
+
brokenLinks?: Array<{
|
|
324
|
+
path: string;
|
|
325
|
+
}>;
|
|
326
|
+
}
|
|
327
|
+
export interface RenameInput {
|
|
328
|
+
from: string;
|
|
329
|
+
to: string;
|
|
330
|
+
contract?: DataContractSelector;
|
|
331
|
+
updateRefs?: boolean;
|
|
332
|
+
ifRevision?: string;
|
|
333
|
+
/** Include the resulting exact Markdown source in `result.document`. */
|
|
334
|
+
includeDocument?: boolean;
|
|
335
|
+
}
|
|
336
|
+
export interface RenameResult extends RecordDocument {
|
|
337
|
+
from: string;
|
|
338
|
+
to: string;
|
|
339
|
+
referencesUpdated?: JsonObject[];
|
|
340
|
+
}
|
|
341
|
+
export interface RenamePreflightResult {
|
|
342
|
+
from: string;
|
|
343
|
+
to: string;
|
|
344
|
+
dryRun: true;
|
|
345
|
+
wouldRename: true;
|
|
346
|
+
referencesAffected?: Array<{
|
|
347
|
+
path: string;
|
|
348
|
+
field?: string;
|
|
349
|
+
location?: string;
|
|
350
|
+
}>;
|
|
351
|
+
warnings?: Array<{
|
|
352
|
+
path: string;
|
|
353
|
+
message: string;
|
|
354
|
+
}>;
|
|
355
|
+
}
|
|
356
|
+
export interface ReadTypeInput {
|
|
357
|
+
name?: string;
|
|
358
|
+
path?: string;
|
|
359
|
+
}
|
|
360
|
+
export interface CreateTypeInput {
|
|
361
|
+
document: string;
|
|
362
|
+
path?: string;
|
|
363
|
+
}
|
|
364
|
+
export interface UpdateTypeInput extends ReadTypeInput {
|
|
365
|
+
document: string;
|
|
366
|
+
ifRevision: string;
|
|
367
|
+
}
|
|
368
|
+
export interface ReadViewSourceInput {
|
|
369
|
+
path: string;
|
|
370
|
+
}
|
|
371
|
+
export interface CreateViewSourceInput {
|
|
372
|
+
document: string;
|
|
373
|
+
path?: string;
|
|
374
|
+
format?: string;
|
|
375
|
+
name?: string;
|
|
376
|
+
}
|
|
377
|
+
export interface UpdateViewSourceInput {
|
|
378
|
+
path: string;
|
|
379
|
+
document: string;
|
|
380
|
+
ifRevision?: string;
|
|
381
|
+
}
|
|
382
|
+
export interface DeleteViewSourceInput {
|
|
383
|
+
path: string;
|
|
384
|
+
ifRevision?: string;
|
|
385
|
+
}
|
|
386
|
+
export interface DeleteViewSourceResult {
|
|
387
|
+
path: string;
|
|
388
|
+
deleted: boolean;
|
|
389
|
+
}
|
|
390
|
+
export interface ExecuteViewInput {
|
|
391
|
+
path: string;
|
|
392
|
+
view: string;
|
|
393
|
+
/** IANA timezone used for calendar semantics in this invocation. */
|
|
394
|
+
timezone?: string;
|
|
395
|
+
context?: {
|
|
396
|
+
path: string;
|
|
397
|
+
} | null;
|
|
398
|
+
limit?: number;
|
|
399
|
+
offset?: number;
|
|
400
|
+
/** Opaque, single-use token returned for the next snapshot-pinned page. */
|
|
401
|
+
cursor?: string;
|
|
402
|
+
render?: boolean;
|
|
403
|
+
}
|
|
404
|
+
export interface SavedViewPagesOptions<Frontmatter extends JsonObject = JsonObject> {
|
|
405
|
+
firstPageSize?: number;
|
|
406
|
+
pageSize?: number;
|
|
407
|
+
signal?: AbortSignal;
|
|
408
|
+
/** Independent budget for each page requested by this caller-driven iterator. */
|
|
409
|
+
pageTimeoutMs?: number | null;
|
|
410
|
+
coordination?: RequestCoordinationOptions;
|
|
411
|
+
onProgress?: (page: SavedViewPage<Frontmatter>) => void;
|
|
412
|
+
}
|
|
413
|
+
export interface SavedViewPresentation extends JsonObject {
|
|
414
|
+
type: string;
|
|
415
|
+
fallback?: string;
|
|
416
|
+
mappings?: Record<string, string>;
|
|
417
|
+
options?: JsonObject;
|
|
418
|
+
}
|
|
419
|
+
export interface SavedViewSource {
|
|
420
|
+
path: string;
|
|
421
|
+
format: string;
|
|
422
|
+
revision: string;
|
|
423
|
+
writable: boolean;
|
|
424
|
+
}
|
|
425
|
+
export interface SavedViewProperty {
|
|
426
|
+
key: string;
|
|
427
|
+
label?: string;
|
|
428
|
+
description?: string;
|
|
429
|
+
format?: string;
|
|
430
|
+
hidden?: boolean;
|
|
431
|
+
}
|
|
432
|
+
export interface SavedNamedView {
|
|
433
|
+
id: string;
|
|
434
|
+
name: string;
|
|
435
|
+
properties: SavedViewProperty[];
|
|
436
|
+
presentation?: SavedViewPresentation;
|
|
437
|
+
}
|
|
438
|
+
export interface SavedViewDocument {
|
|
439
|
+
id: string;
|
|
440
|
+
name: string;
|
|
441
|
+
source: SavedViewSource;
|
|
442
|
+
views: SavedNamedView[];
|
|
443
|
+
}
|
|
444
|
+
export interface SavedViewList {
|
|
445
|
+
views: SavedViewDocument[];
|
|
446
|
+
meta: {
|
|
447
|
+
totalCount: number;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
export interface SavedViewSourceDocument {
|
|
451
|
+
path: string;
|
|
452
|
+
format: string;
|
|
453
|
+
revision: string;
|
|
454
|
+
document: string;
|
|
455
|
+
}
|
|
456
|
+
export interface SavedViewRecord<Frontmatter extends JsonObject = JsonObject> extends Omit<QueryRecord<Frontmatter>, "effectiveFrontmatter"> {
|
|
457
|
+
effectiveFrontmatter: Frontmatter;
|
|
458
|
+
values?: JsonObject;
|
|
459
|
+
}
|
|
460
|
+
export interface SavedViewExecution<Frontmatter extends JsonObject = JsonObject> {
|
|
461
|
+
results: Array<SavedViewRecord<Frontmatter>>;
|
|
462
|
+
meta: {
|
|
463
|
+
totalCount: number;
|
|
464
|
+
hasMore: boolean;
|
|
465
|
+
cursor?: string;
|
|
466
|
+
view: {
|
|
467
|
+
path: string;
|
|
468
|
+
id: string;
|
|
469
|
+
};
|
|
470
|
+
context?: {
|
|
471
|
+
path: string;
|
|
472
|
+
};
|
|
473
|
+
groups?: Array<{
|
|
474
|
+
values: JsonObject;
|
|
475
|
+
count: number;
|
|
476
|
+
summaries: JsonObject;
|
|
477
|
+
}>;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
export interface SavedViewPage<Frontmatter extends JsonObject = JsonObject> extends SavedViewExecution<Frontmatter> {
|
|
481
|
+
page: number;
|
|
482
|
+
offset: number;
|
|
483
|
+
loaded: number;
|
|
484
|
+
complete: boolean;
|
|
485
|
+
/** Opaque token for the next page while this iterator remains open. */
|
|
486
|
+
cursor?: string;
|
|
487
|
+
}
|
|
488
|
+
export type ContractSetupChoice = {
|
|
489
|
+
contract: ContractRequirement;
|
|
490
|
+
mode: "starter";
|
|
491
|
+
} | {
|
|
492
|
+
contract: ContractRequirement;
|
|
493
|
+
mode: "existing";
|
|
494
|
+
typeName: string;
|
|
495
|
+
typeRevision: string;
|
|
496
|
+
fields: Record<string, string>;
|
|
497
|
+
binding?: Record<string, unknown>;
|
|
498
|
+
};
|
|
499
|
+
export interface TypePackResourceDiff {
|
|
500
|
+
source: string;
|
|
501
|
+
target: string;
|
|
502
|
+
kind: "contract" | "type" | "schema";
|
|
503
|
+
mode: "managed" | "seed";
|
|
504
|
+
action: "create" | "update" | "delete" | "adopt" | "unchanged" | "preserve" | "conflict";
|
|
505
|
+
digest: string;
|
|
506
|
+
currentDigest?: string;
|
|
507
|
+
installedDigest?: string;
|
|
508
|
+
adoptedFromDigest?: string;
|
|
509
|
+
reason?: string;
|
|
510
|
+
}
|
|
511
|
+
export interface TypePackReceipt {
|
|
512
|
+
id: string;
|
|
513
|
+
version: string;
|
|
514
|
+
digest: string;
|
|
515
|
+
installedBy: string;
|
|
516
|
+
resources: Array<Omit<TypePackResourceDiff, "action" | "currentDigest" | "installedDigest" | "reason">>;
|
|
517
|
+
}
|
|
518
|
+
export interface TypePackAssessment {
|
|
519
|
+
status: "current" | "install" | "upgrade" | "downgrade" | "reconfigure" | "conflict";
|
|
520
|
+
applicable: boolean;
|
|
521
|
+
assessmentDigest: string;
|
|
522
|
+
current?: TypePackReceipt;
|
|
523
|
+
desired: TypePackReceipt;
|
|
524
|
+
resources: TypePackResourceDiff[];
|
|
525
|
+
lock: {
|
|
526
|
+
target: "mdbase.lock.yaml";
|
|
527
|
+
action: "create" | "update" | "unchanged";
|
|
528
|
+
digest: string;
|
|
529
|
+
};
|
|
530
|
+
contractSetups: {
|
|
531
|
+
choices: ContractSetupChoice[];
|
|
532
|
+
resources: TypePackResourceDiff[];
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
export interface TypePackApplyResult extends TypePackAssessment {
|
|
536
|
+
receipt: TypePackReceipt;
|
|
537
|
+
cleanupDeferred: boolean;
|
|
538
|
+
}
|
|
539
|
+
export type ConfigurationContributionValue = string | number | boolean | null;
|
|
540
|
+
export interface ConfigurationRequirement {
|
|
541
|
+
id: string;
|
|
542
|
+
path: string;
|
|
543
|
+
predicate: "contains";
|
|
544
|
+
value: ConfigurationContributionValue;
|
|
545
|
+
}
|
|
546
|
+
export interface ConfigurationProvision {
|
|
547
|
+
requirement: string;
|
|
548
|
+
operation: "set_add";
|
|
549
|
+
path: string;
|
|
550
|
+
value: ConfigurationContributionValue;
|
|
551
|
+
}
|
|
552
|
+
export interface ApplicationCollectionSetupRequirements {
|
|
553
|
+
configuration: ConfigurationRequirement[];
|
|
554
|
+
}
|
|
555
|
+
export interface ApplicationCollectionSetupProvisions {
|
|
556
|
+
configuration: ConfigurationProvision[];
|
|
557
|
+
typePacks: TypePackProvision[];
|
|
558
|
+
}
|
|
559
|
+
export interface ConfigurationSetupConflict {
|
|
560
|
+
code: "configuration_path_conflict" | "configuration_type_conflict";
|
|
561
|
+
path: string;
|
|
562
|
+
expected: "mapping" | "sequence";
|
|
563
|
+
observed: "null" | "boolean" | "number" | "string" | "sequence" | "mapping" | "tagged";
|
|
564
|
+
message: string;
|
|
565
|
+
}
|
|
566
|
+
export interface ConfigurationSetupAssessment {
|
|
567
|
+
requirement: string;
|
|
568
|
+
path: string;
|
|
569
|
+
value: ConfigurationContributionValue;
|
|
570
|
+
action: "current" | "add" | "conflict";
|
|
571
|
+
conflict?: ConfigurationSetupConflict;
|
|
572
|
+
}
|
|
573
|
+
export interface CollectionSetupAssessment {
|
|
574
|
+
status: "current" | "provision" | "conflict";
|
|
575
|
+
applicable: boolean;
|
|
576
|
+
applicationId: string;
|
|
577
|
+
declarationDigest: string;
|
|
578
|
+
provisionDigest: string;
|
|
579
|
+
collectionRevision: string;
|
|
580
|
+
finalCollectionRevision: string;
|
|
581
|
+
baselineDiagnosticCount: number;
|
|
582
|
+
finalDiagnosticCount: number;
|
|
583
|
+
resolvedDiagnosticCount: number;
|
|
584
|
+
introducedDiagnosticCount: number;
|
|
585
|
+
baselineDiagnosticDigest: string;
|
|
586
|
+
configuration: ConfigurationSetupAssessment[];
|
|
587
|
+
typePacks: TypePackAssessment[];
|
|
588
|
+
finalResourceRevisions: Record<string, string>;
|
|
589
|
+
assessmentDigest: string;
|
|
590
|
+
}
|
|
591
|
+
export interface CollectionSetupReceipt {
|
|
592
|
+
applicationId: string;
|
|
593
|
+
declarationDigest: string;
|
|
594
|
+
provisionDigest: string;
|
|
595
|
+
assessmentDigest: string;
|
|
596
|
+
collectionRevision: string;
|
|
597
|
+
configuration: Array<{
|
|
598
|
+
requirement: string;
|
|
599
|
+
path: string;
|
|
600
|
+
value: ConfigurationContributionValue;
|
|
601
|
+
}>;
|
|
602
|
+
typePacks: TypePackReceipt[];
|
|
603
|
+
cleanupDeferred: boolean;
|
|
604
|
+
}
|
|
605
|
+
export interface CollectionSetupApplyResult {
|
|
606
|
+
assessment: CollectionSetupAssessment;
|
|
607
|
+
receipt: CollectionSetupReceipt;
|
|
608
|
+
}
|
|
609
|
+
export interface AssessTypePackInput {
|
|
610
|
+
provision: TypePackProvision;
|
|
611
|
+
installedBy: string;
|
|
612
|
+
adoptResources?: Record<string, string>;
|
|
613
|
+
preserveSeedTargets?: string[];
|
|
614
|
+
targetOverrides?: Record<string, string>;
|
|
615
|
+
contractSetups?: ContractSetupChoice[];
|
|
616
|
+
}
|
|
617
|
+
export interface ApplyTypePackInput extends AssessTypePackInput {
|
|
618
|
+
expectedAssessmentDigest: string;
|
|
619
|
+
allowDowngrade?: boolean;
|
|
620
|
+
}
|
|
621
|
+
export interface AssessCollectionSetupInput {
|
|
622
|
+
applicationId: string;
|
|
623
|
+
declarationDigest: string;
|
|
624
|
+
requirements: ApplicationCollectionSetupRequirements;
|
|
625
|
+
provisions: ApplicationCollectionSetupProvisions;
|
|
626
|
+
contractSetups?: ContractSetupChoice[];
|
|
627
|
+
/** Digest-pinned consent to adopt unmanaged managed resources, keyed by pack id and target. */
|
|
628
|
+
typePackAdoptions?: Record<string, Record<string, string>>;
|
|
629
|
+
}
|
|
630
|
+
export interface ApplyCollectionSetupInput extends AssessCollectionSetupInput {
|
|
631
|
+
expectedAssessmentDigest: string;
|
|
632
|
+
expectedCollectionRevision: string;
|
|
633
|
+
expectedProvisionDigest: string;
|
|
634
|
+
allowTypePackDowngrades?: string[];
|
|
635
|
+
}
|
|
636
|
+
export interface ChangesInput {
|
|
637
|
+
after?: number;
|
|
638
|
+
limit?: number;
|
|
639
|
+
}
|
|
640
|
+
export interface WatchOptions {
|
|
641
|
+
cursor?: number;
|
|
642
|
+
pollIntervalMs?: number;
|
|
643
|
+
signal?: AbortSignal;
|
|
644
|
+
/** Per-poll/reconnect budget. null deliberately disables the SDK default. */
|
|
645
|
+
timeoutMs?: number | null;
|
|
646
|
+
/** Set to false to surface transient transport failures immediately. */
|
|
647
|
+
retry?: false | WatchRetryOptions;
|
|
648
|
+
onStatus?: (status: WatchStatus) => void;
|
|
649
|
+
}
|
|
650
|
+
export interface WatchRetryOptions {
|
|
651
|
+
initialDelayMs?: number;
|
|
652
|
+
maxDelayMs?: number;
|
|
653
|
+
multiplier?: number;
|
|
654
|
+
/** Number of consecutive transient failures. Omit to keep reconnecting. */
|
|
655
|
+
maxAttempts?: number;
|
|
656
|
+
}
|
|
657
|
+
export type WatchStatus = {
|
|
658
|
+
state: "connecting";
|
|
659
|
+
cursor?: number;
|
|
660
|
+
} | {
|
|
661
|
+
state: "connected";
|
|
662
|
+
cursor: number;
|
|
663
|
+
recovered: boolean;
|
|
664
|
+
} | {
|
|
665
|
+
state: "reconnecting";
|
|
666
|
+
cursor?: number;
|
|
667
|
+
attempt: number;
|
|
668
|
+
retryInMs: number;
|
|
669
|
+
problem: ConnectProblem;
|
|
670
|
+
} | {
|
|
671
|
+
state: "reset_required";
|
|
672
|
+
cursor: number;
|
|
673
|
+
problem: ConnectProblem<"change_cursor_reset">;
|
|
674
|
+
} | {
|
|
675
|
+
state: "closed";
|
|
676
|
+
cursor?: number;
|
|
677
|
+
};
|
|
678
|
+
export interface WatchInput {
|
|
679
|
+
cursor?: number;
|
|
680
|
+
pollIntervalMs?: number;
|
|
681
|
+
retry?: false | WatchRetryOptions;
|
|
682
|
+
/** Cancels the subscription lifetime after bounded startup succeeds. */
|
|
683
|
+
lifetimeSignal?: AbortSignal;
|
|
684
|
+
}
|
|
685
|
+
export interface MdbaseWatchSubscription {
|
|
686
|
+
readonly status: WatchStatus;
|
|
687
|
+
readonly problem: ConnectProblem | null;
|
|
688
|
+
subscribe(listener: (change: CollectionChange) => void, onStatus?: (status: WatchStatus) => void, onProblem?: (problem: ConnectProblem) => void): () => void;
|
|
689
|
+
close(): void;
|
|
690
|
+
}
|
|
691
|
+
export interface CollectionChange {
|
|
692
|
+
cursor: number;
|
|
693
|
+
type: string;
|
|
694
|
+
occurredAt: string;
|
|
695
|
+
payload: JsonObject;
|
|
696
|
+
}
|
|
697
|
+
export interface CollectionChangesPage {
|
|
698
|
+
events: CollectionChange[];
|
|
699
|
+
cursor: number;
|
|
700
|
+
hasMore: boolean;
|
|
701
|
+
reset: boolean;
|
|
702
|
+
}
|
|
703
|
+
/** Provider-neutral operation transport used by the typed collection client. */
|
|
704
|
+
export interface MdbaseCollectionTransport {
|
|
705
|
+
operation<Result>(operation: CollectionOperation, input: unknown, options?: ConnectRequestOptions): Promise<Result>;
|
|
706
|
+
}
|
|
707
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|