@flashbacktech/flashbackclient 0.2.22 → 0.2.24
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, StorageBucket, GetBucketsResponse, StorageBucketStatusResponse, GetBucketNodeStatsRequest, GetBucketNodeStatsResponse, CreateRepoWithBucketsRequest, UpdateRepoWithBucketsRequest, ValidateRepoBucketsRequest, ValidateRepoBucketsResponse } from './types/storage/storage';
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { ActivateUserRequest, ActivateUserResponse, DeactivateResponse, DemoRequestBody, DemoRequestResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody, Web3RegisterBody } from './types/platform/auth';
|
|
4
4
|
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/storage/stats';
|
|
5
5
|
import { NodeInfoResponse, RegisterRequest } from './types/storage/bridge';
|
|
6
6
|
import { GetOrganizationKeysResponse } from './types/storage/noderegistration';
|
|
@@ -37,7 +37,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
37
37
|
setDebug: (debug: boolean) => void;
|
|
38
38
|
setAuthToken: (token: string | null) => void;
|
|
39
39
|
authenticate: (token: string, provider: ProviderType, deviceInfo?: DeviceInfo) => Promise<any>;
|
|
40
|
-
exchangeCode: (code: string, provider: ProviderType) => Promise<OAuth2ResponseDTO>;
|
|
40
|
+
exchangeCode: (code: string, provider: ProviderType, uid?: string, token?: string) => Promise<OAuth2ResponseDTO>;
|
|
41
41
|
private exchangeGithubCode;
|
|
42
42
|
private exchangeWeb3StellarCode;
|
|
43
43
|
/**
|
|
@@ -93,7 +93,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
93
93
|
userLogin: (data: LoginBody) => Promise<LoginResponse>;
|
|
94
94
|
userRefresh: (refreshToken: string) => Promise<RefreshTokenResponse | RefreshTokenErrorResponse>;
|
|
95
95
|
userLogout: (refreshToken: string) => Promise<LogoutResponse>;
|
|
96
|
-
userActivate: () => Promise<
|
|
96
|
+
userActivate: (data: ActivateUserRequest) => Promise<ActivateUserResponse>;
|
|
97
97
|
userDeactivate: () => Promise<DeactivateResponse>;
|
|
98
98
|
getUserQuota: () => Promise<QuotaResponse>;
|
|
99
99
|
updateUser: (userId: string, data: UserUpdateRequest) => Promise<UserUpdateResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -40,10 +40,10 @@ class ApiClient {
|
|
|
40
40
|
throw new Error(`Unsupported provider: ${provider}`);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
this.exchangeCode = async (code, provider) => {
|
|
43
|
+
this.exchangeCode = async (code, provider, uid, token) => {
|
|
44
44
|
switch (provider) {
|
|
45
45
|
case interfaces_1.ProviderType.GOOGLE:
|
|
46
|
-
return this.exchangeGoogleCode(code);
|
|
46
|
+
return this.exchangeGoogleCode(code, uid, token);
|
|
47
47
|
case interfaces_1.ProviderType.GITHUB:
|
|
48
48
|
return this.exchangeGithubCode(code);
|
|
49
49
|
case interfaces_1.ProviderType.WEB3_STELLAR:
|
|
@@ -152,8 +152,8 @@ class ApiClient {
|
|
|
152
152
|
refresh_token: refreshToken,
|
|
153
153
|
});
|
|
154
154
|
};
|
|
155
|
-
this.exchangeGoogleCode = async (code) => {
|
|
156
|
-
return this.makeRequest('auth/google/exchange', 'POST', { code });
|
|
155
|
+
this.exchangeGoogleCode = async (code, uid, token) => {
|
|
156
|
+
return this.makeRequest('auth/google/exchange', 'POST', { code, uid, token });
|
|
157
157
|
};
|
|
158
158
|
// Token Management
|
|
159
159
|
this.getTokens = async () => {
|
|
@@ -222,8 +222,8 @@ class ApiClient {
|
|
|
222
222
|
this.userLogout = async (refreshToken) => {
|
|
223
223
|
return this.makeRequest('user/logout', 'POST', { refresh_token: refreshToken });
|
|
224
224
|
};
|
|
225
|
-
this.userActivate = async () => {
|
|
226
|
-
return this.makeRequest('user/activate', 'POST',
|
|
225
|
+
this.userActivate = async (data) => {
|
|
226
|
+
return this.makeRequest('user/activate', 'POST', data);
|
|
227
227
|
};
|
|
228
228
|
this.userDeactivate = async () => {
|
|
229
229
|
return this.makeRequest('user/deactivate', 'POST', null);
|
package/dist/api/interfaces.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, GetBucketsResponse, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse } from './types/storage/storage';
|
|
2
|
-
import { RegisterBody, LoginBody, RegisterResponse, LoginResponse, LogoutResponse,
|
|
2
|
+
import { RegisterBody, LoginBody, RegisterResponse, LoginResponse, LogoutResponse, ActivateUserRequest, ActivateUserResponse, DeactivateResponse, RefreshTokenResponse, RefreshTokenErrorResponse } from './types/platform/auth';
|
|
3
3
|
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams } from './types/storage/stats';
|
|
4
4
|
import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/platform/subscriptions';
|
|
5
5
|
export declare enum ProviderType {
|
|
@@ -29,7 +29,7 @@ export interface IApiClient {
|
|
|
29
29
|
userLogin(loginBody: LoginBody): Promise<LoginResponse>;
|
|
30
30
|
userRefresh(refreshToken: string): Promise<RefreshTokenResponse | RefreshTokenErrorResponse>;
|
|
31
31
|
userLogout(refreshToken: string): Promise<LogoutResponse>;
|
|
32
|
-
userActivate(): Promise<
|
|
32
|
+
userActivate(data: ActivateUserRequest): Promise<ActivateUserResponse>;
|
|
33
33
|
userDeactivate(): Promise<DeactivateResponse>;
|
|
34
34
|
getDailyStats(params: StatsQueryParams): Promise<StatsResponse>;
|
|
35
35
|
getMinuteStats(params: StatsQueryParams): Promise<StatsResponse>;
|
|
@@ -121,3 +121,24 @@ export interface DemoRequestResponse {
|
|
|
121
121
|
success: boolean;
|
|
122
122
|
calendarUrl: string;
|
|
123
123
|
}
|
|
124
|
+
export interface ActivateUserRequest {
|
|
125
|
+
uid: string;
|
|
126
|
+
token: string;
|
|
127
|
+
registrationInfo: RegisterBody;
|
|
128
|
+
}
|
|
129
|
+
export interface ActivateUserResponse {
|
|
130
|
+
success: boolean;
|
|
131
|
+
error_code?: string;
|
|
132
|
+
message?: string;
|
|
133
|
+
accessToken?: string;
|
|
134
|
+
refreshToken?: string;
|
|
135
|
+
tokenId?: string;
|
|
136
|
+
expiresAt?: number;
|
|
137
|
+
user?: {
|
|
138
|
+
id: string;
|
|
139
|
+
email: string;
|
|
140
|
+
name: string;
|
|
141
|
+
orgId?: string;
|
|
142
|
+
orgRole?: number;
|
|
143
|
+
};
|
|
144
|
+
}
|