@go-avro/avro-js 0.0.2-beta.53 → 0.0.2-beta.54

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,7 @@
1
1
  import { InfiniteData, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
2
2
  import { AuthManager } from '../auth/AuthManager';
3
3
  import { _Event, ApiInfo, Bill, Company, Job, LineItem, Route, ServiceMonth, Session, User } from '../types/api';
4
+ import { Tokens } from '../types/auth';
4
5
  import { CancelToken, RetryStrategy } from '../types/client';
5
6
  import { StandardError } from '../types/error';
6
7
  export interface AvroQueryClientConfig {
@@ -181,6 +182,8 @@ export declare class AvroQueryClient {
181
182
  username: string;
182
183
  password: string;
183
184
  }, cancelToken?: CancelToken): Promise<Boolean>;
185
+ setTokens(tokens: Tokens): Promise<void>;
186
+ clearTokens(): Promise<void>;
184
187
  logout(cancelToken?: CancelToken): Promise<void>;
185
188
  fetchJobs(companyGuid: string, body?: {
186
189
  amt?: number;
@@ -34,6 +34,12 @@ export class AvroQueryClient {
34
34
  throw new StandardError(401, 'Login failed');
35
35
  });
36
36
  }
37
+ setTokens(tokens) {
38
+ return this.config.authManager.setTokens(tokens);
39
+ }
40
+ clearTokens() {
41
+ return this.config.authManager.clearTokens();
42
+ }
37
43
  logout(cancelToken) {
38
44
  return this._fetch('POST', '/logout', null, cancelToken)
39
45
  .then(() => this.config.authManager.clearTokens())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.53",
3
+ "version": "0.0.2-beta.54",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",