mindoodb-app-sdk 0.0.33 → 0.0.34
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 +25 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -2
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +17 -1
- package/dist/{types-c6uTlJnB.d.ts → types-Bl6CrBn1.d.ts} +42 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -418,7 +418,8 @@ const history = await db.documents.listHistory(docId);
|
|
|
418
418
|
// identityLabel?,
|
|
419
419
|
// isDeleted,
|
|
420
420
|
// isCurrent,
|
|
421
|
-
// summary
|
|
421
|
+
// summary?,
|
|
422
|
+
// dependencyIds?
|
|
422
423
|
// }
|
|
423
424
|
|
|
424
425
|
// Load the document state at an exact DAG revision
|
|
@@ -446,6 +447,27 @@ const pointInTime = await db.documents.getAtTimestamp(
|
|
|
446
447
|
|
|
447
448
|
Historical snapshots include the document data payload as it existed at that revision. When the snapshot has attachments, `attachments` reflects the historical `_attachments` array for that same revision, including the attachment reference that Haven needs to stop at the correct historical `lastChunkId`.
|
|
448
449
|
|
|
450
|
+
#### What one revision changed
|
|
451
|
+
|
|
452
|
+
To show a diff, you need both sides of a revision. Pass `{ phase: "before" }` to read the state the revision was written against instead of the state it produced:
|
|
453
|
+
|
|
454
|
+
```ts
|
|
455
|
+
const after = await db.documents.getAtRevision(docId, revisionId);
|
|
456
|
+
const before = await db.documents.getAtRevision(docId, revisionId, {
|
|
457
|
+
phase: "before",
|
|
458
|
+
});
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
`before` is always a single document, even when the revision merged concurrent branches: it is the merge of all its parents, which is exactly what its author had loaded. For the document's creation there is no prior state, so `before` reports `state: "missing"`.
|
|
462
|
+
|
|
463
|
+
The `dependencyIds` on each history entry are that revision's parents — the edges of the signed change graph. Since a timeline is only one linearization of that graph, use them to draw or walk the graph itself, and `getAtHeads` to materialize any point in it:
|
|
464
|
+
|
|
465
|
+
```ts
|
|
466
|
+
const merged = await db.documents.getAtHeads(docId, entry.dependencyIds ?? []);
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
An id in `dependencyIds` may name a revision the timeline does not list, because a change that left the document state untouched produces no timeline row. Draw only the edges whose endpoints you have; `getAtHeads` still resolves the full list.
|
|
470
|
+
|
|
449
471
|
### Granular JSON edits
|
|
450
472
|
|
|
451
473
|
When you need to edit nested objects or lists inside a document — not just top-level fields — describe the change as a **granular JSON patch** rather than rewriting the whole document. This is the model behind structured collaborative editing in apps like [`mindoodb-app-teamgrid`](https://github.com/klehmann/mindoodb-app-teamgrid), where two users can insert different rows into the same worksheet on different devices and the merge keeps both sides cleanly.
|
|
@@ -1451,7 +1473,8 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
|
|
|
1451
1473
|
| `undelete(docId)` | `Promise<{ ok: true }>` |
|
|
1452
1474
|
| `listHistory(docId)` | `Promise<MindooDBAppDocumentHistoryEntry[]>` |
|
|
1453
1475
|
| `getAtTimestamp(docId, timestamp)` | `Promise<MindooDBAppHistoricalDocument>` |
|
|
1454
|
-
| `getAtRevision(docId, revisionId)` | `Promise<MindooDBAppHistoricalDocument>`
|
|
1476
|
+
| `getAtRevision(docId, revisionId, opts?)` | `Promise<MindooDBAppHistoricalDocument>` |
|
|
1477
|
+
| `getAtHeads(docId, headIds)` | `Promise<MindooDBAppHistoricalDocument>` |
|
|
1455
1478
|
|
|
1456
1479
|
`getAutomergeSnapshot` and `applyAutomergeChanges` are **discouraged** escape-hatch APIs for binary Automerge sync. Prefer `set`/`unset` and JSON patches (`text`, `richText`, `json`) instead. See [Automerge binary sync (advanced)](#automerge-binary-sync-advanced).
|
|
1457
1480
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppBridge, b as MindooDBAppDatabase, c as MindooDBAppDocument, d as MindooDBAppRichTextSpan, e as MindooDBAppRichTextSnapshot } from './types-
|
|
2
|
-
export { f as MINDOODB_APP_SEAL_SIGNING_DOMAIN, g as MindooDBAppAccessDecision, h as MindooDBAppAccessTier, i as MindooDBAppAttachmentApi, j as MindooDBAppAttachmentChunk, k as MindooDBAppAttachmentInfo, l as MindooDBAppAttachmentPreviewOptions, m as MindooDBAppAttachmentPreviewSession, n as MindooDBAppAutomergeChangesPatch, o as MindooDBAppAutomergeChangesSince, p as MindooDBAppAutomergeGetOptions, q as MindooDBAppAutomergePatchResult, r as MindooDBAppAutomergeSnapshot, s as MindooDBAppBridgeConnectMessage, t as MindooDBAppBridgeConnectOptions, u as MindooDBAppBridgeConnectedMessage, v as MindooDBAppBridgeErrorPayload, w as MindooDBAppBridgeHandshakeErrorMessage, x as MindooDBAppBridgeLocaleChangedMessage, y as MindooDBAppBridgePortMessage, z as MindooDBAppBridgeQueryResultMessage, A as MindooDBAppBridgeRpcError, B as MindooDBAppBridgeRpcMessage, C as MindooDBAppBridgeRpcRequest, D as MindooDBAppBridgeRpcSuccess, E as MindooDBAppBridgeStreamAbortRequest, F as MindooDBAppBridgeStreamAck, G as MindooDBAppBridgeStreamCloseRequest, H as MindooDBAppBridgeStreamError, I as MindooDBAppBridgeStreamMessage, J as MindooDBAppBridgeStreamOpenResult, K as MindooDBAppBridgeStreamReadRequest, L as MindooDBAppBridgeStreamWriteRequest, N as MindooDBAppBridgeThemeChangedMessage, O as MindooDBAppBridgeUiPreferencesChangedMessage, P as MindooDBAppBridgeViewChangedMessage, Q as MindooDBAppBridgeViewportChangedMessage, R as MindooDBAppCapability, S as MindooDBAppConfiguredViewCategorizationStyle, T as MindooDBAppConfiguredViewColumn, U as MindooDBAppConfiguredViewColumnRole, V as MindooDBAppConfiguredViewExpressionMode, W as MindooDBAppConfiguredViewFieldExpression, X as MindooDBAppConfiguredViewFilterDefinition, Y as MindooDBAppConfiguredViewFilterMode, Z as MindooDBAppConfiguredViewFilterRule, _ as MindooDBAppConfiguredViewFormulaExpression, $ as MindooDBAppConfiguredViewFormulaFilterDefinition, a0 as MindooDBAppConfiguredViewPreviewMode, a1 as MindooDBAppConfiguredViewRuleFilterDefinition, a2 as MindooDBAppConfiguredViewRuleMatchMode, a3 as MindooDBAppConfiguredViewRuleOperator, a4 as MindooDBAppConfiguredViewValueExpression, a5 as MindooDBAppCreateDocumentInput, a6 as MindooDBAppCreateViewInput, a7 as MindooDBAppCreateViewNavigatorInput, a8 as MindooDBAppDatabaseInfo, a9 as MindooDBAppDirectoryApi, aa as MindooDBAppDirectoryEntry, ab as MindooDBAppDocumentApi, ac as MindooDBAppDocumentHeadCursorResult, ad as MindooDBAppDocumentHistoryEntry, ae as MindooDBAppDocumentListQuery, af as MindooDBAppDocumentListResult, ag as MindooDBAppDocumentQuery, ah as MindooDBAppDocumentRevisionId, ai as MindooDBAppDocumentScanPreset, aj as MindooDBAppDocumentSummary, ak as MindooDBAppEntryAttachmentRef, al as MindooDBAppEntryProvenance, am as MindooDBAppExtractionSetup, an as MindooDBAppFulltextSetup, ao as MindooDBAppHistoricalDocument, ap as MindooDBAppHistoryQuery, aq as MindooDBAppHostTheme, ar as MindooDBAppIdentityApi, as as MindooDBAppJsonListDeletePatch, at as MindooDBAppJsonListInsertPatch, au as MindooDBAppJsonPatch, av as MindooDBAppJsonSetPatch, aw as MindooDBAppJsonTextMarkPatch, ax as MindooDBAppJsonTextSplicePatch, ay as MindooDBAppJsonTextUnmarkPatch, az as MindooDBAppJsonUnsetPatch, aA as MindooDBAppLaunchContext, aB as MindooDBAppLiveQuerySubscription, aC as MindooDBAppMenuAnchor, aD as MindooDBAppMenuApi, aE as MindooDBAppMenuCommandItem, aF as MindooDBAppMenuDismissReason, aG as MindooDBAppMenuDismissedResult, aH as MindooDBAppMenuItem, aI as MindooDBAppMenuKind, aJ as MindooDBAppMenuPlacement, aK as MindooDBAppMenuPointAnchor, aL as MindooDBAppMenuRect, aM as MindooDBAppMenuRectAnchor, aN as MindooDBAppMenuSelectionResult, aO as MindooDBAppMenuSeparatorItem, aP as MindooDBAppQueryCoverage, aQ as MindooDBAppQueryResult, aR as MindooDBAppQueryRow, aS as MindooDBAppQuerySortKey, aT as MindooDBAppQueryTextClause, aU as MindooDBAppReadableAttachmentStream, aV as MindooDBAppResolvedViewDefinition, aW as MindooDBAppResolvedViewSource, aX as
|
|
1
|
+
import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppBridge, b as MindooDBAppDatabase, c as MindooDBAppDocument, d as MindooDBAppRichTextSpan, e as MindooDBAppRichTextSnapshot } from './types-Bl6CrBn1.js';
|
|
2
|
+
export { f as MINDOODB_APP_SEAL_SIGNING_DOMAIN, g as MindooDBAppAccessDecision, h as MindooDBAppAccessTier, i as MindooDBAppAttachmentApi, j as MindooDBAppAttachmentChunk, k as MindooDBAppAttachmentInfo, l as MindooDBAppAttachmentPreviewOptions, m as MindooDBAppAttachmentPreviewSession, n as MindooDBAppAutomergeChangesPatch, o as MindooDBAppAutomergeChangesSince, p as MindooDBAppAutomergeGetOptions, q as MindooDBAppAutomergePatchResult, r as MindooDBAppAutomergeSnapshot, s as MindooDBAppBridgeConnectMessage, t as MindooDBAppBridgeConnectOptions, u as MindooDBAppBridgeConnectedMessage, v as MindooDBAppBridgeErrorPayload, w as MindooDBAppBridgeHandshakeErrorMessage, x as MindooDBAppBridgeLocaleChangedMessage, y as MindooDBAppBridgePortMessage, z as MindooDBAppBridgeQueryResultMessage, A as MindooDBAppBridgeRpcError, B as MindooDBAppBridgeRpcMessage, C as MindooDBAppBridgeRpcRequest, D as MindooDBAppBridgeRpcSuccess, E as MindooDBAppBridgeStreamAbortRequest, F as MindooDBAppBridgeStreamAck, G as MindooDBAppBridgeStreamCloseRequest, H as MindooDBAppBridgeStreamError, I as MindooDBAppBridgeStreamMessage, J as MindooDBAppBridgeStreamOpenResult, K as MindooDBAppBridgeStreamReadRequest, L as MindooDBAppBridgeStreamWriteRequest, N as MindooDBAppBridgeThemeChangedMessage, O as MindooDBAppBridgeUiPreferencesChangedMessage, P as MindooDBAppBridgeViewChangedMessage, Q as MindooDBAppBridgeViewportChangedMessage, R as MindooDBAppCapability, S as MindooDBAppConfiguredViewCategorizationStyle, T as MindooDBAppConfiguredViewColumn, U as MindooDBAppConfiguredViewColumnRole, V as MindooDBAppConfiguredViewExpressionMode, W as MindooDBAppConfiguredViewFieldExpression, X as MindooDBAppConfiguredViewFilterDefinition, Y as MindooDBAppConfiguredViewFilterMode, Z as MindooDBAppConfiguredViewFilterRule, _ as MindooDBAppConfiguredViewFormulaExpression, $ as MindooDBAppConfiguredViewFormulaFilterDefinition, a0 as MindooDBAppConfiguredViewPreviewMode, a1 as MindooDBAppConfiguredViewRuleFilterDefinition, a2 as MindooDBAppConfiguredViewRuleMatchMode, a3 as MindooDBAppConfiguredViewRuleOperator, a4 as MindooDBAppConfiguredViewValueExpression, a5 as MindooDBAppCreateDocumentInput, a6 as MindooDBAppCreateViewInput, a7 as MindooDBAppCreateViewNavigatorInput, a8 as MindooDBAppDatabaseInfo, a9 as MindooDBAppDirectoryApi, aa as MindooDBAppDirectoryEntry, ab as MindooDBAppDocumentApi, ac as MindooDBAppDocumentHeadCursorResult, ad as MindooDBAppDocumentHistoryEntry, ae as MindooDBAppDocumentListQuery, af as MindooDBAppDocumentListResult, ag as MindooDBAppDocumentQuery, ah as MindooDBAppDocumentRevisionId, ai as MindooDBAppDocumentScanPreset, aj as MindooDBAppDocumentSummary, ak as MindooDBAppEntryAttachmentRef, al as MindooDBAppEntryProvenance, am as MindooDBAppExtractionSetup, an as MindooDBAppFulltextSetup, ao as MindooDBAppHistoricalDocument, ap as MindooDBAppHistoryQuery, aq as MindooDBAppHostTheme, ar as MindooDBAppIdentityApi, as as MindooDBAppJsonListDeletePatch, at as MindooDBAppJsonListInsertPatch, au as MindooDBAppJsonPatch, av as MindooDBAppJsonSetPatch, aw as MindooDBAppJsonTextMarkPatch, ax as MindooDBAppJsonTextSplicePatch, ay as MindooDBAppJsonTextUnmarkPatch, az as MindooDBAppJsonUnsetPatch, aA as MindooDBAppLaunchContext, aB as MindooDBAppLiveQuerySubscription, aC as MindooDBAppMenuAnchor, aD as MindooDBAppMenuApi, aE as MindooDBAppMenuCommandItem, aF as MindooDBAppMenuDismissReason, aG as MindooDBAppMenuDismissedResult, aH as MindooDBAppMenuItem, aI as MindooDBAppMenuKind, aJ as MindooDBAppMenuPlacement, aK as MindooDBAppMenuPointAnchor, aL as MindooDBAppMenuRect, aM as MindooDBAppMenuRectAnchor, aN as MindooDBAppMenuSelectionResult, aO as MindooDBAppMenuSeparatorItem, aP as MindooDBAppQueryCoverage, aQ as MindooDBAppQueryResult, aR as MindooDBAppQueryRow, aS as MindooDBAppQuerySortKey, aT as MindooDBAppQueryTextClause, aU as MindooDBAppReadableAttachmentStream, aV as MindooDBAppResolvedViewDefinition, aW as MindooDBAppResolvedViewSource, aX as MindooDBAppRevisionPhase, aY as MindooDBAppRevisionVerification, aZ as MindooDBAppRichTextBlockSpan, a_ as MindooDBAppRichTextGetOptions, a$ as MindooDBAppRichTextImmutableString, b0 as MindooDBAppRichTextMarkRange, b1 as MindooDBAppRichTextMaterializeValue, b2 as MindooDBAppRichTextPatch, b3 as MindooDBAppRichTextScalar, b4 as MindooDBAppRichTextSpliceStep, b5 as MindooDBAppRichTextStep, b6 as MindooDBAppRichTextStepPatch, b7 as MindooDBAppRichTextTextSpan, b8 as MindooDBAppRuntime, b9 as MindooDBAppScanAttachmentOptions, ba as MindooDBAppScanAttachmentResult, bb as MindooDBAppScopedDocId, bc as MindooDBAppScopedDocumentSummary, bd as MindooDBAppSealIntent, be as MindooDBAppSession, bf as MindooDBAppShowMenuInput, bg as MindooDBAppShowMenuResult, bh as MindooDBAppSignPreview, bi as MindooDBAppSignPreviewScope, bj as MindooDBAppSignStatementInput, bk as MindooDBAppSignStatementResult, bl as MindooDBAppTextEdit, bm as MindooDBAppTextPatch, bn as MindooDBAppThemeMode, bo as MindooDBAppTimestampApi, bp as MindooDBAppTimestampInput, bq as MindooDBAppTimestampProvider, br as MindooDBAppTimestampResult, bs as MindooDBAppUiPreferences, bt as MindooDBAppUpdateDocumentInput, bu as MindooDBAppViewCursorDocumentListResult, bv as MindooDBAppViewCursorResult, bw as MindooDBAppViewEntry, bx as MindooDBAppViewEntryKind, by as MindooDBAppViewNavigator, bz as MindooDBAppViewNavigatorExpansionState, bA as MindooDBAppViewNavigatorOpenOptions, bB as MindooDBAppViewNavigatorPageOptions, bC as MindooDBAppViewNavigatorPageResult, bD as MindooDBAppViewNavigatorRangeQuery, bE as MindooDBAppViewNavigatorSelectionState, bF as MindooDBAppViewUpdateStats, bG as MindooDBAppViewport, bH as MindooDBAppWritableAttachmentStream } from './types-Bl6CrBn1.js';
|
|
3
3
|
import { MindooDBAppBooleanExpression } from 'mindoodb-view-language';
|
|
4
4
|
export { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppFilterDefinition, MindooDBAppViewCategoryChildrenPageRequest, MindooDBAppViewColumn, MindooDBAppViewColumnRole, MindooDBAppViewDefinition, MindooDBAppViewExpansionState, MindooDBAppViewExpressionBase, MindooDBAppViewExpressionDatePart, MindooDBAppViewExpressionOperation, MindooDBAppViewFieldExpression, MindooDBAppViewIfExpression, MindooDBAppViewLetExpression, MindooDBAppViewLiteralExpression, MindooDBAppViewLookupByPath, MindooDBAppViewOperationExpression, MindooDBAppViewOriginExpression, MindooDBAppViewPageRequest, MindooDBAppViewPageResult, MindooDBAppViewRow, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewValueExpressionRef, MindooDBAppViewVariableExpression, createViewLanguage } from 'mindoodb-view-language';
|
|
5
5
|
import { MindooDB, MindooQuerySortKey, MindooQueryOptions, MindooQueryResult } from 'mindoodb';
|
package/dist/index.js
CHANGED
|
@@ -910,10 +910,16 @@ var MindooDBAppDatabaseImpl = class {
|
|
|
910
910
|
docId,
|
|
911
911
|
timestamp
|
|
912
912
|
}),
|
|
913
|
-
getAtRevision: async (docId, revisionId) => await this.rpc.call("documents.history.getAtRevision", {
|
|
913
|
+
getAtRevision: async (docId, revisionId, options) => await this.rpc.call("documents.history.getAtRevision", {
|
|
914
914
|
databaseId: this.databaseId,
|
|
915
915
|
docId,
|
|
916
|
-
revisionId
|
|
916
|
+
revisionId,
|
|
917
|
+
phase: options?.phase
|
|
918
|
+
}),
|
|
919
|
+
getAtHeads: async (docId, headIds) => await this.rpc.call("documents.history.getAtHeads", {
|
|
920
|
+
databaseId: this.databaseId,
|
|
921
|
+
docId,
|
|
922
|
+
headIds
|
|
917
923
|
}),
|
|
918
924
|
listVerification: async (docId, revisionIds) => await this.rpc.call("documents.history.listVerification", {
|
|
919
925
|
databaseId: this.databaseId,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aA as MindooDBAppLaunchContext, a8 as MindooDBAppDatabaseInfo, ab as MindooDBAppDocumentApi, a7 as MindooDBAppCreateViewNavigatorInput,
|
|
1
|
+
import { aA as MindooDBAppLaunchContext, a8 as MindooDBAppDatabaseInfo, ab as MindooDBAppDocumentApi, a7 as MindooDBAppCreateViewNavigatorInput, by as MindooDBAppViewNavigator, bA as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, ar as MindooDBAppIdentityApi, bo as MindooDBAppTimestampApi, a9 as MindooDBAppDirectoryApi, an as MindooDBAppFulltextSetup, am as MindooDBAppExtractionSetup, a as MindooDBAppBridge, be as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, aq as MindooDBAppHostTheme, bG as MindooDBAppViewport, bs as MindooDBAppUiPreferences, aQ as MindooDBAppQueryResult, bF as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-Bl6CrBn1.js';
|
|
2
2
|
import 'mindoodb-view-language';
|
|
3
3
|
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
package/dist/testing/index.js
CHANGED
|
@@ -1077,6 +1077,16 @@ function createDatabaseHandle(definition) {
|
|
|
1077
1077
|
attachments: []
|
|
1078
1078
|
};
|
|
1079
1079
|
},
|
|
1080
|
+
async getAtHeads(docId, _headIds) {
|
|
1081
|
+
return {
|
|
1082
|
+
id: docId,
|
|
1083
|
+
timestamp: Date.now(),
|
|
1084
|
+
heads: [],
|
|
1085
|
+
state: "missing",
|
|
1086
|
+
data: null,
|
|
1087
|
+
attachments: []
|
|
1088
|
+
};
|
|
1089
|
+
},
|
|
1080
1090
|
async listVerification() {
|
|
1081
1091
|
return [];
|
|
1082
1092
|
}
|
|
@@ -1750,7 +1760,13 @@ function createFakeBridgeHost(options = {}) {
|
|
|
1750
1760
|
case "documents.history.getAtRevision":
|
|
1751
1761
|
return await state.getDatabase(String(params.databaseId)).documents.getAtRevision(
|
|
1752
1762
|
String(params.docId),
|
|
1753
|
-
String(params.revisionId)
|
|
1763
|
+
String(params.revisionId),
|
|
1764
|
+
params.phase === "before" ? { phase: "before" } : void 0
|
|
1765
|
+
);
|
|
1766
|
+
case "documents.history.getAtHeads":
|
|
1767
|
+
return await state.getDatabase(String(params.databaseId)).documents.getAtHeads(
|
|
1768
|
+
String(params.docId),
|
|
1769
|
+
Array.isArray(params.headIds) ? params.headIds.map(String) : []
|
|
1754
1770
|
);
|
|
1755
1771
|
case "documents.history.listVerification":
|
|
1756
1772
|
return await state.getDatabase(String(params.databaseId)).documents.listVerification(
|
|
@@ -208,7 +208,29 @@ interface MindooDBAppDocumentHistoryEntry {
|
|
|
208
208
|
isDeleted: boolean;
|
|
209
209
|
isCurrent: boolean;
|
|
210
210
|
summary?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The revisions this one was written on top of — the edges of the signed
|
|
213
|
+
* change graph, in the same id space as {@link revisionId}. More than one id
|
|
214
|
+
* means this revision merged concurrent branches.
|
|
215
|
+
*
|
|
216
|
+
* A timeline is a linearization of that graph, so an id here may name a
|
|
217
|
+
* revision the timeline does not list (a change that left the document state
|
|
218
|
+
* untouched produces no timeline row). Draw only the edges whose endpoints you
|
|
219
|
+
* have; use {@link MindooDBAppDocumentHistoryApi.getAtHeads} to reconstruct
|
|
220
|
+
* state from the full list.
|
|
221
|
+
*/
|
|
222
|
+
dependencyIds?: string[];
|
|
211
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Which side of a revision to read: the state it produced (`after`, the
|
|
226
|
+
* default), or the state it was written against (`before`).
|
|
227
|
+
*
|
|
228
|
+
* `before` is a single document even for a revision that merged several
|
|
229
|
+
* branches: it is the merge of all its parents, which is what its author had
|
|
230
|
+
* loaded. For the document's creation there is no prior state, so `before`
|
|
231
|
+
* reports a `missing` snapshot.
|
|
232
|
+
*/
|
|
233
|
+
type MindooDBAppRevisionPhase = "before" | "after";
|
|
212
234
|
/**
|
|
213
235
|
* The cryptographic record behind one revision, as it sits in the append-only
|
|
214
236
|
* store — what a seal or an audit needs and what {@link MindooDBAppDocumentHistoryEntry}
|
|
@@ -1274,8 +1296,26 @@ interface MindooDBAppDocumentApi {
|
|
|
1274
1296
|
* identifiers — the preferred way to load historical states and the value
|
|
1275
1297
|
* to pass to historical attachment APIs. Requires the `history`
|
|
1276
1298
|
* capability.
|
|
1299
|
+
*
|
|
1300
|
+
* Pass `{ phase: "before" }` to read the state the revision was written
|
|
1301
|
+
* against instead of the state it produced, which is how you show what one
|
|
1302
|
+
* revision changed. See {@link MindooDBAppRevisionPhase}.
|
|
1303
|
+
*/
|
|
1304
|
+
getAtRevision(docId: string, revisionId: MindooDBAppDocumentRevisionId, options?: {
|
|
1305
|
+
phase?: MindooDBAppRevisionPhase;
|
|
1306
|
+
}): Promise<MindooDBAppHistoricalDocument>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Read-only snapshot of the document as it stood at a set of concurrent
|
|
1309
|
+
* revisions: the merge of those heads, with nothing that came after them.
|
|
1310
|
+
*
|
|
1311
|
+
* Use it to reconstruct a specific point in the change graph rather than in
|
|
1312
|
+
* the timeline — for example, pass a revision's
|
|
1313
|
+
* {@link MindooDBAppDocumentHistoryEntry.dependencyIds} to see exactly the
|
|
1314
|
+
* document its author was editing. An empty or unresolvable head list means
|
|
1315
|
+
* there was no document yet and reports a `missing` snapshot. Requires the
|
|
1316
|
+
* `history` capability.
|
|
1277
1317
|
*/
|
|
1278
|
-
|
|
1318
|
+
getAtHeads(docId: string, headIds: MindooDBAppDocumentRevisionId[]): Promise<MindooDBAppHistoricalDocument>;
|
|
1279
1319
|
/**
|
|
1280
1320
|
* The signatures and witness receipts behind a document's revisions —
|
|
1281
1321
|
* everything {@link listHistory} leaves out because a timeline UI does not
|
|
@@ -1885,4 +1925,4 @@ interface MindooDBAppBridge {
|
|
|
1885
1925
|
connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
|
|
1886
1926
|
}
|
|
1887
1927
|
|
|
1888
|
-
export { type MindooDBAppConfiguredViewFormulaFilterDefinition as $, type MindooDBAppBridgeRpcError as A, type MindooDBAppBridgeRpcMessage as B, type MindooDBAppBridgeRpcRequest as C, type MindooDBAppBridgeRpcSuccess as D, type MindooDBAppBridgeStreamAbortRequest as E, type MindooDBAppBridgeStreamAck as F, type MindooDBAppBridgeStreamCloseRequest as G, type MindooDBAppBridgeStreamError as H, type MindooDBAppBridgeStreamMessage as I, type MindooDBAppBridgeStreamOpenResult as J, type MindooDBAppBridgeStreamReadRequest as K, type MindooDBAppBridgeStreamWriteRequest as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppBridgeThemeChangedMessage as N, type MindooDBAppBridgeUiPreferencesChangedMessage as O, type MindooDBAppBridgeViewChangedMessage as P, type MindooDBAppBridgeViewportChangedMessage as Q, type MindooDBAppCapability as R, type MindooDBAppConfiguredViewCategorizationStyle as S, type MindooDBAppConfiguredViewColumn as T, type MindooDBAppConfiguredViewColumnRole as U, type MindooDBAppConfiguredViewExpressionMode as V, type MindooDBAppConfiguredViewFieldExpression as W, type MindooDBAppConfiguredViewFilterDefinition as X, type MindooDBAppConfiguredViewFilterMode as Y, type MindooDBAppConfiguredViewFilterRule as Z, type MindooDBAppConfiguredViewFormulaExpression as _, type MindooDBAppBridge as a, type
|
|
1928
|
+
export { type MindooDBAppConfiguredViewFormulaFilterDefinition as $, type MindooDBAppBridgeRpcError as A, type MindooDBAppBridgeRpcMessage as B, type MindooDBAppBridgeRpcRequest as C, type MindooDBAppBridgeRpcSuccess as D, type MindooDBAppBridgeStreamAbortRequest as E, type MindooDBAppBridgeStreamAck as F, type MindooDBAppBridgeStreamCloseRequest as G, type MindooDBAppBridgeStreamError as H, type MindooDBAppBridgeStreamMessage as I, type MindooDBAppBridgeStreamOpenResult as J, type MindooDBAppBridgeStreamReadRequest as K, type MindooDBAppBridgeStreamWriteRequest as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppBridgeThemeChangedMessage as N, type MindooDBAppBridgeUiPreferencesChangedMessage as O, type MindooDBAppBridgeViewChangedMessage as P, type MindooDBAppBridgeViewportChangedMessage as Q, type MindooDBAppCapability as R, type MindooDBAppConfiguredViewCategorizationStyle as S, type MindooDBAppConfiguredViewColumn as T, type MindooDBAppConfiguredViewColumnRole as U, type MindooDBAppConfiguredViewExpressionMode as V, type MindooDBAppConfiguredViewFieldExpression as W, type MindooDBAppConfiguredViewFilterDefinition as X, type MindooDBAppConfiguredViewFilterMode as Y, type MindooDBAppConfiguredViewFilterRule as Z, type MindooDBAppConfiguredViewFormulaExpression as _, type MindooDBAppBridge as a, type MindooDBAppRichTextImmutableString as a$, type MindooDBAppConfiguredViewPreviewMode as a0, type MindooDBAppConfiguredViewRuleFilterDefinition as a1, type MindooDBAppConfiguredViewRuleMatchMode as a2, type MindooDBAppConfiguredViewRuleOperator as a3, type MindooDBAppConfiguredViewValueExpression as a4, type MindooDBAppCreateDocumentInput as a5, type MindooDBAppCreateViewInput as a6, type MindooDBAppCreateViewNavigatorInput as a7, type MindooDBAppDatabaseInfo as a8, type MindooDBAppDirectoryApi as a9, type MindooDBAppLaunchContext as aA, type MindooDBAppLiveQuerySubscription as aB, type MindooDBAppMenuAnchor as aC, type MindooDBAppMenuApi as aD, type MindooDBAppMenuCommandItem as aE, type MindooDBAppMenuDismissReason as aF, type MindooDBAppMenuDismissedResult as aG, type MindooDBAppMenuItem as aH, type MindooDBAppMenuKind as aI, type MindooDBAppMenuPlacement as aJ, type MindooDBAppMenuPointAnchor as aK, type MindooDBAppMenuRect as aL, type MindooDBAppMenuRectAnchor as aM, type MindooDBAppMenuSelectionResult as aN, type MindooDBAppMenuSeparatorItem as aO, type MindooDBAppQueryCoverage as aP, type MindooDBAppQueryResult as aQ, type MindooDBAppQueryRow as aR, type MindooDBAppQuerySortKey as aS, type MindooDBAppQueryTextClause as aT, type MindooDBAppReadableAttachmentStream as aU, type MindooDBAppResolvedViewDefinition as aV, type MindooDBAppResolvedViewSource as aW, type MindooDBAppRevisionPhase as aX, type MindooDBAppRevisionVerification as aY, type MindooDBAppRichTextBlockSpan as aZ, type MindooDBAppRichTextGetOptions as a_, type MindooDBAppDirectoryEntry as aa, type MindooDBAppDocumentApi as ab, type MindooDBAppDocumentHeadCursorResult as ac, type MindooDBAppDocumentHistoryEntry as ad, type MindooDBAppDocumentListQuery as ae, type MindooDBAppDocumentListResult as af, type MindooDBAppDocumentQuery as ag, type MindooDBAppDocumentRevisionId as ah, type MindooDBAppDocumentScanPreset as ai, type MindooDBAppDocumentSummary as aj, type MindooDBAppEntryAttachmentRef as ak, type MindooDBAppEntryProvenance as al, type MindooDBAppExtractionSetup as am, type MindooDBAppFulltextSetup as an, type MindooDBAppHistoricalDocument as ao, type MindooDBAppHistoryQuery as ap, type MindooDBAppHostTheme as aq, type MindooDBAppIdentityApi as ar, type MindooDBAppJsonListDeletePatch as as, type MindooDBAppJsonListInsertPatch as at, type MindooDBAppJsonPatch as au, type MindooDBAppJsonSetPatch as av, type MindooDBAppJsonTextMarkPatch as aw, type MindooDBAppJsonTextSplicePatch as ax, type MindooDBAppJsonTextUnmarkPatch as ay, type MindooDBAppJsonUnsetPatch as az, type MindooDBAppDatabase as b, type MindooDBAppRichTextMarkRange as b0, type MindooDBAppRichTextMaterializeValue as b1, type MindooDBAppRichTextPatch as b2, type MindooDBAppRichTextScalar as b3, type MindooDBAppRichTextSpliceStep as b4, type MindooDBAppRichTextStep as b5, type MindooDBAppRichTextStepPatch as b6, type MindooDBAppRichTextTextSpan as b7, type MindooDBAppRuntime as b8, type MindooDBAppScanAttachmentOptions as b9, type MindooDBAppViewNavigatorOpenOptions as bA, type MindooDBAppViewNavigatorPageOptions as bB, type MindooDBAppViewNavigatorPageResult as bC, type MindooDBAppViewNavigatorRangeQuery as bD, type MindooDBAppViewNavigatorSelectionState as bE, type MindooDBAppViewUpdateStats as bF, type MindooDBAppViewport as bG, type MindooDBAppWritableAttachmentStream as bH, type MindooDBAppScanAttachmentResult as ba, type MindooDBAppScopedDocId as bb, type MindooDBAppScopedDocumentSummary as bc, type MindooDBAppSealIntent as bd, type MindooDBAppSession as be, type MindooDBAppShowMenuInput as bf, type MindooDBAppShowMenuResult as bg, type MindooDBAppSignPreview as bh, type MindooDBAppSignPreviewScope as bi, type MindooDBAppSignStatementInput as bj, type MindooDBAppSignStatementResult as bk, type MindooDBAppTextEdit as bl, type MindooDBAppTextPatch as bm, type MindooDBAppThemeMode as bn, type MindooDBAppTimestampApi as bo, type MindooDBAppTimestampInput as bp, type MindooDBAppTimestampProvider as bq, type MindooDBAppTimestampResult as br, type MindooDBAppUiPreferences as bs, type MindooDBAppUpdateDocumentInput as bt, type MindooDBAppViewCursorDocumentListResult as bu, type MindooDBAppViewCursorResult as bv, type MindooDBAppViewEntry as bw, type MindooDBAppViewEntryKind as bx, type MindooDBAppViewNavigator as by, type MindooDBAppViewNavigatorExpansionState as bz, type MindooDBAppDocument as c, type MindooDBAppRichTextSpan as d, type MindooDBAppRichTextSnapshot as e, MINDOODB_APP_SEAL_SIGNING_DOMAIN as f, type MindooDBAppAccessDecision as g, type MindooDBAppAccessTier as h, type MindooDBAppAttachmentApi as i, type MindooDBAppAttachmentChunk as j, type MindooDBAppAttachmentInfo as k, type MindooDBAppAttachmentPreviewOptions as l, type MindooDBAppAttachmentPreviewSession as m, type MindooDBAppAutomergeChangesPatch as n, type MindooDBAppAutomergeChangesSince as o, type MindooDBAppAutomergeGetOptions as p, type MindooDBAppAutomergePatchResult as q, type MindooDBAppAutomergeSnapshot as r, type MindooDBAppBridgeConnectMessage as s, type MindooDBAppBridgeConnectOptions as t, type MindooDBAppBridgeConnectedMessage as u, type MindooDBAppBridgeErrorPayload as v, type MindooDBAppBridgeHandshakeErrorMessage as w, type MindooDBAppBridgeLocaleChangedMessage as x, type MindooDBAppBridgePortMessage as y, type MindooDBAppBridgeQueryResultMessage 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.34",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.13.0"
|
|
6
6
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@automerge/automerge": "^3.2.1",
|
|
51
|
-
"mindoodb": "^0.0.
|
|
51
|
+
"mindoodb": "^0.0.47",
|
|
52
52
|
"@types/node": "25.5.0",
|
|
53
53
|
"tsup": "^8.5.1",
|
|
54
54
|
"typescript": "^6.0.2",
|