mindoodb 0.0.1
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 +263 -0
- package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts +5 -0
- package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts.map +1 -0
- package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js +17 -0
- package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js.map +1 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +111 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +237 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -0
- package/dist/appendonlystores/network/HttpTransport.d.ts +78 -0
- package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -0
- package/dist/appendonlystores/network/HttpTransport.js +356 -0
- package/dist/appendonlystores/network/HttpTransport.js.map +1 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +131 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +248 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -0
- package/dist/appendonlystores/network/index.d.ts +8 -0
- package/dist/appendonlystores/network/index.d.ts.map +1 -0
- package/dist/appendonlystores/network/index.js +21 -0
- package/dist/appendonlystores/network/index.js.map +1 -0
- package/dist/browser/crypto/BrowserCryptoAdapter.d.ts +14 -0
- package/dist/browser/crypto/BrowserCryptoAdapter.d.ts.map +1 -0
- package/dist/browser/crypto/BrowserCryptoAdapter.js +30 -0
- package/dist/browser/crypto/BrowserCryptoAdapter.js.map +1 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +26 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/core/BaseMindooDB.d.ts +182 -0
- package/dist/core/BaseMindooDB.d.ts.map +1 -0
- package/dist/core/BaseMindooDB.js +1701 -0
- package/dist/core/BaseMindooDB.js.map +1 -0
- package/dist/core/BaseMindooTenant.d.ts +155 -0
- package/dist/core/BaseMindooTenant.d.ts.map +1 -0
- package/dist/core/BaseMindooTenant.js +673 -0
- package/dist/core/BaseMindooTenant.js.map +1 -0
- package/dist/core/BaseMindooTenantDirectory.d.ts +99 -0
- package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -0
- package/dist/core/BaseMindooTenantDirectory.js +776 -0
- package/dist/core/BaseMindooTenantDirectory.js.map +1 -0
- package/dist/core/BaseMindooTenantFactory.d.ts +91 -0
- package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -0
- package/dist/core/BaseMindooTenantFactory.js +297 -0
- package/dist/core/BaseMindooTenantFactory.js.map +1 -0
- package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts +111 -0
- package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts.map +1 -0
- package/dist/core/appendonlystores/InMemoryContentAddressedStore.js +293 -0
- package/dist/core/appendonlystores/InMemoryContentAddressedStore.js.map +1 -0
- package/dist/core/appendonlystores/network/AuthenticationService.d.ts +78 -0
- package/dist/core/appendonlystores/network/AuthenticationService.d.ts.map +1 -0
- package/dist/core/appendonlystores/network/AuthenticationService.js +297 -0
- package/dist/core/appendonlystores/network/AuthenticationService.js.map +1 -0
- package/dist/core/appendonlystores/network/NetworkTransport.d.ts +174 -0
- package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -0
- package/dist/core/appendonlystores/network/NetworkTransport.js +3 -0
- package/dist/core/appendonlystores/network/NetworkTransport.js.map +1 -0
- package/dist/core/appendonlystores/network/types.d.ts +135 -0
- package/dist/core/appendonlystores/network/types.d.ts.map +1 -0
- package/dist/core/appendonlystores/network/types.js +35 -0
- package/dist/core/appendonlystores/network/types.js.map +1 -0
- package/dist/core/appendonlystores/types.d.ts +157 -0
- package/dist/core/appendonlystores/types.d.ts.map +1 -0
- package/dist/core/appendonlystores/types.js +3 -0
- package/dist/core/appendonlystores/types.js.map +1 -0
- package/dist/core/crypto/CryptoAdapter.d.ts +19 -0
- package/dist/core/crypto/CryptoAdapter.d.ts.map +1 -0
- package/dist/core/crypto/CryptoAdapter.js +3 -0
- package/dist/core/crypto/CryptoAdapter.js.map +1 -0
- package/dist/core/crypto/MindooDocSigner.d.ts +106 -0
- package/dist/core/crypto/MindooDocSigner.d.ts.map +1 -0
- package/dist/core/crypto/MindooDocSigner.js +192 -0
- package/dist/core/crypto/MindooDocSigner.js.map +1 -0
- package/dist/core/crypto/RSAEncryption.d.ts +62 -0
- package/dist/core/crypto/RSAEncryption.d.ts.map +1 -0
- package/dist/core/crypto/RSAEncryption.js +167 -0
- package/dist/core/crypto/RSAEncryption.js.map +1 -0
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +17 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +53 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/indexing/virtualviews/IViewEntryAccessCheck.d.ts +33 -0
- package/dist/core/indexing/virtualviews/IViewEntryAccessCheck.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/IViewEntryAccessCheck.js +27 -0
- package/dist/core/indexing/virtualviews/IViewEntryAccessCheck.js.map +1 -0
- package/dist/core/indexing/virtualviews/IVirtualViewDataProvider.d.ts +31 -0
- package/dist/core/indexing/virtualviews/IVirtualViewDataProvider.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/IVirtualViewDataProvider.js +3 -0
- package/dist/core/indexing/virtualviews/IVirtualViewDataProvider.js.map +1 -0
- package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts +52 -0
- package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js +106 -0
- package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js.map +1 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKey.d.ts +44 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKey.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKey.js +107 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKey.js.map +1 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.d.ts +28 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.js +133 -0
- package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualView.d.ts +109 -0
- package/dist/core/indexing/virtualviews/VirtualView.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualView.js +504 -0
- package/dist/core/indexing/virtualviews/VirtualView.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewColumn.d.ts +59 -0
- package/dist/core/indexing/virtualviews/VirtualViewColumn.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewColumn.js +70 -0
- package/dist/core/indexing/virtualviews/VirtualViewColumn.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewDataChange.d.ts +49 -0
- package/dist/core/indexing/virtualviews/VirtualViewDataChange.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewDataChange.js +69 -0
- package/dist/core/indexing/virtualviews/VirtualViewDataChange.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewEntryData.d.ts +121 -0
- package/dist/core/indexing/virtualviews/VirtualViewEntryData.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewEntryData.js +365 -0
- package/dist/core/indexing/virtualviews/VirtualViewEntryData.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewFactory.d.ts +131 -0
- package/dist/core/indexing/virtualviews/VirtualViewFactory.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewFactory.js +236 -0
- package/dist/core/indexing/virtualviews/VirtualViewFactory.js.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewNavigator.d.ts +330 -0
- package/dist/core/indexing/virtualviews/VirtualViewNavigator.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/VirtualViewNavigator.js +1010 -0
- package/dist/core/indexing/virtualviews/VirtualViewNavigator.js.map +1 -0
- package/dist/core/indexing/virtualviews/index.d.ts +53 -0
- package/dist/core/indexing/virtualviews/index.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/index.js +89 -0
- package/dist/core/indexing/virtualviews/index.js.map +1 -0
- package/dist/core/indexing/virtualviews/types.d.ts +115 -0
- package/dist/core/indexing/virtualviews/types.d.ts.map +1 -0
- package/dist/core/indexing/virtualviews/types.js +175 -0
- package/dist/core/indexing/virtualviews/types.js.map +1 -0
- package/dist/core/keys/KeyBag.d.ts +122 -0
- package/dist/core/keys/KeyBag.d.ts.map +1 -0
- package/dist/core/keys/KeyBag.js +401 -0
- package/dist/core/keys/KeyBag.js.map +1 -0
- package/dist/core/types.d.ts +1004 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/userid/index.d.ts +53 -0
- package/dist/core/userid/index.d.ts.map +1 -0
- package/dist/core/userid/index.js +3 -0
- package/dist/core/userid/index.js.map +1 -0
- package/dist/core/utils/idGeneration.d.ts +109 -0
- package/dist/core/utils/idGeneration.d.ts.map +1 -0
- package/dist/core/utils/idGeneration.js +182 -0
- package/dist/core/utils/idGeneration.js.map +1 -0
- package/dist/core/utils/index.d.ts +5 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/index.js +19 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/node/crypto/NodeCryptoAdapter.d.ts +16 -0
- package/dist/node/crypto/NodeCryptoAdapter.d.ts.map +1 -0
- package/dist/node/crypto/NodeCryptoAdapter.js +53 -0
- package/dist/node/crypto/NodeCryptoAdapter.js.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +26 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { MindooDB } from "../../types";
|
|
2
|
+
import { VirtualView } from "./VirtualView";
|
|
3
|
+
import { VirtualViewColumn, VirtualViewColumnOptions } from "./VirtualViewColumn";
|
|
4
|
+
import type { VirtualViewEntryData } from "./VirtualViewEntryData";
|
|
5
|
+
import { VirtualViewNavigator } from "./VirtualViewNavigator";
|
|
6
|
+
import type { IVirtualViewDataProvider } from "./IVirtualViewDataProvider";
|
|
7
|
+
import { MindooDBVirtualViewDataProviderOptions } from "./MindooDBVirtualViewDataProvider";
|
|
8
|
+
import type { IViewEntryAccessCheck } from "./IViewEntryAccessCheck";
|
|
9
|
+
import { CategorizationStyle, ColumnSorting, TotalMode, DocumentFilterFunction } from "./types";
|
|
10
|
+
/**
|
|
11
|
+
* Builder for creating VirtualView instances with a fluent API
|
|
12
|
+
*/
|
|
13
|
+
export declare class VirtualViewBuilder {
|
|
14
|
+
private columns;
|
|
15
|
+
private categorizationStyle;
|
|
16
|
+
private dataProviders;
|
|
17
|
+
/**
|
|
18
|
+
* Add a column to the view
|
|
19
|
+
*/
|
|
20
|
+
addColumn(column: VirtualViewColumn): this;
|
|
21
|
+
/**
|
|
22
|
+
* Add a column using options
|
|
23
|
+
*/
|
|
24
|
+
addColumnFromOptions(options: VirtualViewColumnOptions): this;
|
|
25
|
+
/**
|
|
26
|
+
* Add a category column
|
|
27
|
+
*/
|
|
28
|
+
addCategoryColumn(name: string, options?: Partial<Omit<VirtualViewColumnOptions, "name" | "isCategory">>): this;
|
|
29
|
+
/**
|
|
30
|
+
* Add a sorted column
|
|
31
|
+
*/
|
|
32
|
+
addSortedColumn(name: string, sorting?: ColumnSorting, options?: Partial<Omit<VirtualViewColumnOptions, "name" | "sorting">>): this;
|
|
33
|
+
/**
|
|
34
|
+
* Add a display-only column
|
|
35
|
+
*/
|
|
36
|
+
addDisplayColumn(name: string, options?: Partial<Omit<VirtualViewColumnOptions, "name">>): this;
|
|
37
|
+
/**
|
|
38
|
+
* Add a total column
|
|
39
|
+
*/
|
|
40
|
+
addTotalColumn(name: string, totalMode: TotalMode, options?: Partial<Omit<VirtualViewColumnOptions, "name" | "totalMode">>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Set the categorization style
|
|
43
|
+
*/
|
|
44
|
+
withCategorizationStyle(style: CategorizationStyle): this;
|
|
45
|
+
/**
|
|
46
|
+
* Add a MindooDB data provider
|
|
47
|
+
*/
|
|
48
|
+
withMindooDB(options: MindooDBVirtualViewDataProviderOptions): this;
|
|
49
|
+
/**
|
|
50
|
+
* Add a MindooDB with simplified options
|
|
51
|
+
*/
|
|
52
|
+
withDB(origin: string, db: MindooDB, filterFunction?: DocumentFilterFunction): this;
|
|
53
|
+
/**
|
|
54
|
+
* Add a custom data provider
|
|
55
|
+
*/
|
|
56
|
+
withDataProvider(provider: IVirtualViewDataProvider): this;
|
|
57
|
+
/**
|
|
58
|
+
* Build the VirtualView
|
|
59
|
+
*/
|
|
60
|
+
build(): VirtualView;
|
|
61
|
+
/**
|
|
62
|
+
* Build the VirtualView and run initial update
|
|
63
|
+
*/
|
|
64
|
+
buildAndUpdate(): Promise<VirtualView>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Builder for creating VirtualViewNavigator instances
|
|
68
|
+
*/
|
|
69
|
+
export declare class VirtualViewNavigatorBuilder {
|
|
70
|
+
private readonly view;
|
|
71
|
+
private withCategories;
|
|
72
|
+
private withDocuments;
|
|
73
|
+
private accessCheck;
|
|
74
|
+
private dontShowEmptyCategories;
|
|
75
|
+
private rootEntry;
|
|
76
|
+
constructor(view: VirtualView);
|
|
77
|
+
/**
|
|
78
|
+
* Include only categories (no documents)
|
|
79
|
+
*/
|
|
80
|
+
categoriesOnly(): this;
|
|
81
|
+
/**
|
|
82
|
+
* Include only documents (no categories)
|
|
83
|
+
*/
|
|
84
|
+
documentsOnly(): this;
|
|
85
|
+
/**
|
|
86
|
+
* Don't show empty categories
|
|
87
|
+
*/
|
|
88
|
+
hideEmptyCategories(): this;
|
|
89
|
+
/**
|
|
90
|
+
* Set a custom access check
|
|
91
|
+
*/
|
|
92
|
+
withAccessCheck(check: IViewEntryAccessCheck): this;
|
|
93
|
+
/**
|
|
94
|
+
* Set a callback-based access check
|
|
95
|
+
*/
|
|
96
|
+
withAccessCallback(callback: (nav: VirtualViewNavigator, entry: VirtualViewEntryData) => boolean): this;
|
|
97
|
+
/**
|
|
98
|
+
* Start navigation from a specific category
|
|
99
|
+
*/
|
|
100
|
+
fromCategory(categoryPath: string): this;
|
|
101
|
+
/**
|
|
102
|
+
* Start navigation from a specific entry
|
|
103
|
+
*/
|
|
104
|
+
fromEntry(entry: VirtualViewEntryData): this;
|
|
105
|
+
/**
|
|
106
|
+
* Build the navigator
|
|
107
|
+
*/
|
|
108
|
+
build(): VirtualViewNavigator;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Factory for creating VirtualView instances
|
|
112
|
+
*/
|
|
113
|
+
export declare class VirtualViewFactory {
|
|
114
|
+
/**
|
|
115
|
+
* Create a new VirtualView builder
|
|
116
|
+
*/
|
|
117
|
+
static createView(): VirtualViewBuilder;
|
|
118
|
+
/**
|
|
119
|
+
* Create a VirtualView with columns directly
|
|
120
|
+
*/
|
|
121
|
+
static createViewWithColumns(columns: VirtualViewColumn[]): VirtualView;
|
|
122
|
+
/**
|
|
123
|
+
* Create a navigator builder for a view
|
|
124
|
+
*/
|
|
125
|
+
static createNavigator(view: VirtualView): VirtualViewNavigatorBuilder;
|
|
126
|
+
/**
|
|
127
|
+
* Create a simple navigator for a view (all categories and documents)
|
|
128
|
+
*/
|
|
129
|
+
static createSimpleNavigator(view: VirtualView): VirtualViewNavigator;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=VirtualViewFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualViewFactory.d.ts","sourceRoot":"","sources":["../../../../src/core/indexing/virtualviews/VirtualViewFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAmC,sCAAsC,EAAE,MAAM,mCAAmC,CAAC;AAC5H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,SAAS,EAGT,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,mBAAmB,CAAmE;IAC9F,OAAO,CAAC,aAAa,CAAkC;IAEvD;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAK1C;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAK7D;;OAEG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,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C,IAAI,EAAE,WAAW;IAI7B;;OAEG;IACH,cAAc,IAAI,IAAI;IAMtB;;OAEG;IACH,aAAa,IAAI,IAAI;IAMrB;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAK3B;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI;IAKnD;;OAEG;IACH,kBAAkB,CAChB,QAAQ,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,KAAK,OAAO,GAC5E,IAAI;IAKP;;OAEG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAwBxC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAK5C;;OAEG;IACH,KAAK,IAAI,oBAAoB;CAY9B;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,MAAM,CAAC,UAAU,IAAI,kBAAkB;IAIvC;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,WAAW;IAIvE;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,2BAA2B;IAItE;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,oBAAoB;CAGtE"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VirtualViewFactory = exports.VirtualViewNavigatorBuilder = exports.VirtualViewBuilder = void 0;
|
|
4
|
+
const VirtualView_1 = require("./VirtualView");
|
|
5
|
+
const VirtualViewColumn_1 = require("./VirtualViewColumn");
|
|
6
|
+
const VirtualViewNavigator_1 = require("./VirtualViewNavigator");
|
|
7
|
+
const MindooDBVirtualViewDataProvider_1 = require("./MindooDBVirtualViewDataProvider");
|
|
8
|
+
const IViewEntryAccessCheck_1 = require("./IViewEntryAccessCheck");
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
/**
|
|
11
|
+
* Builder for creating VirtualView instances with a fluent API
|
|
12
|
+
*/
|
|
13
|
+
class VirtualViewBuilder {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.columns = [];
|
|
16
|
+
this.categorizationStyle = types_1.CategorizationStyle.DOCUMENT_THEN_CATEGORY;
|
|
17
|
+
this.dataProviders = [];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Add a column to the view
|
|
21
|
+
*/
|
|
22
|
+
addColumn(column) {
|
|
23
|
+
this.columns.push(column);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Add a column using options
|
|
28
|
+
*/
|
|
29
|
+
addColumnFromOptions(options) {
|
|
30
|
+
this.columns.push(new VirtualViewColumn_1.VirtualViewColumn(options));
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Add a category column
|
|
35
|
+
*/
|
|
36
|
+
addCategoryColumn(name, options) {
|
|
37
|
+
this.columns.push(VirtualViewColumn_1.VirtualViewColumn.category(name, options));
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Add a sorted column
|
|
42
|
+
*/
|
|
43
|
+
addSortedColumn(name, sorting = types_1.ColumnSorting.ASCENDING, options) {
|
|
44
|
+
this.columns.push(VirtualViewColumn_1.VirtualViewColumn.sorted(name, sorting, options));
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Add a display-only column
|
|
49
|
+
*/
|
|
50
|
+
addDisplayColumn(name, options) {
|
|
51
|
+
this.columns.push(VirtualViewColumn_1.VirtualViewColumn.display(name, options));
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Add a total column
|
|
56
|
+
*/
|
|
57
|
+
addTotalColumn(name, totalMode, options) {
|
|
58
|
+
this.columns.push(VirtualViewColumn_1.VirtualViewColumn.total(name, totalMode, options));
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Set the categorization style
|
|
63
|
+
*/
|
|
64
|
+
withCategorizationStyle(style) {
|
|
65
|
+
this.categorizationStyle = style;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Add a MindooDB data provider
|
|
70
|
+
*/
|
|
71
|
+
withMindooDB(options) {
|
|
72
|
+
this.dataProviders.push(new MindooDBVirtualViewDataProvider_1.MindooDBVirtualViewDataProvider(options));
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Add a MindooDB with simplified options
|
|
77
|
+
*/
|
|
78
|
+
withDB(origin, db, filterFunction) {
|
|
79
|
+
this.dataProviders.push(new MindooDBVirtualViewDataProvider_1.MindooDBVirtualViewDataProvider({
|
|
80
|
+
origin,
|
|
81
|
+
db,
|
|
82
|
+
filterFunction,
|
|
83
|
+
}));
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Add a custom data provider
|
|
88
|
+
*/
|
|
89
|
+
withDataProvider(provider) {
|
|
90
|
+
this.dataProviders.push(provider);
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Build the VirtualView
|
|
95
|
+
*/
|
|
96
|
+
build() {
|
|
97
|
+
if (this.columns.length === 0) {
|
|
98
|
+
throw new Error("At least one column is required");
|
|
99
|
+
}
|
|
100
|
+
const view = new VirtualView_1.VirtualView(this.columns);
|
|
101
|
+
view.setCategorizationStyle(this.categorizationStyle);
|
|
102
|
+
for (const provider of this.dataProviders) {
|
|
103
|
+
provider.init(view);
|
|
104
|
+
view.addDataProvider(provider);
|
|
105
|
+
}
|
|
106
|
+
return view;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Build the VirtualView and run initial update
|
|
110
|
+
*/
|
|
111
|
+
async buildAndUpdate() {
|
|
112
|
+
const view = this.build();
|
|
113
|
+
await view.update();
|
|
114
|
+
return view;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.VirtualViewBuilder = VirtualViewBuilder;
|
|
118
|
+
/**
|
|
119
|
+
* Builder for creating VirtualViewNavigator instances
|
|
120
|
+
*/
|
|
121
|
+
class VirtualViewNavigatorBuilder {
|
|
122
|
+
constructor(view) {
|
|
123
|
+
this.withCategories = types_1.WithCategories.YES;
|
|
124
|
+
this.withDocuments = types_1.WithDocuments.YES;
|
|
125
|
+
this.accessCheck = null;
|
|
126
|
+
this.dontShowEmptyCategories = false;
|
|
127
|
+
this.rootEntry = null;
|
|
128
|
+
this.view = view;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Include only categories (no documents)
|
|
132
|
+
*/
|
|
133
|
+
categoriesOnly() {
|
|
134
|
+
this.withCategories = types_1.WithCategories.YES;
|
|
135
|
+
this.withDocuments = types_1.WithDocuments.NO;
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Include only documents (no categories)
|
|
140
|
+
*/
|
|
141
|
+
documentsOnly() {
|
|
142
|
+
this.withCategories = types_1.WithCategories.NO;
|
|
143
|
+
this.withDocuments = types_1.WithDocuments.YES;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Don't show empty categories
|
|
148
|
+
*/
|
|
149
|
+
hideEmptyCategories() {
|
|
150
|
+
this.dontShowEmptyCategories = true;
|
|
151
|
+
return this;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Set a custom access check
|
|
155
|
+
*/
|
|
156
|
+
withAccessCheck(check) {
|
|
157
|
+
this.accessCheck = check;
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Set a callback-based access check
|
|
162
|
+
*/
|
|
163
|
+
withAccessCallback(callback) {
|
|
164
|
+
this.accessCheck = new IViewEntryAccessCheck_1.CallbackAccessCheck(callback);
|
|
165
|
+
return this;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Start navigation from a specific category
|
|
169
|
+
*/
|
|
170
|
+
fromCategory(categoryPath) {
|
|
171
|
+
// Navigate to category by path (e.g., "Sales\\2024")
|
|
172
|
+
const root = this.view.getRoot();
|
|
173
|
+
const parts = categoryPath.split("\\");
|
|
174
|
+
let current = root;
|
|
175
|
+
for (const part of parts) {
|
|
176
|
+
const children = current.getChildCategories();
|
|
177
|
+
const match = children.find(c => {
|
|
178
|
+
const catValue = c.getCategoryValue();
|
|
179
|
+
return catValue !== null && String(catValue) === part;
|
|
180
|
+
});
|
|
181
|
+
if (!match) {
|
|
182
|
+
// Category not found - will start from root
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
current = match;
|
|
186
|
+
}
|
|
187
|
+
this.rootEntry = current;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Start navigation from a specific entry
|
|
192
|
+
*/
|
|
193
|
+
fromEntry(entry) {
|
|
194
|
+
this.rootEntry = entry;
|
|
195
|
+
return this;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Build the navigator
|
|
199
|
+
*/
|
|
200
|
+
build() {
|
|
201
|
+
const topEntry = this.rootEntry ?? this.view.getRoot();
|
|
202
|
+
return new VirtualViewNavigator_1.VirtualViewNavigator(this.view, topEntry, this.withCategories, this.withDocuments, this.accessCheck, this.dontShowEmptyCategories);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.VirtualViewNavigatorBuilder = VirtualViewNavigatorBuilder;
|
|
206
|
+
/**
|
|
207
|
+
* Factory for creating VirtualView instances
|
|
208
|
+
*/
|
|
209
|
+
class VirtualViewFactory {
|
|
210
|
+
/**
|
|
211
|
+
* Create a new VirtualView builder
|
|
212
|
+
*/
|
|
213
|
+
static createView() {
|
|
214
|
+
return new VirtualViewBuilder();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Create a VirtualView with columns directly
|
|
218
|
+
*/
|
|
219
|
+
static createViewWithColumns(columns) {
|
|
220
|
+
return new VirtualView_1.VirtualView(columns);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Create a navigator builder for a view
|
|
224
|
+
*/
|
|
225
|
+
static createNavigator(view) {
|
|
226
|
+
return new VirtualViewNavigatorBuilder(view);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Create a simple navigator for a view (all categories and documents)
|
|
230
|
+
*/
|
|
231
|
+
static createSimpleNavigator(view) {
|
|
232
|
+
return new VirtualViewNavigatorBuilder(view).build();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.VirtualViewFactory = VirtualViewFactory;
|
|
236
|
+
//# sourceMappingURL=VirtualViewFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualViewFactory.js","sourceRoot":"","sources":["../../../../src/core/indexing/virtualviews/VirtualViewFactory.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,2DAAkF;AAElF,iEAA8D;AAE9D,uFAA4H;AAE5H,mEAAmF;AACnF,mCAOiB;AAEjB;;GAEG;AACH,MAAa,kBAAkB;IAA/B;QACU,YAAO,GAAwB,EAAE,CAAC;QAClC,wBAAmB,GAAwB,2BAAmB,CAAC,sBAAsB,CAAC;QACtF,kBAAa,GAA+B,EAAE,CAAC;IAqIzD,CAAC;IAnIC;;OAEG;IACH,SAAS,CAAC,MAAyB;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,OAAiC;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,qCAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,iBAAiB,C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