mindoodb-app-sdk 0.0.6 → 0.0.8
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 +132 -33
- package/dist/index.d.ts +2 -2
- package/dist/index.js +164 -68
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +333 -90
- package/dist/{types-BDY_80wd.d.ts → types-C_kZcG24.d.ts} +125 -22
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewDefinition
|
|
1
|
+
import { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewDefinition } from 'mindoodb-view-language';
|
|
2
2
|
|
|
3
3
|
/** Launch target used by the Administrator when opening an app. */
|
|
4
4
|
type MindooDBAppRuntime = "iframe" | "window";
|
|
@@ -126,6 +126,11 @@ interface MindooDBAppAttachmentPreviewOptions {
|
|
|
126
126
|
/** Historical snapshot timestamp previously obtained from `documents.history.getAtTimestamp()`. */
|
|
127
127
|
timestamp?: number;
|
|
128
128
|
}
|
|
129
|
+
/** Resolved Haven preview session prepared for opening in a separate tab or window. */
|
|
130
|
+
interface MindooDBAppAttachmentPreviewSession {
|
|
131
|
+
sessionId: string;
|
|
132
|
+
previewUrl: string;
|
|
133
|
+
}
|
|
129
134
|
/** Database entry visible to the app during launch and database listing. */
|
|
130
135
|
interface MindooDBAppDatabaseInfo {
|
|
131
136
|
id: string;
|
|
@@ -331,28 +336,125 @@ interface MindooDBAppDocumentApi {
|
|
|
331
336
|
listHistory(docId: string): Promise<MindooDBAppDocumentHistoryEntry[]>;
|
|
332
337
|
getAtTimestamp(docId: string, timestamp: number): Promise<MindooDBAppHistoricalDocument>;
|
|
333
338
|
}
|
|
334
|
-
|
|
335
|
-
|
|
339
|
+
type MindooDBAppViewEntryKind = "category" | "document";
|
|
340
|
+
/** Unique document identity within a multi-source view. */
|
|
341
|
+
interface MindooDBAppScopedDocId {
|
|
342
|
+
origin: string;
|
|
343
|
+
docId: string;
|
|
344
|
+
}
|
|
345
|
+
/** Serialized view entry returned by the navigator APIs. */
|
|
346
|
+
interface MindooDBAppViewEntry {
|
|
347
|
+
/** Unique occurrence key within the current navigator session. */
|
|
348
|
+
key: string;
|
|
349
|
+
kind: MindooDBAppViewEntryKind;
|
|
350
|
+
origin: string;
|
|
351
|
+
docId: string | null;
|
|
352
|
+
level: number;
|
|
353
|
+
parentKey: string | null;
|
|
354
|
+
categoryPath: unknown[];
|
|
355
|
+
columnValues: Record<string, unknown>;
|
|
356
|
+
descendantDocumentCount: number;
|
|
357
|
+
childCategoryCount: number;
|
|
358
|
+
childDocumentCount: number;
|
|
359
|
+
/** Stable continuation token for the current occurrence. */
|
|
360
|
+
position: string | null;
|
|
361
|
+
expanded: boolean;
|
|
362
|
+
selected: boolean;
|
|
363
|
+
isVisible: boolean;
|
|
364
|
+
}
|
|
365
|
+
/** Options that shape which subtree and entry kinds a navigator exposes. */
|
|
366
|
+
interface MindooDBAppViewNavigatorOpenOptions {
|
|
367
|
+
includeCategories?: boolean;
|
|
368
|
+
includeDocuments?: boolean;
|
|
369
|
+
hideEmptyCategories?: boolean;
|
|
370
|
+
rootCategoryPath?: unknown[];
|
|
371
|
+
rootEntryKey?: string;
|
|
372
|
+
}
|
|
373
|
+
/** Input used when creating a dynamic view and immediately opening a navigator. */
|
|
374
|
+
interface MindooDBAppCreateViewNavigatorInput {
|
|
375
|
+
databaseIds: string[];
|
|
376
|
+
definition: MindooDBAppViewDefinition;
|
|
377
|
+
options?: MindooDBAppViewNavigatorOpenOptions;
|
|
378
|
+
}
|
|
379
|
+
/** @deprecated Use `MindooDBAppCreateViewNavigatorInput`. */
|
|
380
|
+
type MindooDBAppCreateViewInput = MindooDBAppCreateViewNavigatorInput;
|
|
381
|
+
/** Range query options for key and key-range lookups within a category. */
|
|
382
|
+
interface MindooDBAppViewNavigatorRangeQuery {
|
|
383
|
+
startKey?: unknown;
|
|
384
|
+
endKey?: unknown;
|
|
385
|
+
descending?: boolean;
|
|
386
|
+
exact?: boolean;
|
|
387
|
+
}
|
|
388
|
+
/** Options for batched navigator reads. */
|
|
389
|
+
interface MindooDBAppViewNavigatorPageOptions {
|
|
390
|
+
limit?: number;
|
|
391
|
+
selectedOnly?: boolean;
|
|
392
|
+
startPosition?: string | null;
|
|
393
|
+
}
|
|
394
|
+
/** Paged batch of navigator entries. */
|
|
395
|
+
interface MindooDBAppViewNavigatorPageResult {
|
|
396
|
+
entries: MindooDBAppViewEntry[];
|
|
397
|
+
nextPosition: string | null;
|
|
398
|
+
hasMore: boolean;
|
|
399
|
+
}
|
|
400
|
+
/** Serializable selection state for restoring a navigator session. */
|
|
401
|
+
interface MindooDBAppViewNavigatorSelectionState {
|
|
402
|
+
selectAllByDefault: boolean;
|
|
403
|
+
entryKeys: string[];
|
|
404
|
+
}
|
|
405
|
+
/** Serializable expansion state for restoring a navigator session. */
|
|
406
|
+
interface MindooDBAppViewNavigatorExpansionState {
|
|
407
|
+
expandAllByDefault: boolean;
|
|
408
|
+
expandLevel: number;
|
|
409
|
+
entryKeys: string[];
|
|
410
|
+
}
|
|
411
|
+
/** Stateful view navigator that closely mirrors the core VirtualViewNavigator. */
|
|
412
|
+
interface MindooDBAppViewNavigator {
|
|
336
413
|
getDefinition(): Promise<MindooDBAppViewDefinition>;
|
|
337
414
|
refresh(): Promise<void>;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
415
|
+
getCurrentEntry(): Promise<MindooDBAppViewEntry | null>;
|
|
416
|
+
gotoFirst(): Promise<boolean>;
|
|
417
|
+
gotoLast(): Promise<boolean>;
|
|
418
|
+
gotoNext(): Promise<boolean>;
|
|
419
|
+
gotoPrev(): Promise<boolean>;
|
|
420
|
+
gotoNextSibling(): Promise<boolean>;
|
|
421
|
+
gotoPrevSibling(): Promise<boolean>;
|
|
422
|
+
gotoParent(): Promise<boolean>;
|
|
423
|
+
gotoFirstChild(): Promise<boolean>;
|
|
424
|
+
gotoLastChild(): Promise<boolean>;
|
|
425
|
+
gotoPos(position: string): Promise<boolean>;
|
|
426
|
+
getPos(position: string): Promise<MindooDBAppViewEntry | null>;
|
|
427
|
+
findCategoryEntryByParts(parts: unknown[]): Promise<MindooDBAppViewEntry | null>;
|
|
428
|
+
entriesForward(options?: MindooDBAppViewNavigatorPageOptions): Promise<MindooDBAppViewNavigatorPageResult>;
|
|
429
|
+
entriesBackward(options?: MindooDBAppViewNavigatorPageOptions): Promise<MindooDBAppViewNavigatorPageResult>;
|
|
430
|
+
gotoNextSelected(): Promise<boolean>;
|
|
431
|
+
gotoPrevSelected(): Promise<boolean>;
|
|
432
|
+
select(origin: string, docId: string, selectParentCategories?: boolean): Promise<void>;
|
|
433
|
+
deselect(origin: string, docId: string): Promise<void>;
|
|
434
|
+
selectAllEntries(): Promise<void>;
|
|
435
|
+
deselectAllEntries(): Promise<void>;
|
|
436
|
+
isSelected(origin: string, docId: string): Promise<boolean>;
|
|
437
|
+
getSelectionState(): Promise<MindooDBAppViewNavigatorSelectionState>;
|
|
438
|
+
setSelectionState(state: MindooDBAppViewNavigatorSelectionState): Promise<void>;
|
|
439
|
+
expand(origin: string, docId: string): Promise<void>;
|
|
440
|
+
collapse(origin: string, docId: string): Promise<void>;
|
|
441
|
+
expandAll(): Promise<void>;
|
|
442
|
+
collapseAll(): Promise<void>;
|
|
443
|
+
expandToLevel(level: number): Promise<void>;
|
|
444
|
+
isExpanded(entryKey: string): Promise<boolean>;
|
|
445
|
+
getExpansionState(): Promise<MindooDBAppViewNavigatorExpansionState>;
|
|
446
|
+
setExpansionState(state: MindooDBAppViewNavigatorExpansionState): Promise<void>;
|
|
447
|
+
childEntries(entryKey: string, descending?: boolean): Promise<MindooDBAppViewEntry[]>;
|
|
448
|
+
childCategories(entryKey: string, descending?: boolean): Promise<MindooDBAppViewEntry[]>;
|
|
449
|
+
childDocuments(entryKey: string, descending?: boolean): Promise<MindooDBAppViewEntry[]>;
|
|
450
|
+
childCategoriesByKey(entryKey: string, key: unknown, exact?: boolean, descending?: boolean): Promise<MindooDBAppViewEntry[]>;
|
|
451
|
+
childDocumentsByKey(entryKey: string, key: unknown, exact?: boolean, descending?: boolean): Promise<MindooDBAppViewEntry[]>;
|
|
452
|
+
childCategoriesBetween(entryKey: string, range: MindooDBAppViewNavigatorRangeQuery): Promise<MindooDBAppViewEntry[]>;
|
|
453
|
+
childDocumentsBetween(entryKey: string, range: MindooDBAppViewNavigatorRangeQuery): Promise<MindooDBAppViewEntry[]>;
|
|
454
|
+
getSortedDocIds(descending?: boolean): Promise<MindooDBAppScopedDocId[]>;
|
|
455
|
+
getSortedDocIdsScoped(entryKey: string, descending?: boolean): Promise<MindooDBAppScopedDocId[]>;
|
|
349
456
|
dispose(): Promise<void>;
|
|
350
457
|
}
|
|
351
|
-
/** Payload used when creating one dynamic view inside the current app session. */
|
|
352
|
-
interface MindooDBAppCreateViewInput {
|
|
353
|
-
databaseId: string;
|
|
354
|
-
definition: MindooDBAppViewDefinition;
|
|
355
|
-
}
|
|
356
458
|
/** Attachment operations exposed by an opened database handle. */
|
|
357
459
|
interface MindooDBAppAttachmentApi {
|
|
358
460
|
list(docId: string): Promise<MindooDBAppAttachmentInfo[]>;
|
|
@@ -361,6 +463,7 @@ interface MindooDBAppAttachmentApi {
|
|
|
361
463
|
}>;
|
|
362
464
|
openReadStream(docId: string, attachmentName: string): Promise<MindooDBAppReadableAttachmentStream>;
|
|
363
465
|
openWriteStream(docId: string, attachmentName: string, contentType?: string): Promise<MindooDBAppWritableAttachmentStream>;
|
|
466
|
+
preparePreviewSession(docId: string, attachmentName: string, options?: MindooDBAppAttachmentPreviewOptions): Promise<MindooDBAppAttachmentPreviewSession>;
|
|
364
467
|
openPreview(docId: string, attachmentName: string, options?: MindooDBAppAttachmentPreviewOptions): Promise<{
|
|
365
468
|
ok: true;
|
|
366
469
|
}>;
|
|
@@ -376,8 +479,8 @@ interface MindooDBAppSession {
|
|
|
376
479
|
getLaunchContext(): Promise<MindooDBAppLaunchContext>;
|
|
377
480
|
listDatabases(): Promise<MindooDBAppDatabaseInfo[]>;
|
|
378
481
|
openDatabase(databaseId: string): Promise<MindooDBAppDatabase>;
|
|
379
|
-
|
|
380
|
-
|
|
482
|
+
createViewNavigator(input: MindooDBAppCreateViewNavigatorInput): Promise<MindooDBAppViewNavigator>;
|
|
483
|
+
openViewNavigator(viewId: string, options?: MindooDBAppViewNavigatorOpenOptions): Promise<MindooDBAppViewNavigator>;
|
|
381
484
|
onThemeChange(listener: (theme: MindooDBAppHostTheme) => void): () => void;
|
|
382
485
|
onViewportChange(listener: (viewport: MindooDBAppViewport) => void): () => void;
|
|
383
486
|
disconnect(): Promise<void>;
|
|
@@ -387,4 +490,4 @@ interface MindooDBAppBridge {
|
|
|
387
490
|
connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
|
|
388
491
|
}
|
|
389
492
|
|
|
390
|
-
export type {
|
|
493
|
+
export type { MindooDBAppHistoricalDocument as $, MindooDBAppConfiguredViewCategorizationStyle as A, MindooDBAppConfiguredViewColumn as B, MindooDBAppConfiguredViewColumnRole as C, MindooDBAppConfiguredViewExpressionMode as D, MindooDBAppConfiguredViewFieldExpression as E, MindooDBAppConfiguredViewFilterDefinition as F, MindooDBAppConfiguredViewFilterMode as G, MindooDBAppConfiguredViewFilterRule as H, MindooDBAppConfiguredViewFormulaExpression as I, MindooDBAppConfiguredViewFormulaFilterDefinition as J, MindooDBAppConfiguredViewPreviewMode as K, MindooDBAppConfiguredViewRuleFilterDefinition as L, MindooDBAppAttachmentPreviewMode as M, MindooDBAppConfiguredViewRuleMatchMode as N, MindooDBAppConfiguredViewRuleOperator as O, MindooDBAppConfiguredViewValueExpression as P, MindooDBAppCreateDocumentInput as Q, MindooDBAppCreateViewInput as R, MindooDBAppCreateViewNavigatorInput as S, MindooDBAppDatabase as T, MindooDBAppDatabaseInfo as U, MindooDBAppDocument as V, MindooDBAppDocumentApi as W, MindooDBAppDocumentHistoryEntry as X, MindooDBAppDocumentListQuery as Y, MindooDBAppDocumentListResult as Z, MindooDBAppDocumentSummary as _, MindooDBAppBridge as a, MindooDBAppHistoryQuery as a0, MindooDBAppHostTheme as a1, MindooDBAppLaunchContext as a2, MindooDBAppReadableAttachmentStream as a3, MindooDBAppResolvedViewDefinition as a4, MindooDBAppResolvedViewSource as a5, MindooDBAppRuntime as a6, MindooDBAppScopedDocId as a7, MindooDBAppSession as a8, MindooDBAppThemeMode as a9, MindooDBAppUpdateDocumentInput as aa, MindooDBAppViewEntry as ab, MindooDBAppViewEntryKind as ac, MindooDBAppViewNavigator as ad, MindooDBAppViewNavigatorExpansionState as ae, MindooDBAppViewNavigatorOpenOptions as af, MindooDBAppViewNavigatorPageOptions as ag, MindooDBAppViewNavigatorPageResult as ah, MindooDBAppViewNavigatorRangeQuery as ai, MindooDBAppViewNavigatorSelectionState as aj, MindooDBAppViewport as ak, MindooDBAppWritableAttachmentStream as al, MindooDBAppAttachmentApi as b, MindooDBAppAttachmentChunk as c, MindooDBAppAttachmentInfo as d, MindooDBAppAttachmentPreviewOptions as e, MindooDBAppAttachmentPreviewSession as f, MindooDBAppBridgeConnectMessage as g, MindooDBAppBridgeConnectOptions as h, MindooDBAppBridgeConnectedMessage as i, MindooDBAppBridgeErrorPayload as j, MindooDBAppBridgePortMessage as k, MindooDBAppBridgeRpcError as l, MindooDBAppBridgeRpcMessage as m, MindooDBAppBridgeRpcRequest as n, MindooDBAppBridgeRpcSuccess as o, MindooDBAppBridgeStreamAbortRequest as p, MindooDBAppBridgeStreamAck as q, MindooDBAppBridgeStreamCloseRequest as r, MindooDBAppBridgeStreamError as s, MindooDBAppBridgeStreamMessage as t, MindooDBAppBridgeStreamOpenResult as u, MindooDBAppBridgeStreamReadRequest as v, MindooDBAppBridgeStreamWriteRequest as w, MindooDBAppBridgeThemeChangedMessage as x, MindooDBAppBridgeViewportChangedMessage as y, MindooDBAppCapability 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.8",
|
|
4
4
|
"description": "MindooDB app SDK for building apps that connect to the Haven host bridge",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Mindoo GmbH",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prepublishOnly": "npm run build && npm run test"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"mindoodb-view-language": "0.0.
|
|
43
|
+
"mindoodb-view-language": "0.0.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.5.0",
|