@niledatabase/server 3.0.0-alpha.10 → 3.0.0-alpha.11

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,3 +1,4 @@
1
1
  import { Routes } from '../../types';
2
- export default function route(request: Request): Promise<Response>;
2
+ import { Config } from '../../../utils/Config';
3
+ export default function route(request: Request, config: Config): Promise<Response>;
3
4
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -1,3 +1,4 @@
1
1
  import { Routes } from '../../types';
2
- export default function route(req: Request): Promise<Response>;
2
+ import { Config } from '../../../utils/Config';
3
+ export default function route(req: Request, config: Config): Promise<Response>;
3
4
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -1,3 +1,4 @@
1
1
  import { Routes } from '../../types';
2
- export default function route(req: Request): Promise<Response>;
2
+ import { Config } from '../../../utils/Config';
3
+ export default function route(req: Request, config: Config): Promise<Response>;
3
4
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -1,3 +1,4 @@
1
1
  import { Routes } from '../../types';
2
- export default function route(req: Request): Promise<Response>;
2
+ import { Config } from '../../../utils/Config';
3
+ export default function route(req: Request, config: Config): Promise<Response>;
3
4
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -29,5 +29,6 @@
29
29
  * content: {}
30
30
  */
31
31
  import { Routes } from '../../types';
32
- export default function route(req: Request): Promise<Response>;
32
+ import { Config } from '../../../utils/Config';
33
+ export default function route(req: Request, config: Config): Promise<Response>;
33
34
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -1,3 +1,4 @@
1
1
  import { Routes } from '../../types';
2
- export default function route(request: Request): Promise<Response>;
2
+ import { Config } from '../../../utils/Config';
3
+ export default function route(request: Request, config: Config): Promise<Response>;
3
4
  export declare function matches(configRoutes: Routes, request: Request): boolean;
@@ -1,3 +1,4 @@
1
+ import { Config } from '../../../utils/Config';
1
2
  import { ActiveSession } from '../../utils/auth';
2
3
  /**
3
4
  * @swagger
@@ -27,6 +28,6 @@ import { ActiveSession } from '../../utils/auth';
27
28
  * description: Unauthorized
28
29
  * content: {}
29
30
  */
