@go-avro/avro-js 0.0.2-beta.47 → 0.0.2-beta.48

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.
@@ -1,6 +1,6 @@
1
- import { InfiniteData, UseInfiniteQueryResult, useMutation, useQuery, UseQueryResult } from '@tanstack/react-query';
1
+ import { InfiniteData, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
2
2
  import { AuthManager } from '../auth/AuthManager';
3
- import { _Event, Bill, Company, Job, LineItem, Route, ServiceMonth, Session, User } from '../types/api';
3
+ import { _Event, ApiInfo, Bill, Company, Job, LineItem, Route, ServiceMonth, Session, User } from '../types/api';
4
4
  import { CancelToken, RetryStrategy } from '../types/client';
5
5
  import { StandardError } from '../types/error';
6
6
  export interface AvroQueryClientConfig {
@@ -15,7 +15,7 @@ declare module '../client/QueryClient' {
15
15
  _xhr<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number): Promise<T>;
16
16
  _fetch<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number): Promise<T>;
17
17
  getDelay(strategy: RetryStrategy, attempt: number): number;
18
- useGetRoot(): ReturnType<typeof useQuery>;
18
+ useGetRoot(): UseQueryResult<ApiInfo, StandardError>;
19
19
  useGetJobs(companyGuid: string, body: {
20
20
  amt?: number;
21
21
  query?: string;
@@ -3,6 +3,6 @@ import { AvroQueryClient } from '../../client/QueryClient';
3
3
  AvroQueryClient.prototype.useGetRoot = function () {
4
4
  return useQuery({
5
5
  queryKey: ['health'],
6
- queryFn: () => this.get('/', undefined) // your async fetch function
6
+ queryFn: () => this.get('/'),
7
7
  });
8
8
  };
@@ -1,3 +1,12 @@
1
+ export interface ApiInfo {
2
+ app_semver: string;
3
+ db_healthy: boolean;
4
+ logged_in_as: string;
5
+ ors_healthy: string;
6
+ pelias_healthy: boolean;
7
+ version: string;
8
+ vroom_healthy: boolean;
9
+ }
1
10
  export interface PaymentMethod {
2
11
  allow_redisplay: string;
3
12
  autopay: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.47",
3
+ "version": "0.0.2-beta.48",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",