harperdb 4.7.18 → 4.7.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.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +57 -57
  3. package/bin/lite.js +54 -54
  4. package/components/EntryHandler.d.ts +2 -1
  5. package/components/Logger.d.ts +12 -0
  6. package/components/OptionsWatcher.d.ts +2 -1
  7. package/components/Scope.d.ts +16 -5
  8. package/index.d.ts +20 -9
  9. package/index.js +3 -0
  10. package/launchServiceScripts/launchNatsIngestService.js +54 -54
  11. package/launchServiceScripts/launchNatsReplyService.js +54 -54
  12. package/launchServiceScripts/launchUpdateNodes4-0-0.js +54 -54
  13. package/npm-shrinkwrap.json +346 -335
  14. package/package.json +1 -1
  15. package/resources/Table.d.ts +10 -4
  16. package/resources/databases.d.ts +12 -2
  17. package/server/jobs/jobProcess.js +54 -54
  18. package/server/threads/threadServer.js +54 -54
  19. package/studio/web/assets/{index-reMfz-PE.js → index-D-fcKyYx.js} +1 -1
  20. package/studio/web/assets/{index-C7BE1t1i.js → index-JYy8fJSs.js} +1 -1
  21. package/studio/web/assets/index-Zl65hD8K.css +1 -0
  22. package/studio/web/assets/index-oKJ2dNTo.js +234 -0
  23. package/studio/web/assets/{index.lazy-DG7DUk1C.js → index.lazy-C7Y8KaC7.js} +1 -1
  24. package/studio/web/assets/profiler-CxDJoqcP.js +1 -0
  25. package/studio/web/assets/{react-redux-4JeOy3fU.js → react-redux-LHAYowSO.js} +1 -1
  26. package/studio/web/assets/startRecording-CTUOSIln.js +2 -0
  27. package/studio/web/index.html +2 -2
  28. package/utility/scripts/restartHdb.js +54 -54
  29. package/v1.d.ts +8 -16
  30. package/v1.js +3 -0
  31. package/v2.d.ts +8 -16
  32. package/v2.js +41 -0
  33. package/studio/web/assets/index-BZ1HpJ7A.css +0 -1
  34. package/studio/web/assets/index-Bu-PphJh.js +0 -234
  35. package/studio/web/assets/profiler-B4vE9rPH.js +0 -1
  36. package/studio/web/assets/startRecording-B3i2VhSx.js +0 -2
@@ -2,6 +2,7 @@ import type { Stats } from 'node:fs';
2
2
  import { EventEmitter } from 'node:events';
3
3
  import { FileAndURLPathConfig } from './Component.js';
4
4
  import { FilesOption } from './deriveGlobOptions.js';
