harperdb 4.5.0-alpha.3 → 4.5.0-beta.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.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +85 -85
  3. package/bin/lite.js +82 -82
  4. package/config/yaml/defaultConfig.yaml +2 -2
  5. package/json/systemSchema.json +3 -0
  6. package/launchServiceScripts/launchInstallNATSServer.js +3 -3
  7. package/launchServiceScripts/launchNatsIngestService.js +82 -82
  8. package/launchServiceScripts/launchNatsReplyService.js +81 -81
  9. package/launchServiceScripts/launchUpdateNodes4-0-0.js +81 -81
  10. package/npm-shrinkwrap.json +1027 -887
  11. package/package.json +10 -8
  12. package/resources/RecordEncoder.d.ts +5 -1
  13. package/resources/Resource.d.ts +1 -0
  14. package/resources/Resources.d.ts +11 -3
  15. package/resources/Table.d.ts +4 -3
  16. package/resources/blob.d.ts +3 -2
  17. package/resources/databases.d.ts +4 -3
  18. package/server/Server.d.ts +1 -0
  19. package/server/jobs/jobProcess.js +82 -82
  20. package/server/serverHelpers/JSONStream.d.ts +14 -0
  21. package/server/serverHelpers/contentTypes.d.ts +56 -0
  22. package/server/storageReclamation.d.ts +18 -0
  23. package/server/threads/threadServer.js +82 -82
  24. package/studio/build-local/asset-manifest.json +42 -41
  25. package/studio/build-local/index.html +1 -1
  26. package/studio/build-local/running.html +86 -88
  27. package/studio/build-local/static/css/main.34b26890.css +13 -0
  28. package/studio/build-local/static/js/164.6e0cda73.chunk.js +1 -0
  29. package/studio/build-local/static/js/279.7dfac9c5.chunk.js +1 -0
  30. package/studio/build-local/static/js/545.046f5738.chunk.js +1 -0
  31. package/studio/build-local/static/js/833.22ea9ecd.chunk.js +1 -0
  32. package/studio/build-local/static/js/873.55a21fe5.chunk.js +2 -0
  33. package/studio/build-local/static/js/873.55a21fe5.chunk.js.LICENSE.txt +5 -0
  34. package/studio/build-local/static/js/{browse-csvupload.02fdfbea.chunk.js → browse-csvupload.1345356f.chunk.js} +1 -1
  35. package/studio/build-local/static/js/browse-datatable.8d180288.chunk.js +1 -0
  36. package/studio/build-local/static/js/browse-entitymanager.3f0871ba.chunk.js +1 -0
  37. package/studio/build-local/static/js/{browse-jsonviewer.b690b1bb.chunk.js → browse-jsonviewer.7ef3cb49.chunk.js} +1 -1
  38. package/studio/build-local/static/js/custom-functions.d7869749.chunk.js +1 -0
  39. package/studio/build-local/static/js/instance-cluster.ded77459.chunk.js +1 -0
  40. package/studio/build-local/static/js/instance-config.f3087710.chunk.js +1 -0
  41. package/studio/build-local/static/js/instance-logs.fb150c6f.chunk.js +1 -0
  42. package/studio/build-local/static/js/instance-roles.32b7be24.chunk.js +1 -0
  43. package/studio/build-local/static/js/instance-status.d7ddf38a.chunk.js +1 -0
  44. package/studio/build-local/static/js/instance-users-datatable.68cb8e34.chunk.js +1 -0
  45. package/studio/build-local/static/js/{instance-users-edit.6ea9cc6f.chunk.js → instance-users-edit.8de84af8.chunk.js} +1 -1
  46. package/studio/build-local/static/js/{instance-users.876f6070.chunk.js → instance-users.ff289f79.chunk.js} +1 -1
  47. package/studio/build-local/static/js/instance.127e14b8.chunk.js +1 -0
  48. package/studio/build-local/static/js/instances.1dd2b960.chunk.js +1 -0
  49. package/studio/build-local/static/js/main.95db34b0.js +2 -0
  50. package/studio/build-local/static/js/offline-app.029491be.chunk.js +1 -0
  51. package/studio/build-local/static/js/online-app.80d24598.chunk.js +1 -0
  52. package/studio/build-local/static/js/{organization-billing.21b2d3c9.chunk.js → organization-billing.586a6019.chunk.js} +1 -1
  53. package/studio/build-local/static/js/organization-users.0facdb34.chunk.js +1 -0
  54. package/studio/build-local/static/js/organization.4e2c7ae6.chunk.js +1 -0
  55. package/studio/build-local/static/js/organizations.c8c00251.chunk.js +1 -0
  56. package/studio/build-local/static/js/{profile.c05c7042.chunk.js → profile.a5fbf515.chunk.js} +1 -1
  57. package/studio/build-local/static/js/resetPassword.9ad8cde1.chunk.js +1 -0
  58. package/studio/build-local/static/js/{roles-jsonviewer.bf1011d5.chunk.js → roles-jsonviewer.ad6e2622.chunk.js} +1 -1
  59. package/studio/build-local/static/js/signIn.3d65d81a.chunk.js +1 -0
  60. package/studio/build-local/static/js/signUp.eaa5b3f0.chunk.js +1 -0
  61. package/studio/build-local/static/js/{structure-reloader.f65842a1.chunk.js → structure-reloader.8c8f5e18.chunk.js} +1 -1
  62. package/studio/build-local/static/js/topnav.73def1f2.chunk.js +1 -0
  63. package/studio/build-local/static/js/updatePassword.e0a672ee.chunk.js +1 -0
  64. package/studio/build-local/static/media/PPRadioGrotesk-Bold.31436818ea74a78b55af.woff +0 -0
  65. package/studio/build-local/static/media/checkmark.3d7d209874703a9cd0cc.svg +3 -0
  66. package/studio/build-local/static/media/logo_harper_db_studio.81490e70fa4af6879c2e.png +0 -0
  67. package/utility/hdbTerms.d.ts +794 -0
  68. package/utility/scripts/restartHdb.js +82 -82
  69. package/studio/build-local/static/css/main.fee3019a.css +0 -13
  70. package/studio/build-local/static/js/279.7890bce3.chunk.js +0 -1
  71. package/studio/build-local/static/js/311.9e648b13.chunk.js +0 -2
  72. package/studio/build-local/static/js/311.9e648b13.chunk.js.LICENSE.txt +0 -38
  73. package/studio/build-local/static/js/452.d771b05a.chunk.js +0 -2
  74. package/studio/build-local/static/js/452.d771b05a.chunk.js.LICENSE.txt +0 -13
  75. package/studio/build-local/static/js/545.be2e36f9.chunk.js +0 -1
  76. package/studio/build-local/static/js/806.afb99f70.chunk.js +0 -1
  77. package/studio/build-local/static/js/833.5b133801.chunk.js +0 -1
  78. package/studio/build-local/static/js/browse-datatable.0e20a171.chunk.js +0 -1
  79. package/studio/build-local/static/js/browse-entitymanager.0db076c3.chunk.js +0 -1
  80. package/studio/build-local/static/js/custom-functions.04b93135.chunk.js +0 -1
  81. package/studio/build-local/static/js/instance-charts.217c477d.chunk.js +0 -1
  82. package/studio/build-local/static/js/instance-cluster.0ba07710.chunk.js +0 -1
  83. package/studio/build-local/static/js/instance-config.2274de0a.chunk.js +0 -1
  84. package/studio/build-local/static/js/instance-query.fdc5f922.chunk.js +0 -1
  85. package/studio/build-local/static/js/instance-roles.38ef8e77.chunk.js +0 -1
  86. package/studio/build-local/static/js/instance-status.d09551b0.chunk.js +0 -1
  87. package/studio/build-local/static/js/instance-users-datatable.9b5617bc.chunk.js +0 -1
  88. package/studio/build-local/static/js/instance.ad30f892.chunk.js +0 -1
  89. package/studio/build-local/static/js/instances.f4fec0cb.chunk.js +0 -1
  90. package/studio/build-local/static/js/main.c0a12520.js +0 -2
  91. package/studio/build-local/static/js/offline-app.31ad36fc.chunk.js +0 -1
  92. package/studio/build-local/static/js/online-app.91033fd0.chunk.js +0 -1
  93. package/studio/build-local/static/js/organization-users.6f50ca02.chunk.js +0 -1
  94. package/studio/build-local/static/js/organization.89b902c4.chunk.js +0 -1
  95. package/studio/build-local/static/js/organizations.4933fdbc.chunk.js +0 -1
  96. package/studio/build-local/static/js/resetPassword.3478535b.chunk.js +0 -1
  97. package/studio/build-local/static/js/signIn.996cf7ee.chunk.js +0 -1
  98. package/studio/build-local/static/js/signUp.c8fce52d.chunk.js +0 -1
  99. package/studio/build-local/static/js/topnav.0fa4de77.chunk.js +0 -1
  100. package/studio/build-local/static/js/updatePassword.bc881b36.chunk.js +0 -1
  101. /package/studio/build-local/static/js/{main.c0a12520.js.LICENSE.txt → main.95db34b0.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.5.0-alpha.3",
3
+ "version": "4.5.0-beta.2",
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",
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "license": "SEE LICENSE IN LICENSE",
45
45
  "dependencies": {
46
- "@aws-sdk/client-s3": "3.717.0",
47
- "@aws-sdk/lib-storage": "3.717.0",
46
+ "@aws-sdk/client-s3": "3.750.0",
47
+ "@aws-sdk/lib-storage": "3.750.0",
48
48
  "@endo/static-module-record": "^1.0.4",
49
49
  "@fastify/autoload": "5.10.0",
50
50
  "@fastify/compress": "~6.5.0",
@@ -65,7 +65,8 @@
65
65
  "chalk": "4.1.2",
66
66
  "cli-progress": "3.12.0",
67
67
  "clone": "2.1.2",
68
- "fast-glob": "3.3.2",
68
+ "dotenv": "^16.4.7",
69
+ "fast-glob": "3.3.3",
69
70
  "fastify": "~4.29.0",
70
71
  "fastify-plugin": "~4.5.1",
71
72
  "fs-extra": "11.2.0",
@@ -84,13 +85,13 @@
84
85
  "mathjs": "11.12.0",
85
86
  "minimist": "1.2.8",
86
87
  "moment": "2.30.1",
87
- "mqtt-packet": "~9.0.0",
88
+ "mqtt-packet": "~9.0.1",
88
89
  "msgpackr": "1.11.2",
89
90
  "nats": "2.19.0",
90
91
  "needle": "3.3.1",
91
92
  "node-forge": "^1.3.1",
92
93
  "node-stream-zip": "1.15.0",
93
- "node-unix-socket": "0.2.5",
94
+ "node-unix-socket": "0.2.7",
94
95
  "normalize-path": "^3.0.0",
95
96
  "ora": "5.4.1",
96
97
  "ordered-binary": "1.5.3",
@@ -114,7 +115,7 @@
114
115
  "ulidx": "0.5.0",
115
116
  "uuid": "10.0.0",
116
117
  "validate.js": "0.13.1",
117
- "ws": "8.18.0",
118
+ "ws": "8.18.1",
118
119
  "yaml": "2.7.0"
119
120
  },
120
121
  "overrides": {
@@ -123,7 +124,8 @@
123
124
  }
124
125
  },
