@niledatabase/server 3.0.0-alpha.18 → 3.0.0-alpha.19

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/Server.d.ts CHANGED
@@ -6,7 +6,6 @@ export declare class Server {
6
6
  config: Config;
7
7
  api: Api;
8
8
  private manager;
9
- private servers;
10
9
  constructor(config?: ServerConfig);
11
10
  setConfig(cfg: Config): void;
12
11
  init(cfg?: Config): Promise<this>;
@@ -19,9 +18,7 @@ export declare class Server {
19
18
  set token(token: string | undefined | null);
20
19
  get db(): Pool;
21
20
  /**
22
- * A utility function if you want to manage different NileDB instances yourself
23
- * returns the global Server object, an existing server that's already been configured,
24
- * or a new one if the config isn't in the cache
21
+ * A convenience function that applies a config and ensures whatever was passed is set properly
25
22
  */
26
23
  getInstance(config: ServerConfig): Server;
27
24
  }
@@ -0,0 +1,37 @@
1
+ import { Config } from '../../../../utils/Config';
2
+ /**
3
+ * @swagger
4
+ * /api/tenants/{tenantId}:
5
+ * get:
6
+ * tags:
7
+ * - tenants
8
+ * summary: Obtains a specific tenant.
9
+ * operationId: getTenant
10
+ * parameters:
11
+ * - name: tenantId
12
+ * in: path
13
+ * required: true
14
+ * schema:
15
+ * type: string
16
+ * responses:
17
+ * "200":
18
+ * description: the desired tenant
19
+ * application/json:
20
+ * schema:
21
+ * $ref: '#/components/schemas/Tenant'
22
+ * "401":
23
+ * description: Unauthorized
24
+ * content:
25
+ * application/json:
26
+ * schema:
27
+ * $ref: '#/components/schemas/APIError'
28
+ * "404":
29
+ * description: Tenant not found
30
+ * content:
31
+ * application/json:
32
+ * schema:
33
+ * $ref: '#/components/schemas/APIError'
34
+ */
35
+ export declare function GET(config: Config, init: RequestInit & {
36
+ request: Request;
37
+ }, log: (...args: string[]) => void): Promise<Response>;
@@ -0,0 +1,38 @@
1
+ import { Config } from '../../../../utils/Config';
2
+ /**
3
+ * @swagger
4
+ * /api/tenants/{tenantId}:
5
+ * put:
6
+ * tags:
7
+ * - tenants
8
+ * summary: Obtains a specific tenant.
9
+ * operationId: updateTenant
10
+ * parameters:
11
+ * - name: tenantId
12
+ * in: path
13
+ * required: true
14
+ * schema:
15
+ * type: string
16
+ * responses:
17
+ * "201":
18
+ * description: update an existing tenant
19
+ * content:
20
+ * application/json:
21
+ * schema:
22
+ * $ref: '#/components/schemas/Tenant'
23
+ * "401":
24
+ * description: Unauthorized
25
+ * content:
26
+ * application/json:
27
+ * schema:
28
+ * $ref: '#/components/schemas/APIError'
29
+ * "404":
30
+ * description: Tenant not found
31
+ * content:
32
+ * application/json:
33
+ * schema:
34
+ * $ref: '#/components/schemas/APIError'
35
+ */
36
+ export declare function PUT(config: Config, init: RequestInit & {
37
+ request: Request;
38
+ }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,3 @@
1
- import { ActiveSession } from '../../utils/auth';
2
1
  import { Config } from '../../../utils/Config';
3
2
  /**
4
3
  * @swagger
@@ -62,6 +61,6 @@ import { Config } from '../../../utils/Config';
62
61
  * description: Unauthorized
63
62
  * content: {}
64
63
  */
65
- export declare function POST(config: Config, session: void | ActiveSession, init: RequestInit & {
64
+ export declare function POST(config: Config, init: RequestInit & {
66
65
  request: Request;
67
66
  }, log?: (...args: string[]) => void): Promise<Response>;
@@ -4,6 +4,7 @@ import NileDatabase from './NileInstance';
4
4
  export default class DBManager {
5
5
  connections: Map<string, NileDatabase>;
6
6
  cleared: boolean;
7
+ private poolWatcherFn;
7
8
  private makeId;
8
9
  constructor(config: ServerConfig);
9
10
  poolWatcher: (config: ServerConfig) => (id: undefined | null | string) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Pool } from 'pg';
3
2
  import { Config } from '../utils/Config';
4
3
  declare class NileDatabase {