@colior115/all-connected-be-sdk 1.0.27 → 1.0.28
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/clients/user.client.ts +7 -1
- package/src/types.ts +10 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { request, SdkConfig } from "../http";
|
|
2
|
-
import { UserDTO, CreateUserInputDTO, UpdateUserInputDTO, UserSystemRole } from "../types";
|
|
2
|
+
import { UserDTO, CreateUserInputDTO, UpdateUserInputDTO, UserSystemRole, UserSettings, UpdateUserSettingsInputDTO } from "../types";
|
|
3
3
|
|
|
4
4
|
export const createUserClient = (config: SdkConfig) => ({
|
|
5
5
|
get: (id: string) =>
|
|
@@ -22,4 +22,10 @@ export const createUserClient = (config: SdkConfig) => ({
|
|
|
22
22
|
|
|
23
23
|
claimAccount: () =>
|
|
24
24
|
request<UserDTO>(config, "/api/user/claim", { method: "POST" }),
|
|
25
|
+
|
|
26
|
+
getSettings: () =>
|
|
27
|
+
request<UserSettings>(config, "/api/user/settings"),
|
|
28
|
+
|
|
29
|
+
updateSettings: (input: UpdateUserSettingsInputDTO) =>
|
|
30
|
+
request<UserSettings>(config, "/api/user/settings", { method: "PUT", body: input }),
|
|
25
31
|
});
|
package/src/types.ts
CHANGED
|
@@ -9,16 +9,24 @@ export type Gender = "male" | "female" | "other";
|
|
|
9
9
|
|
|
10
10
|
// ── User ──────────────────────────────────────────────────────────────────────
|
|
11
11
|
|
|
12
|
+
export type UserSettings = {
|
|
13
|
+
theme: "light" | "dark";
|
|
14
|
+
lang: "en" | "he";
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type UpdateUserSettingsInputDTO = Partial<UserSettings>;
|
|
18
|
+
|
|
12
19
|
export type UserDTO = {
|
|
13
20
|
id: string;
|
|
14
21
|
firstName: string;
|
|
15
22
|
lastName: string;
|
|
16
23
|
email: string;
|
|
17
24
|
role: UserSystemRole;
|
|
25
|
+
settings: UserSettings;
|
|
18
26
|
};
|
|
19
27
|
|
|
20
|
-
export type CreateUserInputDTO = Omit<UserDTO, "id">;
|
|
21
|
-
export type UpdateUserInputDTO = Partial<
|
|
28
|
+
export type CreateUserInputDTO = Omit<UserDTO, "id" | "settings">;
|
|
29
|
+
export type UpdateUserInputDTO = Partial<Omit<UserDTO, "id" | "settings">>;
|
|
22
30
|
|
|
23
31
|
// ── Business ──────────────────────────────────────────────────────────────────
|
|
24
32
|
|