125
126
  "optionalDependencies": {
126
- "bufferutil": "^4.0.7",
127
+ "bufferutil": "^4.0.9",
128
+ "hdd-space": "^1.2.0",
127
129
  "segfault-handler": "^1.3.0",
128
130
  "utf-8-validate": "^5.0.10"
129
131
  },
@@ -9,6 +9,7 @@ import './blob';
9
9
  export declare const TIMESTAMP_PLACEHOLDER: Uint8Array<ArrayBuffer>;
10
10
  export declare const LAST_TIMESTAMP_PLACEHOLDER: Uint8Array<ArrayBuffer>;
11
11
  export declare const PREVIOUS_TIMESTAMP_PLACEHOLDER: Uint8Array<ArrayBuffer>;
12
+ export declare const NEW_TIMESTAMP_PLACEHOLDER: Uint8Array<ArrayBuffer>;
12
13
  export declare const LOCAL_TIMESTAMP: unique symbol;
13
14
  export declare const METADATA: unique symbol;
14
15
  export declare const NO_TIMESTAMP = 0;
@@ -25,5 +26,8 @@ export declare class RecordEncoder extends Encoder {
25
26
  decode(buffer: any, options: any): any;
26
27
  }
27
28
  export declare function handleLocalTimeForGets(store: any, root_store: any): any;
