@flashbacktech/flashbackclient 0.1.89 → 0.1.91
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 +17 -1
- package/dist/api/client.js +25 -0
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.js +3 -1
- package/dist/api/types/bridge.d.ts +2 -0
- package/dist/api/types/noderegistration.d.ts +20 -0
- package/dist/api/types/noderegistration.js +6 -0
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoRes
|
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
3
|
import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody, Web3RegisterBody } from './types/auth';
|
|
4
4
|
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/stats';
|
|
5
|
-
import { NodeInfo } from './types/bridge';
|
|
5
|
+
import { NodeInfo, RegisterRequest } from './types/bridge';
|
|
6
|
+
import { GetOrganizationKeysResponse } from './types/noderegistration';
|
|
6
7
|
import { QuotaResponse } from './types/quota';
|
|
7
8
|
import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDeviceRequest, TrustDeviceResponse, UntrustDeviceResponse, RemoveDeviceResponse, RevokeSessionResponse, RevokeAllSessionsResponse, SessionHeartbeatResponse, DeviceInfo } from './types/device';
|
|
8
9
|
import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/subscriptions';
|
|
@@ -52,6 +53,13 @@ export declare class ApiClient implements IApiClient {
|
|
|
52
53
|
private refreshGoogleToken;
|
|
53
54
|
private refreshGithubToken;
|
|
54
55
|
private exchangeGoogleCode;
|
|
56
|
+
getTokens: () => Promise<{
|
|
57
|
+
success: boolean;
|
|
58
|
+
tokens: any[];
|
|
59
|
+
}>;
|
|
60
|
+
revokeToken: (tokenId: string) => Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
}>;
|
|
55
63
|
createStorageUnit: (data: CreateUnitRequest) => Promise<CreateUnitResponse>;
|
|
56
64
|
getStorageUnits: () => Promise<GetUnitsResponse>;
|
|
57
65
|
validateStorageUnit: (unitId: string, data: ValidateUnitRequest) => Promise<ValidateUnitResponse>;
|
|
@@ -191,5 +199,13 @@ export declare class ApiClient implements IApiClient {
|
|
|
191
199
|
}>;
|
|
192
200
|
getOrganization: (orgId: string) => Promise<GetOrganizationResponse>;
|
|
193
201
|
updateOrganization: (orgId: string, request: UpdateOrganizationBody) => Promise<UpdateOrganizationResponse>;
|
|
202
|
+
generateOrgKey: (idOrg: string) => Promise<string>;
|
|
203
|
+
deleteOrgKeys: (idOrg: string) => Promise<{
|
|
204
|
+
success: boolean;
|
|
205
|
+
message: string;
|
|
206
|
+
}>;
|
|
207
|
+
getOrgKeys: (idOrg: string) => Promise<GetOrganizationKeysResponse>;
|
|
208
|
+
nodeRegister: (data: RegisterRequest) => Promise<RegisterResponse>;
|
|
209
|
+
nodeUnregister: (data: RegisterRequest) => Promise<RegisterResponse>;
|
|
194
210
|
}
|
|
195
211
|
export {};
|
package/dist/api/client.js
CHANGED
|
@@ -155,6 +155,13 @@ class ApiClient {
|
|
|
155
155
|
this.exchangeGoogleCode = async (code) => {
|
|
156
156
|
return this.makeRequest('auth/google/exchange', 'POST', { code });
|
|
157
157
|
};
|
|
158
|
+
// Token Management
|
|
159
|
+
this.getTokens = async () => {
|
|
160
|
+
return this.makeRequest('token', 'GET', null);
|
|
161
|
+
};
|
|
162
|
+
this.revokeToken = async (tokenId) => {
|
|
163
|
+
return this.makeRequest(`token/${tokenId}`, 'DELETE', null);
|
|
164
|
+
};
|
|
158
165
|
////// Units API
|
|
159
166
|
this.createStorageUnit = async (data) => {
|
|
160
167
|
return this.makeRequest('unit', 'POST', data);
|
|
@@ -468,6 +475,24 @@ class ApiClient {
|
|
|
468
475
|
this.updateOrganization = async (orgId, request) => {
|
|
469
476
|
return this.makeRequest(`organization/${orgId}`, 'PUT', request);
|
|
470
477
|
};
|
|
478
|
+
// Node registration methods
|
|
479
|
+
// Organization Keys API calls
|
|
480
|
+
this.generateOrgKey = async (idOrg) => {
|
|
481
|
+
return this.makeRequest(`organization/${idOrg}/key`, 'POST');
|
|
482
|
+
};
|
|
483
|
+
this.deleteOrgKeys = async (idOrg) => {
|
|
484
|
+
return this.makeRequest(`organization/${idOrg}/key`, 'DELETE');
|
|
485
|
+
};
|
|
486
|
+
this.getOrgKeys = async (idOrg) => {
|
|
487
|
+
return this.makeRequest(`organization/${idOrg}/key`, 'GET');
|
|
488
|
+
};
|
|
489
|
+
// Node Registration API calls
|
|
490
|
+
this.nodeRegister = async (data) => {
|
|
491
|
+
return this.makeRequest('register', 'POST', data);
|
|
492
|
+
};
|
|
493
|
+
this.nodeUnregister = async (data) => {
|
|
494
|
+
return this.makeRequest('unregister', 'POST', data);
|
|
495
|
+
};
|
|
471
496
|
this.baseURL = baseURL;
|
|
472
497
|
this.headers = {};
|
|
473
498
|
this.debug = false;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ import * as SettingsTypes from './types/settings';
|
|
|
13
13
|
import * as RolesTypes from './types/roles';
|
|
14
14
|
import * as WorkspaceTypes from './types/workspace';
|
|
15
15
|
import * as OrganizationTypes from './types/organization';
|
|
16
|
-
|
|
16
|
+
import * as NodeRegistrationTypes from './types/noderegistration';
|
|
17
|
+
export { ApiClient, ApiTypes, AuthTypes, StatsTypes, ApiInterfaces, HttpError, BridgeTypes, EmailTypes, QuotaTypes, SubscriptionTypes, DeviceTypes, MFATypes, SettingsTypes, RolesTypes, WorkspaceTypes, OrganizationTypes, NodeRegistrationTypes };
|
package/dist/api/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.OrganizationTypes = exports.WorkspaceTypes = exports.RolesTypes = exports.SettingsTypes = exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
|
|
36
|
+
exports.NodeRegistrationTypes = exports.OrganizationTypes = exports.WorkspaceTypes = exports.RolesTypes = exports.SettingsTypes = exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
|
|
37
37
|
const client_1 = require("./client");
|
|
38
38
|
Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return client_1.ApiClient; } });
|
|
39
39
|
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return client_1.HttpError; } });
|
|
@@ -65,3 +65,5 @@ const WorkspaceTypes = __importStar(require("./types/workspace"));
|
|
|
65
65
|
exports.WorkspaceTypes = WorkspaceTypes;
|
|
66
66
|
const OrganizationTypes = __importStar(require("./types/organization"));
|
|
67
67
|
exports.OrganizationTypes = OrganizationTypes;
|
|
68
|
+
const NodeRegistrationTypes = __importStar(require("./types/noderegistration"));
|
|
69
|
+
exports.NodeRegistrationTypes = NodeRegistrationTypes;
|
|
@@ -8,6 +8,7 @@ interface NodeSignedMessage {
|
|
|
8
8
|
region: string;
|
|
9
9
|
timestamp: number;
|
|
10
10
|
signature: string;
|
|
11
|
+
id_org?: string;
|
|
11
12
|
}
|
|
12
13
|
export interface NodeStatusInfo {
|
|
13
14
|
ip: string;
|
|
@@ -49,5 +50,6 @@ export interface NodeInfo {
|
|
|
49
50
|
latencyMs?: number;
|
|
50
51
|
lastUpdated: string;
|
|
51
52
|
url: string;
|
|
53
|
+
id_org?: string;
|
|
52
54
|
}
|
|
53
55
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Registration DTOs
|
|
3
|
+
* Data Transfer Objects for organization keys
|
|
4
|
+
*/
|
|
5
|
+
export interface NodeKey {
|
|
6
|
+
keyId: string;
|
|
7
|
+
nodeId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OrganizationKey {
|
|
10
|
+
id: string;
|
|
11
|
+
orgId: string;
|
|
12
|
+
publicKey: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
nodeKeys: NodeKey[];
|
|
15
|
+
}
|
|
16
|
+
export interface GetOrganizationKeysResponse {
|
|
17
|
+
success: boolean;
|
|
18
|
+
data?: OrganizationKey[];
|
|
19
|
+
message: string;
|
|
20
|
+
}
|