@go-avro/avro-js 0.1.12 → 0.1.14

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.
@@ -483,8 +483,10 @@ export class AvroQueryClient {
483
483
  this.authStateListeners = this.authStateListeners.filter((c) => c !== cb);
484
484
  }
485
485
  setAuthState(state) {
486
- this.authStateListeners.forEach((cb) => cb(state));
486
+ // Store before notifying so listeners that read getAuthState()
487
+ // (e.g. useSyncExternalStore snapshots) see the new value.
487
488
  this._authState = state;
489
+ this.authStateListeners.forEach((cb) => cb(state));
488
490
  }
489
491
  getAuthState() {
490
492
  return this._authState;
package/dist/index.d.ts CHANGED
@@ -43,6 +43,7 @@ import './client/hooks/email.js';
43
43
  export { defaultPassOnFeeMethod } from './billing/fees.js';
44
44
  export { reverseGeocode } from './geocode.js';
45
45
  export { fetchCensusFeatures } from './census.js';
46
+ export { getDegradedServices } from './serviceStatus.js';
46
47
  export { LOCATION_STALE_MINUTES, LOCATION_RECENT_HOURS, isLocationRecent, REPORTING_STATUSES, locationAgeMinutes, isLocationStale, isReportingStatus, isMobileDevice, mobileDevices, userPresence, } from './presence.js';
47
48
  export type { UserPresence } from './presence.js';
48
49
  export type { ReverseGeocodeResult } from './geocode.js';
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ import './client/hooks/email.js';
40
40
  export { defaultPassOnFeeMethod } from './billing/fees.js';
41
41
  export { reverseGeocode } from './geocode.js';
42
42
  export { fetchCensusFeatures } from './census.js';
43
+ export { getDegradedServices } from './serviceStatus.js';
43
44
  export { LOCATION_STALE_MINUTES, LOCATION_RECENT_HOURS, isLocationRecent, REPORTING_STATUSES, locationAgeMinutes, isLocationStale, isReportingStatus, isMobileDevice, mobileDevices, userPresence, } from './presence.js';
44
45
  export * from './types/api.js';
45
46
  export * from './types/auth.js';
@@ -0,0 +1,7 @@
1
+ import type { ApiInfo } from './types/api.js';
2
+ /**
3
+ * Display names of the core services the API root reports as anything
4
+ * but ready. A missing `apiInfo` (the root request failed) reports every
5
+ * service, since none of them can be confirmed up.
6
+ */
7
+ export declare const getDegradedServices: (apiInfo: ApiInfo | undefined) => string[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Display names of the core services the API root reports as anything
3
+ * but ready. A missing `apiInfo` (the root request failed) reports every
4
+ * service, since none of them can be confirmed up.
5
+ */
6
+ export const getDegradedServices = (apiInfo) => [
7
+ apiInfo?.db_status !== 'ready' && 'Database',
8
+ apiInfo?.pelias_status !== 'ready' && 'Geocoding',
9
+ apiInfo?.vroom_status !== 'ready' && 'Optimization',
10
+ apiInfo?.ors_status !== 'ready' && 'Routing',
11
+ ].filter((s) => Boolean(s));
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "0.1.12";
1
+ export declare const AVRO_JS_VERSION = "0.1.14";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '0.1.12';
3
+ export const AVRO_JS_VERSION = '0.1.14';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",