mindoodb-app-sdk 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -1
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +83 -7
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3931 -8
- package/dist/{types-nFt-aryL.d.ts → types-CQt2ObMu.d.ts} +110 -2
- package/package.json +2 -1
|
@@ -295,13 +295,36 @@ interface MindooDBAppRichTextBlockSpan {
|
|
|
295
295
|
value: Record<string, MindooDBAppRichTextMaterializeValue>;
|
|
296
296
|
}
|
|
297
297
|
type MindooDBAppRichTextSpan = MindooDBAppRichTextTextSpan | MindooDBAppRichTextBlockSpan;
|
|
298
|
+
interface MindooDBAppRichTextMarkRange {
|
|
299
|
+
index: number;
|
|
300
|
+
length: number;
|
|
301
|
+
marks: Record<string, MindooDBAppRichTextMaterializeValue>;
|
|
302
|
+
}
|
|
303
|
+
interface MindooDBAppRichTextSpliceStep {
|
|
304
|
+
type: "splice";
|
|
305
|
+
index: number;
|
|
306
|
+
deleteCount: number;
|
|
307
|
+
insert?: string;
|
|
308
|
+
marks?: MindooDBAppRichTextMarkRange[];
|
|
309
|
+
}
|
|
310
|
+
type MindooDBAppRichTextStep = MindooDBAppRichTextSpliceStep;
|
|
311
|
+
interface MindooDBAppRichTextStepPatch {
|
|
312
|
+
/** Path to the Automerge rich-text field inside the document payload. */
|
|
313
|
+
path: Array<string | number>;
|
|
314
|
+
/** Automerge heads of the document state these positional steps were based on. */
|
|
315
|
+
baseHeads?: string[];
|
|
316
|
+
/** Ordered rich-text positional operations to apply with Automerge splice/mark. */
|
|
317
|
+
steps: MindooDBAppRichTextStep[];
|
|
318
|
+
}
|
|
298
319
|
interface MindooDBAppRichTextPatch {
|
|
299
320
|
/** Path to the Automerge rich-text field inside the document payload. */
|
|
300
321
|
path: Array<string | number>;
|
|
301
322
|
/** Automerge heads of the document state this rich-text snapshot was based on. */
|
|
302
323
|
baseHeads?: string[];
|
|
303
324
|
/** Full JSON-safe span snapshot to apply with Automerge `updateSpans`. */
|
|
304
|
-
spans
|
|
325
|
+
spans?: MindooDBAppRichTextSpan[];
|
|
326
|
+
/** Ordered snapshots to apply one-by-one so each `updateSpans` diff stays transaction-sized. */
|
|
327
|
+
spansSequence?: MindooDBAppRichTextSpan[][];
|
|
305
328
|
/** Optional Automerge `updateSpans` configuration, kept JSON-safe over the bridge. */
|
|
306
329
|
updateSpansConfig?: Record<string, unknown>;
|
|
307
330
|
}
|
|
@@ -314,6 +337,43 @@ interface MindooDBAppRichTextGetOptions {
|
|
|
314
337
|
/** Stable revision id previously obtained from `documents.listHistory()`. */
|
|
315
338
|
revisionId?: MindooDBAppDocumentRevisionId;
|
|
316
339
|
}
|
|
340
|
+
/** Binary Automerge snapshot of the full internal document. */
|
|
341
|
+
interface MindooDBAppAutomergeSnapshot {
|
|
342
|
+
binary: Uint8Array;
|
|
343
|
+
heads: string[];
|
|
344
|
+
}
|
|
345
|
+
interface MindooDBAppAutomergeGetOptions {
|
|
346
|
+
/** Stable revision id previously obtained from `documents.listHistory()`. */
|
|
347
|
+
revisionId?: MindooDBAppDocumentRevisionId;
|
|
348
|
+
}
|
|
349
|
+
/** Raw Automerge change bytes produced by a local replica. */
|
|
350
|
+
interface MindooDBAppAutomergeChangesPatch {
|
|
351
|
+
/** Heads the client had when authoring `changes`; optional, for correlation only. */
|
|
352
|
+
baseHeads?: string[];
|
|
353
|
+
/**
|
|
354
|
+
* Heads of the local replica after authoring `changes`. When provided, the
|
|
355
|
+
* apply response includes `changesSince` for incremental reconciliation.
|
|
356
|
+
*/
|
|
357
|
+
replicaHeads?: string[];
|
|
358
|
+
/** Change bytes from `Automerge.getChangesSince`; merged into Haven's current doc. */
|
|
359
|
+
changes: Uint8Array[];
|
|
360
|
+
}
|
|
361
|
+
/** Incremental catch-up bytes for a local replica after an apply merge. */
|
|
362
|
+
interface MindooDBAppAutomergeChangesSince {
|
|
363
|
+
/** Echo of `replicaHeads` from the request. */
|
|
364
|
+
sinceHeads: string[];
|
|
365
|
+
/** Changes on the merged canonical doc that the replica is missing. */
|
|
366
|
+
changes: Uint8Array[];
|
|
367
|
+
}
|
|
368
|
+
interface MindooDBAppAutomergePatchResult {
|
|
369
|
+
document: MindooDBAppDocument;
|
|
370
|
+
heads: string[];
|
|
371
|
+
/**
|
|
372
|
+
* Present when the request included `replicaHeads`. Apply locally with
|
|
373
|
+
* `Automerge.applyChanges` instead of reloading a full snapshot.
|
|
374
|
+
*/
|
|
375
|
+
changesSince?: MindooDBAppAutomergeChangesSince;
|
|
376
|
+
}
|
|
317
377
|
/**
|
|
318
378
|
* Sets the value at `path` inside the document payload.
|
|
319
379
|
*
|
|
@@ -356,6 +416,33 @@ interface MindooDBAppJsonListDeletePatch {
|
|
|
356
416
|
index: number;
|
|
357
417
|
deleteCount: number;
|
|
358
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Splices text at `path` using Automerge text semantics.
|
|
421
|
+
*/
|
|
422
|
+
interface MindooDBAppJsonTextSplicePatch {
|
|
423
|
+
path: Array<string | number>;
|
|
424
|
+
index: number;
|
|
425
|
+
deleteCount: number;
|
|
426
|
+
insert?: string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Applies one or more marks to a text range at `path`.
|
|
430
|
+
*/
|
|
431
|
+
interface MindooDBAppJsonTextMarkPatch {
|
|
432
|
+
path: Array<string | number>;
|
|
433
|
+
index: number;
|
|
434
|
+
length: number;
|
|
435
|
+
marks: Record<string, MindooDBAppRichTextMaterializeValue>;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Removes marks from a text range at `path`.
|
|
439
|
+
*/
|
|
440
|
+
interface MindooDBAppJsonTextUnmarkPatch {
|
|
441
|
+
path: Array<string | number>;
|
|
442
|
+
index: number;
|
|
443
|
+
length: number;
|
|
444
|
+
names: string[];
|
|
445
|
+
}
|
|
359
446
|
interface MindooDBAppJsonPatch {
|
|
360
447
|
/**
|
|
361
448
|
* Automerge heads of the document snapshot this JSON patch was authored
|
|
@@ -367,6 +454,9 @@ interface MindooDBAppJsonPatch {
|
|
|
367
454
|
unset?: MindooDBAppJsonUnsetPatch[];
|
|
368
455
|
listInsert?: MindooDBAppJsonListInsertPatch[];
|
|
369
456
|
listDelete?: MindooDBAppJsonListDeletePatch[];
|
|
457
|
+
textSplice?: MindooDBAppJsonTextSplicePatch[];
|
|
458
|
+
textMark?: MindooDBAppJsonTextMarkPatch[];
|
|
459
|
+
textUnmark?: MindooDBAppJsonTextUnmarkPatch[];
|
|
370
460
|
}
|
|
371
461
|
/**
|
|
372
462
|
* Sparse patch payload used when updating an existing document.
|
|
@@ -386,6 +476,8 @@ interface MindooDBAppUpdateDocumentInput {
|
|
|
386
476
|
text?: MindooDBAppTextPatch[];
|
|
387
477
|
/** Rich-text span snapshots to apply at document paths. */
|
|
388
478
|
richText?: MindooDBAppRichTextPatch[];
|
|
479
|
+
/** Rich-text positional steps to apply at document paths. */
|
|
480
|
+
richTextSteps?: MindooDBAppRichTextStepPatch[];
|
|
389
481
|
}
|
|
390
482
|
/** Query used for history lookups at a specific timestamp. */
|
|
391
483
|
interface MindooDBAppHistoryQuery {
|
|
@@ -600,6 +692,22 @@ interface MindooDBAppDocumentApi {
|
|
|
600
692
|
getHeadCursor(): Promise<MindooDBAppDocumentHeadCursorResult>;
|
|
601
693
|
get(docId: string): Promise<MindooDBAppDocument | null>;
|
|
602
694
|
getRichText(docId: string, path: Array<string | number>, options?: MindooDBAppRichTextGetOptions): Promise<MindooDBAppRichTextSnapshot>;
|
|
695
|
+
/**
|
|
696
|
+
* Export the full internal Automerge document as binary.
|
|
697
|
+
*
|
|
698
|
+
* **Discouraged** — prefer `getRichText`, `get`, and `documents.update` (`set`,
|
|
699
|
+
* `unset`, `text`, `richText`, `json`) unless those APIs cannot express your
|
|
700
|
+
* edits. Added for TeamEdit Word/.docx (local Automerge replica + binary flush).
|
|
701
|
+
*/
|
|
702
|
+
getAutomergeSnapshot(docId: string, options?: MindooDBAppAutomergeGetOptions): Promise<MindooDBAppAutomergeSnapshot>;
|
|
703
|
+
/**
|
|
704
|
+
* Merge raw Automerge change bytes into the canonical document on Haven.
|
|
705
|
+
*
|
|
706
|
+
* **Discouraged** — prefer `documents.update` patch operations. Escape hatch
|
|
707
|
+
* for apps that host a local Automerge replica when JSON patches are insufficient.
|
|
708
|
+
* Include `replicaHeads` to receive incremental `changesSince` in the response.
|
|
709
|
+
*/
|
|
710
|
+
applyAutomergeChanges(docId: string, patch: MindooDBAppAutomergeChangesPatch): Promise<MindooDBAppAutomergePatchResult>;
|
|
603
711
|
create(input: MindooDBAppCreateDocumentInput): Promise<MindooDBAppDocument>;
|
|
604
712
|
update(docId: string, patch: MindooDBAppUpdateDocumentInput): Promise<MindooDBAppDocument>;
|
|
605
713
|
delete(docId: string): Promise<{
|
|
@@ -777,4 +885,4 @@ interface MindooDBAppBridge {
|
|
|
777
885
|
connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
|
|
778
886
|
}
|
|
779
887
|
|
|
780
|
-
export type {
|
|
888
|
+
export type { MindooDBAppCreateDocumentInput as $, MindooDBAppBridgeStreamAck as A, MindooDBAppBridgeStreamCloseRequest as B, MindooDBAppBridgeStreamError as C, MindooDBAppBridgeStreamMessage as D, MindooDBAppBridgeStreamOpenResult as E, MindooDBAppBridgeStreamReadRequest as F, MindooDBAppBridgeStreamWriteRequest as G, MindooDBAppBridgeThemeChangedMessage as H, MindooDBAppBridgeUiPreferencesChangedMessage as I, MindooDBAppBridgeViewportChangedMessage as J, MindooDBAppCapability as K, MindooDBAppConfiguredViewCategorizationStyle as L, MindooDBAppAttachmentPreviewMode as M, MindooDBAppConfiguredViewColumn as N, MindooDBAppConfiguredViewColumnRole as O, MindooDBAppConfiguredViewExpressionMode as P, MindooDBAppConfiguredViewFieldExpression as Q, MindooDBAppConfiguredViewFilterDefinition as R, MindooDBAppConfiguredViewFilterMode as S, MindooDBAppConfiguredViewFilterRule as T, MindooDBAppConfiguredViewFormulaExpression as U, MindooDBAppConfiguredViewFormulaFilterDefinition as V, MindooDBAppConfiguredViewPreviewMode as W, MindooDBAppConfiguredViewRuleFilterDefinition as X, MindooDBAppConfiguredViewRuleMatchMode as Y, MindooDBAppConfiguredViewRuleOperator as Z, MindooDBAppConfiguredViewValueExpression as _, MindooDBAppBridge as a, MindooDBAppViewCursorDocumentListResult as a$, MindooDBAppCreateViewInput as a0, MindooDBAppCreateViewNavigatorInput as a1, MindooDBAppDatabaseInfo as a2, MindooDBAppDocumentApi as a3, MindooDBAppDocumentHeadCursorResult as a4, MindooDBAppDocumentHistoryEntry as a5, MindooDBAppDocumentListQuery as a6, MindooDBAppDocumentListResult as a7, MindooDBAppDocumentRevisionId as a8, MindooDBAppDocumentScanPreset as a9, MindooDBAppReadableAttachmentStream as aA, MindooDBAppResolvedViewDefinition as aB, MindooDBAppResolvedViewSource as aC, MindooDBAppRichTextBlockSpan as aD, MindooDBAppRichTextGetOptions as aE, MindooDBAppRichTextImmutableString as aF, MindooDBAppRichTextMarkRange as aG, MindooDBAppRichTextMaterializeValue as aH, MindooDBAppRichTextPatch as aI, MindooDBAppRichTextScalar as aJ, MindooDBAppRichTextSpliceStep as aK, MindooDBAppRichTextStep as aL, MindooDBAppRichTextStepPatch as aM, MindooDBAppRichTextTextSpan as aN, MindooDBAppRuntime as aO, MindooDBAppScanAttachmentOptions as aP, MindooDBAppScanAttachmentResult as aQ, MindooDBAppScopedDocId as aR, MindooDBAppScopedDocumentSummary as aS, MindooDBAppSession as aT, MindooDBAppShowMenuInput as aU, MindooDBAppShowMenuResult as aV, MindooDBAppTextEdit as aW, MindooDBAppTextPatch as aX, MindooDBAppThemeMode as aY, MindooDBAppUiPreferences as aZ, MindooDBAppUpdateDocumentInput as a_, MindooDBAppDocumentSummary as aa, MindooDBAppHistoricalDocument as ab, MindooDBAppHistoryQuery as ac, MindooDBAppHostTheme as ad, MindooDBAppJsonListDeletePatch as ae, MindooDBAppJsonListInsertPatch as af, MindooDBAppJsonPatch as ag, MindooDBAppJsonSetPatch as ah, MindooDBAppJsonTextMarkPatch as ai, MindooDBAppJsonTextSplicePatch as aj, MindooDBAppJsonTextUnmarkPatch as ak, MindooDBAppJsonUnsetPatch as al, MindooDBAppLaunchContext as am, MindooDBAppMenuAnchor as an, MindooDBAppMenuApi as ao, MindooDBAppMenuCommandItem as ap, MindooDBAppMenuDismissReason as aq, MindooDBAppMenuDismissedResult as ar, MindooDBAppMenuItem as as, MindooDBAppMenuKind as at, MindooDBAppMenuPlacement as au, MindooDBAppMenuPointAnchor as av, MindooDBAppMenuRect as aw, MindooDBAppMenuRectAnchor as ax, MindooDBAppMenuSelectionResult as ay, MindooDBAppMenuSeparatorItem as az, MindooDBAppDatabase as b, MindooDBAppViewCursorResult as b0, MindooDBAppViewEntry as b1, MindooDBAppViewEntryKind as b2, MindooDBAppViewNavigator as b3, MindooDBAppViewNavigatorExpansionState as b4, MindooDBAppViewNavigatorOpenOptions as b5, MindooDBAppViewNavigatorPageOptions as b6, MindooDBAppViewNavigatorPageResult as b7, MindooDBAppViewNavigatorRangeQuery as b8, MindooDBAppViewNavigatorSelectionState as b9, MindooDBAppViewport as ba, MindooDBAppWritableAttachmentStream as bb, MindooDBAppDocument as c, MindooDBAppRichTextSpan as d, MindooDBAppRichTextSnapshot as e, MindooDBAppAttachmentApi as f, MindooDBAppAttachmentChunk as g, MindooDBAppAttachmentInfo as h, MindooDBAppAttachmentPreviewOptions as i, MindooDBAppAttachmentPreviewSession as j, MindooDBAppAutomergeChangesPatch as k, MindooDBAppAutomergeChangesSince as l, MindooDBAppAutomergeGetOptions as m, MindooDBAppAutomergePatchResult as n, MindooDBAppAutomergeSnapshot as o, MindooDBAppBridgeConnectMessage as p, MindooDBAppBridgeConnectOptions as q, MindooDBAppBridgeConnectedMessage as r, MindooDBAppBridgeErrorPayload as s, MindooDBAppBridgeHandshakeErrorMessage as t, MindooDBAppBridgePortMessage as u, MindooDBAppBridgeRpcError as v, MindooDBAppBridgeRpcMessage as w, MindooDBAppBridgeRpcRequest as x, MindooDBAppBridgeRpcSuccess as y, MindooDBAppBridgeStreamAbortRequest as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindoodb-app-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.13.0"
|
|
6
6
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"mindoodb-view-language": "0.0.13"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@automerge/automerge": "^3.2.1",
|
|
42
43
|
"@types/node": "25.5.0",
|
|
43
44
|
"tsup": "^8.5.1",
|
|
44
45
|
"typescript": "^6.0.2",
|