28
- export declare function recordUpdater(store: any, table_id: any, audit_store: any): (id: any, record: any, existing_entry: any, new_version: any, assign_metadata?: number, audit?: boolean, options?: any, type?: string, resolve_record?: boolean, audit_record?: any) => any;
29
+ export declare function recordUpdater(store: any, table_id: any, audit_store: any): (id: any, record: any, existing_entry: any, new_version: any, assign_metadata?: number, // when positive, this has a set of metadata flags for the record
30
+ audit?: boolean, // true -> audit this record. false -> do not. null -> retain any audit timestamp
31
+ options?: any, type?: string, resolve_record?: boolean, // indicates that we are resolving (from source) record that was previously invalidated
32
+ audit_record?: any) => Promise<void>;
29
33
  export declare function removeEntry(store: any, entry: any, existing_version?: number): any;
@@ -17,6 +17,7 @@ export declare class Resource implements ResourceInterface {
17
17
  static transactions: Transaction[] & {
18
18
  timestamp: number;
19
19
  };
20
+ static directURLMapping: boolean;
20
21
  constructor(identifier: Id, source: any);
21
22
  /**
22
23
  * The get methods are for directly getting a resource, and called for HTTP GET requests.
@@ -1,8 +1,15 @@
1
1
  import { Resource } from './Resource';
2
+ interface ResourceEntry {
3
+ Resource: typeof Resource;
4
+ path: string;
5
+ exportTypes: any;
6
+ hasSubPaths: boolean;
7
+ relativeURL: string;
8
+ }
2
9
  /**
3
10
  * This is the global set of all resources that have been registered on this server.
4
11
  */
5
- export declare class Resources extends Map<string, typeof Resource> {
12
+ export declare class Resources extends Map<string, ResourceEntry> {
6
13
  isWorker: boolean;
7
14
  loginPath?: (request: any) => string;
8
15
  set(path: any, resource: any, export_types?: string[], force?: boolean): void;
@@ -15,11 +22,12 @@ export declare class Resources extends Map<string, typeof Resource> {
15
22
  * that can further transform data from the main structured object resources).
16
23
  * @return The matched Resource class. Note that the remaining path is "returned" by setting the relativeURL property
17
24
  */
18
- getMatch(url: string, export_type?: string): any;
19
- getResource(path: string, resource_info: any): any;
25
+ getMatch(url: string, export_type?: string): ResourceEntry | undefined;
26
+ getResource(path: string, resource_info: any): Resource | Promise<Resource>;
20
27
  call(path: string, request: any, callback: Function): Promise<any>;
21
28
  setRepresentation(path: any, type: any, representation: any): void;
22
29
  }
23
30
  export declare let resources: Resources;
24
31
  export declare function resetResources(): Resources;
25
32
  export declare function keyArrayToString(key: any): any;
33
+ export {};
@@ -567,7 +567,7 @@ export declare function makeTable(options: any): {
567
567
  /**
568
568
  * 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.
569
569
  */
570
- evict(id: any, existing_record: any, existing_version: any): any;
570
+ evict(id: any, existing_record: any, existing_version: any): Promise<void>;
571
571
  operation(operation: any, context: any): any;
572
572
  /**
573
573
  * This is responsible for ordering and select()ing the attributes/properties from returned entries
@@ -608,13 +608,13 @@ export declare function makeTable(options: any): {
608
608
  free: number;
609
609
  size: number;
610
610
  };
611
- getRecordCount(options: any): {
611
+ getRecordCount(options?: any): Promise<{
612
612
  recordCount: number;
613
613
  estimatedRange: number[];
614
614
  } | {
615
615
  recordCount: number;
616
616
  estimatedRange?: undefined;
617
- };
617
+ }>;
618
618
  /**
619
619
  * When attributes have been changed, we update the accessors that are assigned to this table
620
620
  */
@@ -635,6 +635,7 @@ export declare function makeTable(options: any): {
635
635
  transactions: import("./DatabaseTransaction").Transaction[] & {
636
636
  timestamp: number;
637
637
  };
638
+ directURLMapping: boolean;
638
639
  get(identifier: Id, context?: Context): Promise<Resource>;
639
640
  get(query: Query, context?: Context): Promise<AsyncIterable<object>>;
640
641
  put: {
@@ -55,7 +55,7 @@ declare class FileBackedBlob extends InstanceOfBlobWithNoConstructor {
55
55
  finished: Promise<void>;
56
56
  constructor(options?: BlobCreationOptions);
57
57
  on(type: string, callback: (error: Error) => void): void;
58
- toJSON(): {
58
+ toJSON(): string | {
59
59
  description: string;
60
60
  };
61
61
  text(): Promise<string>;
@@ -100,7 +100,7 @@ export declare function encodeBlobsAsBuffers<T>(callback: () => T): Promise<T>;
100
100
  * Decode blobs, creating local storage to hold the blogs and returning a promise that resolves when all the blobs are written to disk
101
101
  * @param callback
102
102
  */
103
- export declare function decodeBlobsWithWrites(callback: () => void, blobCallback?: (blob: Blob) => void): void | Promise<void> | Promise<void[]>;
103
+ export declare function decodeBlobsWithWrites(callback: () => void, blobCallback?: (blob: Blob) => void): Promise<void> | Promise<void[]>;
104
104
  /**
105
105
  * Decode with a callback for when blobs are encountered, allowing for detecting of blobs
106
106
  * @param callback
@@ -116,4 +116,5 @@ export declare function decodeFromDatabase(callback: () => void, rootStore: LMDB
116
116
  * @param object
117
117
  */
118
118
  export declare function deleteBlobsInObject(object: any): void;
119
+ export declare function findBlobsInObject(object: any, callback: (blob: Blob) => void): void;
119
120
  export {};
@@ -454,7 +454,7 @@ export declare function table(table_definition: TableDefinition): {
454
454
  coerceId(id: string): number | string;
455
455
  dropTable(): Promise<void>;
456
456
  _recordRelocate(existing_entry: any, entry: any): void;
457
- evict(id: any, existing_record: any, existing_version: any): any;
457
+ evict(id: any, existing_record: any, existing_version: any): Promise<void>;
458
458
  operation(operation: any, context: any): any;
459
459
  transformToOrderedSelect(entries: any[], select: (string | import("./ResourceInterface").SubSelect)[], sort: import("./ResourceInterface").Sort, context: import("./ResourceInterface").Context, read_txn: any, transformToRecord: Function): any;
460
460
  transformEntryForSelect(select: any, context: any, read_txn: any, filtered: any, ensure_loaded?: any, can_skip?: any): (entry: any) => any;
@@ -468,13 +468,13 @@ export declare function table(table_definition: TableDefinition): {
468
468
  free: number;
469
469
  size: number;
470
470
  };
471
- getRecordCount(options: any): {
471
+ getRecordCount(options?: any): Promise<{
472
472
  recordCount: number;
473
473
  estimatedRange: number[];
474
474
  } | {
475
475
  recordCount: number;
476
476
  estimatedRange?: undefined;
477
- };
477
+ }>;
478
478
  updatedAttributes(): void;
479
479
  setComputedAttribute(attribute_name: any, resolver: any): void;
480
480
  deleteHistory(end_time?: number, cleanup_deleted_records?: boolean): Promise<void>;
@@ -492,6 +492,7 @@ export declare function table(table_definition: TableDefinition): {
492
492
  transactions: import("./DatabaseTransaction").Transaction[] & {
493
493
  timestamp: number;
494
494
  };
495
+ directURLMapping: boolean;
495
496
  get(identifier: import("./ResourceInterface").Id, context?: import("./ResourceInterface").Context): Promise<import("./Resource").Resource>;
496
497
  get(query: import("./ResourceInterface").Query, context?: import("./ResourceInterface").Context): Promise<AsyncIterable<object>>;
497
498
  put: {
@@ -11,6 +11,7 @@ interface Server {
11
11
  ws?(listener: (ws: WebSocket, request: Request, requestCompletion: Promise<any>) => any, options?: WebSocketOptions): void;
12
12
  contentTypes: Map<string, ContentTypeHandler>;
13
13
  getUser(username: string, password: string | null, request: Request): any;
14
+ authenticateUser(username: string, password: string, request: Request): any;
14
15
  operation(operation: any, context: any, authorize?: boolean): Promise<any>;
15
16
  recordAnalytics(value: Value, metric: string, path?: string, method?: string, type?: string): void;
16
17
  }