harperdb 4.2.8 → 4.3.0-alpha.2
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 +1 -1
- package/bin/harperdb.js +57 -63
- package/bin/lite.js +18 -26
- package/config/yaml/defaultConfig.yaml +2 -0
- package/launchServiceScripts/launchInstallNATSServer.js +3 -3
- package/launchServiceScripts/launchNatsIngestService.js +18 -21
- package/launchServiceScripts/launchNatsReplyService.js +18 -21
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +18 -21
- package/npm-shrinkwrap.json +844 -1216
- package/package.json +19 -17
- package/resources/DatabaseTransaction.d.ts +3 -1
- package/resources/RecordEncoder.d.ts +1 -0
- package/resources/Resource.d.ts +6 -17
- package/resources/Table.d.ts +50 -36
- package/resources/auditStore.d.ts +2 -2
- package/resources/crdt.d.ts +19 -0
- package/resources/databases.d.ts +32 -36
- package/resources/search.d.ts +6 -21
- package/resources/tracked.d.ts +7 -1
- package/resources/transactionBroadcast.d.ts +1 -1
- package/server/Server.d.ts +1 -1
- package/server/jobs/jobProcess.js +18 -21
- package/server/threads/threadServer.js +18 -26
- package/studio/build-local/asset-manifest.json +53 -0
- package/studio/build-local/fontawesome/fa-brands-400.eot +0 -0
- package/studio/build-local/fontawesome/fa-brands-400.svg +3717 -0
- package/studio/build-local/fontawesome/fa-brands-400.ttf +0 -0
- package/studio/build-local/fontawesome/fa-brands-400.woff +0 -0
- package/studio/build-local/fontawesome/fa-brands-400.woff2 +0 -0
- package/studio/build-local/fontawesome/fa-regular-400.eot +0 -0
- package/studio/build-local/fontawesome/fa-regular-400.svg +801 -0
- package/studio/build-local/fontawesome/fa-regular-400.ttf +0 -0
- package/studio/build-local/fontawesome/fa-regular-400.woff +0 -0
- package/studio/build-local/fontawesome/fa-regular-400.woff2 +0 -0
- package/studio/build-local/fontawesome/fa-solid-900.eot +0 -0
- package/studio/build-local/fontawesome/fa-solid-900.svg +5034 -0
- package/studio/build-local/fontawesome/fa-solid-900.ttf +0 -0
- package/studio/build-local/fontawesome/fa-solid-900.woff +0 -0
- package/studio/build-local/fontawesome/fa-solid-900.woff2 +0 -0
- package/studio/build-local/fontawesome/fontawesome.css +5 -0
- package/studio/build-local/fontawesome/fontawesome.js +5 -0
- package/studio/build-local/images/favicon_akamai.png +0 -0
- package/studio/build-local/images/favicon_dark.png +0 -0
- package/studio/build-local/images/favicon_light.png +0 -0
- package/studio/build-local/images/favicon_lumen.png +0 -0
- package/studio/build-local/images/favicon_purple.png +0 -0
- package/studio/build-local/images/favicon_verizon.png +0 -0
- package/studio/build-local/images/logo_circle.png +0 -0
- package/studio/build-local/images/logo_manifest.png +0 -0
- package/studio/build-local/index.html +1 -0
- package/studio/build-local/js/kissmetrics.js +24 -0
- package/studio/build-local/js/linkedin.js +33 -0
- package/studio/build-local/manifest.json +20 -0
- package/studio/build-local/robots.txt +3 -0
- package/studio/{running.html → build-local/running.html} +2 -2
- package/studio/build-local/static/css/main.038ec116.css +13 -0
- package/studio/build-local/static/js/110.ca4244a6.chunk.js +2 -0
- package/studio/build-local/static/js/110.ca4244a6.chunk.js.LICENSE.txt +1 -0
- package/studio/build-local/static/js/228.302d7db9.chunk.js +1 -0
- package/studio/build-local/static/js/287.21477cf9.chunk.js +1 -0
- package/studio/build-local/static/js/409.17daa4fe.chunk.js +2 -0
- package/studio/build-local/static/js/409.17daa4fe.chunk.js.LICENSE.txt +8 -0
- package/studio/build-local/static/js/424.7d57284b.chunk.js +1 -0
- package/studio/build-local/static/js/446.5237e847.chunk.js +2 -0
- package/studio/build-local/static/js/446.5237e847.chunk.js.LICENSE.txt +13 -0
- package/studio/build-local/static/js/662.02ce7b65.chunk.js +1 -0
- package/studio/build-local/static/js/718.74e9355d.chunk.js +1 -0
- package/studio/build-local/static/js/723.36068040.chunk.js +2 -0
- package/studio/build-local/static/js/723.36068040.chunk.js.LICENSE.txt +5 -0
- package/studio/build-local/static/js/731.8a941eb3.chunk.js +1 -0
- package/studio/build-local/static/js/807.3473ab0a.chunk.js +2 -0
- package/studio/build-local/static/js/807.3473ab0a.chunk.js.LICENSE.txt +5 -0
- package/studio/build-local/static/js/926.88d6f9ce.chunk.js +1 -0
- package/studio/build-local/static/js/browse-csvupload.5e77eb8a.chunk.js +1 -0
- package/studio/build-local/static/js/browse-datatable.cd71d518.chunk.js +1 -0
- package/studio/build-local/static/js/browse-entitymanager.09237801.chunk.js +1 -0
- package/studio/build-local/static/js/browse-jsonviewer.fcccabdc.chunk.js +1 -0
- package/studio/build-local/static/js/custom-functions.98af4a5e.chunk.js +1 -0
- package/studio/build-local/static/js/instance-charts.f1a1969d.chunk.js +1 -0
- package/studio/build-local/static/js/instance-cluster.0dc3ac1b.chunk.js +1 -0
- package/studio/build-local/static/js/instance-config.19223fab.chunk.js +1 -0
- package/studio/build-local/static/js/instance-query.ed7e59f5.chunk.js +1 -0
- package/studio/build-local/static/js/instance-roles.9c3f140d.chunk.js +1 -0
- package/studio/build-local/static/js/instance-status.1687cd77.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users-datatable.ced7813f.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users-edit.436e0908.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users.12c0c117.chunk.js +1 -0
- package/studio/build-local/static/js/instance.b8863754.chunk.js +1 -0
- package/studio/build-local/static/js/instances.5bd051eb.chunk.js +1 -0
- package/studio/build-local/static/js/main.824bbe07.js +2 -0
- package/studio/{hdb.js.LICENSE.txt → build-local/static/js/main.824bbe07.js.LICENSE.txt} +41 -35
- package/studio/build-local/static/js/offline-app.b3ad12ac.chunk.js +1 -0
- package/studio/build-local/static/js/online-app.2ac03c15.chunk.js +1 -0
- package/studio/build-local/static/js/organization-billing.a8014c6f.chunk.js +1 -0
- package/studio/build-local/static/js/organization-users.523136d9.chunk.js +1 -0
- package/studio/build-local/static/js/organization.0abc89ca.chunk.js +1 -0
- package/studio/build-local/static/js/organizations.e536b86f.chunk.js +1 -0
- package/studio/build-local/static/js/profile.92f9be59.chunk.js +1 -0
- package/studio/build-local/static/js/resetPassword.8fdfba77.chunk.js +1 -0
- package/studio/build-local/static/js/roles-jsonviewer.5fe72bc9.chunk.js +1 -0
- package/studio/build-local/static/js/signIn.97bded2f.chunk.js +1 -0
- package/studio/build-local/static/js/signUp.482f9fe4.chunk.js +1 -0
- package/studio/build-local/static/js/structure-reloader.9322abd3.chunk.js +1 -0
- package/studio/build-local/static/js/topnav.5e7913a5.chunk.js +1 -0
- package/studio/build-local/static/js/updatePassword.e23019c7.chunk.js +1 -0
- package/utility/scripts/restartHdb.js +18 -21
- package/dependencies/nats-server.zip +0 -0
- package/studio/fonts/FontAwesome.otf +0 -0
- package/studio/fonts/fontawesome-webfont.eot +0 -0
- package/studio/fonts/fontawesome-webfont.svg +0 -2671
- package/studio/fonts/fontawesome-webfont.ttf +0 -0
- package/studio/fonts/fontawesome-webfont.woff +0 -0
- package/studio/fonts/fontawesome-webfont.woff2 +0 -0
- package/studio/hdb.css +0 -4
- package/studio/hdb.js +0 -2
- package/studio/images/logo.png +0 -0
- package/studio/index.html +0 -1
- package/studio/processCSV.worker.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harperdb",
|
|
3
|
-
"version": "4.2
|
|
3
|
+
"version": "4.3.0-alpha.2",
|
|
4
4
|
"description": "HarperDB is a distributed SQL & NoSQL data platform focused on speed, flexibility, and ease of use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"license": "SEE LICENSE IN LICENSE",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@aws-sdk/abort-controller": "3.374.0",
|
|
37
|
-
"@aws-sdk/client-s3": "3.
|
|
38
|
-
"@aws-sdk/lib-storage": "3.
|
|
39
|
-
"@endo/static-module-record": "^0.
|
|
37
|
+
"@aws-sdk/client-s3": "3.477.0",
|
|
38
|
+
"@aws-sdk/lib-storage": "3.477.0",
|
|
39
|
+
"@endo/static-module-record": "^1.0.0",
|
|
40
40
|
"@fastify/autoload": "5.7.1",
|
|
41
|
-
"@fastify/compress": "~6.
|
|
42
|
-
"@fastify/cors": "~8.
|
|
41
|
+
"@fastify/compress": "~6.5.0",
|
|
42
|
+
"@fastify/cors": "~8.5.0",
|
|
43
43
|
"@fastify/static": "~6.11.2",
|
|
44
44
|
"@turf/area": "6.5.0",
|
|
45
45
|
"@turf/boolean-contains": "6.5.0",
|
|
@@ -50,58 +50,60 @@
|
|
|
50
50
|
"@turf/distance": "6.5.0",
|
|
51
51
|
"@turf/helpers": "6.5.0",
|
|
52
52
|
"@turf/length": "6.5.0",
|
|
53
|
-
"alasql": "1.
|
|
53
|
+
"alasql": "4.1.10",
|
|
54
54
|
"cbor-x": "1.5.4",
|
|
55
55
|
"chalk": "4.1.2",
|
|
56
56
|
"cli-progress": "3.12.0",
|
|
57
57
|
"clone": "2.1.2",
|
|
58
58
|
"fast-glob": "3.3.1",
|
|
59
|
-
"fastify": "~4.
|
|
59
|
+
"fastify": "~4.25.1",
|
|
60
60
|
"fastify-plugin": "~4.5.1",
|
|
61
|
-
"fs-extra": "11.
|
|
61
|
+
"fs-extra": "11.2.0",
|
|
62
62
|
"graphql": "^16.8.1",
|
|
63
63
|
"human-readable-ids": "1.0.4",
|
|
64
64
|
"inquirer": "8.2.6",
|
|
65
65
|
"is-number": "7.0.0",
|
|
66
66
|
"joi": "17.11.0",
|
|
67
|
+
"json-bigint-fixes": "1.1.0",
|
|
67
68
|
"json2csv": "5.0.7",
|
|
68
69
|
"jsonata": "1.8.6",
|
|
69
70
|
"jsonwebtoken": "9.0.2",
|
|
70
|
-
"lmdb": "2.9.
|
|
71
|
+
"lmdb": "2.9.3-beta.2",
|
|
71
72
|
"lodash": "4.17.21",
|
|
72
73
|
"mathjs": "11.11.2",
|
|
73
74
|
"minimist": "1.2.8",
|
|
74
75
|
"mkcert": "1.5.1",
|
|
75
76
|
"moment": "2.29.4",
|
|
76
77
|
"mqtt-packet": "~8.2.1",
|
|
77
|
-
"msgpackr": "1.
|
|
78
|
+
"msgpackr": "1.10.1",
|
|
78
79
|
"nats": "2.17.0",
|
|
79
80
|
"needle": "3.2.0",
|
|
80
81
|
"node-stream-zip": "1.15.0",
|
|
81
|
-
"node-unix-socket": "
|
|
82
|
+
"node-unix-socket": "0.2.5",
|
|
82
83
|
"normalize-path": "^3.0.0",
|
|
83
84
|
"ora": "5.4.1",
|
|
84
|
-
"ordered-binary": "1.
|
|
85
|
+
"ordered-binary": "1.5.1",
|
|
85
86
|
"papaparse": "5.4.1",
|
|
86
87
|
"passport": "0.6.0",
|
|
87
88
|
"passport-http": "0.3.0",
|
|
88
89
|
"passport-local": "1.0.0",
|
|
89
|
-
"pino": "8.
|
|
90
|
+
"pino": "8.16.0",
|
|
90
91
|
"pm2": "5.3.0",
|
|
91
92
|
"prompt": "1.3.0",
|
|
92
93
|
"properties-reader": "2.3.0",
|
|
93
94
|
"recursive-iterator": "3.3.0",
|
|
94
95
|
"semver": "7.5.4",
|
|
95
96
|
"send": "^0.18.0",
|
|
96
|
-
"
|
|
97
|
+
"serve-static": "1.15.0",
|
|
98
|
+
"ses": "1.0.0",
|
|
97
99
|
"stream-chain": "2.2.5",
|
|
98
100
|
"stream-json": "1.8.0",
|
|
99
|
-
"systeminformation": "5.21.
|
|
101
|
+
"systeminformation": "5.21.20",
|
|
100
102
|
"tar-fs": "2.1.1",
|
|
101
103
|
"ulidx": "0.5.0",
|
|
102
104
|
"uuid": "9.0.1",
|
|
103
105
|
"validate.js": "0.13.1",
|
|
104
|
-
"ws": "
|
|
106
|
+
"ws": "8.15.1",
|
|
105
107
|
"yaml": "2.3.4"
|
|
106
108
|
},
|
|
107
109
|
"overrides": {
|
|
@@ -4,14 +4,16 @@ export declare class DatabaseTransaction implements Transaction {
|
|
|
4
4
|
lmdbDb: RootDatabase;
|
|
5
5
|
readTxn: LMDBTransaction;
|
|
6
6
|
readTxnRefCount: number;
|
|
7
|
+
readTxnsUsed: number;
|
|
7
8
|
validated: number;
|
|
8
9
|
timestamp: number;
|
|
9
10
|
next: DatabaseTransaction;
|
|
10
11
|
stale: boolean;
|
|
11
12
|
open: boolean;
|
|
12
13
|
getReadTxn(): LMDBTransaction | void;
|
|
14
|
+
useReadTxn(): LMDBTransaction;
|
|
15
|
+
doneReadTxn(): void;
|
|
13
16
|
disregardReadTxn(): void;
|
|
14
|
-
resetReadSnapshot(): void;
|
|
15
17
|
addWrite(operation: any): void;
|
|
16
18
|
removeWrite(operation: any): void;
|
|
17
19
|
/**
|
|
@@ -16,6 +16,7 @@ export declare const TIMESTAMP_ASSIGN_LAST = 1;
|
|
|
16
16
|
export declare const TIMESTAMP_ASSIGN_PREVIOUS = 3;
|
|
17
17
|
export declare const TIMESTAMP_RECORD_PREVIOUS = 4;
|
|
18
18
|
export declare const HAS_EXPIRATION = 16;
|
|
19
|
+
export declare const PENDING_LOCAL_TIME = 1;
|
|
19
20
|
export declare class RecordEncoder extends Encoder {
|
|
20
21
|
constructor(options: any);
|
|
21
22
|
decode(buffer: any, options: any): any;
|
package/resources/Resource.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Transaction } from './DatabaseTransaction';
|
|
|
3
3
|
export declare const CONTEXT: unique symbol;
|
|
4
4
|
export declare const ID_PROPERTY: unique symbol;
|
|
5
5
|
export declare const IS_COLLECTION: unique symbol;
|
|
6
|
-
export declare const SAVE_UPDATES_PROPERTY: unique symbol;
|
|
7
6
|
export declare const RECORD_PROPERTY: unique symbol;
|
|
8
7
|
/**
|
|
9
8
|
* This is the main class that can be extended for any resource in HarperDB and provides the essential reusable
|
|
@@ -37,6 +36,10 @@ export declare class Resource implements ResourceInterface {
|
|
|
37
36
|
(id_or_query: Id, data_or_context?: any, context?: Context): any;
|
|
38
37
|
reliesOnPrototype: boolean;
|
|
39
38
|
};
|
|
39
|
+
static patch: {
|
|
40
|
+
(id_or_query: Id, data_or_context?: any, context?: Context): any;
|
|
41
|
+
reliesOnPrototype: boolean;
|
|
42
|
+
};
|
|
40
43
|
static delete(identifier: Id, context?: Context): Promise<boolean>;
|
|
41
44
|
static delete(request: Request, context?: Context): Promise<object>;
|
|
42
45
|
static delete: typeof Resource.delete;
|
|
@@ -87,22 +90,7 @@ export declare class Resource implements ResourceInterface {
|
|
|
87
90
|
post(new_record: any): any;
|
|
88
91
|
static isCollection(resource: any): any;
|
|
89
92
|
static coerceId(id: string): number | string;
|
|
90
|
-
static parseQuery(search: any):
|
|
91
|
-
conditions: {
|
|
92
|
-
attribute: string;
|
|
93
|
-
value: any;
|
|
94
|
-
comparator: string;
|
|
95
|
-
}[];
|
|
96
|
-
limit: number;
|
|
97
|
-
offset: number;
|
|
98
|
-
select: string[];
|
|
99
|
-
get(name: any): any;
|
|
100
|
-
[Symbol.iterator](): IterableIterator<{
|
|
101
|
-
attribute: string;
|
|
102
|
-
value: any;
|
|
103
|
-
comparator: string;
|
|
104
|
-
}>;
|
|
105
|
-
};
|
|
93
|
+
static parseQuery(search: any): any;
|
|
106
94
|
static parsePath(path: any, context: any, query: any): any;
|
|
107
95
|
/**
|
|
108
96
|
* Gets an instance of a resource by id
|
|
@@ -141,3 +129,4 @@ export declare class Resource implements ResourceInterface {
|
|
|
141
129
|
getContext(): any;
|
|
142
130
|
}
|
|
143
131
|
export declare function snake_case(camelCase: string): string;
|
|
132
|
+
export declare function transformForSelect(select: any, resource: any): (object: any) => any;
|
package/resources/Table.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export declare function makeTable(options: any): {
|
|
|
72
72
|
* @param full_update The provided data in updates is the full intended record; any properties in the existing record that are not in the updates, should be removed
|
|
73
73
|
*/
|
|
74
74
|
update(updates?: any, full_update?: boolean): any;
|
|
75
|
+
addTo(property: any, value: any): void;
|
|
76
|
+
subtractFrom(property: any, value: any): void;
|
|
75
77
|
invalidate(options: any): void;
|
|
76
78
|
/**
|
|
77
79
|
* This is intended to acquire a lock on a record from the whole cluster.
|
|
@@ -85,8 +87,9 @@ export declare function makeTable(options: any): {
|
|
|
85
87
|
* @param record
|
|
86
88
|
* @param options
|
|
87
89
|
*/
|
|
88
|
-
put(record: any):
|
|
89
|
-
|
|
90
|
+
put(record: any): void;
|
|
91
|
+
patch(record_update: any): void;
|
|
92
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
90
93
|
delete(request: Request): Promise<boolean>;
|
|
91
94
|
_writeDelete(options?: any): boolean;
|
|
92
95
|
search(request: Query): AsyncIterable<any>;
|
|
@@ -143,9 +146,9 @@ export declare function makeTable(options: any): {
|
|
|
143
146
|
* @param message
|
|
144
147
|
* @param options
|
|
145
148
|
*/
|
|
146
|
-
publish(message: any, options?: any):
|
|
149
|
+
publish(message: any, options?: any): void;
|
|
147
150
|
_writePublish(message: any, options?: any): void;
|
|
148
|
-
validate(record: any): void;
|
|
151
|
+
validate(record: any, patch?: any): void;
|
|
149
152
|
getUpdatedTime(): any;
|
|
150
153
|
wasLoadedFromSource(): boolean | void;
|
|
151
154
|
post(new_record: any): any;
|
|
@@ -166,6 +169,7 @@ export declare function makeTable(options: any): {
|
|
|
166
169
|
expirationTimer: any;
|
|
167
170
|
createdTimeProperty: any;
|
|
168
171
|
updatedTimeProperty: any;
|
|
172
|
+
propertyResolvers: any;
|
|
169
173
|
sources: any[];
|
|
170
174
|
readonly expirationMS: any;
|
|
171
175
|
dbisDB: any;
|
|
@@ -230,6 +234,8 @@ export declare function makeTable(options: any): {
|
|
|
230
234
|
* @param full_update The provided data in updates is the full intended record; any properties in the existing record that are not in the updates, should be removed
|
|
231
235
|
*/
|
|
232
236
|
update(updates?: any, full_update?: boolean): any;
|
|
237
|
+
addTo(property: any, value: any): void;
|
|
238
|
+
subtractFrom(property: any, value: any): void;
|
|
233
239
|
invalidate(options: any): void;
|
|
234
240
|
/**
|
|
235
241
|
* This is intended to acquire a lock on a record from the whole cluster.
|
|
@@ -243,8 +249,9 @@ export declare function makeTable(options: any): {
|
|
|
243
249
|
* @param record
|
|
244
250
|
* @param options
|
|
245
251
|
*/
|
|
246
|
-
put(record: any):
|
|
247
|
-
|
|
252
|
+
put(record: any): void;
|
|
253
|
+
patch(record_update: any): void;
|
|
254
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
248
255
|
delete(request: Request): Promise<boolean>;
|
|
249
256
|
_writeDelete(options?: any): boolean;
|
|
250
257
|
search(request: Query): AsyncIterable<any>;
|
|
@@ -301,9 +308,9 @@ export declare function makeTable(options: any): {
|
|
|
301
308
|
* @param message
|
|
302
309
|
* @param options
|
|
303
310
|
*/
|
|
304
|
-
publish(message: any, options?: any):
|
|
311
|
+
publish(message: any, options?: any): void;
|
|
305
312
|
_writePublish(message: any, options?: any): void;
|
|
306
|
-
validate(record: any): void;
|
|
313
|
+
validate(record: any, patch?: any): void;
|
|
307
314
|
getUpdatedTime(): any;
|
|
308
315
|
wasLoadedFromSource(): boolean | void;
|
|
309
316
|
post(new_record: any): any;
|
|
@@ -353,6 +360,8 @@ export declare function makeTable(options: any): {
|
|
|
353
360
|
* @param full_update The provided data in updates is the full intended record; any properties in the existing record that are not in the updates, should be removed
|
|
354
361
|
*/
|
|
355
362
|
update(updates?: any, full_update?: boolean): any;
|
|
363
|
+
addTo(property: any, value: any): void;
|
|
364
|
+
subtractFrom(property: any, value: any): void;
|
|
356
365
|
invalidate(options: any): void;
|
|
357
366
|
/**
|
|
358
367
|
* This is intended to acquire a lock on a record from the whole cluster.
|
|
@@ -366,8 +375,9 @@ export declare function makeTable(options: any): {
|
|
|
366
375
|
* @param record
|
|
367
376
|
* @param options
|
|
368
377
|
*/
|
|
369
|
-
put(record: any):
|
|
370
|
-
|
|
378
|
+
put(record: any): void;
|
|
379
|
+
patch(record_update: any): void;
|
|
380
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
371
381
|
delete(request: Request): Promise<boolean>;
|
|
372
382
|
_writeDelete(options?: any): boolean;
|
|
373
383
|
search(request: Query): AsyncIterable<any>;
|
|
@@ -424,9 +434,9 @@ export declare function makeTable(options: any): {
|
|
|
424
434
|
* @param message
|
|
425
435
|
* @param options
|
|
426
436
|
*/
|
|
427
|
-
publish(message: any, options?: any):
|
|
437
|
+
publish(message: any, options?: any): void;
|
|
428
438
|
_writePublish(message: any, options?: any): void;
|
|
429
|
-
validate(record: any): void;
|
|
439
|
+
validate(record: any, patch?: any): void;
|
|
430
440
|
getUpdatedTime(): any;
|
|
431
441
|
wasLoadedFromSource(): boolean | void;
|
|
432
442
|
post(new_record: any): any;
|
|
@@ -456,19 +466,31 @@ export declare function makeTable(options: any): {
|
|
|
456
466
|
*/
|
|
457
467
|
coerceId(id: string): number | string;
|
|
458
468
|
dropTable(): Promise<void>;
|
|
459
|
-
get(request: any, context: any): Promise<object> | {
|
|
460
|
-
recordCount: number;
|
|
461
|
-
estimatedRecordRange: number[];
|
|
462
|
-
records: string;
|
|
463
|
-
name: any;
|
|
464
|
-
database: any;
|
|
465
|
-
attributes: any;
|
|
466
|
-
};
|
|
467
469
|
/**
|
|
468
470
|
* Evicting a record will remove it from a caching table. This is not considered a canonical data change, and it is assumed that retrieving this record from the source will still yield the same record, this is only removing the local copy of the record.
|
|
469
471
|
*/
|
|
470
472
|
evict(id: any, existing_record: any, existing_version: any): any;
|
|
471
473
|
operation(operation: any, context: any): any;
|
|
474
|
+
/**
|
|
475
|
+
* This is responsible for ordering and select()ing the attributes/properties from returned entries
|
|
476
|
+
* @param select
|
|
477
|
+
* @param context
|
|
478
|
+
* @param filtered
|
|
479
|
+
* @param ensure_loaded
|
|
480
|
+
* @param can_skip
|
|
481
|
+
* @returns
|
|
482
|
+
*/
|
|
483
|
+
transformToOrderedSelect(entries: any, select: any, sort: any, context: any, transformToRecord: any): any;
|
|
484
|
+
/**
|
|
485
|
+
* This is responsible for select()ing the attributes/properties from returned entries
|
|
486
|
+
* @param select
|
|
487
|
+
* @param context
|
|
488
|
+
* @param filtered
|
|
489
|
+
* @param ensure_loaded
|
|
490
|
+
* @param can_skip
|
|
491
|
+
* @returns
|
|
492
|
+
*/
|
|
493
|
+
transformEntryForSelect(select: any, context: any, filtered: any, ensure_loaded?: any, can_skip?: any): (entry: any) => any;
|
|
472
494
|
addAttributes(attributes_to_add: any): Promise<any>;
|
|
473
495
|
removeAttributes(names: string[]): Promise<any>;
|
|
474
496
|
getRecordCount(options: any): {
|
|
@@ -496,10 +518,17 @@ export declare function makeTable(options: any): {
|
|
|
496
518
|
transactions: import("./DatabaseTransaction").Transaction[] & {
|
|
497
519
|
timestamp: number;
|
|
498
520
|
};
|
|
521
|
+
get(identifier: Id, context?: Context): Promise<object>;
|
|
522
|
+
get(request: Request, context?: Context): Promise<object>;
|
|
523
|
+
get(query: Query, context?: Context): Promise<AsyncIterable<object>>;
|
|
499
524
|
put: {
|
|
500
525
|
(id_or_query: Id, data_or_context?: any, context?: Context): any;
|
|
501
526
|
reliesOnPrototype: boolean;
|
|
502
527
|
};
|
|
528
|
+
patch: {
|
|
529
|
+
(id_or_query: Id, data_or_context?: any, context?: Context): any;
|
|
530
|
+
reliesOnPrototype: boolean;
|
|
531
|
+
};
|
|
503
532
|
delete(identifier: Id, context?: Context): Promise<boolean>;
|
|
504
533
|
delete(request: Request, context?: Context): Promise<object>;
|
|
505
534
|
getNewId(): `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -543,22 +572,7 @@ export declare function makeTable(options: any): {
|
|
|
543
572
|
reliesOnPrototype: boolean;
|
|
544
573
|
};
|
|
545
574
|
isCollection(resource: any): any;
|
|
546
|
-
parseQuery(search: any):
|
|
547
|
-
conditions: {
|
|
548
|
-
attribute: string;
|
|
549
|
-
value: any;
|
|
550
|
-
comparator: string;
|
|
551
|
-
}[];
|
|
552
|
-
limit: number;
|
|
553
|
-
offset: number;
|
|
554
|
-
select: string[];
|
|
555
|
-
get(name: any): any;
|
|
556
|
-
[Symbol.iterator](): IterableIterator<{
|
|
557
|
-
attribute: string;
|
|
558
|
-
value: any;
|
|
559
|
-
comparator: string;
|
|
560
|
-
}>;
|
|
561
|
-
};
|
|
575
|
+
parseQuery(search: any): any;
|
|
562
576
|
parsePath(path: any, context: any, query: any): any;
|
|
563
577
|
};
|
|
564
578
|
export declare function setServerUtilities(utilities: any): void;
|
|
@@ -11,7 +11,7 @@ export declare const AUDIT_STORE_OPTIONS: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export declare function openAuditStore(root_store: any): any;
|
|
14
|
-
export declare function setAuditRetention(retention_time: any): void;
|
|
14
|
+
export declare function setAuditRetention(retention_time: any, default_delay?: number): void;
|
|
15
15
|
export declare function createAuditEntry(txn_time: any, table_id: any, record_id: any, previous_local_time: any, username: any, type: any, encoded_record: any): Buffer;
|
|
16
16
|
export declare function readAuditEntry(buffer: any): {
|
|
17
17
|
type: any;
|
|
@@ -20,7 +20,7 @@ export declare function readAuditEntry(buffer: any): {
|
|
|
20
20
|
version: any;
|
|
21
21
|
previousLocalTime: any;
|
|
22
22
|
readonly user: import("ordered-binary").Key;
|
|
23
|
-
getValue(store: any): any;
|
|
23
|
+
getValue(store: any, full_record?: any, audit_time?: any): any;
|
|
24
24
|
} | {
|
|
25
25
|
type?: undefined;
|
|
26
26
|
tableId?: undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function add(record: any, property: any, action: any): void;
|
|
2
|
+
export declare namespace add {
|
|
3
|
+
var reverse: (record: any, property: any, action: any) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Rebuild a record update that has a timestamp before the provided newer update
|
|
7
|
+
* @param update
|
|
8
|
+
* @param newer_update
|
|
9
|
+
*/
|
|
10
|
+
export declare function rebuildUpdateBefore(update: any, newer_update: any): any;
|
|
11
|
+
export declare function applyReverse(record: any, update: any): void;
|
|
12
|
+
/**
|
|
13
|
+
* Reconstruct the record state at a given timestamp by going back through the audit history and reversing any changes
|
|
14
|
+
* @param current_entry
|
|
15
|
+
* @param timestamp
|
|
16
|
+
* @param store
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare function getRecordAtTime(current_entry: any, timestamp: any, store: any): any;
|
package/resources/databases.d.ts
CHANGED
|
@@ -78,10 +78,13 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
78
78
|
allowCreate(user: any, new_data: {}): boolean;
|
|
79
79
|
allowDelete(user: any): any;
|
|
80
80
|
update(updates?: any, full_update?: boolean): any;
|
|
81
|
+
addTo(property: any, value: any): void;
|
|
82
|
+
subtractFrom(property: any, value: any): void;
|
|
81
83
|
invalidate(options: any): void;
|
|
82
84
|
lock(): void;
|
|
83
|
-
put(record: any):
|
|
84
|
-
|
|
85
|
+
put(record: any): void;
|
|
86
|
+
patch(record_update: any): void;
|
|
87
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
85
88
|
delete(request: import("./ResourceInterface").Request): Promise<boolean>;
|
|
86
89
|
_writeDelete(options?: any): boolean;
|
|
87
90
|
search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
|
|
@@ -131,9 +134,9 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
131
134
|
eventNames(): (string | symbol)[];
|
|
132
135
|
}>;
|
|
133
136
|
doesExist(): boolean;
|
|
134
|
-
publish(message: any, options?: any):
|
|
137
|
+
publish(message: any, options?: any): void;
|
|
135
138
|
_writePublish(message: any, options?: any): void;
|
|
136
|
-
validate(record: any): void;
|
|
139
|
+
validate(record: any, patch?: any): void;
|
|
137
140
|
getUpdatedTime(): any;
|
|
138
141
|
wasLoadedFromSource(): boolean | void;
|
|
139
142
|
post(new_record: any): any;
|
|
@@ -154,6 +157,7 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
154
157
|
expirationTimer: any;
|
|
155
158
|
createdTimeProperty: any;
|
|
156
159
|
updatedTimeProperty: any;
|
|
160
|
+
propertyResolvers: any;
|
|
157
161
|
sources: any[];
|
|
158
162
|
readonly expirationMS: any;
|
|
159
163
|
dbisDB: any;
|
|
@@ -167,10 +171,13 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
167
171
|
allowCreate(user: any, new_data: {}): boolean;
|
|
168
172
|
allowDelete(user: any): any;
|
|
169
173
|
update(updates?: any, full_update?: boolean): any;
|
|
174
|
+
addTo(property: any, value: any): void;
|
|
175
|
+
subtractFrom(property: any, value: any): void;
|
|
170
176
|
invalidate(options: any): void;
|
|
171
177
|
lock(): void;
|
|
172
|
-
put(record: any):
|
|
173
|
-
|
|
178
|
+
put(record: any): void;
|
|
179
|
+
patch(record_update: any): void;
|
|
180
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
174
181
|
delete(request: import("./ResourceInterface").Request): Promise<boolean>;
|
|
175
182
|
_writeDelete(options?: any): boolean;
|
|
176
183
|
search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
|
|
@@ -220,9 +227,9 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
220
227
|
eventNames(): (string | symbol)[];
|
|
221
228
|
}>;
|
|
222
229
|
doesExist(): boolean;
|
|
223
|
-
publish(message: any, options?: any):
|
|
230
|
+
publish(message: any, options?: any): void;
|
|
224
231
|
_writePublish(message: any, options?: any): void;
|
|
225
|
-
validate(record: any): void;
|
|
232
|
+
validate(record: any, patch?: any): void;
|
|
226
233
|
getUpdatedTime(): any;
|
|
227
234
|
wasLoadedFromSource(): boolean | void;
|
|
228
235
|
post(new_record: any): any;
|
|
@@ -237,10 +244,13 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
237
244
|
allowCreate(user: any, new_data: {}): boolean;
|
|
238
245
|
allowDelete(user: any): any;
|
|
239
246
|
update(updates?: any, full_update?: boolean): any;
|
|
247
|
+
addTo(property: any, value: any): void;
|
|
248
|
+
subtractFrom(property: any, value: any): void;
|
|
240
249
|
invalidate(options: any): void;
|
|
241
250
|
lock(): void;
|
|
242
|
-
put(record: any):
|
|
243
|
-
|
|
251
|
+
put(record: any): void;
|
|
252
|
+
patch(record_update: any): void;
|
|
253
|
+
_writeUpdate(record_update: any, full_update: boolean, options?: any): void;
|
|
244
254
|
delete(request: import("./ResourceInterface").Request): Promise<boolean>;
|
|
245
255
|
_writeDelete(options?: any): boolean;
|
|
246
256
|
search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
|
|
@@ -290,9 +300,9 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
290
300
|
eventNames(): (string | symbol)[];
|
|
291
301
|
}>;
|
|
292
302
|
doesExist(): boolean;
|
|
293
|
-
publish(message: any, options?: any):
|
|
303
|
+
publish(message: any, options?: any): void;
|
|
294
304
|
_writePublish(message: any, options?: any): void;
|
|
295
|
-
validate(record: any): void;
|
|
305
|
+
validate(record: any, patch?: any): void;
|
|
296
306
|
getUpdatedTime(): any;
|
|
297
307
|
wasLoadedFromSource(): boolean | void;
|
|
298
308
|
post(new_record: any): any;
|
|
@@ -308,16 +318,10 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
308
318
|
enableAuditing(audit_enabled?: boolean): void;
|
|
309
319
|
coerceId(id: string): string | number;
|
|
310
320
|
dropTable(): Promise<void>;
|
|
311
|
-
get(request: any, context: any): Promise<object> | {
|
|
312
|
-
recordCount: number;
|
|
313
|
-
estimatedRecordRange: number[];
|
|
314
|
-
records: string;
|
|
315
|
-
name: any;
|
|
316
|
-
database: any;
|
|
317
|
-
attributes: any;
|
|
318
|
-
};
|
|
319
321
|
evict(id: any, existing_record: any, existing_version: any): any;
|
|
320
322
|
operation(operation: any, context: any): any;
|
|
323
|
+
transformToOrderedSelect(entries: any, select: any, sort: any, context: any, transformToRecord: any): any;
|
|
324
|
+
transformEntryForSelect(select: any, context: any, filtered: any, ensure_loaded?: any, can_skip?: any): (entry: any) => any;
|
|
321
325
|
addAttributes(attributes_to_add: any): Promise<any>;
|
|
322
326
|
removeAttributes(names: string[]): Promise<any>;
|
|
323
327
|
getRecordCount(options: any): {
|
|
@@ -342,10 +346,17 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
342
346
|
transactions: import("./DatabaseTransaction").Transaction[] & {
|
|
343
347
|
timestamp: number;
|
|
344
348
|
};
|
|
349
|
+
get(identifier: import("./ResourceInterface").Id, context?: import("./ResourceInterface").Context): Promise<object>;
|
|
350
|
+
get(request: import("./ResourceInterface").Request, context?: import("./ResourceInterface").Context): Promise<object>;
|
|
351
|
+
get(query: import("./ResourceInterface").Query, context?: import("./ResourceInterface").Context): Promise<AsyncIterable<object>>;
|
|
345
352
|
put: {
|
|
346
353
|
(id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
|
|
347
354
|
reliesOnPrototype: boolean;
|
|
348
355
|
};
|
|
356
|
+
patch: {
|
|
357
|
+
(id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
|
|
358
|
+
reliesOnPrototype: boolean;
|
|
359
|
+
};
|
|
349
360
|
delete(identifier: import("./ResourceInterface").Id, context?: import("./ResourceInterface").Context): Promise<boolean>;
|
|
350
361
|
delete(request: import("./ResourceInterface").Request, context?: import("./ResourceInterface").Context): Promise<object>;
|
|
351
362
|
getNewId(): `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -389,22 +400,7 @@ export declare function table({ table: table_name, database: database_name, expi
|
|
|
389
400
|
reliesOnPrototype: boolean;
|
|
390
401
|
};
|
|
391
402
|
isCollection(resource: any): any;
|
|
392
|
-
parseQuery(search: any):
|
|
393
|
-
conditions: {
|
|
394
|
-
attribute: string;
|
|
395
|
-
value: any;
|
|
396
|
-
comparator: string;
|
|
397
|
-
}[];
|
|
398
|
-
limit: number;
|
|
399
|
-
offset: number;
|
|
400
|
-
select: string[];
|
|
401
|
-
get(name: any): any;
|
|
402
|
-
[Symbol.iterator](): IterableIterator<{
|
|
403
|
-
attribute: string;
|
|
404
|
-
value: any;
|
|
405
|
-
comparator: string;
|
|
406
|
-
}>;
|
|
407
|
-
};
|
|
403
|
+
parseQuery(search: any): any;
|
|
408
404
|
parsePath(path: any, context: any, query: any): any;
|
|
409
405
|
};
|
|
410
406
|
export declare function dropTableMeta({ table: table_name, database: database_name }: {
|
package/resources/search.d.ts
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function searchByIndex(search_condition: any, transaction: any, reverse: any, Table: any, allow_full_scan?: any, filtered?: any): any;
|
|
2
|
+
export declare function findAttribute(attributes: any, attribute_name: any): any;
|
|
2
3
|
/**
|
|
3
4
|
* Create a filter based on the search condition that can be used to test each supplied record.
|
|
4
5
|
* @param {SearchObject} search_condition
|
|
5
6
|
* @returns {({}) => boolean}
|
|
6
7
|
*/
|
|
7
|
-
export declare function filterByType(search_condition: any
|
|
8
|
+
export declare function filterByType(search_condition: any, Table: any, context: any, filtered: any): any;
|
|
9
|
+
export declare function estimateCondition(table: any): (condition: any) => any;
|
|
8
10
|
/**
|
|
9
11
|
* This is responsible for taking a query string (from a get()) and converting it to a standard query object
|
|
10
12
|
* structure
|
|
11
13
|
* @param query_string
|
|
12
14
|
*/
|
|
13
|
-
export declare function parseQuery(
|
|
14
|
-
declare
|
|
15
|
-
conditions: {
|
|
16
|
-
attribute: string;
|
|
17
|
-
value: any;
|
|
18
|
-
comparator: string;
|
|
19
|
-
}[];
|
|
20
|
-
limit: number;
|
|
21
|
-
offset: number;
|
|
22
|
-
select: string[];
|
|
23
|
-
constructor();
|
|
24
|
-
[Symbol.iterator](): IterableIterator<{
|
|
25
|
-
attribute: string;
|
|
26
|
-
value: any;
|
|
27
|
-
comparator: string;
|
|
28
|
-
}>;
|
|
29
|
-
get(name: any): any;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
15
|
+
export declare function parseQuery(query_to_parse: any): any;
|
|
16
|
+
export declare function flattenKey(key: any): any;
|
package/resources/tracked.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare function collapseData(target: any): any;
|
|
|
24
24
|
* @param target
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
export declare function deepFreeze(target: any): any;
|
|
27
|
+
export declare function deepFreeze(target: any, changes?: any): any;
|
|
28
28
|
/**
|
|
29
29
|
* Determine if any changes have been made to this tracked object
|
|
30
30
|
* @param target
|
|
@@ -34,3 +34,9 @@ export declare function hasChanges(target: any): boolean;
|
|
|
34
34
|
export declare function copyRecord(record: any, target_resource: any, attributes: any): void;
|
|
35
35
|
export declare const NOT_COPIED_YET: {};
|
|
36
36
|
export declare function withoutCopying(callback: any): any;
|
|
37
|
+
export declare class Addition {
|
|
38
|
+
value: any;
|
|
39
|
+
__op__: string;
|
|
40
|
+
constructor(value: any);
|
|
41
|
+
update(previous_value: any): any;
|
|
42
|
+
}
|
|
@@ -8,7 +8,7 @@ import { IterableEventQueue } from './IterableEventQueue';
|
|
|
8
8
|
* @param key
|
|
9
9
|
* @param listener
|
|
10
10
|
*/
|
|
11
|
-
export declare function addSubscription(table: any, key: any, listener?: (key: any) => any, start_time: number
|
|
11
|
+
export declare function addSubscription(table: any, key: any, listener?: (key: any) => any, start_time: number): Subscription;
|
|
12
12
|
/**
|
|
13
13
|
* This is the class that is returned from subscribe calls and provide the interface to set a callback, end the
|
|
14
14
|
* subscription and get the initial state.
|
package/server/Server.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface Server {
|
|
|
11
11
|
request?(listener: (request: Request, nextLayer: (request: Request) => Response) => void, options?: ServerOptions): void;
|
|
12
12
|
ws?(listener: (ws: WebSocket, request: Request, requestCompletion: Promise<any>) => any, options?: WebSocketOptions): void;
|
|
13
13
|
contentTypes: Map<string, ContentTypeHandler>;
|
|
14
|
-
getUser(username: string, password
|
|
14
|
+
getUser(username: string, password: string | null, request: Request): any;
|
|
15
15
|
operation(operation: any, authorize?: boolean): Promise<any>;
|
|
16
16
|
}
|
|
17
17
|
interface ServerOptions {
|