ingeniuscliq-core 0.5.56 → 0.5.57
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/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts.map +1 -1
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +36 -0
- package/dist/modules/CoreAuth/services/base.d.ts +16 -0
- package/dist/modules/CoreAuth/services/base.d.ts.map +1 -1
- package/dist/modules/CoreAuth/services/base.js +12 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreAuthBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/classes/CoreAuthBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAiD,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,eAAe,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAClI,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,YAAY,EAKjB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGlE,WAAW,GAAE,mBAAmB,CAAC,CAAC,CAAgC,EAClE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"CoreAuthBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/classes/CoreAuthBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAiD,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,eAAe,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAClI,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,YAAY,EAKjB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGlE,WAAW,GAAE,mBAAmB,CAAC,CAAC,CAAgC,EAClE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IA+O3C,KAAK;;;;;;;;;;;;;;;;;CAeb"}
|
|
@@ -182,6 +182,42 @@ class CoreAuthBuilder extends CoreBaseBuilder {
|
|
|
182
182
|
onFinish();
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
|
+
forgotPassword: async (data, actions) => {
|
|
186
|
+
const { onSuccess = () => {
|
|
187
|
+
}, onError = () => {
|
|
188
|
+
}, onFinish = () => {
|
|
189
|
+
} } = actions || {};
|
|
190
|
+
try {
|
|
191
|
+
set({ loading: true, error: null });
|
|
192
|
+
const response = await this.authService.forgotPassword(data);
|
|
193
|
+
set({ loading: false });
|
|
194
|
+
onSuccess(response);
|
|
195
|
+
return response.data;
|
|
196
|
+
} catch (error) {
|
|
197
|
+
set({ loading: false, error });
|
|
198
|
+
onError(error);
|
|
199
|
+
} finally {
|
|
200
|
+
onFinish();
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
resetPassword: async (data, actions) => {
|
|
204
|
+
const { onSuccess = () => {
|
|
205
|
+
}, onError = () => {
|
|
206
|
+
}, onFinish = () => {
|
|
207
|
+
} } = actions || {};
|
|
208
|
+
try {
|
|
209
|
+
set({ loading: true, error: null });
|
|
210
|
+
const response = await this.authService.resetPassword(data);
|
|
211
|
+
set({ loading: false });
|
|
212
|
+
onSuccess(response);
|
|
213
|
+
return response.data;
|
|
214
|
+
} catch (error) {
|
|
215
|
+
set({ loading: false, error });
|
|
216
|
+
onError(error);
|
|
217
|
+
} finally {
|
|
218
|
+
onFinish();
|
|
219
|
+
}
|
|
220
|
+
},
|
|
185
221
|
// Reset
|
|
186
222
|
reset: () => set({ ...this.initialState, ...this.extendInitialState() })
|
|
187
223
|
};
|
|
@@ -46,6 +46,22 @@ export declare class CoreAuthBaseService<T extends CoreUser> extends BaseService
|
|
|
46
46
|
* Delete own account
|
|
47
47
|
*/
|
|
48
48
|
deleteOwnAccount: () => Promise<import('axios').AxiosResponse<BaseApiResponse<null>, any>>;
|
|
49
|
+
/**
|
|
50
|
+
* Send password reset link
|
|
51
|
+
*/
|
|
52
|
+
forgotPassword(data: {
|
|
53
|
+
email: string;
|
|
54
|
+
source?: 'store' | 'backoffice';
|
|
55
|
+
}): Promise<import('axios').AxiosResponse<BaseApiResponse<null>, any>>;
|
|
56
|
+
/**
|
|
57
|
+
* Reset password with token
|
|
58
|
+
*/
|
|
59
|
+
resetPassword(data: {
|
|
60
|
+
email: string;
|
|
61
|
+
password: string;
|
|
62
|
+
password_confirmation: string;
|
|
63
|
+
token: string;
|
|
64
|
+
}): Promise<import('axios').AxiosResponse<BaseApiResponse<null>, any>>;
|
|
49
65
|
}
|
|
50
66
|
export {};
|
|
51
67
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/services/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClK,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,QAAQ,CAAE,SAAQ,WAAW;IACtE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;gBAGtC,MAAM,GAAE,cAKP,EACD,GAAG,CAAC,EAAE,aAAa;IAMrB;;OAEG;IACH,OAAO;IAIP;;OAEG;IACH,KAAK,CAAC,CAAC,SAAS,oBAAoB,EAAE,WAAW,EAAE,CAAC;IAIpD;;OAEG;IACH,QAAQ,CAAC,CAAC,SAAS,uBAAuB,EAAE,WAAW,EAAE,CAAC;IAI1D;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,kBAAkB;IAIlC;;OAEG;IACH,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IAIxC;;OAEG;IACH,cAAc,CAAC,YAAY,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAA;KAAE;IAI1G;;OAEG;IACH,gBAAgB,2EAEd;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/services/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aA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I,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;CAGtG"}
|
|
@@ -54,6 +54,18 @@ class CoreAuthBaseService extends BaseService {
|
|
|
54
54
|
deleteOwnAccount = () => {
|
|
55
55
|
return this.api.delete(`${this.apiPrefix}/users/delete-account`);
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Send password reset link
|
|
59
|
+
*/
|
|
60
|
+
forgotPassword(data) {
|
|
61
|
+
return this.api.post(`${this.apiPrefix}/password/forgot`, data);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reset password with token
|
|
65
|
+
*/
|
|
66
|
+
resetPassword(data) {
|
|
67
|
+
return this.api.post(`${this.apiPrefix}/password/reset`, data);
|
|
68
|
+
}
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
export { CoreAuthBaseService };
|