@go-avro/avro-js 0.0.97 → 0.0.99
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.
|
@@ -632,7 +632,7 @@ export class AvroQueryClient {
|
|
|
632
632
|
},
|
|
633
633
|
onError: (err) => {
|
|
634
634
|
this.config.authManager.clearCache();
|
|
635
|
-
|
|
635
|
+
console.error('Login failed:', err);
|
|
636
636
|
},
|
|
637
637
|
});
|
|
638
638
|
}
|
|
@@ -652,7 +652,7 @@ export class AvroQueryClient {
|
|
|
652
652
|
queryClient.invalidateQueries();
|
|
653
653
|
},
|
|
654
654
|
onError: (err) => {
|
|
655
|
-
|
|
655
|
+
console.error('Request code failed:', err);
|
|
656
656
|
},
|
|
657
657
|
});
|
|
658
658
|
}
|
|
@@ -671,7 +671,7 @@ export class AvroQueryClient {
|
|
|
671
671
|
queryClient.invalidateQueries();
|
|
672
672
|
},
|
|
673
673
|
onError: (err) => {
|
|
674
|
-
|
|
674
|
+
console.error('Update password failed:', err);
|
|
675
675
|
},
|
|
676
676
|
});
|
|
677
677
|
}
|
|
@@ -702,7 +702,7 @@ export class AvroQueryClient {
|
|
|
702
702
|
},
|
|
703
703
|
onError: (err) => {
|
|
704
704
|
this.config.authManager.clearCache();
|
|
705
|
-
|
|
705
|
+
console.error('Google Login failed:', err);
|
|
706
706
|
},
|
|
707
707
|
});
|
|
708
708
|
}
|
|
@@ -733,7 +733,7 @@ export class AvroQueryClient {
|
|
|
733
733
|
},
|
|
734
734
|
onError: (err) => {
|
|
735
735
|
this.config.authManager.clearCache();
|
|
736
|
-
|
|
736
|
+
console.error('Apple Login failed:', err);
|
|
737
737
|
},
|
|
738
738
|
});
|
|
739
739
|
}
|
|
@@ -794,7 +794,9 @@ export class AvroQueryClient {
|
|
|
794
794
|
return this.config.authManager.isAuthenticated();
|
|
795
795
|
}
|
|
796
796
|
getQueryClient() {
|
|
797
|
-
|
|
797
|
+
const queryClient = useQueryClient();
|
|
798
|
+
this._queryClient ?? (this._queryClient = queryClient);
|
|
799
|
+
return queryClient;
|
|
798
800
|
}
|
|
799
801
|
attachQueryClient(queryClient) {
|
|
800
802
|
this._queryClient ?? (this._queryClient = queryClient);
|
|
@@ -911,7 +913,7 @@ export class AvroQueryClient {
|
|
|
911
913
|
if (this.socket && this.socket.connected) {
|
|
912
914
|
this.socket.disconnect();
|
|
913
915
|
}
|
|
914
|
-
this.
|
|
916
|
+
this.peekQueryClient()?.removeQueries();
|
|
915
917
|
}
|
|
916
918
|
useLogout() {
|
|
917
919
|
return useMutation({
|
|
@@ -922,13 +924,17 @@ export class AvroQueryClient {
|
|
|
922
924
|
cancelToken,
|
|
923
925
|
});
|
|
924
926
|
}
|
|
927
|
+
catch (err) {
|
|
928
|
+
throw err instanceof StandardError
|
|
929
|
+
? err
|
|
930
|
+
: new StandardError(500, 'Logout failed');
|
|
931
|
+
}
|
|
925
932
|
finally {
|
|
926
933
|
await this.forceLogout();
|
|
927
934
|
}
|
|
928
935
|
},
|
|
929
936
|
onError: (err) => {
|
|
930
937
|
console.error('Logout failed:', err);
|
|
931
|
-
throw new StandardError(500, 'Logout failed');
|
|
932
938
|
},
|
|
933
939
|
});
|
|
934
940
|
}
|
|
@@ -19,6 +19,7 @@ AvroQueryClient.prototype.useFinanceAnalytics = function ({ periods, cumulative,
|
|
|
19
19
|
'Content-Type': 'application/json',
|
|
20
20
|
},
|
|
21
21
|
}),
|
|
22
|
+
enabled: Boolean(this.companyId),
|
|
22
23
|
});
|
|
23
24
|
};
|
|
24
25
|
AvroQueryClient.prototype.useBillAnalytics = function ({ periods, cumulative, }) {
|
|
@@ -2,10 +2,11 @@ import { useMutation, useQuery, useInfiniteQuery } from '@tanstack/react-query';
|
|
|
2
2
|
import { AvroQueryClient } from '../../client/QueryClient';
|
|
3
3
|
import { Job } from '../../types/api';
|
|
4
4
|
AvroQueryClient.prototype.getJobsFromCache = function (queryClient) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const client = queryClient ?? this.peekQueryClient();
|
|
6
|
+
if (!client) {
|
|
7
|
+
return [];
|
|
7
8
|
}
|
|
8
|
-
return
|
|
9
|
+
return client.getQueryData(['jobs', this.companyId, this.company?.num_jobs]) ?? [];
|
|
9
10
|
};
|
|
10
11
|
AvroQueryClient.prototype.useGetJobs = function (params) {
|
|
11
12
|
const queryClient = this.getQueryClient();
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AVRO_JS_VERSION = "0.0.
|
|
1
|
+
export declare const AVRO_JS_VERSION = "0.0.99";
|
package/dist/version.js
CHANGED