harperdb 4.6.0-alpha.3 → 4.6.0-beta.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 +1 -1
- package/bin/harperdb.js +68 -68
- package/bin/lite.js +66 -66
- package/launchServiceScripts/launchNatsIngestService.js +66 -66
- package/launchServiceScripts/launchNatsReplyService.js +75 -75
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +66 -66
- package/npm-shrinkwrap.json +782 -709
- package/package.json +20 -18
- package/resources/RecordEncoder.d.ts +1 -0
- package/resources/RequestTarget.d.ts +45 -1
- package/resources/Resource.d.ts +5 -5
- package/resources/ResourceInterface.d.ts +7 -7
- package/resources/Table.d.ts +111 -75
- package/resources/analytics/hostnames.d.ts +104 -62
- package/resources/databases.d.ts +104 -62
- package/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +1 -1
- package/resources/search.d.ts +1 -1
- package/server/jobs/jobProcess.js +66 -66
- package/server/status/definitions.d.ts +27 -0
- package/server/status/index.d.ts +17 -0
- package/server/threads/threadServer.js +66 -66
- package/studio/build-local/asset-manifest.json +33 -33
- package/studio/build-local/index.html +1 -1
- package/studio/build-local/static/js/833.fbfe7401.chunk.js +1 -0
- package/studio/build-local/static/js/{504.6e6ee908.chunk.js → 967.204fa205.chunk.js} +2 -2
- package/studio/build-local/static/js/browse-csvupload.2b5a9e13.chunk.js +1 -0
- package/studio/build-local/static/js/browse-datatable.9e58ff64.chunk.js +1 -0
- package/studio/build-local/static/js/browse-entitymanager.d6afc4fd.chunk.js +1 -0
- package/studio/build-local/static/js/browse-jsonviewer.588b23c5.chunk.js +1 -0
- package/studio/build-local/static/js/custom-functions.ff091f75.chunk.js +1 -0
- package/studio/build-local/static/js/instance-cluster.6818b415.chunk.js +1 -0
- package/studio/build-local/static/js/instance-config.7c913130.chunk.js +1 -0
- package/studio/build-local/static/js/instance-logs.7376d433.chunk.js +1 -0
- package/studio/build-local/static/js/instance-roles.cbcbbc42.chunk.js +1 -0
- package/studio/build-local/static/js/{instance-status.192a5e2f.chunk.js → instance-status.0eb61c1f.chunk.js} +1 -1
- package/studio/build-local/static/js/instance-users-datatable.bb1e4157.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users-edit.23ab5e30.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users.56db347f.chunk.js +1 -0
- package/studio/build-local/static/js/instance.88196931.chunk.js +1 -0
- package/studio/build-local/static/js/instances.f4453268.chunk.js +1 -0
- package/studio/build-local/static/js/main.caff865c.js +2 -0
- package/studio/build-local/static/js/offline-app.363c4e03.chunk.js +1 -0
- package/studio/build-local/static/js/online-app.ab23001a.chunk.js +1 -0
- package/studio/build-local/static/js/organization-billing.64cbf949.chunk.js +1 -0
- package/studio/build-local/static/js/organization-users.fa366ada.chunk.js +1 -0
- package/studio/build-local/static/js/organization.f741809a.chunk.js +1 -0
- package/studio/build-local/static/js/organizations.7965cee0.chunk.js +1 -0
- package/studio/build-local/static/js/profile.07e2ebfd.chunk.js +1 -0
- package/studio/build-local/static/js/resetPassword.90ca00d9.chunk.js +1 -0
- package/studio/build-local/static/js/roles-jsonviewer.1574416f.chunk.js +1 -0
- package/studio/build-local/static/js/signIn.0d672113.chunk.js +1 -0
- package/studio/build-local/static/js/signUp.0e036959.chunk.js +1 -0
- package/studio/build-local/static/js/structure-reloader.4726d0b7.chunk.js +1 -0
- package/studio/build-local/static/js/topnav.deb5a145.chunk.js +1 -0
- package/studio/build-local/static/js/updatePassword.8612a372.chunk.js +1 -0
- package/utility/hdbTerms.d.ts +3 -0
- package/utility/scripts/restartHdb.js +66 -66
- package/validation/statusValidator.d.ts +8 -11
- package/server/status.d.ts +0 -448
- package/studio/build-local/static/js/833.e460eaf4.chunk.js +0 -1
- package/studio/build-local/static/js/browse-csvupload.84fd1ae9.chunk.js +0 -1
- package/studio/build-local/static/js/browse-datatable.3d9e9ccf.chunk.js +0 -1
- package/studio/build-local/static/js/browse-entitymanager.4547c0d8.chunk.js +0 -1
- package/studio/build-local/static/js/browse-jsonviewer.71355c20.chunk.js +0 -1
- package/studio/build-local/static/js/custom-functions.31d65bca.chunk.js +0 -1
- package/studio/build-local/static/js/instance-cluster.031dcced.chunk.js +0 -1
- package/studio/build-local/static/js/instance-config.9a23d6ae.chunk.js +0 -1
- package/studio/build-local/static/js/instance-logs.fdaf96ec.chunk.js +0 -1
- package/studio/build-local/static/js/instance-roles.984ced56.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users-datatable.40846e47.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users-edit.f10344c8.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users.adc43a74.chunk.js +0 -1
- package/studio/build-local/static/js/instance.9de0a105.chunk.js +0 -1
- package/studio/build-local/static/js/instances.299d83e9.chunk.js +0 -1
- package/studio/build-local/static/js/main.5a7cabb6.js +0 -2
- package/studio/build-local/static/js/offline-app.5bc1159b.chunk.js +0 -1
- package/studio/build-local/static/js/online-app.22102869.chunk.js +0 -1
- package/studio/build-local/static/js/organization-billing.56e7e051.chunk.js +0 -1
- package/studio/build-local/static/js/organization-users.b46b9e8f.chunk.js +0 -1
- package/studio/build-local/static/js/organization.eab64d57.chunk.js +0 -1
- package/studio/build-local/static/js/organizations.4567ae59.chunk.js +0 -1
- package/studio/build-local/static/js/profile.d45cd6b3.chunk.js +0 -1
- package/studio/build-local/static/js/resetPassword.812fc880.chunk.js +0 -1
- package/studio/build-local/static/js/roles-jsonviewer.73c8bb9d.chunk.js +0 -1
- package/studio/build-local/static/js/signIn.32766fa9.chunk.js +0 -1
- package/studio/build-local/static/js/signUp.07fd6662.chunk.js +0 -1
- package/studio/build-local/static/js/structure-reloader.ce2b39d2.chunk.js +0 -1
- package/studio/build-local/static/js/topnav.e661156c.chunk.js +0 -1
- package/studio/build-local/static/js/updatePassword.dcac970c.chunk.js +0 -1
- /package/studio/build-local/static/js/{504.6e6ee908.chunk.js.LICENSE.txt → 967.204fa205.chunk.js.LICENSE.txt} +0 -0
- /package/studio/build-local/static/js/{main.5a7cabb6.js.LICENSE.txt → main.caff865c.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harperdb",
|
|
3
|
-
"version": "4.6.0-
|
|
3
|
+
"version": "4.6.0-beta.1",
|
|
4
4
|
"description": "HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"main": "harperdb.js",
|
|
27
27
|
"bin": {
|
|
28
|
-
"harperdb": "./bin/harperdb.js"
|
|
28
|
+
"harperdb": "./bin/harperdb.js",
|
|
29
|
+
"harper": "./bin/harperdb.js"
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|
|
31
32
|
"minimum-node": "16.0.0",
|
|
@@ -43,8 +44,8 @@
|
|
|
43
44
|
},
|
|
44
45
|
"license": "SEE LICENSE IN LICENSE",
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@aws-sdk/client-s3": "3.
|
|
47
|
-
"@aws-sdk/lib-storage": "3.
|
|
47
|
+
"@aws-sdk/client-s3": "3.824.0",
|
|
48
|
+
"@aws-sdk/lib-storage": "3.824.0",
|
|
48
49
|
"@endo/static-module-record": "^1.0.4",
|
|
49
50
|
"@fastify/autoload": "5.10.0",
|
|
50
51
|
"@fastify/compress": "~6.5.0",
|
|
@@ -59,8 +60,8 @@
|
|
|
59
60
|
"@turf/distance": "6.5.0",
|
|
60
61
|
"@turf/helpers": "6.5.0",
|
|
61
62
|
"@turf/length": "6.5.0",
|
|
62
|
-
"alasql": "4.
|
|
63
|
-
"argon2": "0.
|
|
63
|
+
"alasql": "4.6.6",
|
|
64
|
+
"argon2": "0.43.0",
|
|
64
65
|
"cbor-x": "1.6.0",
|
|
65
66
|
"chalk": "4.1.2",
|
|
66
67
|
"chokidar": "^4.0.3",
|
|
@@ -70,20 +71,21 @@
|
|
|
70
71
|
"fast-glob": "3.3.3",
|
|
71
72
|
"fastify": "~4.29.0",
|
|
72
73
|
"fastify-plugin": "~4.5.1",
|
|
73
|
-
"fs-extra": "11.
|
|
74
|
+
"fs-extra": "11.3.0",
|
|
74
75
|
"graphql": "^16.10.0",
|
|
75
76
|
"gunzip-maybe": "1.4.2",
|
|
76
77
|
"human-readable-ids": "1.0.4",
|
|
77
78
|
"inquirer": "8.2.6",
|
|
78
79
|
"is-number": "7.0.0",
|
|
79
|
-
"joi": "17.
|
|
80
|
+
"joi": "17.13.3",
|
|
80
81
|
"json-bigint-fixes": "1.1.0",
|
|
81
82
|
"json2csv": "5.0.7",
|
|
82
83
|
"jsonata": "1.8.7",
|
|
83
84
|
"jsonwebtoken": "9.0.2",
|
|
84
|
-
"lmdb": "3.
|
|
85
|
+
"lmdb": "3.4.0",
|
|
85
86
|
"lodash": "4.17.21",
|
|
86
87
|
"mathjs": "11.12.0",
|
|
88
|
+
"micromatch": "^4.0.8",
|
|
87
89
|
"minimist": "1.2.8",
|
|
88
90
|
"moment": "2.30.1",
|
|
89
91
|
"mqtt-packet": "~9.0.1",
|
|
@@ -96,8 +98,8 @@
|
|
|
96
98
|
"normalize-path": "^3.0.0",
|
|
97
99
|
"ora": "5.4.1",
|
|
98
100
|
"ordered-binary": "1.5.3",
|
|
99
|
-
"papaparse": "5.
|
|
100
|
-
"passport": "0.
|
|
101
|
+
"papaparse": "5.5.3",
|
|
102
|
+
"passport": "0.7.0",
|
|
101
103
|
"passport-http": "0.3.0",
|
|
102
104
|
"passport-local": "1.0.0",
|
|
103
105
|
"pino": "8.16.0",
|
|
@@ -105,19 +107,19 @@
|
|
|
105
107
|
"prompt": "1.3.0",
|
|
106
108
|
"properties-reader": "2.3.0",
|
|
107
109
|
"recursive-iterator": "3.3.0",
|
|
108
|
-
"semver": "7.
|
|
110
|
+
"semver": "7.7.2",
|
|
109
111
|
"send": "^1.1.0",
|
|
110
112
|
"serve-static": "^2.2.0",
|
|
111
|
-
"ses": "1.
|
|
113
|
+
"ses": "1.13.0",
|
|
112
114
|
"stream-chain": "2.2.5",
|
|
113
|
-
"stream-json": "1.
|
|
114
|
-
"systeminformation": "5.
|
|
115
|
-
"tar-fs": "3.0.
|
|
115
|
+
"stream-json": "1.9.1",
|
|
116
|
+
"systeminformation": "5.27.1",
|
|
117
|
+
"tar-fs": "3.0.9",
|
|
116
118
|
"ulidx": "0.5.0",
|
|
117
119
|
"uuid": "10.0.0",
|
|
118
120
|
"validate.js": "0.13.1",
|
|
119
|
-
"ws": "8.18.
|
|
120
|
-
"yaml": "2.
|
|
121
|
+
"ws": "8.18.2",
|
|
122
|
+
"yaml": "2.8.0"
|
|
121
123
|
},
|
|
122
124
|
"optionalDependencies": {
|
|
123
125
|
"bufferutil": "^4.0.9",
|
|
@@ -32,6 +32,7 @@ export declare const HAS_RESIDENCY_ID = 32;
|
|
|
32
32
|
export declare const PENDING_LOCAL_TIME = 1;
|
|
33
33
|
export declare const HAS_STRUCTURE_UPDATE = 256;
|
|
34
34
|
export declare const entryMap: WeakMap<any, Entry>;
|
|
35
|
+
export declare let lastMetadata: Entry | null;
|
|
35
36
|
export declare class RecordEncoder extends Encoder {
|
|
36
37
|
constructor(options: any);
|
|
37
38
|
decode(buffer: any, options: any): any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Conditions, Id, Select, Sort } from './ResourceInterface';
|
|
2
2
|
export declare class RequestTarget extends URLSearchParams {
|
|
3
|
-
|
|
3
|
+
#private;
|
|
4
4
|
pathname: string;
|
|
5
5
|
search?: string;
|
|
6
6
|
/** Target a specific record, but can be combined with select */
|
|
7
7
|
id?: Id;
|
|
8
|
+
/** Indicates that this is a request to query for collection of records */
|
|
9
|
+
isCollection?: boolean;
|
|
8
10
|
/** The conditions to use in the query, that the returned records must satisfy */
|
|
9
11
|
conditions?: Conditions;
|
|
10
12
|
/** The number of records to return */
|
|
@@ -23,8 +25,50 @@ export declare class RequestTarget extends URLSearchParams {
|
|
|
23
25
|
/** Force the query to be executed in the order of conditions */
|
|
24
26
|
enforceExecutionOrder?: boolean;
|
|
25
27
|
lazy?: boolean;
|
|
28
|
+
parseError?: Error;
|
|
29
|
+
noCacheStore?: boolean;
|
|
30
|
+
noCache?: boolean;
|
|
31
|
+
onlyIfCached?: boolean;
|
|
32
|
+
staleIfError?: boolean;
|
|
33
|
+
mustRevalidate?: boolean;
|
|
34
|
+
replicateTo?: string[];
|
|
35
|
+
replicateFrom?: boolean;
|
|
36
|
+
replicatedConfirmation?: number;
|
|
37
|
+
originatingOperation?: string;
|
|
38
|
+
previousResidency?: string[];
|
|
39
|
+
checkPermission?: Permission | boolean;
|
|
26
40
|
constructor(target?: string);
|
|
27
41
|
toString(): string;
|
|
28
42
|
get url(): string;
|
|
43
|
+
delete(name: string): void;
|
|
44
|
+
set(name: string, value: string): void;
|
|
45
|
+
append(name: string, value: string): void;
|
|
29
46
|
}
|
|
30
47
|
export type RequestTargetOrId = RequestTarget | Id;
|
|
48
|
+
interface Permission {
|
|
49
|
+
read: boolean;
|
|
50
|
+
update: boolean;
|
|
51
|
+
delete: boolean;
|
|
52
|
+
insert: boolean;
|
|
53
|
+
[database: string]: boolean | {
|
|
54
|
+
read: boolean;
|
|
55
|
+
update: boolean;
|
|
56
|
+
delete: boolean;
|
|
57
|
+
insert: boolean;
|
|
58
|
+
tables: {
|
|
59
|
+
[table: string]: {
|
|
60
|
+
read: boolean;
|
|
61
|
+
update: boolean;
|
|
62
|
+
delete: boolean;
|
|
63
|
+
insert: boolean;
|
|
64
|
+
attribute_permissions: {
|
|
65
|
+
attribute_name: string;
|
|
66
|
+
read: boolean;
|
|
67
|
+
update: boolean;
|
|
68
|
+
delete: boolean;
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export {};
|
package/resources/Resource.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export declare class Resource implements ResourceInterface {
|
|
|
104
104
|
static isCollection(resource: any): any;
|
|
105
105
|
get isCollection(): boolean;
|
|
106
106
|
static coerceId(id: string): number | string;
|
|
107
|
-
static parseQuery(search: any, query: any):
|
|
107
|
+
static parseQuery(search: any, query: any): any;
|
|
108
108
|
static parsePath(path: any, context: any, query: any): any;
|
|
109
109
|
/**
|
|
110
110
|
* Gets an instance of a resource by id
|
|
@@ -127,10 +127,10 @@ export declare class Resource implements ResourceInterface {
|
|
|
127
127
|
value: object;
|
|
128
128
|
}>;
|
|
129
129
|
connect(incomingMessages: IterableEventQueue, query?: {}): AsyncIterable<any>;
|
|
130
|
-
allowRead(user: any): boolean
|
|
131
|
-
allowUpdate(user: any): boolean
|
|
132
|
-
allowCreate(user: any): boolean
|
|
133
|
-
allowDelete(user: any): boolean
|
|
130
|
+
allowRead(user: any, target: RequestTarget): boolean;
|
|
131
|
+
allowUpdate(user: any, updatedData: any, target: RequestTarget): boolean;
|
|
132
|
+
allowCreate(user: any, newData: any, target: RequestTarget): boolean;
|
|
133
|
+
allowDelete(user: any, target: RequestTarget): boolean;
|
|
134
134
|
/**
|
|
135
135
|
* Get the primary key value for this resource.
|
|
136
136
|
* @returns primary key
|
|
@@ -12,10 +12,10 @@ export interface ResourceInterface<Key = any, Record = any> {
|
|
|
12
12
|
delete?(target: RequestTargetOrId): boolean;
|
|
13
13
|
search?(query: RequestTarget): AsyncIterable<any>;
|
|
14
14
|
subscribe?(request: SubscriptionRequest): Subscription;
|
|
15
|
-
allowRead(user: any, target: RequestTarget
|
|
16
|
-
allowUpdate(user: any, record: any,
|
|
17
|
-
allowCreate(user: any, record: any,
|
|
18
|
-
allowDelete(user: any, target: RequestTarget
|
|
15
|
+
allowRead(user: any, target: RequestTarget): boolean | Promise<boolean>;
|
|
16
|
+
allowUpdate(user: any, record: any, target: RequestTarget): boolean | Promise<boolean>;
|
|
17
|
+
allowCreate(user: any, record: any, target: RequestTarget): boolean | Promise<boolean>;
|
|
18
|
+
allowDelete(user: any, target: RequestTarget): boolean | Promise<boolean>;
|
|
19
19
|
}
|
|
20
20
|
export interface User {
|
|
21
21
|
username: string;
|
|
@@ -55,11 +55,11 @@ export type Operator = 'and' | 'or';
|
|
|
55
55
|
type SearchType = 'equals' | 'contains' | 'starts_with' | 'ends_with' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'between';
|
|
56
56
|
export interface DirectCondition {
|
|
57
57
|
attribute?: string;
|
|
58
|
-
|
|
58
|
+
search_attribute?: string;
|
|
59
59
|
comparator?: SearchType;
|
|
60
|
-
|
|
60
|
+
search_type?: SearchType;
|
|
61
61
|
value?: any;
|
|
62
|
-
|
|
62
|
+
search_value?: any;
|
|
63
63
|
}
|
|
64
64
|
interface ConditionGroup {
|
|
65
65
|
conditions: Conditions;
|
package/resources/Table.d.ts
CHANGED
|
@@ -43,55 +43,68 @@ type ResidencyDefinition = number | string[] | void;
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function makeTable(options: any): {
|
|
45
45
|
new (identifier: Id, source: any): {
|
|
46
|
-
"__#
|
|
47
|
-
"__#
|
|
48
|
-
"__#
|
|
49
|
-
"__#
|
|
50
|
-
"__#
|
|
51
|
-
"__#
|
|
46
|
+
"__#6@#record": any;
|
|
47
|
+
"__#6@#changes": any;
|
|
48
|
+
"__#6@#version"?: number;
|
|
49
|
+
"__#6@#entry"?: Entry;
|
|
50
|
+
"__#6@#saveMode"?: boolean;
|
|
51
|
+
"__#6@#loadedFromSource"?: boolean;
|
|
52
52
|
getProperty: (name: string) => any;
|
|
53
53
|
/**
|
|
54
54
|
* This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
|
|
55
55
|
* This will load from source if the current record is expired, missing, or invalidated.
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
|
-
ensureLoaded():
|
|
58
|
+
ensureLoaded(): unknown;
|
|
59
59
|
/**
|
|
60
60
|
* This retrieves the data of this resource. By default, with no argument, just return `this`.
|
|
61
61
|
* @param target - If included, is an identifier/query that specifies the requested target to retrieve and query
|
|
62
62
|
*/
|
|
63
|
-
get(target?: RequestTarget): Promise<object | void
|
|
63
|
+
get(target?: RequestTarget): Promise<object | void>;
|
|
64
64
|
/**
|
|
65
65
|
* Determine if the user is allowed to get/read data from the current resource
|
|
66
66
|
* @param user The current, authenticated user
|
|
67
|
-
* @param
|
|
67
|
+
* @param target The parsed query from the search part of the URL
|
|
68
68
|
*/
|
|
69
|
-
allowRead(user: any,
|
|
69
|
+
allowRead(user: any, target: RequestTarget): boolean;
|
|
70
70
|
/**
|
|
71
71
|
* Determine if the user is allowed to update data from the current resource
|
|
72
72
|
* @param user The current, authenticated user
|
|
73
73
|
* @param updatedData
|
|
74
74
|
* @param fullUpdate
|
|
75
75
|
*/
|
|
76
|
-
allowUpdate(user: any, updatedData: any): boolean;
|
|
76
|
+
allowUpdate(user: any, updatedData: any, target: RequestTarget): boolean;
|
|
77
77
|
/**
|
|
78
78
|
* Determine if the user is allowed to create new data in the current resource
|
|
79
79
|
* @param user The current, authenticated user
|
|
80
80
|
* @param newData
|
|
81
81
|
*/
|
|
82
|
-
allowCreate(user: any, newData:
|
|
82
|
+
allowCreate(user: any, newData: any, target: RequestTarget): boolean;
|
|
83
83
|
/**
|
|
84
84
|
* Determine if the user is allowed to delete from the current resource
|
|
85
85
|
* @param user The current, authenticated user
|
|
86
86
|
*/
|
|
87
|
-
allowDelete(user: any): boolean;
|
|
87
|
+
allowDelete(user: any, target: RequestTarget): boolean;
|
|
88
88
|
/**
|
|
89
89
|
* Start updating a record. The returned resource will record changes which are written
|
|
90
90
|
* once the corresponding transaction is committed. These changes can (eventually) include CRDT type operations.
|
|
91
91
|
* @param updates This can be a record to update the current resource with.
|
|
92
92
|
* @param fullUpdate 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
|
|
93
93
|
*/
|
|
94
|
-
update(target: RequestTarget, updates?: any): any
|
|
94
|
+
update(target: RequestTarget, updates?: any): /*elided*/ any | {
|
|
95
|
+
set: (property: string, value: any) => void;
|
|
96
|
+
getProperty: (property: string) => any;
|
|
97
|
+
getUpdatedTime(): number;
|
|
98
|
+
getExpiresAt(): number;
|
|
99
|
+
addTo(property: string, value: number | bigint): void;
|
|
100
|
+
subtractFrom(property: string, value: number | bigint): void;
|
|
101
|
+
"__#4@#record": any;
|
|
102
|
+
"__#4@#changes": any;
|
|
103
|
+
getRecord(): any;
|
|
104
|
+
setRecord(record: any): void;
|
|
105
|
+
getChanges(): any;
|
|
106
|
+
_setChanges(changes: any): void;
|
|
107
|
+
};
|
|
95
108
|
addTo(property: any, value: any): void;
|
|
96
109
|
subtractFrom(property: any, value: any): void;
|
|
97
110
|
getMetadata(): Entry;
|
|
@@ -108,18 +121,17 @@ export declare function makeTable(options: any): {
|
|
|
108
121
|
lock(): void;
|
|
109
122
|
/**
|
|
110
123
|
* Store the provided record data into the current resource. This is not written
|
|
111
|
-
* until the corresponding transaction is committed.
|
|
112
|
-
* succeed. That doesn't necessarily mean it will "win", another concurrent put could come "after" (monotonically,
|
|
113
|
-
* even if not chronologically) this one.
|
|
124
|
+
* until the corresponding transaction is committed.
|
|
114
125
|
* @param record
|
|
115
126
|
* @param options
|
|
116
127
|
*/
|
|
117
|
-
put(target: RequestTarget, record: any): void
|
|
128
|
+
put(target: RequestTarget, record: any): void | Promise<void>;
|
|
129
|
+
create(target: RequestTarget, record: any): void | Promise<void>;
|
|
118
130
|
patch(target: RequestTarget, recordUpdate: any): void | Promise<void>;
|
|
119
131
|
_writeUpdate(id: Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
|
|
120
|
-
delete(target: RequestTarget): Promise<boolean
|
|
132
|
+
delete(target: RequestTarget): Promise<boolean> | boolean;
|
|
121
133
|
_writeDelete(id: Id, options?: any): boolean;
|
|
122
|
-
search(
|
|
134
|
+
search(target: RequestTarget): AsyncIterable<any>;
|
|
123
135
|
subscribe(request: SubscriptionRequest): Promise<{
|
|
124
136
|
listener: (recordId: Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
|
|
125
137
|
subscriptions: [];
|
|
@@ -181,12 +193,12 @@ export declare function makeTable(options: any): {
|
|
|
181
193
|
*/
|
|
182
194
|
publish(target: RequestTarget, message: any, options?: any): void;
|
|
183
195
|
_writePublish(id: Id, message: any, options?: any): void;
|
|
184
|
-
validate(record: any, patch?:
|
|
196
|
+
validate(record: any, patch?: boolean): void;
|
|
185
197
|
getUpdatedTime(): number;
|
|
186
198
|
wasLoadedFromSource(): boolean | void;
|
|
187
|
-
readonly "__#
|
|
188
|
-
readonly "__#
|
|
189
|
-
"__#
|
|
199
|
+
readonly "__#7@#id": Id;
|
|
200
|
+
readonly "__#7@#context": Context;
|
|
201
|
+
"__#7@#isCollection": boolean;
|
|
190
202
|
post(newRecord: any): Promise<any>;
|
|
191
203
|
readonly isCollection: boolean;
|
|
192
204
|
connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
|
|
@@ -240,55 +252,68 @@ export declare function makeTable(options: any): {
|
|
|
240
252
|
* @returns
|
|
241
253
|
*/
|
|
242
254
|
getResource(id: Id, request: Context, resourceOptions?: any): Promise<{
|
|
243
|
-
"__#
|
|
244
|
-
"__#
|
|
245
|
-
"__#
|
|
246
|
-
"__#
|
|
247
|
-
"__#
|
|
248
|
-
"__#
|
|
255
|
+
"__#6@#record": any;
|
|
256
|
+
"__#6@#changes": any;
|
|
257
|
+
"__#6@#version"?: number;
|
|
258
|
+
"__#6@#entry"?: Entry;
|
|
259
|
+
"__#6@#saveMode"?: boolean;
|
|
260
|
+
"__#6@#loadedFromSource"?: boolean;
|
|
249
261
|
getProperty: (name: string) => any;
|
|
250
262
|
/**
|
|
251
263
|
* This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
|
|
252
264
|
* This will load from source if the current record is expired, missing, or invalidated.
|
|
253
265
|
* @returns
|
|
254
266
|
*/
|
|
255
|
-
ensureLoaded():
|
|
267
|
+
ensureLoaded(): unknown;
|
|
256
268
|
/**
|
|
257
269
|
* This retrieves the data of this resource. By default, with no argument, just return `this`.
|
|
258
270
|
* @param target - If included, is an identifier/query that specifies the requested target to retrieve and query
|
|
259
271
|
*/
|
|
260
|
-
get(target?: RequestTarget): Promise<object | void
|
|
272
|
+
get(target?: RequestTarget): Promise<object | void>;
|
|
261
273
|
/**
|
|
262
274
|
* Determine if the user is allowed to get/read data from the current resource
|
|
263
275
|
* @param user The current, authenticated user
|
|
264
|
-
* @param
|
|
276
|
+
* @param target The parsed query from the search part of the URL
|
|
265
277
|
*/
|
|
266
|
-
allowRead(user: any,
|
|
278
|
+
allowRead(user: any, target: RequestTarget): boolean;
|
|
267
279
|
/**
|
|
268
280
|
* Determine if the user is allowed to update data from the current resource
|
|
269
281
|
* @param user The current, authenticated user
|
|
270
282
|
* @param updatedData
|
|
271
283
|
* @param fullUpdate
|
|
272
284
|
*/
|
|
273
|
-
allowUpdate(user: any, updatedData: any): boolean;
|
|
285
|
+
allowUpdate(user: any, updatedData: any, target: RequestTarget): boolean;
|
|
274
286
|
/**
|
|
275
287
|
* Determine if the user is allowed to create new data in the current resource
|
|
276
288
|
* @param user The current, authenticated user
|
|
277
289
|
* @param newData
|
|
278
290
|
*/
|
|
279
|
-
allowCreate(user: any, newData:
|
|
291
|
+
allowCreate(user: any, newData: any, target: RequestTarget): boolean;
|
|
280
292
|
/**
|
|
281
293
|
* Determine if the user is allowed to delete from the current resource
|
|
282
294
|
* @param user The current, authenticated user
|
|
283
295
|
*/
|
|
284
|
-
allowDelete(user: any): boolean;
|
|
296
|
+
allowDelete(user: any, target: RequestTarget): boolean;
|
|
285
297
|
/**
|
|
286
298
|
* Start updating a record. The returned resource will record changes which are written
|
|
287
299
|
* once the corresponding transaction is committed. These changes can (eventually) include CRDT type operations.
|
|
288
300
|
* @param updates This can be a record to update the current resource with.
|
|
289
301
|
* @param fullUpdate 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
|
|
290
302
|
*/
|
|
291
|
-
update(target: RequestTarget, updates?: any): any
|
|
303
|
+
update(target: RequestTarget, updates?: any): /*elided*/ any | {
|
|
304
|
+
set: (property: string, value: any) => void;
|
|
305
|
+
getProperty: (property: string) => any;
|
|
306
|
+
getUpdatedTime(): number;
|
|
307
|
+
getExpiresAt(): number;
|
|
308
|
+
addTo(property: string, value: number | bigint): void;
|
|
309
|
+
subtractFrom(property: string, value: number | bigint): void;
|
|
310
|
+
"__#4@#record": any;
|
|
311
|
+
"__#4@#changes": any;
|
|
312
|
+
getRecord(): any;
|
|
313
|
+
setRecord(record: any): void;
|
|
314
|
+
getChanges(): any;
|
|
315
|
+
_setChanges(changes: any): void;
|
|
316
|
+
};
|
|
292
317
|
addTo(property: any, value: any): void;
|
|
293
318
|
subtractFrom(property: any, value: any): void;
|
|
294
319
|
getMetadata(): Entry;
|
|
@@ -305,18 +330,17 @@ export declare function makeTable(options: any): {
|
|
|
305
330
|
lock(): void;
|
|
306
331
|
/**
|
|
307
332
|
* Store the provided record data into the current resource. This is not written
|
|
308
|
-
* until the corresponding transaction is committed.
|
|
309
|
-
* succeed. That doesn't necessarily mean it will "win", another concurrent put could come "after" (monotonically,
|
|
310
|
-
* even if not chronologically) this one.
|
|
333
|
+
* until the corresponding transaction is committed.
|
|
311
334
|
* @param record
|
|
312
335
|
* @param options
|
|
313
336
|
*/
|
|
314
|
-
put(target: RequestTarget, record: any): void
|
|
337
|
+
put(target: RequestTarget, record: any): void | Promise<void>;
|
|
338
|
+
create(target: RequestTarget, record: any): void | Promise<void>;
|
|
315
339
|
patch(target: RequestTarget, recordUpdate: any): void | Promise<void>;
|
|
316
340
|
_writeUpdate(id: Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
|
|
317
|
-
delete(target: RequestTarget): Promise<boolean
|
|
341
|
+
delete(target: RequestTarget): Promise<boolean> | boolean;
|
|
318
342
|
_writeDelete(id: Id, options?: any): boolean;
|
|
319
|
-
search(
|
|
343
|
+
search(target: RequestTarget): AsyncIterable<any>;
|
|
320
344
|
subscribe(request: SubscriptionRequest): Promise<{
|
|
321
345
|
listener: (recordId: Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
|
|
322
346
|
subscriptions: [];
|
|
@@ -378,67 +402,80 @@ export declare function makeTable(options: any): {
|
|
|
378
402
|
*/
|
|
379
403
|
publish(target: RequestTarget, message: any, options?: any): void;
|
|
380
404
|
_writePublish(id: Id, message: any, options?: any): void;
|
|
381
|
-
validate(record: any, patch?:
|
|
405
|
+
validate(record: any, patch?: boolean): void;
|
|
382
406
|
getUpdatedTime(): number;
|
|
383
407
|
wasLoadedFromSource(): boolean | void;
|
|
384
|
-
readonly "__#
|
|
385
|
-
readonly "__#
|
|
386
|
-
"__#
|
|
408
|
+
readonly "__#7@#id": Id;
|
|
409
|
+
readonly "__#7@#context": Context;
|
|
410
|
+
"__#7@#isCollection": boolean;
|
|
387
411
|
post(newRecord: any): Promise<any>;
|
|
388
412
|
readonly isCollection: boolean;
|
|
389
413
|
connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
|
|
390
414
|
getId(): Id;
|
|
391
415
|
getContext(): Context;
|
|
392
416
|
}> | {
|
|
393
|
-
"__#
|
|
394
|
-
"__#
|
|
395
|
-
"__#
|
|
396
|
-
"__#
|
|
397
|
-
"__#
|
|
398
|
-
"__#
|
|
417
|
+
"__#6@#record": any;
|
|
418
|
+
"__#6@#changes": any;
|
|
419
|
+
"__#6@#version"?: number;
|
|
420
|
+
"__#6@#entry"?: Entry;
|
|
421
|
+
"__#6@#saveMode"?: boolean;
|
|
422
|
+
"__#6@#loadedFromSource"?: boolean;
|
|
399
423
|
getProperty: (name: string) => any;
|
|
400
424
|
/**
|
|
401
425
|
* This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
|
|
402
426
|
* This will load from source if the current record is expired, missing, or invalidated.
|
|
403
427
|
* @returns
|
|
404
428
|
*/
|
|
405
|
-
ensureLoaded():
|
|
429
|
+
ensureLoaded(): unknown;
|
|
406
430
|
/**
|
|
407
431
|
* This retrieves the data of this resource. By default, with no argument, just return `this`.
|
|
408
432
|
* @param target - If included, is an identifier/query that specifies the requested target to retrieve and query
|
|
409
433
|
*/
|
|
410
|
-
get(target?: RequestTarget): Promise<object | void
|
|
434
|
+
get(target?: RequestTarget): Promise<object | void>;
|
|
411
435
|
/**
|
|
412
436
|
* Determine if the user is allowed to get/read data from the current resource
|
|
413
437
|
* @param user The current, authenticated user
|
|
414
|
-
* @param
|
|
438
|
+
* @param target The parsed query from the search part of the URL
|
|
415
439
|
*/
|
|
416
|
-
allowRead(user: any,
|
|
440
|
+
allowRead(user: any, target: RequestTarget): boolean;
|
|
417
441
|
/**
|
|
418
442
|
* Determine if the user is allowed to update data from the current resource
|
|
419
443
|
* @param user The current, authenticated user
|
|
420
444
|
* @param updatedData
|
|
421
445
|
* @param fullUpdate
|
|
422
446
|
*/
|
|
423
|
-
allowUpdate(user: any, updatedData: any): boolean;
|
|
447
|
+
allowUpdate(user: any, updatedData: any, target: RequestTarget): boolean;
|
|
424
448
|
/**
|
|
425
449
|
* Determine if the user is allowed to create new data in the current resource
|
|
426
450
|
* @param user The current, authenticated user
|
|
427
451
|
* @param newData
|
|
428
452
|
*/
|
|
429
|
-
allowCreate(user: any, newData:
|
|
453
|
+
allowCreate(user: any, newData: any, target: RequestTarget): boolean;
|
|
430
454
|
/**
|
|
431
455
|
* Determine if the user is allowed to delete from the current resource
|
|
432
456
|
* @param user The current, authenticated user
|
|
433
457
|
*/
|
|
434
|
-
allowDelete(user: any): boolean;
|
|
458
|
+
allowDelete(user: any, target: RequestTarget): boolean;
|
|
435
459
|
/**
|
|
436
460
|
* Start updating a record. The returned resource will record changes which are written
|
|
437
461
|
* once the corresponding transaction is committed. These changes can (eventually) include CRDT type operations.
|
|
438
462
|
* @param updates This can be a record to update the current resource with.
|
|
439
463
|
* @param fullUpdate 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
|
|
440
464
|
*/
|
|
441
|
-
update(target: RequestTarget, updates?: any): any
|
|
465
|
+
update(target: RequestTarget, updates?: any): /*elided*/ any | {
|
|
466
|
+
set: (property: string, value: any) => void;
|
|
467
|
+
getProperty: (property: string) => any;
|
|
468
|
+
getUpdatedTime(): number;
|
|
469
|
+
getExpiresAt(): number;
|
|
470
|
+
addTo(property: string, value: number | bigint): void;
|
|
471
|
+
subtractFrom(property: string, value: number | bigint): void;
|
|
472
|
+
"__#4@#record": any;
|
|
473
|
+
"__#4@#changes": any;
|
|
474
|
+
getRecord(): any;
|
|
475
|
+
setRecord(record: any): void;
|
|
476
|
+
getChanges(): any;
|
|
477
|
+
_setChanges(changes: any): void;
|
|
478
|
+
};
|
|
442
479
|
addTo(property: any, value: any): void;
|
|
443
480
|
subtractFrom(property: any, value: any): void;
|
|
444
481
|
getMetadata(): Entry;
|
|
@@ -455,18 +492,17 @@ export declare function makeTable(options: any): {
|
|
|
455
492
|
lock(): void;
|
|
456
493
|
/**
|
|
457
494
|
* Store the provided record data into the current resource. This is not written
|
|
458
|
-
* until the corresponding transaction is committed.
|
|
459
|
-
* succeed. That doesn't necessarily mean it will "win", another concurrent put could come "after" (monotonically,
|
|
460
|
-
* even if not chronologically) this one.
|
|
495
|
+
* until the corresponding transaction is committed.
|
|
461
496
|
* @param record
|
|
462
497
|
* @param options
|
|
463
498
|
*/
|
|
464
|
-
put(target: RequestTarget, record: any): void
|
|
499
|
+
put(target: RequestTarget, record: any): void | Promise<void>;
|
|
500
|
+
create(target: RequestTarget, record: any): void | Promise<void>;
|
|
465
501
|
patch(target: RequestTarget, recordUpdate: any): void | Promise<void>;
|
|
466
502
|
_writeUpdate(id: Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
|
|
467
|
-
delete(target: RequestTarget): Promise<boolean
|
|
503
|
+
delete(target: RequestTarget): Promise<boolean> | boolean;
|
|
468
504
|
_writeDelete(id: Id, options?: any): boolean;
|
|
469
|
-
search(
|
|
505
|
+
search(target: RequestTarget): AsyncIterable<any>;
|
|
470
506
|
subscribe(request: SubscriptionRequest): Promise<{
|
|
471
507
|
listener: (recordId: Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
|
|
472
508
|
subscriptions: [];
|
|
@@ -528,12 +564,12 @@ export declare function makeTable(options: any): {
|
|
|
528
564
|
*/
|
|
529
565
|
publish(target: RequestTarget, message: any, options?: any): void;
|
|
530
566
|
_writePublish(id: Id, message: any, options?: any): void;
|
|
531
|
-
validate(record: any, patch?:
|
|
567
|
+
validate(record: any, patch?: boolean): void;
|
|
532
568
|
getUpdatedTime(): number;
|
|
533
569
|
wasLoadedFromSource(): boolean | void;
|
|
534
|
-
readonly "__#
|
|
535
|
-
readonly "__#
|
|
536
|
-
"__#
|
|
570
|
+
readonly "__#7@#id": Id;
|
|
571
|
+
readonly "__#7@#context": Context;
|
|
572
|
+
"__#7@#isCollection": boolean;
|
|
537
573
|
post(newRecord: any): Promise<any>;
|
|
538
574
|
readonly isCollection: boolean;
|
|
539
575
|
connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
|
|
@@ -569,11 +605,11 @@ export declare function makeTable(options: any): {
|
|
|
569
605
|
coerceId(id: string): number | string;
|
|
570
606
|
dropTable(): Promise<void>;
|
|
571
607
|
/**
|
|
572
|
-
* Record the relocation of an entry (when a record is moved to a different node)
|
|
608
|
+
* Record the relocation of an entry (when a record is moved to a different node), return true if it is now located locally
|
|
573
609
|
* @param existingEntry
|
|
574
610
|
* @param entry
|
|
575
611
|
*/
|
|
576
|
-
_recordRelocate(existingEntry: any, entry: any):
|
|
612
|
+
_recordRelocate(existingEntry: any, entry: any): boolean;
|
|
577
613
|
/**
|
|
578
614
|
* 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.
|
|
579
615
|
*/
|
|
@@ -703,7 +739,7 @@ export declare function makeTable(options: any): {
|
|
|
703
739
|
reliesOnPrototype: boolean;
|
|
704
740
|
};
|
|
705
741
|
isCollection(resource: any): any;
|
|
706
|
-
parseQuery(search: any, query: any):
|
|
742
|
+
parseQuery(search: any, query: any): any;
|
|
707
743
|
parsePath(path: any, context: any, query: any): any;
|
|
708
744
|
};
|
|
709
745
|
export declare function setServerUtilities(utilities: any): void;
|