@taruvi/sdk 1.2.7 → 1.2.8
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/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/lib/user/UserClient.ts +2 -2
- package/src/lib/user/types.ts +39 -32
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -16,9 +16,9 @@ export { Analytics } from "./lib/Analytics/AnalyticsClient.js"
|
|
|
16
16
|
// Export types
|
|
17
17
|
export type { TaruviConfig, StorageFilters, DatabaseFilters } from "./types.js"
|
|
18
18
|
export type { AuthTokens } from "./lib-internal/token/TokenClient.js"
|
|
19
|
-
export type { UserCreateRequest, UserCreateResponse as UserResponse, UserDataResponse } from "./lib/user/types.js"
|
|
19
|
+
export type { UserCreateRequest, UserCreateResponse as UserResponse, UserDataResponse, UserUpdateRequest, UserUpdateResponse } from "./lib/user/types.js"
|
|
20
20
|
export type { Principal, Resource, Resources } from "./lib/Policy/types.js"
|
|
21
|
-
export type { RoleResponse } from "./lib/App/types.js"
|
|
21
|
+
export type { RoleResponse, SettingsResponse as AppSettingsResponse } from "./lib/App/types.js"
|
|
22
22
|
export type { FunctionRequest, FunctionResponse, FunctionInvocation } from "./lib/Function/types.js"
|
|
23
23
|
export type { DatabaseRequest, DatabaseResponse, FilterOperator, SortOrder } from "./lib/Database/types.js"
|
|
24
24
|
export type { StorageRequest, StorageUpdateRequest, StorageResponse } from "./lib/Storage/types.js"
|
|
@@ -21,8 +21,8 @@ export class User {
|
|
|
21
21
|
return await this.client.httpClient.put(UserRoutes.updateUser(username), body)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async getUser(username: string
|
|
25
|
-
return await this.client.httpClient.
|
|
24
|
+
async getUser(username: string): Promise<UserDataResponse> {
|
|
25
|
+
return await this.client.httpClient.get<UserDataResponse>(UserRoutes.getUser(username))
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async list(filters: UserList) {
|
package/src/lib/user/types.ts
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
export interface UserCreateRequest {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
// Required fields
|
|
3
|
+
username: string
|
|
4
|
+
email: string
|
|
5
|
+
first_name: string
|
|
6
|
+
last_name: string
|
|
7
|
+
// Optional fields
|
|
8
|
+
password?: string
|
|
9
|
+
confirm_password?: string
|
|
10
|
+
is_active?: boolean
|
|
11
|
+
is_staff?: boolean
|
|
12
|
+
attributes?: string
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export interface UserCreateResponse {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
id: number
|
|
17
|
+
uuid: string
|
|
18
|
+
username: string
|
|
19
|
+
email: string
|
|
20
|
+
first_name: string
|
|
21
|
+
last_name: string
|
|
22
|
+
is_active: boolean
|
|
23
|
+
is_staff: boolean
|
|
24
|
+
is_superuser: boolean
|
|
25
|
+
is_deleted: boolean
|
|
26
|
+
date_joined: string
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export interface UserDataResponse {
|
|
@@ -36,25 +42,26 @@ export interface UserDataResponse {
|
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
export interface UserUpdateRequest {
|
|
39
|
-
username?: string
|
|
40
|
-
email?: string
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
is_active?: boolean,
|
|
46
|
-
is_staff?: boolean,
|
|
47
|
-
attributes?: string
|
|
45
|
+
username?: string
|
|
46
|
+
email?: string
|
|
47
|
+
first_name?: string
|
|
48
|
+
last_name?: string
|
|
49
|
+
is_active?: boolean
|
|
50
|
+
is_staff?: boolean
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export interface UserUpdateResponse {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
id: number
|
|
55
|
+
uuid: string
|
|
56
|
+
username: string
|
|
57
|
+
email: string
|
|
58
|
+
first_name: string
|
|
59
|
+
last_name: string
|
|
60
|
+
is_active: boolean
|
|
61
|
+
is_staff: boolean
|
|
62
|
+
is_superuser: boolean
|
|
63
|
+
is_deleted: boolean
|
|
64
|
+
date_joined: string
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
export interface UserList {
|