@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taruvi/sdk",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Taruvi SDK",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
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, body: UserUpdateRequest): Promise<UserCreateResponse> {
25
- return await this.client.httpClient.put(UserRoutes.getUser(username), body)
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) {
@@ -1,23 +1,29 @@
1
1
  export interface UserCreateRequest {
2
- username: string,
3
- email: string,
4
- password: string,
5
- confirm_password: string,
6
- first_name: string,
7
- last_name: string,
8
- is_active: boolean,
9
- is_staff: boolean,
10
- attributes: string
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
- username: string,
15
- email: string,
16
- first_name: string,
17
- last_name: string,
18
- is_active: boolean,
19
- is_staff: boolean,
20
- attributes: string
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
- password?: string,
42
- confirm_password?: string,
43
- first_name?: string,
44
- last_name?: string,
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
- username: string,
52
- email: string,
53
- first_name: string,
54
- last_name: string,
55
- is_active: boolean,
56
- is_staff: boolean,
57
- attributes: string
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 {