@flashbacktech/flashbackclient 0.1.73 → 0.1.74

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.
@@ -4,7 +4,7 @@ import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutR
4
4
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/stats';
5
5
  import { NodeInfo } from './types/bridge';
6
6
  import { QuotaResponse } from './types/quota';
7
- import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDeviceRequest, TrustDeviceResponse, UntrustDeviceResponse, RemoveDeviceResponse, RevokeSessionResponse, RevokeAllSessionsResponse, SessionHeartbeatResponse } from './types/device';
7
+ import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDeviceRequest, TrustDeviceResponse, UntrustDeviceResponse, RemoveDeviceResponse, RevokeSessionResponse, RevokeAllSessionsResponse, SessionHeartbeatResponse, DeviceInfo } from './types/device';
8
8
  import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/subscriptions';
9
9
  interface ErrorResponse {
10
10
  message?: string;
@@ -23,7 +23,7 @@ export declare class ApiClient implements IApiClient {
23
23
  constructor(baseURL?: string);
24
24
  setDebug: (debug: boolean) => void;
25
25
  setAuthToken: (token: string | null) => void;
26
- authenticate: (token: string, provider: ProviderType) => Promise<any>;
26
+ authenticate: (token: string, provider: ProviderType, deviceInfo?: DeviceInfo) => Promise<any>;
27
27
  exchangeCode: (code: string, provider: ProviderType) => Promise<OAuth2ResponseDTO>;
28
28
  private exchangeGithubCode;
29
29
  private exchangeWeb3StellarCode;
@@ -25,13 +25,13 @@ class ApiClient {
25
25
  };
26
26
  }
27
27
  };
28
- this.authenticate = async (token, provider) => {
28
+ this.authenticate = async (token, provider, deviceInfo) => {
29
29
  this.setAuthToken(token);
30
30
  switch (provider) {
31
31
  case interfaces_1.ProviderType.GOOGLE:
32
- return this.authenticateGoogle(token);
32
+ return this.authenticateGoogle({ token, deviceInfo });
33
33
  case interfaces_1.ProviderType.GITHUB:
34
- return this.authenticateGithub(token);
34
+ return this.authenticateGithub({ code: token, deviceInfo });
35
35
  case interfaces_1.ProviderType.WEB3_STELLAR:
36
36
  throw new Error('Call web3Authenticate for web3 authentication');
37
37
  case interfaces_1.ProviderType.LOCAL:
@@ -102,11 +102,12 @@ export interface ResetPasswordBody {
102
102
  token: string;
103
103
  newPassword: string;
104
104
  }
105
- export interface GoogleLoginRequest {
105
+ export interface LoginDeviceInfo {
106
+ deviceInfo?: DeviceInfo;
107
+ }
108
+ export interface GoogleLoginRequest extends LoginDeviceInfo {
106
109
  token: string;
107
- deviceInfo: DeviceInfo;
108
110
  }
109
- export interface GithubLoginRequest {
111
+ export interface GithubLoginRequest extends LoginDeviceInfo {
110
112
  code: string;
111
- deviceInfo: DeviceInfo;
112
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.73",
3
+ "version": "0.1.74",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"