@niledatabase/server 5.0.0-alpha.5 → 5.0.0-alpha.7

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/dist/index.d.mts CHANGED
@@ -1,5 +1,14 @@
1
1
  import pg, { PoolConfig, PoolClient } from 'pg';
2
2
 
3
+ type LogFunction = (message: string | unknown, meta?: Record<string, unknown>) => void;
4
+ type Loggable = {
5
+ info: LogFunction;
6
+ debug: LogFunction;
7
+ warn: LogFunction;
8
+ error: LogFunction;
9
+ };
10
+ type LogReturn = (prefixes?: string | string[]) => Loggable;
11
+
3
12
  type ExtensionCtx = {
4
13
  handleOnRequest: (config: Config, _init: RequestInit & {
5
14
  request: Request;
@@ -24,7 +33,7 @@ declare class Config {
24
33
  };
25
34
  extensionCtx: ExtensionCtx;
26
35
  extensions?: Extension[];
27
- logger: LoggerType;
36
+ logger: LogReturn;
28
37
  /**
29
38
  * Stores the set tenant id from Server for use in sub classes
30
39
  */
@@ -433,7 +442,7 @@ type NileConfig = {
433
442
  /**
434
443
  * Some kind of logger if you want to send to an external service
435
444
  */
436
- logger?: LoggerType;
445
+ logger?: LogReturn;
437
446
  /**
438
447
  * The configuration value that maps to `NILEDB_API_URL` - its going to be nile-auth (or similar service)
439
448
  */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import pg, { PoolConfig, PoolClient } from 'pg';
2
2
 
3
+ type LogFunction = (message: string | unknown, meta?: Record<string, unknown>) => void;
4
+ type Loggable = {
5
+ info: LogFunction;
6
+ debug: LogFunction;
7
+ warn: LogFunction;
8
+ error: LogFunction;
9
+ };
10
+ type LogReturn = (prefixes?: string | string[]) => Loggable;
11
+
3
12
  type ExtensionCtx = {
4
13
  handleOnRequest: (config: Config, _init: RequestInit & {
5
14
  request: Request;
@@ -24,7 +33,7 @@ declare class Config {
24
33
  };
25
34
  extensionCtx: ExtensionCtx;
26
35
  extensions?: Extension[];
27
- logger: LoggerType;
36
+ logger: LogReturn;
28
37
  /**
29
38
  * Stores the set tenant id from Server for use in sub classes
30
39
  */
@@ -433,7 +442,7 @@ type NileConfig = {
433
442
  /**
434
443
  * Some kind of logger if you want to send to an external service
435
444
  */
436
- logger?: LoggerType;
445
+ logger?: LogReturn;
437
446
  /**
438
447
  * The configuration value that maps to `NILEDB_API_URL` - its going to be nile-auth (or similar service)
439
448
  */