5
+ import type { Logger } from './Logger.ts';
5
6
  export interface BaseEntry {
6
7
  stats?: Stats;
7
8
  urlPath: string;
@@ -52,7 +53,7 @@ export type EntryHandlerEventMap = {
52
53
  export declare class EntryHandler extends EventEmitter<EntryHandlerEventMap> {
53
54
  #private;
54
55
  ready: Promise<any[]>;
55
- constructor(name: string, directory: string, config: FilesOption | FileAndURLPathConfig, logger?: any);
56
+ constructor(name: string, directory: string, config: FilesOption | FileAndURLPathConfig, logger?: Logger);
56
57
  get name(): string;
57
58
  get directory(): string;
58
59
  close(): this;
@@ -0,0 +1,12 @@
1
+ export interface Logger {
2
+ logLevel: string;
3
+ notify?: (...args: any[]) => void;
4
+ fatal?: (...args: any[]) => void;
5
+ error?: (...args: any[]) => void;
6
+ warn?: (...args: any[]) => void;
7
+ info?: (...args: any[]) => void;
8
+ debug?: (...args: any[]) => void;
9
+ trace?: (...args: any[]) => void;
10
+ withTag: (tag: string) => Logger;
11
+ loggerWithTag: (tag: string) => Logger;
12
+ }
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from 'events';
2
+ import type { Logger } from './Logger.ts';
2
3
  export interface Config {
3
4
  [key: string]: ConfigValue;
4
5
  }
@@ -40,7 +41,7 @@ export declare class CannotSetPropertyError extends Error {
40
41
  export declare class OptionsWatcher extends EventEmitter<OptionsWatcherEventMap> {
41
42
  #private;
42
43
  ready: Promise<any[]>;
43
- constructor(name: string, filePath: string, logger?: any);
44
+ constructor(name: string, filePath: string, logger?: Logger);
44
45
  /**
45
46
  * Closes the underlying file watcher, emits the `close` event, and removes any listeners on the OptionsWatcher instance
46
47
  */
@@ -1,6 +1,8 @@
1
1
  import { EventEmitter } from 'node:events';
2
+ import { databaseEventsEmitter } from '../resources/databases.ts';
2
3
  import { type Server } from '../server/Server.ts';
3
4
  import { EntryHandler, type onEntryEventHandler } from './EntryHandler.ts';
5
+ import type { Logger } from './Logger.ts';
4
6
  import { OptionsWatcher } from './OptionsWatcher.ts';
5
7
  import type { Resources } from '../resources/Resources.ts';
6
8
  import type { FileAndURLPathConfig } from './Component.ts';
@@ -8,22 +10,31 @@ import { FilesOption } from './deriveGlobOptions.ts';
8
10
  export declare class MissingDefaultFilesOptionError extends Error {
9
11
  constructor();
10
12
  }
13
+ export type ScopeEventsMap = {
14
+ all: [...args: unknown[]];
15
+ close: [];
16
+ error: [error: unknown];
17
+ ready: [];
18
+ [record: string]: [...args: unknown[]];
19
+ };
11
20
  /**
12
21
  * This class is what is passed to the `handleApplication` function of an extension.
13
22
  *
14
- * It is imperative that the instance is "ready" before its passed to the `handleApplication` function
23
+ * It is imperative that the instance is "ready" before it's passed to the `handleApplication` function
15
24
  * so that the developer can immediately start using `scope.options`, etc.
16
25
  *
17
26
  */
18
- export declare class Scope extends EventEmitter {
27
+ export declare class Scope extends EventEmitter<ScopeEventsMap> {
19
28
  #private;
20
29
  options: OptionsWatcher;
21
30
  resources: Resources;
22
31
  server: Server;
23
32
  ready: Promise<any[]>;
24
- constructor(name: string, directory: string, configFilePath: string, resources: Resources, server: Server);
25
- get logger(): any;
26
- get name(): string;
33
+ databaseEvents: typeof databaseEventsEmitter;
34
+ constructor(appName: string, pluginName: string, directory: string, configFilePath: string, resources: Resources, server: Server, logger?: Logger);
35
+ get logger(): Logger;
36
+ get appName(): string;
37
+ get pluginName(): string;
27
38
  get directory(): string;
28
39
  get configFilePath(): string;
29
40
  close(): this;
package/index.d.ts CHANGED
@@ -1,11 +1,17 @@
1
- export { Resource } from './resources/Resource.ts';
1
+ import type { Logger } from './components/Logger.ts';
2
+ import { BlobCreationOptions } from './resources/blob.ts';
3
+ import { databases as dbDatabases, tables as dbTables } from './resources/databases.ts';
2
4
  import { Resource as ResourceImport } from './resources/Resource.ts';
5
+ import { server as serverImport } from './server/Server.ts';
6
+
7
+ export { Resource } from './resources/Resource.ts';
3
8
  export type {
4
- Query,
5
9
  Context,
10
+ Query,
11
+ RequestTargetOrId,
12
+ Session,
6
13
  SourceContext,
7
14
  SubscriptionRequest,
8
- RequestTargetOrId,
9
15
  } from './resources/ResourceInterface.ts';
10
16
  export { ResourceInterface } from './resources/ResourceInterface.ts';
11
17
  export type { User } from './security/user.ts';
@@ -13,14 +19,17 @@ export type { RecordObject } from './resources/RecordEncoder.ts';
13
19
  export type { IterableEventQueue } from './resources/IterableEventQueue.ts';
14
20
  export { RequestTarget } from './resources/RequestTarget.ts';
15
21
  export { server } from './server/Server';
16
- import { server as serverImport } from './server/Server.ts';
17
- export { tables, databases } from './resources/databases.ts';
18
- import { tables as dbTables, databases as dbDatabases } from './resources/databases.ts';
19
- import { BlobCreationOptions } from './resources/blob.ts';
20
- export { Scope } from './components/Scope.ts';
22
+ export { tables, databases, type Table } from './resources/databases.ts';
23
+ export type { Attribute } from './resources/Table.ts';
24
+
25
+ declare const logger: Logger;
26
+ export { type Logger, logger };
27
+
28
+ export type { Scope } from './components/Scope.ts';
21
29
  export type { FilesOption, FilesOptionObject } from './components/deriveGlobOptions.ts';
22
30
  export type { FileAndURLPathConfig } from './components/Component.ts';
23
31
  export { OptionsWatcher, type Config, type ConfigValue } from './components/OptionsWatcher.ts';
32
+
24
33
  export {
25
34
  EntryHandler,
26
35
  type BaseEntry,
@@ -32,9 +41,11 @@ export {
32
41
  type FileEntryEvent,
33
42
  type AddDirectoryEvent,
34
43
  type UnlinkDirectoryEvent,
35
- type DirectoryEntryEvent } from './components/EntryHandler.ts';
44
+ type DirectoryEntryEvent,
45
+ } from './components/EntryHandler.ts';
36
46
  declare global {
37
47
  const tables: typeof dbTables;
48
+ const logger: Logger;
38
49
  const databases: typeof dbDatabases;
39
50
  const server: typeof serverImport;
40
51
  const Resource: typeof ResourceImport;
package/index.js CHANGED
@@ -7,6 +7,7 @@ if (!workerThreads.isMainThread) {
7
7
  const { globals } = require('./server/threads/threadServer.js');
8
8
 
9
9
  // exported types are needed for parsing as well
10
+ exports.Attribute = undefined;
10
11
  exports.Config = undefined;
11
12
  exports.ConfigValue = undefined;
12
13
  exports.Context = undefined;
@@ -14,6 +15,7 @@ exports.FileAndURLPathConfig = undefined;
14
15
  exports.FilesOption = undefined;
15
16
  exports.FilesOptionObject = undefined;
16
17
  exports.IterableEventQueue = undefined;
18
+ exports.Logger = undefined;
17
19
  exports.Query = undefined;
18
20
  exports.RecordObject = undefined;
19
21
  exports.RequestTarget = undefined;
@@ -24,6 +26,7 @@ exports.Scope = undefined;
24
26
  exports.Session = undefined;
25
27
  exports.SourceContext = undefined;
26
28
  exports.SubscriptionRequest = undefined;
29
+ exports.Table = undefined;
27
30
  exports.User = undefined;
28
31
 
29
32
  // these are all overwritten by the globals, but need to be here so that Node's static