@niledatabase/server 3.0.0-alpha.33 → 3.0.0-alpha.35

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.
@@ -0,0 +1,66 @@
1
+ import { Config } from '../../../utils/Config';
2
+ /**
3
+ * @swagger
4
+ * /api/signup:
5
+ * post:
6
+ * tags:
7
+ * - users
8
+ * summary: signs a user up
9
+ * description: signs a user up and logs them in. Expects a email and password combo
10
+ * operationId: signUp
11
+ * parameters:
12
+ * - name: tenantId
13
+ * description: A tenant id to add the user to when they are created
14
+ * in: query
15
+ * schema:
16
+ * type: string
17
+ * - name: newTenantName
18
+ * description: A tenant name to create, then the user to when they are created
19
+ * in: query
20
+ * schema:
21
+ * type: string
22
+ * requestBody:
23
+ * description: |-
24
+ * The email and password combination the user will use to authenticate.
25
+ * The `name` is optional; if provided it will be recorded in the `users` table.
26
+ * The `newTenant` is optional; if provided, it is used as the name of a new tenant record associated with the newly created user.
27
+ * content:
28
+ * application/json:
29
+ * schema:
30
+ * $ref: '#/components/schemas/CreateBasicUserRequest'
31
+ * examples:
32
+ * Create User Request:
33
+ * summary: Creates a user with basic credentials
34
+ * description: Create User Request
35
+ * value:
36
+ * email: a.user@somedomain.com
37
+ * password: somepassword
38
+ * name: A. User
39
+ * Create User Request with Tenant:
40
+ * summary: Creates a user and a new tenant for that user
41
+ * description: Create User Request with Tenant
42
+ * value:
43
+ * email: a.user@somedomain.com
44
+ * password: somepassword
45
+ * name: A. User
46
+ * newTenant: My Sandbox
47
+ * responses:
48
+ * "201":
49
+ * description: User and session created
50
+ * content:
51
+ * application/json:
52
+ * schema:
53
+ * $ref: "#/components/schemas/User"
54
+ * "400":
55
+ * description: API/Database failures
56
+ * content:
57
+ * text/plain:
58
+ * schema:
59
+ * type: string
60
+ * "401":
61
+ * description: Unauthorized
62
+ * content: {}
63
+ */
64
+ export declare function POST(config: Config, init: RequestInit & {
65
+ request: Request;
66
+ }): Promise<Response>;
@@ -0,0 +1,4 @@
1
+ import { Config } from '../../../utils/Config';
2
+ import { Routes } from '../../types';
3
+ export default function route(request: Request, config: Config): Promise<Response>;
4
+ export declare function matches(configRoutes: Routes, request: Request): boolean;