harperdb 4.6.0-alpha.1 → 4.6.0-alpha.3

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 (102) hide show
  1. package/README.md +1 -1
  2. package/application-template/README.md +26 -8
  3. package/application-template/config.yaml +18 -15
  4. package/application-template/web/index.html +29 -0
  5. package/application-template/web/index.js +18 -0
  6. package/application-template/web/styles.css +57 -0
  7. package/bin/harperdb.js +76 -76
  8. package/bin/lite.js +75 -75
  9. package/launchServiceScripts/launchInstallNATSServer.js +3 -3
  10. package/launchServiceScripts/launchNatsIngestService.js +75 -75
  11. package/launchServiceScripts/launchNatsReplyService.js +76 -76
  12. package/launchServiceScripts/launchUpdateNodes4-0-0.js +75 -75
  13. package/npm-shrinkwrap.json +283 -298
  14. package/package.json +2 -7
  15. package/resources/RecordEncoder.d.ts +15 -0
  16. package/resources/RequestTarget.d.ts +30 -0
  17. package/resources/Resource.d.ts +23 -14
  18. package/resources/ResourceInterface.d.ts +22 -29
  19. package/resources/Resources.d.ts +3 -1
  20. package/resources/Table.d.ts +99 -86
  21. package/resources/analytics/hostnames.d.ts +96 -133
  22. package/resources/analytics/read.d.ts +3 -1
  23. package/resources/databases.d.ts +96 -133
  24. package/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +87 -0
  25. package/resources/indexes/customIndexes.d.ts +4 -0
  26. package/resources/indexes/vector.d.ts +2 -0
  27. package/resources/search.d.ts +4 -10
  28. package/resources/tracked.d.ts +1 -1
  29. package/resources/transactionBroadcast.d.ts +5 -1
  30. package/server/Server.d.ts +3 -1
  31. package/server/jobs/jobProcess.js +75 -75
  32. package/server/status.d.ts +437 -1
  33. package/server/threads/threadServer.js +76 -76
  34. package/studio/build-local/asset-manifest.json +34 -34
  35. package/studio/build-local/index.html +1 -1
  36. package/studio/build-local/static/js/164.a89f3fc2.chunk.js +1 -0
  37. package/studio/build-local/static/js/{101.de926db6.chunk.js → 504.6e6ee908.chunk.js} +2 -2
  38. package/studio/build-local/static/js/833.e460eaf4.chunk.js +1 -0
  39. package/studio/build-local/static/js/browse-csvupload.84fd1ae9.chunk.js +1 -0
  40. package/studio/build-local/static/js/browse-datatable.3d9e9ccf.chunk.js +1 -0
  41. package/studio/build-local/static/js/browse-entitymanager.4547c0d8.chunk.js +1 -0
  42. package/studio/build-local/static/js/browse-jsonviewer.71355c20.chunk.js +1 -0
  43. package/studio/build-local/static/js/custom-functions.31d65bca.chunk.js +1 -0
  44. package/studio/build-local/static/js/instance-cluster.031dcced.chunk.js +1 -0
  45. package/studio/build-local/static/js/instance-config.9a23d6ae.chunk.js +1 -0
  46. package/studio/build-local/static/js/instance-logs.fdaf96ec.chunk.js +1 -0
  47. package/studio/build-local/static/js/instance-roles.984ced56.chunk.js +1 -0
  48. package/studio/build-local/static/js/{instance-status.2f3aaaf7.chunk.js → instance-status.192a5e2f.chunk.js} +1 -1
  49. package/studio/build-local/static/js/instance-users-datatable.40846e47.chunk.js +1 -0
  50. package/studio/build-local/static/js/instance-users-edit.f10344c8.chunk.js +1 -0
  51. package/studio/build-local/static/js/instance-users.adc43a74.chunk.js +1 -0
  52. package/studio/build-local/static/js/instance.9de0a105.chunk.js +1 -0
  53. package/studio/build-local/static/js/instances.299d83e9.chunk.js +1 -0
  54. package/studio/build-local/static/js/{main.24eae3d8.js → main.5a7cabb6.js} +2 -2
  55. package/studio/build-local/static/js/offline-app.5bc1159b.chunk.js +1 -0
  56. package/studio/build-local/static/js/online-app.22102869.chunk.js +1 -0
  57. package/studio/build-local/static/js/organization-billing.56e7e051.chunk.js +1 -0
  58. package/studio/build-local/static/js/organization-users.b46b9e8f.chunk.js +1 -0
  59. package/studio/build-local/static/js/organization.eab64d57.chunk.js +1 -0
  60. package/studio/build-local/static/js/organizations.4567ae59.chunk.js +1 -0
  61. package/studio/build-local/static/js/profile.d45cd6b3.chunk.js +1 -0
  62. package/studio/build-local/static/js/resetPassword.812fc880.chunk.js +1 -0
  63. package/studio/build-local/static/js/roles-jsonviewer.73c8bb9d.chunk.js +1 -0
  64. package/studio/build-local/static/js/signIn.32766fa9.chunk.js +1 -0
  65. package/studio/build-local/static/js/signUp.07fd6662.chunk.js +1 -0
  66. package/studio/build-local/static/js/structure-reloader.ce2b39d2.chunk.js +1 -0
  67. package/studio/build-local/static/js/topnav.e661156c.chunk.js +1 -0
  68. package/studio/build-local/static/js/updatePassword.dcac970c.chunk.js +1 -0
  69. package/utility/scripts/restartHdb.js +75 -75
  70. package/validation/statusValidator.d.ts +22 -0
  71. package/studio/build-local/static/js/164.13a1ca36.chunk.js +0 -1
  72. package/studio/build-local/static/js/833.475ee615.chunk.js +0 -1
  73. package/studio/build-local/static/js/browse-csvupload.cfcf1c79.chunk.js +0 -1
  74. package/studio/build-local/static/js/browse-datatable.85de5169.chunk.js +0 -1
  75. package/studio/build-local/static/js/browse-entitymanager.dddb5da8.chunk.js +0 -1
  76. package/studio/build-local/static/js/browse-jsonviewer.059b4189.chunk.js +0 -1
  77. package/studio/build-local/static/js/custom-functions.2c2e634c.chunk.js +0 -1
  78. package/studio/build-local/static/js/instance-cluster.daef89d8.chunk.js +0 -1
  79. package/studio/build-local/static/js/instance-config.ba645bea.chunk.js +0 -1
  80. package/studio/build-local/static/js/instance-logs.33ace406.chunk.js +0 -1
  81. package/studio/build-local/static/js/instance-roles.0276d83f.chunk.js +0 -1
  82. package/studio/build-local/static/js/instance-users-datatable.f75cf637.chunk.js +0 -1
  83. package/studio/build-local/static/js/instance-users-edit.3a3bc76f.chunk.js +0 -1
  84. package/studio/build-local/static/js/instance-users.70ee5db2.chunk.js +0 -1
  85. package/studio/build-local/static/js/instance.0bbb9d0e.chunk.js +0 -1
  86. package/studio/build-local/static/js/instances.e86d288b.chunk.js +0 -1
  87. package/studio/build-local/static/js/offline-app.edb4be85.chunk.js +0 -1
  88. package/studio/build-local/static/js/online-app.45440c0e.chunk.js +0 -1
  89. package/studio/build-local/static/js/organization-billing.3ff0b995.chunk.js +0 -1
  90. package/studio/build-local/static/js/organization-users.710f96e7.chunk.js +0 -1
  91. package/studio/build-local/static/js/organization.1aa3da8e.chunk.js +0 -1
  92. package/studio/build-local/static/js/organizations.259e09d3.chunk.js +0 -1
  93. package/studio/build-local/static/js/profile.c1840496.chunk.js +0 -1
  94. package/studio/build-local/static/js/resetPassword.37769fbe.chunk.js +0 -1
  95. package/studio/build-local/static/js/roles-jsonviewer.b8cc0628.chunk.js +0 -1
  96. package/studio/build-local/static/js/signIn.061b438e.chunk.js +0 -1
  97. package/studio/build-local/static/js/signUp.cabe1d80.chunk.js +0 -1
  98. package/studio/build-local/static/js/structure-reloader.fd360bad.chunk.js +0 -1
  99. package/studio/build-local/static/js/topnav.1fce7836.chunk.js +0 -1
  100. package/studio/build-local/static/js/updatePassword.dc41627a.chunk.js +0 -1
  101. /package/studio/build-local/static/js/{101.de926db6.chunk.js.LICENSE.txt → 504.6e6ee908.chunk.js.LICENSE.txt} +0 -0
  102. /package/studio/build-local/static/js/{main.24eae3d8.js.LICENSE.txt → main.5a7cabb6.js.LICENSE.txt} +0 -0
