@flashbacktech/flashbackclient 0.1.21 → 0.1.22
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.
- package/dist/api/client.d.ts +1 -0
- package/dist/api/client.js +6 -2
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
38
38
|
private authenticateGoogle;
|
|
39
39
|
private authenticateGithub;
|
|
40
40
|
private refreshGoogleToken;
|
|
41
|
+
private refreshGithubToken;
|
|
41
42
|
private exchangeGoogleCode;
|
|
42
43
|
createStorageUnit: (data: CreateUnitRequest) => Promise<CreateUnitResponse>;
|
|
43
44
|
getStorageUnits: () => Promise<GetUnitsResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -69,8 +69,7 @@ class ApiClient {
|
|
|
69
69
|
case interfaces_1.ProviderType.GOOGLE:
|
|
70
70
|
return this.refreshGoogleToken(refreshToken);
|
|
71
71
|
case interfaces_1.ProviderType.GITHUB:
|
|
72
|
-
|
|
73
|
-
throw new Error('Not implemented');
|
|
72
|
+
return this.refreshGithubToken(refreshToken);
|
|
74
73
|
case interfaces_1.ProviderType.LOCAL:
|
|
75
74
|
return this.userRefresh(refreshToken);
|
|
76
75
|
default:
|
|
@@ -141,6 +140,11 @@ class ApiClient {
|
|
|
141
140
|
refresh_token: refreshToken,
|
|
142
141
|
});
|
|
143
142
|
};
|
|
143
|
+
this.refreshGithubToken = async (refreshToken) => {
|
|
144
|
+
return this.makeRequest('auth/github/refresh', 'POST', {
|
|
145
|
+
refresh_token: refreshToken,
|
|
146
|
+
});
|
|
147
|
+
};
|
|
144
148
|
this.exchangeGoogleCode = async (code) => {
|
|
145
149
|
return this.makeRequest('auth/google/exchange', 'POST', { code });
|
|
146
150
|
};
|