harperdb 4.3.18 → 4.3.20

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.
@@ -1,419 +0,0 @@
1
- /// <reference types="node" />
2
- import { makeTable } from './Table';
3
- interface Tables {
4
- [table_name: string]: ReturnType<typeof makeTable>;
5
- }
6
- interface Databases {
7
- [database_name: string]: Tables;
8
- }
9
- export declare const tables: Tables;
10
- export declare const databases: Databases;
11
- /**
12
- * This gets the set of tables from the default database ("data").
13
- */
14
- export declare function getTables(): Tables;
15
- /**
16
- * This provides the main entry point for getting the set of all HarperDB tables (organized by schemas/databases).
17
- * This proactively scans the known
18
- * databases/schemas directories and finds any databases and opens them. This done proactively so that there is a fast
19
- * object available to all consumers that doesn't require runtime checks for database open states.
20
- * This also attaches the audit store associated with table. Note that legacy tables had a single audit table per db table
21
- * but in newer multi-table databases, there is one consistent, integrated audit table for the database since transactions
22
- * can span any tables in the database.
23
- */
24
- export declare function getDatabases(): Databases;
25
- export declare function resetDatabases(): Databases;
26
- /**
27
- * This is responsible for reading the internal dbi of a single database file to get a list of all the tables and
28
- * their indexed or registered attributes
29
- * @param path
30
- * @param default_table
31
- * @param database_name
32
- */
33
- export declare function readMetaDb(path: string, default_table?: string, database_name?: string, audit_path?: string, is_legacy?: boolean): any;
34
- interface TableDefinition {
35
- table: string;
36
- database?: string;
37
- path?: string;
38
- expiration?: number;
39
- eviction?: number;
40
- scanInterval?: number;
41
- audit?: boolean;
42
- sealed?: boolean;
43
- trackDeletes?: boolean;
44
- attributes: any[];
45
- schemaDefined?: boolean;
46
- origin?: string;
47
- }
48
- /**
49
- * Get root store for a database
50
- * @param options
51
- * @returns
52
- */
53
- export declare function database({ database: database_name, table: table_name }: {
54
- database: any;
55
- table: any;
56
- }): any;
57
- /**
58
- * Delete the database
59
- * @param database_name
60
- */
61
- export declare function dropDatabase(database_name: any): Promise<void>;
62
- /**
63
- * This can be called to ensure that the specified table exists and if it does not exist, it should be created.
64
- * @param table_name
65
- * @param database_name
66
- * @param custom_path
67
- * @param expiration
68
- * @param eviction
69
- * @param scanInterval
70
- * @param attributes
71
- * @param audit
72
- * @param sealed
73
- */
74
- export declare function table({ table: table_name, database: database_name, expiration, eviction, scanInterval: scan_interval, attributes, audit, sealed, trackDeletes: track_deletes, schemaDefined: schema_defined, origin, }: TableDefinition): {
75
- new (identifier: import("./ResourceInterface").Id, source: any): {
76
- ensureLoaded(): any;
77
- get(query?: string | import("./ResourceInterface").Query): void | object | Promise<void | object>;
78
- allowRead(user: any, query: any): any;
79
- allowUpdate(user: any, updated_data: any): boolean;
80
- allowCreate(user: any, new_data: {}): boolean;
81
- allowDelete(user: any): any;
82
- update(updates?: any, full_update?: boolean): any;
83
- addTo(property: any, value: any): void;
84
- subtractFrom(property: any, value: any): void;
85
- getMetadata(): any;
86
- invalidate(options: any): void;
87
- lock(): void;
88
- put(record: any): void;
89
- patch(record_update: any): void;
90
- _writeUpdate(record_update: any, full_update: boolean, options?: any): void;
91
- delete(request: import("./ResourceInterface").Request): Promise<boolean>;
92
- _writeDelete(options?: any): boolean;
93
- search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
94
- subscribe(request: import("./ResourceInterface").SubscriptionRequest): Promise<{
95
- listener: (key: any) => any;
96
- subscriptions: [];
97
- startTime?: number;
98
- end(): void;
99
- toJSON(): {
100
- name: string;
101
- };
102
- resolveNext: Function;
103
- queue: any[];
104
- hasDataListeners: boolean;
105
- push(message: any): void;
106
- send(message: any): void;
107
- getNextMessage(): any;
108
- on(event_name: any, listener: any): any;
109
- [Symbol.asyncIterator](): {
110
- queue: import("./IterableEventQueue").IterableEventQueue;
111
- push(message: any): void;
112
- next(): Promise<unknown> | {
113
- value: any;
114
- };
115
- return(value: any): {
116
- value: any;
117
- done: boolean;
118
- };
119
- throw(error: any): {
120
- done: boolean;
121
- };
122
- };
123
- [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
124
- addListener<K_1>(eventName: string | symbol, listener: (...args: any[]) => void): any;
125
- once<K_2>(eventName: string | symbol, listener: (...args: any[]) => void): any;
126
- removeListener<K_3>(eventName: string | symbol, listener: (...args: any[]) => void): any;
127
- off<K_4>(eventName: string | symbol, listener: (...args: any[]) => void): any;
128
- removeAllListeners(eventName?: string | symbol): any;
129
- setMaxListeners(n: number): any;
130
- getMaxListeners(): number;
131
- listeners<K_5>(eventName: string | symbol): Function[];
132
- rawListeners<K_6>(eventName: string | symbol): Function[];
133
- emit<K_7>(eventName: string | symbol, ...args: any[]): boolean;
134
- listenerCount<K_8>(eventName: string | symbol, listener?: Function): number;
135
- prependListener<K_9>(eventName: string | symbol, listener: (...args: any[]) => void): any;
136
- prependOnceListener<K_10>(eventName: string | symbol, listener: (...args: any[]) => void): any;
137
- eventNames(): (string | symbol)[];
138
- }>;
139
- doesExist(): boolean;
140
- publish(message: any, options?: any): void;
141
- _writePublish(message: any, options?: any): void;
142
- validate(record: any, patch?: any): void;
143
- getUpdatedTime(): any;
144
- wasLoadedFromSource(): boolean | void;
145
- post(new_record: any): any;
146
- connect(query?: {}): AsyncIterable<any>;
147
- getId(): any;
148
- getContext(): any;
149
- };
150
- name: any;
151
- primaryStore: any;
152
- auditStore: any;
153
- primaryKey: any;
154
- tableName: any;
155
- indices: any;
156
- audit: any;
157
- databasePath: any;
158
- databaseName: any;
159
- attributes: any;
160
- expirationTimer: any;
161
- createdTimeProperty: any;
162
- updatedTimeProperty: any;
163
- propertyResolvers: any;
164
- sources: any[];
165
- readonly expirationMS: any;
166
- dbisDB: any;
167
- schemaDefined: any;
168
- sourcedFrom(source: any, options: any): any;
169
- getResource(id: import("./ResourceInterface").Id, request: any, resource_options?: any): {
170
- ensureLoaded(): any;
171
- get(query?: string | import("./ResourceInterface").Query): void | object | Promise<void | object>;
172
- allowRead(user: any, query: any): any;
173
- allowUpdate(user: any, updated_data: any): boolean;
174
- allowCreate(user: any, new_data: {}): boolean;
175
- allowDelete(user: any): any;
176
- update(updates?: any, full_update?: boolean): any;
177
- addTo(property: any, value: any): void;
178
- subtractFrom(property: any, value: any): void;
179
- getMetadata(): any;
180
- invalidate(options: any): void;
181
- lock(): void;
182
- put(record: any): void;
183
- patch(record_update: any): void;
184
- _writeUpdate(record_update: any, full_update: boolean, options?: any): void;
185
- delete(request: import("./ResourceInterface").Request): Promise<boolean>;
186
- _writeDelete(options?: any): boolean;
187
- search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
188
- subscribe(request: import("./ResourceInterface").SubscriptionRequest): Promise<{
189
- listener: (key: any) => any;
190
- subscriptions: [];
191
- startTime?: number;
192
- end(): void;
193
- toJSON(): {
194
- name: string;
195
- };
196
- resolveNext: Function;
197
- queue: any[];
198
- hasDataListeners: boolean;
199
- push(message: any): void;
200
- send(message: any): void;
201
- getNextMessage(): any;
202
- on(event_name: any, listener: any): any;
203
- [Symbol.asyncIterator](): {
204
- queue: import("./IterableEventQueue").IterableEventQueue;
205
- push(message: any): void;
206
- next(): Promise<unknown> | {
207
- value: any;
208
- };
209
- return(value: any): {
210
- value: any;
211
- done: boolean;
212
- };
213
- throw(error: any): {
214
- done: boolean;
215
- };
216
- };
217
- [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
218
- addListener<K_1>(eventName: string | symbol, listener: (...args: any[]) => void): any;
219
- once<K_2>(eventName: string | symbol, listener: (...args: any[]) => void): any;
220
- removeListener<K_3>(eventName: string | symbol, listener: (...args: any[]) => void): any;
221
- off<K_4>(eventName: string | symbol, listener: (...args: any[]) => void): any;
222
- removeAllListeners(eventName?: string | symbol): any;
223
- setMaxListeners(n: number): any;
224
- getMaxListeners(): number;
225
- listeners<K_5>(eventName: string | symbol): Function[];
226
- rawListeners<K_6>(eventName: string | symbol): Function[];
227
- emit<K_7>(eventName: string | symbol, ...args: any[]): boolean;
228
- listenerCount<K_8>(eventName: string | symbol, listener?: Function): number;
229
- prependListener<K_9>(eventName: string | symbol, listener: (...args: any[]) => void): any;
230
- prependOnceListener<K_10>(eventName: string | symbol, listener: (...args: any[]) => void): any;
231
- eventNames(): (string | symbol)[];
232
- }>;
233
- doesExist(): boolean;
234
- publish(message: any, options?: any): void;
235
- _writePublish(message: any, options?: any): void;
236
- validate(record: any, patch?: any): void;
237
- getUpdatedTime(): any;
238
- wasLoadedFromSource(): boolean | void;
239
- post(new_record: any): any;
240
- connect(query?: {}): AsyncIterable<any>;
241
- getId(): any;
242
- getContext(): any;
243
- } | Promise<{
244
- ensureLoaded(): any;
245
- get(query?: string | import("./ResourceInterface").Query): void | object | Promise<void | object>;
246
- allowRead(user: any, query: any): any;
247
- allowUpdate(user: any, updated_data: any): boolean;
248
- allowCreate(user: any, new_data: {}): boolean;
249
- allowDelete(user: any): any;
250
- update(updates?: any, full_update?: boolean): any;
251
- addTo(property: any, value: any): void;
252
- subtractFrom(property: any, value: any): void;
253
- getMetadata(): any;
254
- invalidate(options: any): void;
255
- lock(): void;
256
- put(record: any): void;
257
- patch(record_update: any): void;
258
- _writeUpdate(record_update: any, full_update: boolean, options?: any): void;
259
- delete(request: import("./ResourceInterface").Request): Promise<boolean>;
260
- _writeDelete(options?: any): boolean;
261
- search(request: import("./ResourceInterface").Query): AsyncIterable<any>;
262
- subscribe(request: import("./ResourceInterface").SubscriptionRequest): Promise<{
263
- listener: (key: any) => any;
264
- subscriptions: [];
265
- startTime?: number;
266
- end(): void;
267
- toJSON(): {
268
- name: string;
269
- };
270
- resolveNext: Function;
271
- queue: any[];
272
- hasDataListeners: boolean;
273
- push(message: any): void;
274
- send(message: any): void;
275
- getNextMessage(): any;
276
- on(event_name: any, listener: any): any;
277
- [Symbol.asyncIterator](): {
278
- queue: import("./IterableEventQueue").IterableEventQueue;
279
- push(message: any): void;
280
- next(): Promise<unknown> | {
281
- value: any;
282
- };
283
- return(value: any): {
284
- value: any;
285
- done: boolean;
286
- };
287
- throw(error: any): {
288
- done: boolean;
289
- };
290
- };
291
- [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
292
- addListener<K_1>(eventName: string | symbol, listener: (...args: any[]) => void): any;
293
- once<K_2>(eventName: string | symbol, listener: (...args: any[]) => void): any;
294
- removeListener<K_3>(eventName: string | symbol, listener: (...args: any[]) => void): any;
295
- off<K_4>(eventName: string | symbol, listener: (...args: any[]) => void): any;
296
- removeAllListeners(eventName?: string | symbol): any;
297
- setMaxListeners(n: number): any;
298
- getMaxListeners(): number;
299
- listeners<K_5>(eventName: string | symbol): Function[];
300
- rawListeners<K_6>(eventName: string | symbol): Function[];
301
- emit<K_7>(eventName: string | symbol, ...args: any[]): boolean;
302
- listenerCount<K_8>(eventName: string | symbol, listener?: Function): number;
303
- prependListener<K_9>(eventName: string | symbol, listener: (...args: any[]) => void): any;
304
- prependOnceListener<K_10>(eventName: string | symbol, listener: (...args: any[]) => void): any;
305
- eventNames(): (string | symbol)[];
306
- }>;
307
- doesExist(): boolean;
308
- publish(message: any, options?: any): void;
309
- _writePublish(message: any, options?: any): void;
310
- validate(record: any, patch?: any): void;
311
- getUpdatedTime(): any;
312
- wasLoadedFromSource(): boolean | void;
313
- post(new_record: any): any;
314
- connect(query?: {}): AsyncIterable<any>;
315
- getId(): any;
316
- getContext(): any;
317
- }>;
318
- setTTLExpiration(expiration: number | {
319
- expiration: number;
320
- eviction?: number;
321
- scanInterval?: number;
322
- }): void;
323
- enableAuditing(audit_enabled?: boolean): void;
324
- coerceId(id: string): string | number;
325
- dropTable(): Promise<void>;
326
- evict(id: any, existing_record: any, existing_version: any): any;
327
- operation(operation: any, context: any): any;
328
- transformToOrderedSelect(entries: any, select: any, sort: any, context: any, read_txn: any, transformToRecord: any): any;
329
- transformEntryForSelect(select: any, context: any, read_txn: any, filtered: any, ensure_loaded?: any, can_skip?: any): (entry: any) => any;
330
- addAttributes(attributes_to_add: any): Promise<any>;
331
- removeAttributes(names: string[]): Promise<any>;
332
- getRecordCount(options: any): {
333
- recordCount: number;
334
- estimatedRange: number[];
335
- } | {
336
- recordCount: number;
337
- estimatedRange?: undefined;
338
- };
339
- updatedAttributes(): void;
340
- deleteHistory(end_time?: number): Promise<void>;
341
- getHistory(start_time?: number, end_time?: number): AsyncGenerator<{
342
- id: import("ordered-binary").Key;
343
- localTime: any;
344
- version: any;
345
- type: any;
346
- value: any;
347
- user: import("ordered-binary").Key;
348
- }, void, unknown>;
349
- getHistoryOfRecord(id: any): Promise<any[]>;
350
- cleanup(): void;
351
- transactions: import("./DatabaseTransaction").Transaction[] & {
352
- timestamp: number;
353
- };
354
- get(identifier: import("./ResourceInterface").Id, context?: import("./ResourceInterface").Context): Promise<object>;
355
- get(request: import("./ResourceInterface").Request, context?: import("./ResourceInterface").Context): Promise<object>;
356
- get(query: import("./ResourceInterface").Query, context?: import("./ResourceInterface").Context): Promise<AsyncIterable<object>>;
357
- put: {
358
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
359
- reliesOnPrototype: boolean;
360
- };
361
- patch: {
362
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
363
- reliesOnPrototype: boolean;
364
- };
365
- delete(identifier: import("./ResourceInterface").Id, context?: import("./ResourceInterface").Context): Promise<boolean>;
366
- delete(request: import("./ResourceInterface").Request, context?: import("./ResourceInterface").Context): Promise<object>;
367
- getNewId(): `${string}-${string}-${string}-${string}-${string}`;
368
- create(id_prefix: import("./ResourceInterface").Id, record: any, context: import("./ResourceInterface").Context): Promise<import("./ResourceInterface").Id>;
369
- create(record: any, context: import("./ResourceInterface").Context): Promise<import("./ResourceInterface").Id>;
370
- invalidate: {
371
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
372
- reliesOnPrototype: boolean;
373
- };
374
- post: {
375
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
376
- reliesOnPrototype: boolean;
377
- };
378
- connect: {
379
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
380
- reliesOnPrototype: boolean;
381
- };
382
- subscribe(request: import("./ResourceInterface").SubscriptionRequest): Promise<AsyncIterable<{
383
- id: any;
384
- operation: string;
385
- value: object;
386
- }>>;
387
- publish: {
388
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
389
- reliesOnPrototype: boolean;
390
- };
391
- search: {
392
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
393
- reliesOnPrototype: boolean;
394
- };
395
- query: {
396
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
397
- reliesOnPrototype: boolean;
398
- };
399
- copy: {
400
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
401
- reliesOnPrototype: boolean;
402
- };
403
- move: {
404
- (id_or_query: import("./ResourceInterface").Id, data_or_context?: any, context?: import("./ResourceInterface").Context): any;
405
- reliesOnPrototype: boolean;
406
- };
407
- isCollection(resource: any): any;
408
- parseQuery(search: any): any;
409
- parsePath(path: any, context: any, query: any): any;
410
- };
411
- export declare function dropTableMeta({ table: table_name, database: database_name }: {
412
- table: any;
413
- database: any;
414
- }): Promise<any[]>;
415
- export declare function onUpdatedTable(listener: any): void;
416
- export declare function getDefaultCompression(): {
417
- startingOffset: number;
418
- };
419
- export {};