@niledatabase/server 3.0.0-alpha.4 → 3.0.0-alpha.5
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/Api.d.ts +22 -0
- package/dist/Server.d.ts +1 -21
- package/dist/db/isUUID.d.ts +1 -0
- package/dist/server.cjs.development.js +1541 -1485
- package/dist/server.cjs.development.js.map +1 -1
- package/dist/server.cjs.production.min.js +1 -1
- package/dist/server.cjs.production.min.js.map +1 -1
- package/dist/server.esm.js +1541 -1485
- package/dist/server.esm.js.map +1 -1
- package/dist/tenants/index.d.ts +6 -4
- package/dist/users/index.d.ts +7 -7
- package/dist/utils/Requester/index.d.ts +5 -5
- package/dist/utils/Requester/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/tenants/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '../utils/Config';
|
|
2
|
-
import { NileRequest
|
|
2
|
+
import { NileRequest } from '../utils/Requester';
|
|
3
3
|
export interface Tenant {
|
|
4
4
|
id: string;
|
|
5
5
|
name?: string;
|
|
@@ -12,8 +12,10 @@ export default class Tenants extends Config {
|
|
|
12
12
|
get tenantUrl(): string;
|
|
13
13
|
createTenant: (req: NileRequest<{
|
|
14
14
|
name: string;
|
|
15
|
-
}
|
|
16
|
-
getTenant: (req: NileRequest<
|
|
15
|
+
}> | Headers | string, init?: RequestInit) => Promise<Tenant | Response>;
|
|
16
|
+
getTenant: (req: NileRequest<{
|
|
17
|
+
id: string;
|
|
18
|
+
}> | Headers | string | void, init?: RequestInit) => Promise<Tenant | Response>;
|
|
17
19
|
get tenantListUrl(): string;
|
|
18
|
-
listTenants: (req: NileRequest<void
|
|
20
|
+
listTenants: (req: NileRequest<void> | Headers, init?: RequestInit) => Promise<Tenant[] | Response>;
|
|
19
21
|
}
|
package/dist/users/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '../utils/Config';
|
|
2
|
-
import { NileRequest
|
|
2
|
+
import { NileRequest } from '../utils/Requester';
|
|
3
3
|
export interface CreateBasicUserRequest {
|
|
4
4
|
email: string;
|
|
5
5
|
password: string;
|
|
@@ -34,19 +34,19 @@ export default class Users extends Config {
|
|
|
34
34
|
get usersUrl(): string;
|
|
35
35
|
get tenantUsersUrl(): string;
|
|
36
36
|
handleHeaders(init?: RequestInit): RequestInit | undefined;
|
|
37
|
-
createUser: (req: NileRequest<CreateBasicUserRequest>, init?: RequestInit) =>
|
|
38
|
-
updateUser: (userId: string, req: NileRequest<User>, init?: RequestInit) =>
|
|
39
|
-
listUsers: (req: NileRequest<void> | Headers, init?: RequestInit) =>
|
|
37
|
+
createUser: (req: NileRequest<CreateBasicUserRequest>, init?: RequestInit) => Promise<User | Response>;
|
|
38
|
+
updateUser: (userId: string, req: NileRequest<User>, init?: RequestInit) => Promise<User | Response>;
|
|
39
|
+
listUsers: (req: NileRequest<void> | Headers, init?: RequestInit) => Promise<User[] | Response>;
|
|
40
40
|
linkUser: (req: NileRequest<{
|
|
41
41
|
id: string;
|
|
42
|
-
}> | Headers, init?: RequestInit) =>
|
|
42
|
+
}> | Headers, init?: RequestInit) => Promise<User | Response>;
|
|
43
43
|
tenantUsersDeleteUrl: (userId?: string) => string;
|
|
44
44
|
getUserId: (req: Headers | NileRequest<{
|
|
45
45
|
id: string;
|
|
46
46
|
}>) => Promise<any>;
|
|
47
47
|
unlinkUser: (req: NileRequest<{
|
|
48
48
|
id: string;
|
|
49
|
-
}> | Headers, init?: RequestInit) =>
|
|
49
|
+
}> | Headers, init?: RequestInit) => Promise<User[] | Response>;
|
|
50
50
|
get meUrl(): string;
|
|
51
|
-
me: (req: NileRequest<void
|
|
51
|
+
me: (req: NileRequest<void> | Headers, init?: RequestInit) => Promise<User | Response>;
|
|
52
52
|
}
|
|
@@ -5,7 +5,7 @@ export default class Requester<T> extends Config {
|
|
|
5
5
|
constructor(config: Config);
|
|
6
6
|
rawRequest(method: Methods, url: string, init: RequestInit, body?: string): Promise<Response>;
|
|
7
7
|
/**
|
|
8
|
-
* three
|
|
8
|
+
* three options here
|
|
9
9
|
* 1) pass in headers for a server side request
|
|
10
10
|
* 2) pass in the payload that matches the api
|
|
11
11
|
* 3) pass in the request object sent by a browser
|
|
@@ -16,8 +16,8 @@ export default class Requester<T> extends Config {
|
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
18
|
protected request(method: Methods, url: string, req: T | Headers, init?: RequestInit): Promise<Response>;
|
|
19
|
-
post
|
|
20
|
-
get
|
|
21
|
-
put
|
|
22
|
-
delete
|
|
19
|
+
post<R = JSON>(req: T | Headers, url: string, init?: RequestInit): Promise<Response | R>;
|
|
20
|
+
get<R = JSON>(req: T | Headers, url: string, init?: RequestInit): Promise<Response | R>;
|
|
21
|
+
put<R = JSON>(req: T | Headers, url: string, init?: RequestInit): Promise<Response | R>;
|
|
22
|
+
delete<R = JSON>(req: T | Headers, url: string, init?: RequestInit): Promise<Response | R>;
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niledatabase/server",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/server.esm.js",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"jose": "^4.15.4",
|
|
75
75
|
"pg": "^8.11.3"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "bd0c6918a744feaf883b7dab6d5b076a4a0585a1"
|
|
78
78
|
}
|