@@ -80,52 +80,42 @@ export declare function table(tableDefinition: TableDefinition): {
80
80
  new (identifier: import("./ResourceInterface.js").Id, source: any): {
81
81
  "__#5@#record": any;
82
82
  "__#5@#changes": any;
83
- "__#5@#version": number;
84
- "__#5@#entry": {
85
- key: any;
86
- value: any;
87
- version: number;
88
- localTime: number;
89
- expiresAt: number;
90
- deref?: () => any;
91
- };
92
- "__#5@#saveMode": boolean;
93
- "__#5@#loadedFromSource": boolean;
83
+ "__#5@#version"?: number;
84
+ "__#5@#entry"?: import("./RecordEncoder.ts").Entry;
85
+ "__#5@#saveMode"?: boolean;
86
+ "__#5@#loadedFromSource"?: boolean;
87
+ getProperty: (name: string) => any;
94
88
  ensureLoaded(): any;
95
- get(query?: import("./ResourceInterface.js").Query | string): Promise<object | void> | object | void;
89
+ get(target?: import("./RequestTarget.js").RequestTarget): Promise<object | void> | object | void;
96
90
  allowRead(user: any, query: any): any;
97
91
  allowUpdate(user: any, updatedData: any): boolean;
98
92
  allowCreate(user: any, newData: {}): boolean;
99
93
  allowDelete(user: any): boolean;
100
- update(updates?: any, fullUpdate?: boolean): /*elided*/ any;
94
+ update(target: import("./RequestTarget.js").RequestTarget, updates?: any): any;
101
95
  addTo(property: any, value: any): void;
102
96
  subtractFrom(property: any, value: any): void;
103
- getMetadata(): {
104
- key: any;
105
- value: any;
106
- version: number;
107
- localTime: number;
108
- expiresAt: number;
109
- deref?: () => any;
110
- };
97
+ getMetadata(): import("./RecordEncoder.ts").Entry;
111
98
  getRecord(): any;
112
99
  getChanges(): any;
113
100
  _setChanges(changes: any): void;
114
101
  setRecord(record: any): void;
115
- invalidate(): void;
116
- _writeInvalidate(partialRecord?: any, options?: any): void;
117
- _writeRelocate(options: any): void;
102
+ invalidate(target: import("./ResourceInterface.js").RequestTargetOrId): void;
103
+ _writeInvalidate(id: import("./ResourceInterface.js").Id, partialRecord?: any, options?: any): void;
104
+ _writeRelocate(id: import("./ResourceInterface.js").Id, options: any): void;
118
105
  lock(): void;
119
- put(record: any): void;
120
- patch(recordUpdate: any): void;
121
- _writeUpdate(recordUpdate: any, fullUpdate: boolean, options?: any): void;
122
- delete(request?: import("./ResourceInterface.js").Query | string): Promise<boolean>;
123
- _writeDelete(options?: any): boolean;
124
- search(request: import("./ResourceInterface.js").Query): AsyncIterable<any>;
106
+ put(target: import("./RequestTarget.js").RequestTarget, record: any): void;
107
+ patch(target: import("./RequestTarget.js").RequestTarget, recordUpdate: any): void | Promise<void>;
108
+ _writeUpdate(id: import("./ResourceInterface.js").Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
109
+ delete(target: import("./RequestTarget.js").RequestTarget): Promise<boolean>;
110
+ _writeDelete(id: import("./ResourceInterface.js").Id, options?: any): boolean;
111
+ search(request: import("./RequestTarget.js").RequestTarget): AsyncIterable<any>;
125
112
  subscribe(request: import("./ResourceInterface.js").SubscriptionRequest): Promise<{
126
- listener: (key: any) => any;
113
+ listener: (recordId: import("./ResourceInterface.js").Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
127
114
  subscriptions: [];
128
115
  startTime?: number;
116
+ includeDescendants?: boolean;
117
+ supportsTransactions?: boolean;
118
+ onlyChildren?: boolean;
129
119
  end(): void;
130
120
  toJSON(): {
131
121
  name: string;
@@ -171,8 +161,8 @@ export declare function table(tableDefinition: TableDefinition): {
171
161
  eventNames(): (string | symbol)[];
172
162
  }>;
173
163
  doesExist(): boolean;
174
- publish(message: any, options?: any): void;
175
- _writePublish(message: any, options?: any): void;
164
+ publish(target: import("./RequestTarget.js").RequestTarget, message: any, options?: any): void;
165
+ _writePublish(id: import("./ResourceInterface.js").Id, message: any, options?: any): void;
176
166
  validate(record: any, patch?: any): void;
177
167
  getUpdatedTime(): number;
178
168
  wasLoadedFromSource(): boolean | void;
@@ -181,7 +171,7 @@ export declare function table(tableDefinition: TableDefinition): {
181
171
  "__#6@#isCollection": boolean;
182
172
  post(newRecord: any): Promise<any>;
183
173
  readonly isCollection: boolean;
184
- connect(query?: {}): AsyncIterable<any>;
174
+ connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
185
175
  getId(): import("./ResourceInterface.js").Id;
186
176
  getContext(): import("./ResourceInterface.js").Context;
187
177
  };
@@ -199,25 +189,13 @@ export declare function table(tableDefinition: TableDefinition): {
199
189
  replicate: any;
200
190
  sealed: any;
201
191
  splitSegments: any;
202
- createdTimeProperty: {
203
- name: string;
204
- type: string;
205
- assignCreatedTime?: boolean;
206
- assignUpdatedTime?: boolean;
207
- expiresAt?: boolean;
208
- isPrimaryKey?: boolean;
209
- };
210
- updatedTimeProperty: {
211
- name: string;
212
- type: string;
213
- assignCreatedTime?: boolean;
214
- assignUpdatedTime?: boolean;
215
- expiresAt?: boolean;
216
- isPrimaryKey?: boolean;
217
- };
192
+ createdTimeProperty: import("./Table.ts").Attribute;
193
+ updatedTimeProperty: import("./Table.ts").Attribute;
218
194
  propertyResolvers: any;
219
195
  userResolvers: {};
220
- sources: any[];
196
+ sources: (/*elided*/ any)[];
197
+ sourceOptions: any;
198
+ intermediateSource: boolean;
221
199
  getResidencyById: (id: import("./ResourceInterface.js").Id) => number | void;
222
200
  readonly expirationMS: any;
223
201
  dbisDB: any;
@@ -228,52 +206,42 @@ export declare function table(tableDefinition: TableDefinition): {
228
206
  getResource(id: import("./ResourceInterface.js").Id, request: import("./ResourceInterface.js").Context, resourceOptions?: any): Promise<{
229
207
  "__#5@#record": any;
230
208
  "__#5@#changes": any;
231
- "__#5@#version": number;
232
- "__#5@#entry": {
233
- key: any;
234
- value: any;
235
- version: number;
236
- localTime: number;
237
- expiresAt: number;
238
- deref?: () => any;
239
- };
240
- "__#5@#saveMode": boolean;
241
- "__#5@#loadedFromSource": boolean;
209
+ "__#5@#version"?: number;
210
+ "__#5@#entry"?: import("./RecordEncoder.ts").Entry;
211
+ "__#5@#saveMode"?: boolean;
212
+ "__#5@#loadedFromSource"?: boolean;
213
+ getProperty: (name: string) => any;
242
214
  ensureLoaded(): any;
243
- get(query?: import("./ResourceInterface.js").Query | string): Promise<object | void> | object | void;
215
+ get(target?: import("./RequestTarget.js").RequestTarget): Promise<object | void> | object | void;
244
216
  allowRead(user: any, query: any): any;
245
217
  allowUpdate(user: any, updatedData: any): boolean;
246
218
  allowCreate(user: any, newData: {}): boolean;
247
219
  allowDelete(user: any): boolean;
248
- update(updates?: any, fullUpdate?: boolean): /*elided*/ any;
220
+ update(target: import("./RequestTarget.js").RequestTarget, updates?: any): any;
249
221
  addTo(property: any, value: any): void;
250
222
  subtractFrom(property: any, value: any): void;
251
- getMetadata(): {
252
- key: any;
253
- value: any;
254
- version: number;
255
- localTime: number;
256
- expiresAt: number;
257
- deref?: () => any;
258
- };
223
+ getMetadata(): import("./RecordEncoder.ts").Entry;
259
224
  getRecord(): any;
260
225
  getChanges(): any;
261
226
  _setChanges(changes: any): void;
262
227
  setRecord(record: any): void;
263
- invalidate(): void;
264
- _writeInvalidate(partialRecord?: any, options?: any): void;
265
- _writeRelocate(options: any): void;
228
+ invalidate(target: import("./ResourceInterface.js").RequestTargetOrId): void;
229
+ _writeInvalidate(id: import("./ResourceInterface.js").Id, partialRecord?: any, options?: any): void;
230
+ _writeRelocate(id: import("./ResourceInterface.js").Id, options: any): void;
266
231
  lock(): void;
267
- put(record: any): void;
268
- patch(recordUpdate: any): void;
269
- _writeUpdate(recordUpdate: any, fullUpdate: boolean, options?: any): void;
270
- delete(request?: import("./ResourceInterface.js").Query | string): Promise<boolean>;
271
- _writeDelete(options?: any): boolean;
272
- search(request: import("./ResourceInterface.js").Query): AsyncIterable<any>;
232
+ put(target: import("./RequestTarget.js").RequestTarget, record: any): void;
233
+ patch(target: import("./RequestTarget.js").RequestTarget, recordUpdate: any): void | Promise<void>;
234
+ _writeUpdate(id: import("./ResourceInterface.js").Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
235
+ delete(target: import("./RequestTarget.js").RequestTarget): Promise<boolean>;
236
+ _writeDelete(id: import("./ResourceInterface.js").Id, options?: any): boolean;
237
+ search(request: import("./RequestTarget.js").RequestTarget): AsyncIterable<any>;
273
238
  subscribe(request: import("./ResourceInterface.js").SubscriptionRequest): Promise<{
274
- listener: (key: any) => any;
239
+ listener: (recordId: import("./ResourceInterface.js").Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
275
240
  subscriptions: [];
276
241
  startTime?: number;
242
+ includeDescendants?: boolean;
243
+ supportsTransactions?: boolean;
244
+ onlyChildren?: boolean;
277
245
  end(): void;
278
246
  toJSON(): {
279
247
  name: string;
@@ -319,8 +287,8 @@ export declare function table(tableDefinition: TableDefinition): {
319
287
  eventNames(): (string | symbol)[];
320
288
  }>;
321
289
  doesExist(): boolean;
322
- publish(message: any, options?: any): void;
323
- _writePublish(message: any, options?: any): void;
290
+ publish(target: import("./RequestTarget.js").RequestTarget, message: any, options?: any): void;
291
+ _writePublish(id: import("./ResourceInterface.js").Id, message: any, options?: any): void;
324
292
  validate(record: any, patch?: any): void;
325
293
  getUpdatedTime(): number;
326
294
  wasLoadedFromSource(): boolean | void;
@@ -329,58 +297,48 @@ export declare function table(tableDefinition: TableDefinition): {
329
297
  "__#6@#isCollection": boolean;
330
298
  post(newRecord: any): Promise<any>;
331
299
  readonly isCollection: boolean;
332
- connect(query?: {}): AsyncIterable<any>;
300
+ connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
333
301
  getId(): import("./ResourceInterface.js").Id;
334
302
  getContext(): import("./ResourceInterface.js").Context;
335
303
  }> | {
336
304
  "__#5@#record": any;
337
305
  "__#5@#changes": any;
338
- "__#5@#version": number;
339
- "__#5@#entry": {
340
- key: any;
341
- value: any;
342
- version: number;
343
- localTime: number;
344
- expiresAt: number;
345
- deref?: () => any;
346
- };
347
- "__#5@#saveMode": boolean;
348
- "__#5@#loadedFromSource": boolean;
306
+ "__#5@#version"?: number;
307
+ "__#5@#entry"?: import("./RecordEncoder.ts").Entry;
308
+ "__#5@#saveMode"?: boolean;
309
+ "__#5@#loadedFromSource"?: boolean;
310
+ getProperty: (name: string) => any;
349
311
  ensureLoaded(): any;
350
- get(query?: import("./ResourceInterface.js").Query | string): Promise<object | void> | object | void;
312
+ get(target?: import("./RequestTarget.js").RequestTarget): Promise<object | void> | object | void;
351
313
  allowRead(user: any, query: any): any;
352
314
  allowUpdate(user: any, updatedData: any): boolean;
353
315
  allowCreate(user: any, newData: {}): boolean;
354
316
  allowDelete(user: any): boolean;
355
- update(updates?: any, fullUpdate?: boolean): /*elided*/ any;
317
+ update(target: import("./RequestTarget.js").RequestTarget, updates?: any): any;
356
318
  addTo(property: any, value: any): void;
357
319
  subtractFrom(property: any, value: any): void;
358
- getMetadata(): {
359
- key: any;
360
- value: any;
361
- version: number;
362
- localTime: number;
363
- expiresAt: number;
364
- deref?: () => any;
365
- };
320
+ getMetadata(): import("./RecordEncoder.ts").Entry;
366
321
  getRecord(): any;
367
322
  getChanges(): any;
368
323
  _setChanges(changes: any): void;
369
324
  setRecord(record: any): void;
370
- invalidate(): void;
371
- _writeInvalidate(partialRecord?: any, options?: any): void;
372
- _writeRelocate(options: any): void;
325
+ invalidate(target: import("./ResourceInterface.js").RequestTargetOrId): void;
326
+ _writeInvalidate(id: import("./ResourceInterface.js").Id, partialRecord?: any, options?: any): void;
327
+ _writeRelocate(id: import("./ResourceInterface.js").Id, options: any): void;
373
328
  lock(): void;
374
- put(record: any): void;
375
- patch(recordUpdate: any): void;
376
- _writeUpdate(recordUpdate: any, fullUpdate: boolean, options?: any): void;
377
- delete(request?: import("./ResourceInterface.js").Query | string): Promise<boolean>;
378
- _writeDelete(options?: any): boolean;
379
- search(request: import("./ResourceInterface.js").Query): AsyncIterable<any>;
329
+ put(target: import("./RequestTarget.js").RequestTarget, record: any): void;
330
+ patch(target: import("./RequestTarget.js").RequestTarget, recordUpdate: any): void | Promise<void>;
331
+ _writeUpdate(id: import("./ResourceInterface.js").Id, recordUpdate: any, fullUpdate: boolean, options?: any): void;
332
+ delete(target: import("./RequestTarget.js").RequestTarget): Promise<boolean>;
333
+ _writeDelete(id: import("./ResourceInterface.js").Id, options?: any): boolean;
334
+ search(request: import("./RequestTarget.js").RequestTarget): AsyncIterable<any>;
380
335
  subscribe(request: import("./ResourceInterface.js").SubscriptionRequest): Promise<{
381
- listener: (key: any) => any;
336
+ listener: (recordId: import("./ResourceInterface.js").Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
382
337
  subscriptions: [];
383
338
  startTime?: number;
339
+ includeDescendants?: boolean;
340
+ supportsTransactions?: boolean;
341
+ onlyChildren?: boolean;
384
342
  end(): void;
385
343
  toJSON(): {
386
344
  name: string;
@@ -426,8 +384,8 @@ export declare function table(tableDefinition: TableDefinition): {
426
384
  eventNames(): (string | symbol)[];
427
385
  }>;
428
386
  doesExist(): boolean;
429
- publish(message: any, options?: any): void;
430
- _writePublish(message: any, options?: any): void;
387
+ publish(target: import("./RequestTarget.js").RequestTarget, message: any, options?: any): void;
388
+ _writePublish(id: import("./ResourceInterface.js").Id, message: any, options?: any): void;
431
389
  validate(record: any, patch?: any): void;
432
390
  getUpdatedTime(): number;
433
391
  wasLoadedFromSource(): boolean | void;
@@ -436,7 +394,7 @@ export declare function table(tableDefinition: TableDefinition): {
436
394
  "__#6@#isCollection": boolean;
437
395
  post(newRecord: any): Promise<any>;
438
396
  readonly isCollection: boolean;
439
- connect(query?: {}): AsyncIterable<any>;
397
+ connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
440
398
  getId(): import("./ResourceInterface.js").Id;
441
399
  getContext(): import("./ResourceInterface.js").Context;
442
400
  };
@@ -447,7 +405,7 @@ export declare function table(tableDefinition: TableDefinition): {
447
405
  eviction?: number;
448
406
  scanInterval?: number;
449
407
  }): void;
450
- getResidencyRecord(id: any): any;
408
+ getResidencyRecord(id: import("./ResourceInterface.js").Id): any;
451
409
  setResidency(getResidency?: (record: object, context: import("./ResourceInterface.js").Context) => number | void | string[]): void;
452
410
  setResidencyById(getResidencyById?: (id: import("./ResourceInterface.js").Id) => number | void): void;
453
411
  getResidency(record: object, context: import("./ResourceInterface.js").Context): number | void | string[];
@@ -458,7 +416,7 @@ export declare function table(tableDefinition: TableDefinition): {
458
416
  evict(id: any, existingRecord: any, existingVersion: any): Promise<void>;
459
417
  operation(operation: any, context: any): any;
460
418
  transformToOrderedSelect(entries: any[], select: (string | import("./ResourceInterface.js").SubSelect)[], sort: import("./ResourceInterface.js").Sort, context: import("./ResourceInterface.js").Context, readTxn: any, transformToRecord: Function): any;
461
- transformEntryForSelect(select: any, context: any, readTxn: any, filtered: any, ensure_loaded?: any, canSkip?: any): (entry: any) => any;
419
+ transformEntryForSelect(select: any, context: any, readTxn: any, filtered: any, ensure_loaded?: any, canSkip?: any): (entry: import("./RecordEncoder.ts").Entry) => any;
462
420
  subscribeOnThisThread(workerIndex: any, options: any): boolean;
463
421
  addAttributes(attributesToAdd: any): Promise<any>;
464
422
  removeAttributes(names: string[]): Promise<any>;
@@ -494,14 +452,15 @@ export declare function table(tableDefinition: TableDefinition): {
494
452
  timestamp: number;
495
453
  };
496
454
  directURLMapping: boolean;
455
+ loadAsInstance: boolean;
497
456
  get(identifier: import("./ResourceInterface.js").Id, context?: import("./ResourceInterface.js").Context): Promise<import("./Resource.js").Resource>;
498
- get(query: import("./ResourceInterface.js").Query, context?: import("./ResourceInterface.js").Context): Promise<AsyncIterable<object>>;
457
+ get(target: import("./RequestTarget.js").RequestTarget, context?: import("./ResourceInterface.js").Context): Promise<AsyncIterable<object>>;
499
458
  put: {
500
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
459
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
501
460
  reliesOnPrototype: boolean;
502
461
  };
503
462
  patch: {
504
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
463
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
505
464
  reliesOnPrototype: boolean;
506
465
  };
507
466
  delete(identifier: import("./ResourceInterface.js").Id, context?: import("./ResourceInterface.js").Context): Promise<boolean>;
@@ -509,15 +468,19 @@ export declare function table(tableDefinition: TableDefinition): {
509
468
  create(idPrefix: import("./ResourceInterface.js").Id, record: any, context: import("./ResourceInterface.js").Context): Promise<import("./ResourceInterface.js").Id>;
510
469
  create(record: any, context: import("./ResourceInterface.js").Context): Promise<import("./ResourceInterface.js").Id>;
511
470
  invalidate: {
512
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
471
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
513
472
  reliesOnPrototype: boolean;
514
473
  };
515
474
  post: {
516
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
475
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
476
+ reliesOnPrototype: boolean;
477
+ };
478
+ update: {
479
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
517
480
  reliesOnPrototype: boolean;
518
481
  };
519
482
  connect: {
520
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
483
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
521
484
  reliesOnPrototype: boolean;
522
485
  };
523
486
  subscribe(request: import("./ResourceInterface.js").SubscriptionRequest): Promise<AsyncIterable<{
@@ -526,27 +489,27 @@ export declare function table(tableDefinition: TableDefinition): {
526
489
  value: object;
527
490
  }>>;
528
491
  publish: {
529
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
492
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
530
493
  reliesOnPrototype: boolean;
531
494
  };
532
495
  search: {
533
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
496
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
534
497
  reliesOnPrototype: boolean;
535
498
  };
536
499
  query: {
537
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
500
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
538
501
  reliesOnPrototype: boolean;
539
502
  };
540
503
  copy: {
541
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
504
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
542
505
  reliesOnPrototype: boolean;
543
506
  };
544
507
  move: {
545
- (idOrQuery: string | import("./ResourceInterface.js").Id, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
508
+ (idOrQuery: string | import("./ResourceInterface.js").Id | import("./ResourceInterface.js").Query, dataOrContext?: any, context?: import("./ResourceInterface.js").Context): any;
546
509
  reliesOnPrototype: boolean;
547
510
  };
548
511
  isCollection(resource: any): any;
549
- parseQuery(search: any): any;
512
+ parseQuery(search: any, query: any): URLSearchParams | import("./RequestTarget.js").RequestTarget;
550
513
  parsePath(path: any, context: any, query: any): any;
551
514
  };
552
515
  export declare function dropTableMeta({ table: tableName, database: databaseName }: {
@@ -0,0 +1,87 @@
1
+ import type { Id } from '../../resources/ResourceInterface.ts';
2
+ /**
3
+ * Represents a Hierarchical Navigable Small World (HNSW) index for approximate nearest neighbor search.
4
+ * This implementation is based on hierarchical graph navigation to efficiently index and search high-dimensional vectors.
5
+ * A HNSW is basically a multi-dimensional skip list. Each node has (potentially) higher levels that are used for quickly
6
+ * traversing the graph get in the neighborhood of the node, and then lower levels are used to more accurately find the
7
+ * closest neighbors.
8
+ *
9
+ * This implementation is based on the paper "Efficient and Robust Approximate Nearest Neighbor Search in High Dimensions"
10
+ * (mostly influenced AI's contributions)
11
+ */
12
+ export declare class HierarchicalNavigableSmallWorld {
13
+ static useObjectStore: boolean;
14
+ indexStore: any;
15
+ M: number;
16
+ efConstruction: number;
17
+ efConstructionSearch: number;
18
+ mL: number;
19
+ optimizeRouting: number;
20
+ nodesVisitedCount: number;
21
+ idIncrementer: BigInt64Array | undefined;
22
+ distance: (a: number[], b: number[]) => number;
23
+ constructor(indexStore: any, options: any);
24
+ index(primaryKey: Id, vector: number[], existingVector?: number[]): void;
25
+ private getEntryPoint;
26
+ /**
27
+ * Search one layer of the skip-list using HNSW algorithm for creating a candidate list and navigating the graph
28
+ * TODO: This should be async, but we can't really do that with lmdb-js's transaction system right now. Should be
29
+ * doable with RocksDB. We could also create an async version for searching.
30
+ * @param queryVector
31
+ * @param entryPointId
32
+ * @param entryPoint
33
+ * @param ef
34
+ * @param level
35
+ * @param distanceFunction
36
+ * @private
37
+ */
38
+ private searchLayer;
39
+ /**
40
+ * This the main entry from Harper's query functionality, where we actually search for an ordered list of nearest
41
+ * neighbors, using the provided sort/order definition object and performing the multi-layer skip-list search.
42
+ * This returns an iterable of the nearest neighbors to the provided target vector, with nearest ordered first.
43
+ * @param target
44
+ * @param value
45
+ * @param descending
46
+ * @param distance
47
+ * @param comparator
48
+ * @param context
49
+ */
50
+ search({ target, value, descending, distance, comparator, }: {
51
+ target: number[];
52
+ value: number;
53
+ descending: boolean;
54
+ distance: string;
55
+ comparator: string;
56
+ }): {
57
+ key: string;
58
+ distance: number;
59
+ }[];
60
+ private checkSymmetry;
61
+ private addConnection;
62
+ validateConnectivity(startLevel?: number): {
63
+ isFullyConnected: boolean;
64
+ averageConnections: number;
65
+ };
66
+ get totalNodes(): number;
67
+ /**
68
+ * This is used by the query planner to determine what order to apply conditions. It is our best guess at an estimated count.
69
+ * This unit is typically the number of records that need to be accessed to satisfy the query. We know that we will visit
70
+ * a minimum of efConstructionSearch nodes and a maximum of the total nodes (in absolute worst case).
71
+ * The original paper described the complexity as polylogarithmic. From my testing, the
72
+ * best and simplest guess at the number of nodes that need to be accessed is the geometric mean of the total number of nodes
73
+ * and the efConstruction parameter (for search), which clearly constrains the estimate to the correct range and is
74
+ * similar to polylogarithmic for realistic values.
75
+ *
76
+ * @returns
77
+ */
78
+ estimateCount(): number;
79
+ /**
80
+ * This is used to resolve the vector property, which should be resolved to the distance when used in a sort comparator
81
+ * We also want to cache distance calculations so they can be accessed efficently later
82
+ * @param vector
83
+ * @param context
84
+ * @param entry
85
+ */
86
+ propertyResolver(vector: number[], context: any, entry: any): any;
87
+ }
@@ -0,0 +1,4 @@
1
+ import { HierarchicalNavigableSmallWorld } from './HierarchicalNavigableSmallWorld.ts';
2
+ export declare const CUSTOM_INDEXES: {
3
+ HNSW: typeof HierarchicalNavigableSmallWorld;
4
+ };
@@ -0,0 +1,2 @@
1
+ export declare function euclideanDistance(a: number[], b: number[]): number;
2
+ export declare function cosineDistance(a: number[], b: number[]): number;
@@ -1,4 +1,5 @@
1
1
  import type { DirectCondition, Id } from './ResourceInterface.ts';
2
+ import { RequestTarget } from './RequestTarget.ts';
2
3
  export declare const COERCIBLE_OPERATORS: {
3
4
  lt: boolean;
4
5
  le: boolean;
@@ -17,7 +18,7 @@ export declare function executeConditions(conditions: any, operator: any, table:
17
18
  * @param allowFullScan
18
19
  * @param filtered
19
20
  */
20
- export declare function searchByIndex(searchCondition: DirectCondition, transaction: any, reverse: boolean, Table: any, allowFullScan?: boolean, filtered?: boolean): AsyncIterable<Id | {
21
+ export declare function searchByIndex(searchCondition: DirectCondition, transaction: any, reverse: boolean, Table: any, allowFullScan?: boolean, filtered?: boolean, context?: any): AsyncIterable<Id | {
21
22
  key: Id;
22
23
  value: any;
23
24
  }>;
@@ -30,16 +31,9 @@ export declare function findAttribute(attributes: any, attribute_name: any): any
30
31
  export declare function filterByType(searchCondition: any, Table: any, context: any, filtered: any, isPrimaryKey?: any, estimatedIncomingCount?: any): any;
31
32
  export declare function estimateCondition(table: any): (condition: any) => any;
32
33
  /**
33
- * This is responsible for taking a query string (from a get()) and converting it to a standard query object
34
- * structure
34
+ * This is responsible for taking a query string (from a get()) and merging the parsed elements into a RequestTarget object.
35
35
  * @param queryString
36
36
  */
37
- export declare function parseQuery(queryToParse: any): any;
37
+ export declare function parseQuery(queryToParse: string, query: RequestTarget): URLSearchParams | RequestTarget;
38
38
  export declare function flattenKey(key: any): any;
39
39
  export declare function intersectionEstimate(store: any, left: any, right: any): number;
40
- export declare class SimpleURLQuery {
41
- url: string;
42
- constructor(url: string);
43
- get(): void;
44
- [Symbol.iterator](): ArrayIterator<any>;
45
- }
@@ -9,7 +9,7 @@
9
9
  * @param Target Class to add accessors to
10
10
  * @param typeDef Type definition for determining property
11
11
  */
12
- export declare function assignTrackedAccessors(Target: any, typeDef: any): void;
12
+ export declare function assignTrackedAccessors(Target: any, typeDef: any, useFullPropertyProxy?: boolean): void;
13
13
  export declare class GenericTrackedObject {
14
14
  #private;
15
15
  constructor(sourceObject: any);
@@ -1,4 +1,5 @@
1
1
  import { IterableEventQueue } from './IterableEventQueue.ts';
2
+ import type { Id } from './ResourceInterface.ts';
2
3
  /**
3
4
  * This module/function is responsible for the main work of tracking subscriptions and listening for new transactions
4
5
  * that have occurred on any thread, and then reading through the transaction log to notify listeners. This is
@@ -14,9 +15,12 @@ export declare function addSubscription(table: any, key: any, listener?: (key: a
14
15
  * subscription and get the initial state.
15
16
  */
16
17
  declare class Subscription extends IterableEventQueue {
17
- listener: (key: any) => any;
18
+ listener: (recordId: Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
18
19
  subscriptions: [];
19
20
  startTime?: number;
21
+ includeDescendants?: boolean;
22
+ supportsTransactions?: boolean;
23
+ onlyChildren?: boolean;
20
24
  constructor(listener: any);
21
25
  end(): void;
22
26
  toJSON(): {
@@ -1,10 +1,11 @@
1
1
  import { Socket } from 'net';
2
2
  import type { Value } from '../resources/analytics/write.ts';
3
+ import type { Resources } from '../resources/Resources.ts';
3
4
  /**
4
5
  * This is the central interface by which we define entry points for different server protocol plugins to listen for
5
6
  * incoming connections and requests.
6
7
  */
7
- interface Server {
8
+ export interface Server {
8
9
  socket?(listener: (socket: Socket) => void, options: ServerOptions): void;
9
10
  http?(listener: (request: Request, nextLayer: (request: Request) => Response) => void, options?: ServerOptions): void;
10
11
  request?(listener: (request: Request, nextLayer: (request: Request) => Response) => void, options?: ServerOptions): void;
@@ -17,6 +18,7 @@ interface Server {
17
18
  nodes: string[];
18
19
  shards: Map<number, string[]>;
19
20
  hostname: string;
21
+ resources: Resources;
20
22
  }
21
23
  export interface ServerOptions {
22
24
  port?: number;