@flashbacktech/flashbackclient 0.0.64 → 0.0.66
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,4 +1,4 @@
|
|
|
1
|
-
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse } from './types/storage';
|
|
1
|
+
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse } from './types/storage';
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
3
|
import { OAuth2ResponseDTO, RefreshTokenResponse } from './types/auth';
|
|
4
4
|
interface ErrorResponse {
|
|
@@ -44,6 +44,8 @@ export declare class ApiClient implements IApiClient {
|
|
|
44
44
|
getStorageRepos: () => Promise<GetReposResponse>;
|
|
45
45
|
updateStorageRepo: (repoId: string, data: UpdateRepoRequest) => Promise<UpdateRepoResponse>;
|
|
46
46
|
deleteStorageRepo: (repoId: string) => Promise<ActionResponse>;
|
|
47
|
+
validateNewRepoUnits: (data: ValidateRepoUnitsRequest) => Promise<ValidateRepoUnitsResponse>;
|
|
48
|
+
validateUpdateRepoUnits: (data: ValidateRepoUnitsRequest) => Promise<ValidateRepoUnitsResponse>;
|
|
47
49
|
createRepoKey: (data: CreateRepoKeyRequest) => Promise<CreateRepoKeyResponse>;
|
|
48
50
|
getRepoKeys: (repoId: string) => Promise<GetRepoKeysResponse>;
|
|
49
51
|
updateRepoKey: (repoId: string, data: UpdateRepoKeyRequest) => Promise<UpdateRepoKeyResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -167,6 +167,12 @@ class ApiClient {
|
|
|
167
167
|
this.deleteStorageRepo = async (repoId) => {
|
|
168
168
|
return this.makeRequest(`repo/${repoId}`, 'DELETE', null);
|
|
169
169
|
};
|
|
170
|
+
this.validateNewRepoUnits = async (data) => {
|
|
171
|
+
return this.makeRequest('repo/validate', 'POST', data);
|
|
172
|
+
};
|
|
173
|
+
this.validateUpdateRepoUnits = async (data) => {
|
|
174
|
+
return this.makeRequest(`repo/${data.repoId}/validate`, 'POST', data);
|
|
175
|
+
};
|
|
170
176
|
////// Keys API
|
|
171
177
|
this.createRepoKey = async (data) => {
|
|
172
178
|
return this.makeRequest(`repo/${data.repoId}/apikey`, 'POST', data);
|
package/dist/api/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse } from "./types/storage";
|
|
1
|
+
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse } from "./types/storage";
|
|
2
2
|
export declare enum ProviderType {
|
|
3
3
|
GOOGLE = "GOOGLE",
|
|
4
4
|
GITHUB = "GITHUB",
|
|
@@ -19,4 +19,6 @@ export interface IApiClient {
|
|
|
19
19
|
getRepoKeys(repoId: string): Promise<GetRepoKeysResponse>;
|
|
20
20
|
updateRepoKey(repoId: string, data: UpdateRepoKeyRequest): Promise<UpdateRepoKeyResponse>;
|
|
21
21
|
deleteRepoKey(repoId: string, keyId: string): Promise<ActionResponse>;
|
|
22
|
+
validateNewRepoUnits(data: ValidateRepoUnitsRequest): Promise<ValidateRepoUnitsResponse>;
|
|
23
|
+
validateUpdateRepoUnits(data: ValidateRepoUnitsRequest): Promise<ValidateRepoUnitsResponse>;
|
|
22
24
|
}
|
|
@@ -38,6 +38,7 @@ export interface UpdateUnitResponse extends CreateUnitResponse {
|
|
|
38
38
|
export interface RepoUnitInfo {
|
|
39
39
|
id: string;
|
|
40
40
|
folder: string;
|
|
41
|
+
master: boolean;
|
|
41
42
|
data?: StorageUnit;
|
|
42
43
|
}
|
|
43
44
|
export interface CreateRepoRequest {
|
|
@@ -75,7 +76,7 @@ export interface StorageRepo {
|
|
|
75
76
|
storageType: StorageType;
|
|
76
77
|
mode: ModeType;
|
|
77
78
|
repoUnits: RepoUnitInfo[];
|
|
78
|
-
apiKeys
|
|
79
|
+
apiKeys?: ApiKey[];
|
|
79
80
|
createdAt: string;
|
|
80
81
|
}
|
|
81
82
|
export interface ApiKey {
|
|
@@ -124,3 +125,17 @@ export interface ValidateUnitResponse {
|
|
|
124
125
|
status?: string;
|
|
125
126
|
latency_ms?: number;
|
|
126
127
|
}
|
|
128
|
+
export interface ValidateRepoUnitsRequest {
|
|
129
|
+
repoId: string;
|
|
130
|
+
mode: ModeType;
|
|
131
|
+
repoUnits: RepoUnitInfo[];
|
|
132
|
+
}
|
|
133
|
+
export interface ValidateRepoUnitsResponse {
|
|
134
|
+
success: boolean;
|
|
135
|
+
error_code?: RepoErrorCodes;
|
|
136
|
+
error_message?: string;
|
|
137
|
+
}
|
|
138
|
+
export declare enum RepoErrorCodes {
|
|
139
|
+
MIRROR_MASTER_UNIT_COUNT_INVALID = "MIRROR_MASTER_UNIT_COUNT_INVALID",
|
|
140
|
+
MIRROR_UNIT_ALREADY_IN_OTHER_REPO = "MIRROR_UNIT_ALREADY_IN_OTHER_REPO"
|
|
141
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModeType = exports.AccessType = exports.StorageType = void 0;
|
|
3
|
+
exports.RepoErrorCodes = exports.ModeType = exports.AccessType = exports.StorageType = void 0;
|
|
4
4
|
var StorageType;
|
|
5
5
|
(function (StorageType) {
|
|
6
6
|
StorageType["S3"] = "S3";
|
|
@@ -18,3 +18,8 @@ var ModeType;
|
|
|
18
18
|
ModeType["NORMAL"] = "NORMAL";
|
|
19
19
|
ModeType["MIRROR"] = "MIRROR";
|
|
20
20
|
})(ModeType || (exports.ModeType = ModeType = {}));
|
|
21
|
+
var RepoErrorCodes;
|
|
22
|
+
(function (RepoErrorCodes) {
|
|
23
|
+
RepoErrorCodes["MIRROR_MASTER_UNIT_COUNT_INVALID"] = "MIRROR_MASTER_UNIT_COUNT_INVALID";
|
|
24
|
+
RepoErrorCodes["MIRROR_UNIT_ALREADY_IN_OTHER_REPO"] = "MIRROR_UNIT_ALREADY_IN_OTHER_REPO";
|
|
25
|
+
})(RepoErrorCodes || (exports.RepoErrorCodes = RepoErrorCodes = {}));
|