@nocobase/sdk 1.7.19 → 1.8.0-alpha.10
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/lib/APIClient.d.ts +3 -0
- package/lib/APIClient.js +32 -0
- package/package.json +2 -2
package/lib/APIClient.d.ts
CHANGED
|
@@ -98,6 +98,9 @@ export declare class Auth {
|
|
|
98
98
|
signIn(values: any, authenticator?: string): Promise<AxiosResponse<any>>;
|
|
99
99
|
signUp(values: any, authenticator?: string): Promise<AxiosResponse<any>>;
|
|
100
100
|
signOut(): Promise<AxiosResponse<any, any>>;
|
|
101
|
+
lostPassword(values: any): Promise<AxiosResponse<any>>;
|
|
102
|
+
resetPassword(values: any): Promise<AxiosResponse<any>>;
|
|
103
|
+
checkResetToken(values: any): Promise<AxiosResponse<any>>;
|
|
101
104
|
}
|
|
102
105
|
export declare abstract class Storage {
|
|
103
106
|
abstract clear(): void;
|
package/lib/APIClient.js
CHANGED
|
@@ -232,6 +232,38 @@ const _Auth = class _Auth {
|
|
|
232
232
|
this.setAuthenticator(null);
|
|
233
233
|
return response;
|
|
234
234
|
}
|
|
235
|
+
async lostPassword(values) {
|
|
236
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
237
|
+
const paramsObject = Object.fromEntries(searchParams.entries());
|
|
238
|
+
const response = await this.api.request({
|
|
239
|
+
method: "post",
|
|
240
|
+
url: "auth:lostPassword",
|
|
241
|
+
data: {
|
|
242
|
+
...values,
|
|
243
|
+
baseURL: window.location.href.split("/forgot-password")[0]
|
|
244
|
+
},
|
|
245
|
+
headers: {
|
|
246
|
+
"X-Authenticator": paramsObject.name
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return response;
|
|
250
|
+
}
|
|
251
|
+
async resetPassword(values) {
|
|
252
|
+
const response = await this.api.request({
|
|
253
|
+
method: "post",
|
|
254
|
+
url: "auth:resetPassword",
|
|
255
|
+
data: values
|
|
256
|
+
});
|
|
257
|
+
return response;
|
|
258
|
+
}
|
|
259
|
+
async checkResetToken(values) {
|
|
260
|
+
const response = await this.api.request({
|
|
261
|
+
method: "post",
|
|
262
|
+
url: "auth:checkResetToken",
|
|
263
|
+
data: values
|
|
264
|
+
});
|
|
265
|
+
return response;
|
|
266
|
+
}
|
|
235
267
|
};
|
|
236
268
|
__name(_Auth, "Auth");
|
|
237
269
|
let Auth = _Auth;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-alpha.10",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"axios-mock-adapter": "^1.20.0"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "31b2895b847f6998492e20bb923c2791e896951d"
|
|
15
15
|
}
|