@go-avro/avro-js 0.0.2-beta.88 → 0.0.2-beta.89

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.
@@ -270,6 +270,13 @@ export declare class AvroQueryClient {
270
270
  email?: string;
271
271
  cancelToken?: CancelToken;
272
272
  }>>;
273
+ useUpdatePassword(): ReturnType<typeof useMutation<void, StandardError, {
274
+ username?: string;
275
+ email?: string;
276
+ code: string;
277
+ newPassword: string;
278
+ cancelToken?: CancelToken;
279
+ }>>;
273
280
  useGoogleLogin(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
274
281
  token: string;
275
282
  cancelToken?: CancelToken;
@@ -115,6 +115,20 @@ export class AvroQueryClient {
115
115
  }
116
116
  });
117
117
  }
118
+ useUpdatePassword() {
119
+ const queryClient = useQueryClient();
120
+ return useMutation({
121
+ mutationFn: async ({ username, email, code, newPassword, cancelToken }) => {
122
+ await this.post('/update-password', JSON.stringify({ username, email, code, password: newPassword }), cancelToken, { 'Content-Type': 'application/json' });
123
+ },
124
+ onSettled: () => {
125
+ queryClient.invalidateQueries();
126
+ },
127
+ onError: (err) => {
128
+ throw new StandardError(err.status, err.message || 'Update password failed');
129
+ }
130
+ });
131
+ }
118
132
  useGoogleLogin() {
119
133
  const queryClient = useQueryClient();
120
134
  return useMutation({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.88",
3
+ "version": "0.0.2-beta.89",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",