30
- export declare function GET(session: ActiveSession, init: RequestInit & {
31
+ export declare function GET(config: Config, session: ActiveSession, init: RequestInit & {
31
32
  request: Request;
32
33
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,4 @@
1
- import { ActiveSession } from '../../utils/auth';
1
+ import { Config } from '../../../utils/Config';
2
2
  /**
3
3
  * @swagger
4
4
  * /api/tenants:
@@ -40,6 +40,6 @@ import { ActiveSession } from '../../utils/auth';
40
40
  * schema:
41
41
  * $ref: '#/components/schemas/APIError'
42
42
  */
43
- export declare function POST(session: ActiveSession, init: RequestInit & {
43
+ export declare function POST(config: Config, init: RequestInit & {
44
44
  request: Request;
45
45
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,4 @@
1
- import { ActiveSession } from '../../../utils/auth';
1
+ import { Config } from '../../../../utils/Config';
2
2
  /**
3
3
  * @swagger
4
4
  * /api/tenants/{tenantId}:
@@ -29,6 +29,6 @@ import { ActiveSession } from '../../../utils/auth';
29
29
  * schema:
30
30
  * $ref: '#/components/schemas/APIError'
31
31
  */
32
- export declare function DELETE(session: ActiveSession, init: RequestInit & {
32
+ export declare function DELETE(config: Config, init: RequestInit & {
33
33
  request: Request;
34
34
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,4 @@
1
- import { ActiveSession } from '../../../../utils/auth';
1
+ import { Config } from '../../../../../utils/Config';
2
2
  /**
3
3
  * @swagger
4
4
  * /api/tenants/{tenantId}/users:
@@ -30,6 +30,6 @@ import { ActiveSession } from '../../../../utils/auth';
30
30
  * schema:
31
31
  * $ref: '#/components/schemas/APIError'
32
32
  */
33
- export declare function GET(session: ActiveSession, init: RequestInit & {
33
+ export declare function GET(config: Config, init: RequestInit & {
34
34
  request: Request;
35
35
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,5 @@
1
1
  import { ActiveSession } from '../../../../utils/auth';
2
+ import { Config } from '../../../../../utils/Config';
2
3
  /**
3
4
  * @swagger
4
5
  * /api/tenants/{tenantId}/users:
@@ -39,6 +40,6 @@ import { ActiveSession } from '../../../../utils/auth';
39
40
  * schema:
40
41
  * $ref: '#/components/schemas/User'
41
42
  */
42
- export declare function POST(session: ActiveSession, init: RequestInit & {
43
+ export declare function POST(config: Config, session: ActiveSession, init: RequestInit & {
43
44
  request: Request;
44
45
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,4 @@
1
- import { ActiveSession } from '../../../../utils/auth';
1
+ import { Config } from '../../../../../utils/Config';
2
2
  /**
3
3
  * @swagger
4
4
  * /api/tenants/{tenantId}/users:
@@ -24,6 +24,6 @@ import { ActiveSession } from '../../../../utils/auth';
24
24
  * "201":
25
25
  * description: add user to tenant
26
26
  */
27
- export declare function PUT(session: ActiveSession, init: RequestInit & {
27
+ export declare function PUT(config: Config, init: RequestInit & {
28
28
  request: Request;
29
29
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,4 @@
1
- import { ActiveSession } from '../../../../../utils/auth';
1
+ import { Config } from '../../../../../../utils/Config';
2
2
  /**
3
3
  * @swagger
4
4
  * /api/tenants/{tenantId}/users/{email}:
@@ -25,6 +25,6 @@ import { ActiveSession } from '../../../../../utils/auth';
25
25
  * "204":
26
26
  * description: User removed
27
27
  */
28
- export declare function DELETE(session: ActiveSession, init: RequestInit & {
28
+ export declare function DELETE(config: Config, init: RequestInit & {
29
29
  request: Request;
30
30
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,3 +1,4 @@
1
+ import { Config } from '../../../utils/Config';
1
2
  /**
2
3
  * @swagger
3
4
  * /api/users:
@@ -29,6 +30,6 @@
29
30
  * description: Unauthorized
30
31
  * content: {}
31
32
  */
32
- export declare function GET(init: RequestInit & {
33
+ export declare function GET(config: Config, init: RequestInit & {
33
34
  request: Request;
34
35
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,5 @@
1
1
  import { ActiveSession } from '../../utils/auth';
2
+ import { Config } from '../../../utils/Config';
2
3
  /**
3
4
  * @swagger
4
5
  * /api/users:
@@ -61,6 +62,6 @@ import { ActiveSession } from '../../utils/auth';
61
62
  * description: Unauthorized
62
63
  * content: {}
63
64
  */
64
- export declare function POST(session: void | ActiveSession, init: RequestInit & {
65
+ export declare function POST(config: Config, session: void | ActiveSession, init: RequestInit & {
65
66
  request: Request;
66
67
  }, log?: (...args: string[]) => void): Promise<Response>;
@@ -1,4 +1,5 @@
1
1
  import { ActiveSession } from '../../../utils/auth';
2
+ import { Config } from '../../../../utils/Config';
2
3
  /**
3
4
  * @swagger
4
5
  * /api/users/{userid}:
@@ -35,6 +36,6 @@ import { ActiveSession } from '../../../utils/auth';
35
36
  * description: Unauthorized
36
37
  * content: {}
37
38
  */
38
- export declare function PUT(session: void | ActiveSession, init: RequestInit & {
39
+ export declare function PUT(config: Config, session: void | ActiveSession, init: RequestInit & {
39
40
  request: Request;
40
41
  }, log: (...args: string[]) => void): Promise<Response>;
@@ -1,6 +1,7 @@
1
+ import { Config } from '../../../utils/Config';
1
2
  type ApiRouteKeys = keyof typeof apiRoutes;
2
3
  export type ApiRoutePaths = (typeof apiRoutes)[ApiRouteKeys];
3
- export declare const apiRoutes: {
4
+ export declare const apiRoutes: (config: Config) => {
4
5
  ME: string;
5
6
  USERS: (tenantId?: string) => string;
6
7
  USER: (userId: string) => string;
@@ -1 +1,2 @@
1
- export declare function makeRestUrl(path: string, qp?: Record<string, string>): string;
1
+ import { Config } from '../../../utils/Config';
2
+ export declare function makeRestUrl(config: Config, path: string, qp?: Record<string, string>): string;
@@ -1,4 +1,5 @@
1
- export declare const proxyRoutes: {
1
+ import { Config } from '../../../utils/Config';
2
+ export declare const proxyRoutes: (config: Config) => {
2
3
  SIGNIN: string;
3
4
  PROVIDERS: string;
4
5
  SESSION: string;