@flashbacktech/flashbackclient 0.2.65 → 0.2.67

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.
@@ -53,6 +53,7 @@ export declare class ApiClient implements IApiClient {
53
53
  private makeRequest;
54
54
  private authenticateGoogle;
55
55
  private authenticateGithub;
56
+ private authenticateMicrosoft;
56
57
  /**
57
58
  * Authenticate with a web3 provider
58
59
  * @param data - The data to authenticate with
@@ -61,7 +62,9 @@ export declare class ApiClient implements IApiClient {
61
62
  web3Authenticate: (data: Web3RegisterBody) => Promise<any>;
62
63
  private refreshGoogleToken;
63
64
  private refreshGithubToken;
65
+ private refreshMicrosoftToken;
64
66
  private exchangeGoogleCode;
67
+ private exchangeMicrosoftCode;
65
68
  getTokens: () => Promise<{
66
69
  success: boolean;
67
70
  tokens: any[];
@@ -32,6 +32,8 @@ class ApiClient {
32
32
  return this.authenticateGoogle({ token, deviceInfo });
33
33
  case interfaces_1.ProviderType.GITHUB:
34
34
  return this.authenticateGithub({ code: token, deviceInfo, activationUid, activationToken });
35
+ case interfaces_1.ProviderType.MICROSOFT:
36
+ return this.authenticateMicrosoft({ token, deviceInfo });
35
37
  case interfaces_1.ProviderType.WEB3_STELLAR:
36
38
  throw new Error('Call web3Authenticate for web3 authentication');
37
39
  case interfaces_1.ProviderType.LOCAL:
@@ -46,6 +48,8 @@ class ApiClient {
46
48
  return this.exchangeGoogleCode({ code, activationUid, activationToken });
47
49
  case interfaces_1.ProviderType.GITHUB:
48
50
  return this.exchangeGithubCode(code);
51
+ case interfaces_1.ProviderType.MICROSOFT:
52
+ return this.exchangeMicrosoftCode({ code, activationUid, activationToken });
49
53
  case interfaces_1.ProviderType.WEB3_STELLAR:
50
54
  return this.exchangeWeb3StellarCode(code);
51
55
  default:
@@ -70,6 +74,8 @@ class ApiClient {
70
74
  return this.refreshGoogleToken(refreshToken);
71
75
  case interfaces_1.ProviderType.GITHUB:
72
76
  return this.refreshGithubToken(refreshToken);
77
+ case interfaces_1.ProviderType.MICROSOFT:
78
+ return this.refreshMicrosoftToken(refreshToken);
73
79
  case interfaces_1.ProviderType.LOCAL:
74
80
  case interfaces_1.ProviderType.WEB3_STELLAR:
75
81
  return this.userRefresh(refreshToken);
@@ -155,6 +161,10 @@ class ApiClient {
155
161
  this.setAuthToken(data.code);
156
162
  return this.makeRequest('auth/github', 'POST', data);
157
163
  };
164
+ this.authenticateMicrosoft = async (data) => {
165
+ this.setAuthToken(data.token);
166
+ return this.makeRequest('auth/microsoft', 'POST', data);
167
+ };
158
168
  /**
159
169
  * Authenticate with a web3 provider
160
170
  * @param data - The data to authenticate with
@@ -173,9 +183,17 @@ class ApiClient {
173
183
  refresh_token: refreshToken,
174
184
  });
175
185
  };
186
+ this.refreshMicrosoftToken = async (refreshToken) => {
187
+ return this.makeRequest('auth/microsoft/refresh', 'POST', {
188
+ refresh_token: refreshToken,
189
+ });
190
+ };
176
191
  this.exchangeGoogleCode = async (data) => {
177
192
  return this.makeRequest('auth/google/exchange', 'POST', data);
178
193
  };
194
+ this.exchangeMicrosoftCode = async (data) => {
195
+ return this.makeRequest('auth/microsoft/exchange', 'POST', data);
196
+ };
179
197
  // Token Management
180
198
  this.getTokens = async () => {
181
199
  return this.makeRequest('token', 'GET', null);
@@ -5,6 +5,7 @@ import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsRespon
5
5
  export declare enum ProviderType {
6
6
  GOOGLE = "GOOGLE",
7
7
  GITHUB = "GITHUB",
8
+ MICROSOFT = "MICROSOFT",
8
9
  WEB3_STELLAR = "WEB3_STELLAR",
9
10
  LOCAL = "LOCAL"
10
11
  }
@@ -5,6 +5,7 @@ var ProviderType;
5
5
  (function (ProviderType) {
6
6
  ProviderType["GOOGLE"] = "GOOGLE";
7
7
  ProviderType["GITHUB"] = "GITHUB";
8
+ ProviderType["MICROSOFT"] = "MICROSOFT";
8
9
  ProviderType["WEB3_STELLAR"] = "WEB3_STELLAR";
9
10
  ProviderType["LOCAL"] = "LOCAL";
10
11
  })(ProviderType || (exports.ProviderType = ProviderType = {}));
@@ -127,6 +127,14 @@ export interface GithubLoginRequest extends LoginDeviceInfo {
127
127
  activationUid?: string;
128
128
  activationToken?: string;
129
129
  }
130
+ export interface MicrosoftLoginRequest extends LoginDeviceInfo {
131
+ token: string;
132
+ }
133
+ export interface MicrosoftExchangeCodeRequest {
134
+ code: string;
135
+ activationUid?: string;
136
+ activationToken?: string;
137
+ }
130
138
  export interface DemoRequestBody {
131
139
  userId: string;
132
140
  email: string;
@@ -7,7 +7,7 @@ export interface CreateOrgUserRequest {
7
7
  orgRole?: number;
8
8
  sendInvite?: boolean;
9
9
  provider?: string;
10
- authMethod?: 'LOCAL' | 'GOOGLE' | 'GITHUB';
10
+ authMethod?: 'LOCAL' | 'GOOGLE' | 'GITHUB' | 'MICROSOFT';
11
11
  }
12
12
  export interface UpdateOrgUserRequest {
13
13
  name?: string;
@@ -39,7 +39,8 @@ const getServer = (network) => {
39
39
  serverUrl = "https://soroban-testnet.stellar.org";
40
40
  break;
41
41
  case "PUBLIC":
42
- serverUrl = "https://rpc.stellar.org";
42
+ //serverUrl = "https://rpc.stellar.org";
43
+ serverUrl = "https://stellar-soroban-public.nodies.app";
43
44
  break;
44
45
  }
45
46
  // For Stellar SDK v13+, we need to handle the allowHttp issue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.65",
3
+ "version": "0.2.67",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"