@go-avro/avro-js 0.0.70 → 0.0.71
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/auth/AuthManager.js
CHANGED
|
@@ -78,9 +78,12 @@ export class AuthManager {
|
|
|
78
78
|
const newTokens = await response.json();
|
|
79
79
|
return newTokens;
|
|
80
80
|
}
|
|
81
|
+
if (response.status === 401 || response.status === 422) {
|
|
82
|
+
storage.clear();
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
|
-
catch
|
|
83
|
-
|
|
85
|
+
catch {
|
|
86
|
+
console.error('Error refreshing tokens from storage:', storage);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
throw new StandardError(410, 'Failed to refresh tokens from all storages');
|
|
@@ -695,6 +695,8 @@ export declare class AvroQueryClient {
|
|
|
695
695
|
getAuthState(): AuthState;
|
|
696
696
|
getAuthStateAsync(): Promise<AuthState>;
|
|
697
697
|
getQueryClient(): QueryClient;
|
|
698
|
+
attachQueryClient(queryClient: QueryClient): void;
|
|
699
|
+
peekQueryClient(): QueryClient | null;
|
|
698
700
|
_syncEntity(queryClient: QueryClient, params: {
|
|
699
701
|
action: 'create' | 'update' | 'delete';
|
|
700
702
|
entityKey: string;
|
|
@@ -464,8 +464,7 @@ export class AvroQueryClient {
|
|
|
464
464
|
* (old backend), we fall back to full invalidation.
|
|
465
465
|
*/
|
|
466
466
|
setupSocketInvalidation(queryClient) {
|
|
467
|
-
|
|
468
|
-
if (this._queryClient)
|
|
467
|
+
if (this._socketInvalidationCleanup)
|
|
469
468
|
return;
|
|
470
469
|
this._queryClient = queryClient;
|
|
471
470
|
const handlers = [];
|
|
@@ -773,6 +772,12 @@ export class AvroQueryClient {
|
|
|
773
772
|
getQueryClient() {
|
|
774
773
|
return useQueryClient();
|
|
775
774
|
}
|
|
775
|
+
attachQueryClient(queryClient) {
|
|
776
|
+
this._queryClient ?? (this._queryClient = queryClient);
|
|
777
|
+
}
|
|
778
|
+
peekQueryClient() {
|
|
779
|
+
return this._queryClient;
|
|
780
|
+
}
|
|
776
781
|
async _syncEntity(queryClient, params) {
|
|
777
782
|
const { action, entityKey, id, fetchPath, construct, matchesQuery } = params;
|
|
778
783
|
const predicate = (q) => matchesEntityKey(q, entityKey);
|
|
@@ -7,7 +7,9 @@ import { Job } from '../../types/api/Job';
|
|
|
7
7
|
* location task) where the socket is usually down — sync directly.
|
|
8
8
|
*/
|
|
9
9
|
const syncCheckinCaches = async (client, jobId) => {
|
|
10
|
-
const queryClient = client.
|
|
10
|
+
const queryClient = client.peekQueryClient();
|
|
11
|
+
if (!queryClient)
|
|
12
|
+
return;
|
|
11
13
|
queryClient.invalidateQueries({ queryKey: ['checkins'] });
|
|
12
14
|
if (!jobId)
|
|
13
15
|
return;
|
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.71";
|
package/dist/version.js
CHANGED