mindoodb-app-sdk 0.0.37 → 0.0.39

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 CHANGED
@@ -242,6 +242,7 @@ Each database mapped to your app carries a set of **capabilities** that Haven co
242
242
  | `history` | Access document revision history and historical snapshots |
243
243
  | `attachments` | List, upload, download, remove, and preview file attachments |
244
244
  | `views` | Create app-defined virtual views for this database |
245
+ | `sealedchannel` | Open an encrypted channel to a tenant-joined service |
245
246
 
246
247
  ```ts
247
248
  const db = ctx.databases[0]!;
@@ -256,6 +257,40 @@ if (!db.capabilities.includes("delete")) {
256
257
 
257
258
  When the database is readable, `documents.list()` can also expose deleted document IDs by setting `status: "all"` or `status: "deleted"`. This is useful for app-side indexes and sync checkpoints.
258
259
 
260
+ ### Sealed channels
261
+
262
+ Some services join the user's tenant as a member of their own and then talk to your app over HTTP — the MindooMail bridge is the first. A sealed channel is how you reach one without your app ever touching key material.
263
+
264
+ Haven does the key exchange with the user's identity key, keeps the resulting AES key host-side, and seals and opens every payload. Your app holds an opaque `channelId` and exchanges plain JSON.
265
+
266
+ ```ts
267
+ const opened = await session.openSealedChannel({
268
+ databaseId: db.id,
269
+ baseUrl: "https://bridge.example.com",
270
+ });
271
+ if (!opened.ok) {
272
+ // The user declined. Not an error — leave your UI intact.
273
+ return;
274
+ }
275
+
276
+ const reply = await session.sealedChannelRequest<JmapResponse>({
277
+ channelId: opened.channelId,
278
+ path: "/jmap/api",
279
+ payload: { using: [], methodCalls: [] },
280
+ });
281
+
282
+ await session.closeSealedChannel(opened.channelId);
283
+ ```
284
+
285
+ Requirements and limits worth knowing before you design around this:
286
+
287
+ - The binding named by `databaseId` needs the `sealedchannel` capability.
288
+ - The user is asked to approve the origin the first time this app connects there. Haven stores that grant per identity, app, and origin, and does not ask again on later launches.
289
+ - `baseUrl` must be a bare `https:` origin (or `http:` on loopback for local development) with no path, query, or credentials, and `path` may not leave that origin.
290
+ - The service must allow Haven's origin in its CORS configuration — the request comes from the host, not from your app's iframe.
291
+
292
+ There is deliberately no API for decrypting arbitrary data with the user's key. That would be a decryption oracle: doc keys wrapped to the same key are publicly readable in the tenant directory, so an app able to unwrap chosen ciphertext could obtain keys for databases it was never granted.
293
+
259
294
  ### Theme and viewport events
260
295
 
261
296
  Haven pushes two types of live events to your app:
@@ -1465,6 +1500,9 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1465
1500
  | `openDatabase(databaseId)` | `Promise<MindooDBAppDatabase>` |
1466
1501
  | `createViewNavigator(input)` | `Promise<MindooDBAppViewNavigator>` |
1467
1502
  | `openViewNavigator(viewId, options?)` | `Promise<MindooDBAppViewNavigator>` |
1503
+ | `openSealedChannel(input)` | `Promise<MindooDBAppSealedChannelOpenResult>` |
1504
+ | `sealedChannelRequest(input)` | `Promise<T>` |
1505
+ | `closeSealedChannel(channelId)` | `Promise<void>` |
1468
1506
  | `menus.show(input)` | `Promise<MindooDBAppShowMenuResult>` |
1469
1507
  | `menus.hide()` | `Promise<void>` |
1470
1508
  | `onThemeChange(listener)` | `() => void` (unsubscribe) |
@@ -1488,6 +1526,7 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1488
1526
  | `query(query?)` | `Promise<MindooDBAppQueryResult>` |
1489
1527
  | `liveQuery(query, onResult)` | `Promise<MindooDBAppLiveQuerySubscription>` |
1490
1528
  | `list(query?)` | `Promise<MindooDBAppDocumentListResult>` |
1529
+ | `listInaccessible(query?)` | `Promise<MindooDBAppInaccessibleDocumentListResult>` |
1491
1530
  | `get(docId)` | `Promise<MindooDBAppDocument \| null>` |
1492
1531
  | `getRichText(docId, path, opts?)` | `Promise<MindooDBAppRichTextSnapshot>` |
1493
1532
  | `getAutomergeSnapshot(docId, opts?)` | `Promise<MindooDBAppAutomergeSnapshot>` |
@@ -1510,6 +1549,8 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1510
1549
 
1511
1550
  `list(query?)` accepts the changefeed query options documented above. The `cursor` value is an opaque checkpoint string managed by Haven and should be stored and passed back unchanged.
1512
1551
 
1552
+ `listInaccessible(query?)` returns documents that exist locally but the current user cannot decrypt (not a recipient, or missing the document key). Those ids never appear in `list` / `get`. Each row is unsigned store metadata only (`id`, `createdAt`, `decryptionKeyId`, optional `authorLabel`) — the app does not get CAS access. Use it to distinguish an empty database from one sealed to someone else.
1553
+
1513
1554
  For `create(input)`, use `MindooDBAppCreateDocumentInput` with shape `{ set: Record<string, unknown>; decryptionKeyId?: string; recipients?: string[]; recipientOptions?: { includeSelf?: boolean }; id?: string }`. Omit both `decryptionKeyId` and `recipients` to use the database default shared key (`getDefaultCreateKeyId()` / `listCreateKeys()`). Pass `recipients` to encrypt the document for specific directory users (the launching user is included unless `recipientOptions.includeSelf` is `false`). Use `includeSelf: false` to write initial `set` values and hand the document to someone else — empty `recipients` with `includeSelf: false` is rejected. Changing that list later is `addRecipients` / `removeRecipients` / `setRecipients` — do not write `_encryptFor` via `update`. The optional `id` lets the app pick the document id instead of letting MindooDB generate an ObjectId; when provided it must match `/^[a-z][a-z0-9_]*$/` (lowercase only, since ids become on-disk filenames) and existing live documents with that id are returned as-is (idempotent create-if-missing). If an existing custom-id document is deleted, `create({ id })` undeletes it and preserves the previous document body. Documents created with the same custom id on different replicas converge correctly when synced.
1514
1555
 
1515
1556
  `delete(docId)` writes a lifecycle tombstone; it does not erase the document body from the append-only history. Use `undelete(docId)` to make the latest document state live again. If you want to record a deletion reason, first call `update(docId, { set: { intendedDeletionReason: "..." } })`, then call `delete(docId)`.
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-Plb92iSn.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 MindooDBAppCreateKeyInfo, a7 as MindooDBAppCreateViewInput, a8 as MindooDBAppCreateViewNavigatorInput, a9 as MindooDBAppDatabaseInfo, aa as MindooDBAppDirectoryApi, ab as MindooDBAppDirectoryEntry, ac as MindooDBAppDocumentApi, ad as MindooDBAppDocumentHeadCursorResult, ae as MindooDBAppDocumentHistoryEntry, af as MindooDBAppDocumentListQuery, ag as MindooDBAppDocumentListResult, ah as MindooDBAppDocumentQuery, ai as MindooDBAppDocumentRevisionId, aj as MindooDBAppDocumentScanPreset, ak as MindooDBAppDocumentSummary, al as MindooDBAppEntryAttachmentRef, am as MindooDBAppEntryProvenance, an as MindooDBAppExtractDocumentTextInput, ao as MindooDBAppExtractDocumentTextResult, ap as MindooDBAppExtractTextFormat, aq as MindooDBAppExtractionSetup, ar as MindooDBAppFulltextSetup, as as MindooDBAppHistoricalDocument, at as MindooDBAppHistoryQuery, au as MindooDBAppHostTheme, av as MindooDBAppIdentityApi, aw as MindooDBAppJsonListDeletePatch, ax as MindooDBAppJsonListInsertPatch, ay as MindooDBAppJsonPatch, az as MindooDBAppJsonSetPatch, aA as MindooDBAppJsonTextMarkPatch, aB as MindooDBAppJsonTextSplicePatch, aC as MindooDBAppJsonTextUnmarkPatch, aD as MindooDBAppJsonUnsetPatch, aE as MindooDBAppLaunchContext, aF as MindooDBAppLiveQuerySubscription, aG as MindooDBAppMenuAnchor, aH as MindooDBAppMenuApi, aI as MindooDBAppMenuCommandItem, aJ as MindooDBAppMenuDismissReason, aK as MindooDBAppMenuDismissedResult, aL as MindooDBAppMenuItem, aM as MindooDBAppMenuKind, aN as MindooDBAppMenuPlacement, aO as MindooDBAppMenuPointAnchor, aP as MindooDBAppMenuRect, aQ as MindooDBAppMenuRectAnchor, aR as MindooDBAppMenuSelectionResult, aS as MindooDBAppMenuSeparatorItem, aT as MindooDBAppQueryCoverage, aU as MindooDBAppQueryResult, aV as MindooDBAppQueryRow, aW as MindooDBAppQuerySortKey, aX as MindooDBAppQueryTextClause, aY as MindooDBAppReadableAttachmentStream, aZ as MindooDBAppRecipientOptions, a_ as MindooDBAppResolvedViewDefinition, a$ as MindooDBAppResolvedViewSource, b0 as MindooDBAppRevisionPhase, b1 as MindooDBAppRevisionVerification, b2 as MindooDBAppRichTextBlockSpan, b3 as MindooDBAppRichTextGetOptions, b4 as MindooDBAppRichTextImmutableString, b5 as MindooDBAppRichTextMarkRange, b6 as MindooDBAppRichTextMaterializeValue, b7 as MindooDBAppRichTextPatch, b8 as MindooDBAppRichTextScalar, b9 as MindooDBAppRichTextSpliceStep, ba as MindooDBAppRichTextStep, bb as MindooDBAppRichTextStepPatch, bc as MindooDBAppRichTextTextSpan, bd as MindooDBAppRuntime, be as MindooDBAppScanAttachmentOptions, bf as MindooDBAppScanAttachmentResult, bg as MindooDBAppScopedDocId, bh as MindooDBAppScopedDocumentSummary, bi as MindooDBAppSealIntent, bj as MindooDBAppSession, bk as MindooDBAppShowMenuInput, bl as MindooDBAppShowMenuResult, bm as MindooDBAppSignPreview, bn as MindooDBAppSignPreviewScope, bo as MindooDBAppSignStatementInput, bp as MindooDBAppSignStatementResult, bq as MindooDBAppTextEdit, br as MindooDBAppTextPatch, bs as MindooDBAppThemeMode, bt as MindooDBAppTimestampApi, bu as MindooDBAppTimestampInput, bv as MindooDBAppTimestampProvider, bw as MindooDBAppTimestampResult, bx as MindooDBAppUiPreferences, by as MindooDBAppUpdateDocumentInput, bz as MindooDBAppViewCursorDocumentListResult, bA as MindooDBAppViewCursorResult, bB as MindooDBAppViewEntry, bC as MindooDBAppViewEntryKind, bD as MindooDBAppViewNavigator, bE as MindooDBAppViewNavigatorExpansionState, bF as MindooDBAppViewNavigatorOpenOptions, bG as MindooDBAppViewNavigatorPageOptions, bH as MindooDBAppViewNavigatorPageResult, bI as MindooDBAppViewNavigatorRangeQuery, bJ as MindooDBAppViewNavigatorSelectionState, bK as MindooDBAppViewUpdateStats, bL as MindooDBAppViewport, bM as MindooDBAppWritableAttachmentStream } from './types-Plb92iSn.js';
1
+ import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppBridge, b as MindooDBAppDatabase, c as MindooDBAppDocument, d as MindooDBAppRichTextSpan, e as MindooDBAppRichTextSnapshot } from './types-DlZpHkfb.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 MindooDBAppCreateKeyInfo, a7 as MindooDBAppCreateViewInput, a8 as MindooDBAppCreateViewNavigatorInput, a9 as MindooDBAppDatabaseInfo, aa as MindooDBAppDirectoryApi, ab as MindooDBAppDirectoryEntry, ac as MindooDBAppDocumentApi, ad as MindooDBAppDocumentHeadCursorResult, ae as MindooDBAppDocumentHistoryEntry, af as MindooDBAppDocumentListQuery, ag as MindooDBAppDocumentListResult, ah as MindooDBAppDocumentQuery, ai as MindooDBAppDocumentRevisionId, aj as MindooDBAppDocumentScanPreset, ak as MindooDBAppDocumentSummary, al as MindooDBAppEntryAttachmentRef, am as MindooDBAppEntryProvenance, an as MindooDBAppExtractDocumentTextInput, ao as MindooDBAppExtractDocumentTextResult, ap as MindooDBAppExtractTextFormat, aq as MindooDBAppExtractionSetup, ar as MindooDBAppFulltextSetup, as as MindooDBAppHistoricalDocument, at as MindooDBAppHistoryQuery, au as MindooDBAppHostTheme, av as MindooDBAppIdentityApi, aw as MindooDBAppInaccessibleDocument, ax as MindooDBAppInaccessibleDocumentListQuery, ay as MindooDBAppInaccessibleDocumentListResult, az as MindooDBAppJsonListDeletePatch, aA as MindooDBAppJsonListInsertPatch, aB as MindooDBAppJsonPatch, aC as MindooDBAppJsonSetPatch, aD as MindooDBAppJsonTextMarkPatch, aE as MindooDBAppJsonTextSplicePatch, aF as MindooDBAppJsonTextUnmarkPatch, aG as MindooDBAppJsonUnsetPatch, aH as MindooDBAppLaunchContext, aI as MindooDBAppLiveQuerySubscription, aJ as MindooDBAppMenuAnchor, aK as MindooDBAppMenuApi, aL as MindooDBAppMenuCommandItem, aM as MindooDBAppMenuDismissReason, aN as MindooDBAppMenuDismissedResult, aO as MindooDBAppMenuItem, aP as MindooDBAppMenuKind, aQ as MindooDBAppMenuPlacement, aR as MindooDBAppMenuPointAnchor, aS as MindooDBAppMenuRect, aT as MindooDBAppMenuRectAnchor, aU as MindooDBAppMenuSelectionResult, aV as MindooDBAppMenuSeparatorItem, aW as MindooDBAppQueryCoverage, aX as MindooDBAppQueryResult, aY as MindooDBAppQueryRow, aZ as MindooDBAppQuerySortKey, a_ as MindooDBAppQueryTextClause, a$ as MindooDBAppReadableAttachmentStream, b0 as MindooDBAppRecipientOptions, b1 as MindooDBAppResolvedViewDefinition, b2 as MindooDBAppResolvedViewSource, b3 as MindooDBAppRevisionPhase, b4 as MindooDBAppRevisionVerification, b5 as MindooDBAppRichTextBlockSpan, b6 as MindooDBAppRichTextGetOptions, b7 as MindooDBAppRichTextImmutableString, b8 as MindooDBAppRichTextMarkRange, b9 as MindooDBAppRichTextMaterializeValue, ba as MindooDBAppRichTextPatch, bb as MindooDBAppRichTextScalar, bc as MindooDBAppRichTextSpliceStep, bd as MindooDBAppRichTextStep, be as MindooDBAppRichTextStepPatch, bf as MindooDBAppRichTextTextSpan, bg as MindooDBAppRuntime, bh as MindooDBAppScanAttachmentOptions, bi as MindooDBAppScanAttachmentResult, bj as MindooDBAppScopedDocId, bk as MindooDBAppScopedDocumentSummary, bl as MindooDBAppSealIntent, bm as MindooDBAppSealedChannelOpenInput, bn as MindooDBAppSealedChannelOpenResult, bo as MindooDBAppSealedChannelRequestInput, bp as MindooDBAppSession, bq as MindooDBAppShowMenuInput, br as MindooDBAppShowMenuResult, bs as MindooDBAppSignPreview, bt as MindooDBAppSignPreviewScope, bu as MindooDBAppSignStatementInput, bv as MindooDBAppSignStatementResult, bw as MindooDBAppTextEdit, bx as MindooDBAppTextPatch, by as MindooDBAppThemeMode, bz as MindooDBAppTimestampApi, bA as MindooDBAppTimestampInput, bB as MindooDBAppTimestampProvider, bC as MindooDBAppTimestampResult, bD as MindooDBAppUiPreferences, bE as MindooDBAppUpdateDocumentInput, bF as MindooDBAppViewCursorDocumentListResult, bG as MindooDBAppViewCursorResult, bH as MindooDBAppViewEntry, bI as MindooDBAppViewEntryKind, bJ as MindooDBAppViewNavigator, bK as MindooDBAppViewNavigatorExpansionState, bL as MindooDBAppViewNavigatorOpenOptions, bM as MindooDBAppViewNavigatorPageOptions, bN as MindooDBAppViewNavigatorPageResult, bO as MindooDBAppViewNavigatorRangeQuery, bP as MindooDBAppViewNavigatorSelectionState, bQ as MindooDBAppViewUpdateStats, bR as MindooDBAppViewport, bS as MindooDBAppWritableAttachmentStream } from './types-DlZpHkfb.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
@@ -758,6 +758,10 @@ var MindooDBAppDatabaseImpl = class {
758
758
  databaseId: this.databaseId,
759
759
  query: query ?? {}
760
760
  }),
761
+ listInaccessible: async (query) => await this.rpc.call("documents.listInaccessible", {
762
+ databaseId: this.databaseId,
763
+ query: query ?? {}
764
+ }),
761
765
  query: async (query) => await this.rpc.call("documents.query", {
762
766
  databaseId: this.databaseId,
763
767
  query: normalizeDocumentQuery(query)
@@ -1176,6 +1180,22 @@ var MindooDBAppSessionImpl = class {
1176
1180
  async getLaunchContext() {
1177
1181
  return await this.rpc.call("session.getLaunchContext", {});
1178
1182
  }
1183
+ /**
1184
+ * Asks the host to open an encrypted channel to a tenant-joined service.
1185
+ * The host owns the key exchange and the resulting session key; nothing
1186
+ * secret crosses back into the app.
1187
+ */
1188
+ async openSealedChannel(input) {
1189
+ return await this.rpc.call("sealedChannel.open", input);
1190
+ }
1191
+ /** Sends one request through an open channel; the host seals and opens it. */
1192
+ async sealedChannelRequest(input) {
1193
+ return await this.rpc.call("sealedChannel.request", input);
1194
+ }
1195
+ /** Discards a channel host-side. */
1196
+ async closeSealedChannel(channelId) {
1197
+ await this.rpc.call("sealedChannel.close", { channelId });
1198
+ }
1179
1199
  /** Returns the product names currently licensed in the Haven host. */
1180
1200
  async getLicensedProducts() {
1181
1201
  return await this.rpc.call("session.getLicensedProducts", {});
@@ -1,4 +1,4 @@
1
- import { a8 as MindooDBAppCreateViewNavigatorInput, bD as MindooDBAppViewNavigator, aE as MindooDBAppLaunchContext, a9 as MindooDBAppDatabaseInfo, ac as MindooDBAppDocumentApi, bF as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, av as MindooDBAppIdentityApi, bt as MindooDBAppTimestampApi, aa as MindooDBAppDirectoryApi, c as MindooDBAppDocument, ar as MindooDBAppFulltextSetup, aq as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bj as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, au as MindooDBAppHostTheme, bL as MindooDBAppViewport, bx as MindooDBAppUiPreferences, aU as MindooDBAppQueryResult, bK as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-Plb92iSn.js';
1
+ import { a8 as MindooDBAppCreateViewNavigatorInput, bJ as MindooDBAppViewNavigator, aH as MindooDBAppLaunchContext, a9 as MindooDBAppDatabaseInfo, ac as MindooDBAppDocumentApi, bL as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, av as MindooDBAppIdentityApi, bz as MindooDBAppTimestampApi, aa as MindooDBAppDirectoryApi, c as MindooDBAppDocument, ar as MindooDBAppFulltextSetup, aq as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bp as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, au as MindooDBAppHostTheme, bR as MindooDBAppViewport, bD as MindooDBAppUiPreferences, aX as MindooDBAppQueryResult, bQ as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-DlZpHkfb.js';
2
2
  import * as mindoodb from 'mindoodb';
3
3
  import 'mindoodb-view-language';
4
4
 
@@ -38,7 +38,12 @@ interface MockSeedDocument {
38
38
  id: string;
39
39
  data: Record<string, unknown>;
40
40
  updatedAt?: string;
41
+ createdAt?: string;
41
42
  isDeleted?: boolean;
43
+ /** When true the doc is hidden from `list`/`get` and returned by `listInaccessible`. */
44
+ inaccessible?: boolean;
45
+ decryptionKeyId?: string;
46
+ authorLabel?: string;
42
47
  heads?: string[];
43
48
  attachments?: MindooDBAppDocument["attachments"];
44
49
  }
@@ -67,10 +72,31 @@ interface MockMindooDBAppDatabaseDefinition {
67
72
  */
68
73
  extractionSetup?: MindooDBAppExtractionSetup | null;
69
74
  }
75
+ /**
76
+ * Stands in for the host-owned sealed channel.
77
+ *
78
+ * The mock carries no crypto: Haven does the key exchange and the AES sealing
79
+ * for real, and a test host has no identity key to do it with. What a test can
80
+ * exercise is the shape apps actually depend on — that a declined channel is an
81
+ * ordinary `ok: false`, and that a request round-trips plain JSON.
82
+ */
83
+ interface MockSealedChannelOptions {
84
+ /** When true, `openSealedChannel` resolves `{ ok: false, reason: "declined" }`. */
85
+ declined?: boolean;
86
+ /** Username reported by a successfully opened channel. Defaults to the launch context user. */
87
+ username?: string;
88
+ /** Handles each `sealedChannelRequest`. Without it, requests throw. */
89
+ onRequest?: (input: {
90
+ baseUrl: string;
91
+ path: string;
92
+ payload: unknown;
93
+ }) => MaybePromise<unknown>;
94
+ }
70
95
  interface CreateMockMindooDBAppSessionOptions {
71
96
  launchContext?: Partial<MindooDBAppLaunchContext>;
72
97
  databases?: MockMindooDBAppDatabaseDefinition[];
73
98
  onDisconnect?: () => MaybePromise<void>;
99
+ sealedChannel?: MockSealedChannelOptions;
74
100
  }
75
101
  interface MockMindooDBAppSessionController {
76
102
  bridge: MindooDBAppBridge;
@@ -123,4 +149,4 @@ interface FakeBridgeHostController {
123
149
  }
124
150
  declare function createFakeBridgeHost(options?: CreateFakeBridgeHostOptions): FakeBridgeHostController;
125
151
 
126
- export { type CreateFakeBridgeHostOptions, type CreateMockMindooDBAppSessionOptions, type EvaluatingViewDocument, type FakeBridgeHostController, type FakeBridgePortMessageHandler, type FakeBridgeRequestHandler, type MockMindooDBAppDatabaseDefinition, type MockMindooDBAppSessionController, type MockSeedDocument, createEvaluatingViewNavigator, createFakeBridgeHost, createMockMindooDBAppBridge, createMockMindooDBAppSession, loadMindoodbForTesting };
152
+ export { type CreateFakeBridgeHostOptions, type CreateMockMindooDBAppSessionOptions, type EvaluatingViewDocument, type FakeBridgeHostController, type FakeBridgePortMessageHandler, type FakeBridgeRequestHandler, type MockMindooDBAppDatabaseDefinition, type MockMindooDBAppSessionController, type MockSealedChannelOptions, type MockSeedDocument, createEvaluatingViewNavigator, createFakeBridgeHost, createMockMindooDBAppBridge, createMockMindooDBAppSession, loadMindoodbForTesting };
@@ -942,7 +942,7 @@ function runMockDocumentQuery(storedDocuments, databaseId, query) {
942
942
  const sortBy = query?.sortBy && query.sortBy.length > 0 ? query.sortBy : query?.text ? [{ special: "textScore", direction: "descending" }] : [];
943
943
  const matches = [];
944
944
  for (const document of storedDocuments.values()) {
945
- if (document.isDeleted) {
945
+ if (document.isDeleted || document.inaccessible) {
946
946
  continue;
947
947
  }
948
948
  let textScore;
@@ -1228,7 +1228,11 @@ function createDatabaseHandle(definition) {
1228
1228
  heads: seed.heads ? [...seed.heads] : void 0,
1229
1229
  attachments: seed.attachments ? structuredClone(seed.attachments) : [],
1230
1230
  updatedAt: seed.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
1231
- isDeleted: seed.isDeleted ?? false
1231
+ isDeleted: seed.isDeleted ?? false,
1232
+ inaccessible: seed.inaccessible ?? false,
1233
+ decryptionKeyId: seed.decryptionKeyId,
1234
+ authorLabel: seed.authorLabel,
1235
+ createdAt: seed.createdAt
1232
1236
  });
1233
1237
  }
1234
1238
  const liveQuerySubscriptions = /* @__PURE__ */ new Set();
@@ -1325,7 +1329,7 @@ function createDatabaseHandle(definition) {
1325
1329
  const offset = decodeMockListCursor(query?.cursor) + skip;
1326
1330
  const metadataOnly = query?.metadataOnly ?? false;
1327
1331
  const idPrefix = query?.idPrefix;
1328
- const items = Array.from(storedDocuments.values()).filter(
1332
+ const items = Array.from(storedDocuments.values()).filter((document) => !document.inaccessible).filter(
1329
1333
  (document) => status === "all" ? true : status === "deleted" ? document.isDeleted : !document.isDeleted
1330
1334
  ).filter((document) => matchesMockIdPrefix(document.id, idPrefix)).filter(
1331
1335
  (document) => metadataOnly ? true : matchesDocumentFilter(document, query?.filter)
@@ -1362,9 +1366,19 @@ function createDatabaseHandle(definition) {
1362
1366
  cursor: String(storedDocuments.size)
1363
1367
  };
1364
1368
  },
1369
+ async listInaccessible(query) {
1370
+ const idPrefix = query?.idPrefix;
1371
+ const items = Array.from(storedDocuments.values()).filter((document) => document.inaccessible).filter((document) => matchesMockIdPrefix(document.id, idPrefix)).sort((left, right) => left.id.localeCompare(right.id)).map((document) => ({
1372
+ id: document.id,
1373
+ createdAt: document.createdAt ?? document.updatedAt ?? (/* @__PURE__ */ new Date(0)).toISOString(),
1374
+ decryptionKeyId: document.decryptionKeyId ?? "sealed",
1375
+ authorLabel: document.authorLabel
1376
+ }));
1377
+ return { items };
1378
+ },
1365
1379
  async get(_docId) {
1366
1380
  const document = storedDocuments.get(_docId);
1367
- if (!document || document.isDeleted) {
1381
+ if (!document || document.isDeleted || document.inaccessible) {
1368
1382
  return null;
1369
1383
  }
1370
1384
  return {
@@ -1803,7 +1817,7 @@ function createDatabaseHandle(definition) {
1803
1817
  };
1804
1818
  return {
1805
1819
  handle: databaseHandle,
1806
- listViewDocuments: () => Array.from(storedDocuments.values()).filter((document) => !document.isDeleted).map((document) => ({
1820
+ listViewDocuments: () => Array.from(storedDocuments.values()).filter((document) => !document.isDeleted && !document.inaccessible).map((document) => ({
1807
1821
  origin: definition.info.id,
1808
1822
  docId: document.id,
1809
1823
  data: structuredClone(document.data),
@@ -1823,6 +1837,18 @@ function createMockSessionState(options = {}) {
1823
1837
  const sessionViews = /* @__PURE__ */ new Map();
1824
1838
  let activeMenuResolve = null;
1825
1839
  let databaseInfos = [];
1840
+ const openSealedChannels = /* @__PURE__ */ new Map();
1841
+ const requireCapability = (databaseId, capability) => {
1842
+ const info = databaseInfos.find((entry) => entry.id === databaseId);
1843
+ if (!info) {
1844
+ throw new Error(`Unknown database "${databaseId}"`);
1845
+ }
1846
+ if (!info.capabilities.includes(capability)) {
1847
+ throw new Error(
1848
+ `Database "${databaseId}" was not granted the "${capability}" capability`
1849
+ );
1850
+ }
1851
+ };
1826
1852
  const menus = {
1827
1853
  async show(_input) {
1828
1854
  if (activeMenuResolve) {
@@ -1883,6 +1909,36 @@ function createMockSessionState(options = {}) {
1883
1909
  async getLaunchContext() {
1884
1910
  return mergeLaunchContext(launchContext);
1885
1911
  },
1912
+ async openSealedChannel(input) {
1913
+ if (options.sealedChannel?.declined) {
1914
+ return { ok: false, reason: "declined" };
1915
+ }
1916
+ requireCapability(input.databaseId, "sealedchannel");
1917
+ const channelId = `mock-channel-${openSealedChannels.size + 1}`;
1918
+ openSealedChannels.set(channelId, input.baseUrl);
1919
+ return {
1920
+ ok: true,
1921
+ channelId,
1922
+ username: options.sealedChannel?.username ?? launchContext.user.username,
1923
+ expiresAt: Date.now() + 12 * 60 * 60 * 1e3
1924
+ };
1925
+ },
1926
+ async sealedChannelRequest(input) {
1927
+ const baseUrl = openSealedChannels.get(input.channelId);
1928
+ if (baseUrl == null) {
1929
+ throw new Error(`Unknown sealed channel "${input.channelId}"`);
1930
+ }
1931
+ const handler = options.sealedChannel?.onRequest;
1932
+ if (!handler) {
1933
+ throw new Error(
1934
+ "sealedChannelRequest is not configured in this test session (pass sealedChannel.onRequest)"
1935
+ );
1936
+ }
1937
+ return await handler({ baseUrl, path: input.path, payload: input.payload });
1938
+ },
1939
+ async closeSealedChannel(channelId) {
1940
+ openSealedChannels.delete(channelId);
1941
+ },
1886
1942
  async getLicensedProducts() {
1887
1943
  return [...launchContext.licensedProducts ?? []];
1888
1944
  },
@@ -2243,10 +2299,25 @@ function createFakeBridgeHost(options = {}) {
2243
2299
  case "session.disconnect":
2244
2300
  await state.session.disconnect();
2245
2301
  return { ok: true };
2302
+ case "sealedChannel.open":
2303
+ return await state.session.openSealedChannel(
2304
+ params
2305
+ );
2306
+ case "sealedChannel.request":
2307
+ return await state.session.sealedChannelRequest(
2308
+ params
2309
+ );
2310
+ case "sealedChannel.close":
2311
+ await state.session.closeSealedChannel(String(params.channelId));
2312
+ return { ok: true };
2246
2313
  case "documents.list":
2247
2314
  return await state.getDatabase(String(params.databaseId)).documents.list(
2248
2315
  params.query
2249
2316
  );
2317
+ case "documents.listInaccessible":
2318
+ return await state.getDatabase(String(params.databaseId)).documents.listInaccessible(
2319
+ params.query
2320
+ );
2250
2321
  case "documents.getHeadCursor":
2251
2322
  return await state.getDatabase(String(params.databaseId)).documents.getHeadCursor();
2252
2323
  case "database.getFulltextSetup":
@@ -102,7 +102,7 @@ interface MindooDBAppResolvedViewDefinition {
102
102
  columns: MindooDBAppConfiguredViewColumn[];
103
103
  }
104
104
  /** Permission/capability flags exposed for a database binding inside the app session. */
105
- type MindooDBAppCapability = "read" | "create" | "update" | "delete" | "history" | "attachments" | "views" | "sign" | "timestamps" | "directory";
105
+ type MindooDBAppCapability = "read" | "create" | "update" | "delete" | "history" | "attachments" | "views" | "sign" | "timestamps" | "directory" | "sealedchannel";
106
106
  /** Metadata about the current app launch supplied by the Haven host. */
107
107
  interface MindooDBAppLaunchContext {
108
108
  appId: string;
@@ -359,6 +359,30 @@ interface MindooDBAppDocumentListQuery {
359
359
  */
360
360
  idPrefix?: string;
361
361
  }
362
+ /** Query options for {@link MindooDBAppDocumentApi.listInaccessible}. */
363
+ interface MindooDBAppInaccessibleDocumentListQuery {
364
+ /**
365
+ * Restrict the listing to documents whose id matches this prefix. Matching is
366
+ * the same boundary-aware rule as {@link MindooDBAppDocumentListQuery.idPrefix}.
367
+ */
368
+ idPrefix?: string;
369
+ }
370
+ /**
371
+ * A document that exists in the local store but the current user cannot open.
372
+ * Built from unsigned `doc_create` (or `doc_snapshot`) metadata — no payload
373
+ * and no CAS access for the app.
374
+ */
375
+ interface MindooDBAppInaccessibleDocument {
376
+ id: string;
377
+ createdAt: string;
378
+ decryptionKeyId: string;
379
+ /** Directory display name of the origin author, when the host can resolve it. */
380
+ authorLabel?: string;
381
+ }
382
+ /** Result of {@link MindooDBAppDocumentApi.listInaccessible}. */
383
+ interface MindooDBAppInaccessibleDocumentListResult {
384
+ items: MindooDBAppInaccessibleDocument[];
385
+ }
362
386
  /** Paged result returned by `documents.list()`. */
363
387
  interface MindooDBAppDocumentListResult {
364
388
  items: MindooDBAppDocumentSummary[];
@@ -1177,6 +1201,14 @@ interface MindooDBAppDocumentApi {
1177
1201
  * {@link query}. Requires the `read` capability.
1178
1202
  */
1179
1203
  list(query?: MindooDBAppDocumentListQuery): Promise<MindooDBAppDocumentListResult>;
1204
+ /**
1205
+ * Documents present in this database that the current user cannot decrypt
1206
+ * (not a recipient, or missing `decryptionKeyId`). They do not appear in
1207
+ * {@link list} or {@link get}. Each row is store-metadata only: id,
1208
+ * origin timestamp, key id, and the author's directory label when known.
1209
+ * Requires the `read` capability.
1210
+ */
1211
+ listInaccessible(query?: MindooDBAppInaccessibleDocumentListQuery): Promise<MindooDBAppInaccessibleDocumentListResult>;
1180
1212
  /**
1181
1213
  * The database's latest changefeed cursor without loading any documents.
1182
1214
  * Useful as a baseline checkpoint before starting an incremental
@@ -1934,6 +1966,43 @@ interface MindooDBAppDatabase {
1934
1966
  */
1935
1967
  setExtractionSetup(config: MindooDBAppExtractionSetup | null): Promise<void>;
1936
1968
  }
1969
+ /** Request to open a host-owned encrypted channel to a tenant-joined service. */
1970
+ interface MindooDBAppSealedChannelOpenInput {
1971
+ /** Binding whose `sealedchannel` capability authorises the channel. */
1972
+ databaseId: string;
1973
+ /**
1974
+ * Base URL of the service, e.g. `https://bridge.example.com`. Must be
1975
+ * `https:` unless it is a loopback host, and carries no path, query or
1976
+ * fragment.
1977
+ */
1978
+ baseUrl: string;
1979
+ }
1980
+ /**
1981
+ * Outcome of {@link MindooDBAppSession.openSealedChannel}.
1982
+ *
1983
+ * Declining is an ordinary outcome, not an error, so an app can tell "the user
1984
+ * said no" from "the handshake failed" without inspecting error strings.
1985
+ */
1986
+ type MindooDBAppSealedChannelOpenResult = {
1987
+ ok: true;
1988
+ /** Handle for {@link MindooDBAppSession.sealedChannelRequest}. Not a secret. */
1989
+ channelId: string;
1990
+ /** Tenant username the far side authenticated this channel as. */
1991
+ username: string;
1992
+ /** Epoch milliseconds after which the far side stops accepting the channel. */
1993
+ expiresAt: number;
1994
+ } | {
1995
+ ok: false;
1996
+ reason: "declined";
1997
+ };
1998
+ /** One request over an open sealed channel. */
1999
+ interface MindooDBAppSealedChannelRequestInput {
2000
+ channelId: string;
2001
+ /** Path below the channel's base URL, e.g. `/jmap/api`. */
2002
+ path: string;
2003
+ /** JSON-serialisable body. Sealed by the host before it leaves the device. */
2004
+ payload: unknown;
2005
+ }
1937
2006
  /** Connected session between the running app and the Haven host. */
