@temboplus/afloat 0.1.37 → 0.1.39
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/esm/src/features/admin/contract.d.ts +129 -135
- package/esm/src/features/admin/contract.d.ts.map +1 -1
- package/esm/src/features/admin/contract.js +57 -29
- package/esm/src/features/admin/repository.d.ts +17 -3
- package/esm/src/features/admin/repository.d.ts.map +1 -1
- package/esm/src/features/admin/repository.js +21 -7
- package/package.json +1 -1
- package/script/src/features/admin/contract.d.ts +129 -135
- package/script/src/features/admin/contract.d.ts.map +1 -1
- package/script/src/features/admin/contract.js +57 -29
- package/script/src/features/admin/repository.d.ts +17 -3
- package/script/src/features/admin/repository.d.ts.map +1 -1
- package/script/src/features/admin/repository.js +21 -7
|
@@ -39,11 +39,23 @@ export declare class UserManagementRepository extends BaseRepository<typeof user
|
|
|
39
39
|
/**
|
|
40
40
|
* Archives (soft deletes) a user account by ID.
|
|
41
41
|
* @param {string} id - The unique identifier of the user account to archive.
|
|
42
|
-
* @returns {Promise<
|
|
42
|
+
* @returns {Promise<{ isArchived: boolean }>} A promise that resolves to whether isArchived.
|
|
43
43
|
* @throws {PermissionError} If the user lacks required permissions
|
|
44
44
|
* @throws {APIError} If the response status code is not 200.
|
|
45
45
|
*/
|
|
46
|
-
archiveUser(id: string): Promise<
|
|
46
|
+
archiveUser(id: string): Promise<{
|
|
47
|
+
isArchived: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Archives (soft deletes) a user account by ID.
|
|
51
|
+
* @param {string} id - The unique identifier of the user account to archive.
|
|
52
|
+
* @returns {Promise<{ isArchived: boolean }>} A promise that resolves to whether isArchived.
|
|
53
|
+
* @throws {PermissionError} If the user lacks required permissions
|
|
54
|
+
* @throws {APIError} If the response status code is not 200.
|
|
55
|
+
*/
|
|
56
|
+
unArchiveUser(id: string): Promise<{
|
|
57
|
+
isArchived: boolean;
|
|
58
|
+
}>;
|
|
47
59
|
/**
|
|
48
60
|
* Resets a user's password.
|
|
49
61
|
* @param {string} id - The unique identifier of the user account.
|
|
@@ -52,7 +64,9 @@ export declare class UserManagementRepository extends BaseRepository<typeof user
|
|
|
52
64
|
* @throws {PermissionError} If the user lacks required permissions
|
|
53
65
|
* @throws {APIError} If the response status code is not 200.
|
|
54
66
|
*/
|
|
55
|
-
resetUserPassword(id: string, input?: ResetPasswordRequest): Promise<
|
|
67
|
+
resetUserPassword(id: string, input?: ResetPasswordRequest): Promise<{
|
|
68
|
+
success: boolean;
|
|
69
|
+
}>;
|
|
56
70
|
/**
|
|
57
71
|
* Retrieves all user accounts.
|
|
58
72
|
* Results are ordered in descending order by creation date by default.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/admin/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EAGZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAiB,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,wBACX,SAAQ,cAAc,CAAC,OAAO,sBAAsB,CAAC;IACrD;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAIxD;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBvE;;;;;;;OAOG;IACG,UAAU,CAAC,EAAE,EAAE,MA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AAiB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,oBAAyB,GAC/B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAkBhC;;;;;;;;;;OAUG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAgB3C;;;;;;;;;;OAUG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAuB/C;;;;;;;;;OASG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAsBpC;;;;;;;;;;OAUG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmBzC"}
|
|
@@ -71,7 +71,7 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
71
71
|
/**
|
|
72
72
|
* Archives (soft deletes) a user account by ID.
|
|
73
73
|
* @param {string} id - The unique identifier of the user account to archive.
|
|
74
|
-
* @returns {Promise<
|
|
74
|
+
* @returns {Promise<{ isArchived: boolean }>} A promise that resolves to whether isArchived.
|
|
75
75
|
* @throws {PermissionError} If the user lacks required permissions
|
|
76
76
|
* @throws {APIError} If the response status code is not 200.
|
|
77
77
|
*/
|
|
@@ -85,12 +85,26 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
const result = await this.client.archiveUser({ params: { id } });
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
return this.handleResponse(result, 200);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Archives (soft deletes) a user account by ID.
|
|
92
|
+
* @param {string} id - The unique identifier of the user account to archive.
|
|
93
|
+
* @returns {Promise<{ isArchived: boolean }>} A promise that resolves to whether isArchived.
|
|
94
|
+
* @throws {PermissionError} If the user lacks required permissions
|
|
95
|
+
* @throws {APIError} If the response status code is not 200.
|
|
96
|
+
*/
|
|
97
|
+
async unArchiveUser(id) {
|
|
98
|
+
const auth = this.getAuthForPermissionCheck();
|
|
99
|
+
const requiredPerm = index_js_1.Permissions.UserManagement.ArchiveUser;
|
|
100
|
+
if (!auth.checkPermission(requiredPerm)) {
|
|
101
|
+
throw new index_js_2.PermissionError({
|
|
102
|
+
message: "You are not authorized to un-archive user accounts.",
|
|
103
|
+
requiredPermissions: [requiredPerm],
|
|
104
|
+
});
|
|
92
105
|
}
|
|
93
|
-
|
|
106
|
+
const result = await this.client.unarchiveUser({ params: { id } });
|
|
107
|
+
return this.handleResponse(result, 200);
|
|
94
108
|
}
|
|
95
109
|
/**
|
|
96
110
|
* Resets a user's password.
|
|
@@ -113,7 +127,7 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
113
127
|
params: { id },
|
|
114
128
|
body: input,
|
|
115
129
|
});
|
|
116
|
-
this.handleResponse(result, 200);
|
|
130
|
+
return this.handleResponse(result, 200);
|
|
117
131
|
}
|
|
118
132
|
/**
|
|
119
133
|
* Retrieves all user accounts.
|