1938
2007
  interface MindooDBAppSession {
1939
2008
  /**
@@ -1942,6 +2011,26 @@ interface MindooDBAppSession {
1942
2011
  * mapped to this app. Cached — repeated calls do not hit the host again.
1943
2012
  */
1944
2013
  getLaunchContext(): Promise<MindooDBAppLaunchContext>;
2014
+ /**
2015
+ * Open an end-to-end encrypted channel to a service that has joined the
2016
+ * user's tenant, such as a mail bridge.
2017
+ *
2018
+ * Haven performs the key exchange with the user's identity key and keeps the
2019
+ * resulting AES key host-side, so the app sends and receives plain JSON and
2020
+ * never handles key material. Requires the `sealedchannel` capability on
2021
+ * `databaseId` plus the user's consent for the target origin.
2022
+ *
2023
+ * Resolves with `ok: false` when the user declines — an ordinary outcome, not
2024
+ * an error.
2025
+ */
2026
+ openSealedChannel(input: MindooDBAppSealedChannelOpenInput): Promise<MindooDBAppSealedChannelOpenResult>;
2027
+ /**
2028
+ * Send `payload` through an open channel and return the decrypted reply.
2029
+ * `path` is resolved against the channel's base URL and may not escape it.
2030
+ */
2031
+ sealedChannelRequest<T = unknown>(input: MindooDBAppSealedChannelRequestInput): Promise<T>;
2032
+ /** Discard a channel and its key. Idempotent. */
2033
+ closeSealedChannel(channelId: string): Promise<void>;
1945
2034
  /**
1946
2035
  * Product license identifiers active for the current Haven user, for apps
1947
2036
  * that gate features on licensing.
@@ -2026,4 +2115,4 @@ interface MindooDBAppBridge {
2026
2115
  connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
2027
2116
  }
2028
2117
 
2029
- 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 MindooDBAppResolvedViewSource 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 MindooDBAppCreateKeyInfo as a6, type MindooDBAppCreateViewInput as a7, type MindooDBAppCreateViewNavigatorInput as a8, type MindooDBAppDatabaseInfo as a9, type MindooDBAppJsonTextMarkPatch as aA, type MindooDBAppJsonTextSplicePatch as aB, type MindooDBAppJsonTextUnmarkPatch as aC, type MindooDBAppJsonUnsetPatch as aD, type MindooDBAppLaunchContext as aE, type MindooDBAppLiveQuerySubscription as aF, type MindooDBAppMenuAnchor as aG, type MindooDBAppMenuApi as aH, type MindooDBAppMenuCommandItem as aI, type MindooDBAppMenuDismissReason as aJ, type MindooDBAppMenuDismissedResult as aK, type MindooDBAppMenuItem as aL, type MindooDBAppMenuKind as aM, type MindooDBAppMenuPlacement as aN, type MindooDBAppMenuPointAnchor as aO, type MindooDBAppMenuRect as aP, type MindooDBAppMenuRectAnchor as aQ, type MindooDBAppMenuSelectionResult as aR, type MindooDBAppMenuSeparatorItem as aS, type MindooDBAppQueryCoverage as aT, type MindooDBAppQueryResult as aU, type MindooDBAppQueryRow as aV, type MindooDBAppQuerySortKey as aW, type MindooDBAppQueryTextClause as aX, type MindooDBAppReadableAttachmentStream as aY, type MindooDBAppRecipientOptions as aZ, type MindooDBAppResolvedViewDefinition as a_, type MindooDBAppDirectoryApi as aa, type MindooDBAppDirectoryEntry as ab, type MindooDBAppDocumentApi as ac, type MindooDBAppDocumentHeadCursorResult as ad, type MindooDBAppDocumentHistoryEntry as ae, type MindooDBAppDocumentListQuery as af, type MindooDBAppDocumentListResult as ag, type MindooDBAppDocumentQuery as ah, type MindooDBAppDocumentRevisionId as ai, type MindooDBAppDocumentScanPreset as aj, type MindooDBAppDocumentSummary as ak, type MindooDBAppEntryAttachmentRef as al, type MindooDBAppEntryProvenance as am, type MindooDBAppExtractDocumentTextInput as an, type MindooDBAppExtractDocumentTextResult as ao, type MindooDBAppExtractTextFormat as ap, type MindooDBAppExtractionSetup as aq, type MindooDBAppFulltextSetup as ar, type MindooDBAppHistoricalDocument as as, type MindooDBAppHistoryQuery as at, type MindooDBAppHostTheme as au, type MindooDBAppIdentityApi as av, type MindooDBAppJsonListDeletePatch as aw, type MindooDBAppJsonListInsertPatch as ax, type MindooDBAppJsonPatch as ay, type MindooDBAppJsonSetPatch as az, type MindooDBAppDatabase as b, type MindooDBAppRevisionPhase as b0, type MindooDBAppRevisionVerification as b1, type MindooDBAppRichTextBlockSpan as b2, type MindooDBAppRichTextGetOptions as b3, type MindooDBAppRichTextImmutableString as b4, type MindooDBAppRichTextMarkRange as b5, type MindooDBAppRichTextMaterializeValue as b6, type MindooDBAppRichTextPatch as b7, type MindooDBAppRichTextScalar as b8, type MindooDBAppRichTextSpliceStep as b9, type MindooDBAppViewCursorResult as bA, type MindooDBAppViewEntry as bB, type MindooDBAppViewEntryKind as bC, type MindooDBAppViewNavigator as bD, type MindooDBAppViewNavigatorExpansionState as bE, type MindooDBAppViewNavigatorOpenOptions as bF, type MindooDBAppViewNavigatorPageOptions as bG, type MindooDBAppViewNavigatorPageResult as bH, type MindooDBAppViewNavigatorRangeQuery as bI, type MindooDBAppViewNavigatorSelectionState as bJ, type MindooDBAppViewUpdateStats as bK, type MindooDBAppViewport as bL, type MindooDBAppWritableAttachmentStream as bM, type MindooDBAppRichTextStep as ba, type MindooDBAppRichTextStepPatch as bb, type MindooDBAppRichTextTextSpan as bc, type MindooDBAppRuntime as bd, type MindooDBAppScanAttachmentOptions as be, type MindooDBAppScanAttachmentResult as bf, type MindooDBAppScopedDocId as bg, type MindooDBAppScopedDocumentSummary as bh, type MindooDBAppSealIntent as bi, type MindooDBAppSession as bj, type MindooDBAppShowMenuInput as bk, type MindooDBAppShowMenuResult as bl, type MindooDBAppSignPreview as bm, type MindooDBAppSignPreviewScope as bn, type MindooDBAppSignStatementInput as bo, type MindooDBAppSignStatementResult as bp, type MindooDBAppTextEdit as bq, type MindooDBAppTextPatch as br, type MindooDBAppThemeMode as bs, type MindooDBAppTimestampApi as bt, type MindooDBAppTimestampInput as bu, type MindooDBAppTimestampProvider as bv, type MindooDBAppTimestampResult as bw, type MindooDBAppUiPreferences as bx, type MindooDBAppUpdateDocumentInput as by, type MindooDBAppViewCursorDocumentListResult 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 };
2118
+ 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 MindooDBAppReadableAttachmentStream 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 MindooDBAppCreateKeyInfo as a6, type MindooDBAppCreateViewInput as a7, type MindooDBAppCreateViewNavigatorInput as a8, type MindooDBAppDatabaseInfo as a9, type MindooDBAppJsonListInsertPatch as aA, type MindooDBAppJsonPatch as aB, type MindooDBAppJsonSetPatch as aC, type MindooDBAppJsonTextMarkPatch as aD, type MindooDBAppJsonTextSplicePatch as aE, type MindooDBAppJsonTextUnmarkPatch as aF, type MindooDBAppJsonUnsetPatch as aG, type MindooDBAppLaunchContext as aH, type MindooDBAppLiveQuerySubscription as aI, type MindooDBAppMenuAnchor as aJ, type MindooDBAppMenuApi as aK, type MindooDBAppMenuCommandItem as aL, type MindooDBAppMenuDismissReason as aM, type MindooDBAppMenuDismissedResult as aN, type MindooDBAppMenuItem as aO, type MindooDBAppMenuKind as aP, type MindooDBAppMenuPlacement as aQ, type MindooDBAppMenuPointAnchor as aR, type MindooDBAppMenuRect as aS, type MindooDBAppMenuRectAnchor as aT, type MindooDBAppMenuSelectionResult as aU, type MindooDBAppMenuSeparatorItem as aV, type MindooDBAppQueryCoverage as aW, type MindooDBAppQueryResult as aX, type MindooDBAppQueryRow as aY, type MindooDBAppQuerySortKey as aZ, type MindooDBAppQueryTextClause as a_, type MindooDBAppDirectoryApi as aa, type MindooDBAppDirectoryEntry as ab, type MindooDBAppDocumentApi as ac, type MindooDBAppDocumentHeadCursorResult as ad, type MindooDBAppDocumentHistoryEntry as ae, type MindooDBAppDocumentListQuery as af, type MindooDBAppDocumentListResult as ag, type MindooDBAppDocumentQuery as ah, type MindooDBAppDocumentRevisionId as ai, type MindooDBAppDocumentScanPreset as aj, type MindooDBAppDocumentSummary as ak, type MindooDBAppEntryAttachmentRef as al, type MindooDBAppEntryProvenance as am, type MindooDBAppExtractDocumentTextInput as an, type MindooDBAppExtractDocumentTextResult as ao, type MindooDBAppExtractTextFormat as ap, type MindooDBAppExtractionSetup as aq, type MindooDBAppFulltextSetup as ar, type MindooDBAppHistoricalDocument as as, type MindooDBAppHistoryQuery as at, type MindooDBAppHostTheme as au, type MindooDBAppIdentityApi as av, type MindooDBAppInaccessibleDocument as aw, type MindooDBAppInaccessibleDocumentListQuery as ax, type MindooDBAppInaccessibleDocumentListResult as ay, type MindooDBAppJsonListDeletePatch as az, type MindooDBAppDatabase as b, type MindooDBAppRecipientOptions as b0, type MindooDBAppResolvedViewDefinition as b1, type MindooDBAppResolvedViewSource as b2, type MindooDBAppRevisionPhase as b3, type MindooDBAppRevisionVerification as b4, type MindooDBAppRichTextBlockSpan as b5, type MindooDBAppRichTextGetOptions as b6, type MindooDBAppRichTextImmutableString as b7, type MindooDBAppRichTextMarkRange as b8, type MindooDBAppRichTextMaterializeValue as b9, type MindooDBAppTimestampInput as bA, type MindooDBAppTimestampProvider as bB, type MindooDBAppTimestampResult as bC, type MindooDBAppUiPreferences as bD, type MindooDBAppUpdateDocumentInput as bE, type MindooDBAppViewCursorDocumentListResult as bF, type MindooDBAppViewCursorResult as bG, type MindooDBAppViewEntry as bH, type MindooDBAppViewEntryKind as bI, type MindooDBAppViewNavigator as bJ, type MindooDBAppViewNavigatorExpansionState as bK, type MindooDBAppViewNavigatorOpenOptions as bL, type MindooDBAppViewNavigatorPageOptions as bM, type MindooDBAppViewNavigatorPageResult as bN, type MindooDBAppViewNavigatorRangeQuery as bO, type MindooDBAppViewNavigatorSelectionState as bP, type MindooDBAppViewUpdateStats as bQ, type MindooDBAppViewport as bR, type MindooDBAppWritableAttachmentStream as bS, type MindooDBAppRichTextPatch as ba, type MindooDBAppRichTextScalar as bb, type MindooDBAppRichTextSpliceStep as bc, type MindooDBAppRichTextStep as bd, type MindooDBAppRichTextStepPatch as be, type MindooDBAppRichTextTextSpan as bf, type MindooDBAppRuntime as bg, type MindooDBAppScanAttachmentOptions as bh, type MindooDBAppScanAttachmentResult as bi, type MindooDBAppScopedDocId as bj, type MindooDBAppScopedDocumentSummary as bk, type MindooDBAppSealIntent as bl, type MindooDBAppSealedChannelOpenInput as bm, type MindooDBAppSealedChannelOpenResult as bn, type MindooDBAppSealedChannelRequestInput as bo, type MindooDBAppSession as bp, type MindooDBAppShowMenuInput as bq, type MindooDBAppShowMenuResult as br, type MindooDBAppSignPreview as bs, type MindooDBAppSignPreviewScope as bt, type MindooDBAppSignStatementInput as bu, type MindooDBAppSignStatementResult as bv, type MindooDBAppTextEdit as bw, type MindooDBAppTextPatch as bx, type MindooDBAppThemeMode as by, type MindooDBAppTimestampApi 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.37",
3
+ "version": "0.0.39",
4
4
  "engines": {
5
5
  "node": ">=22.13.0"
6
6
  },
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@automerge/automerge": "^3.3.2",
43
- "mindoodb": ">=0.0.53"
43
+ "mindoodb": ">=0.0.56"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@automerge/automerge": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@automerge/automerge": "^3.3.2",
55
- "mindoodb": "^0.0.53",
55
+ "mindoodb": "^0.0.56",
56
56
  "@types/node": "25.5.0",
57
57
  "tsup": "^8.5.1",
58
58
  "typescript": "^6.0.2",