@flashbacktech/flashbackclient 0.0.65 → 0.0.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.
@@ -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>;
@@ -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);
@@ -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
  }
@@ -49,6 +49,8 @@ export interface CreateRepoRequest {
49
49
  }
50
50
  export interface CreateRepoResponse {
51
51
  success: boolean;
52
+ error_code?: RepoErrorCodes;
53
+ error_message?: string;
52
54
  repoId: string;
53
55
  }
54
56
  export interface UpdateRepoRequest extends CreateRepoRequest {
@@ -76,7 +78,7 @@ export interface StorageRepo {
76
78
  storageType: StorageType;
77
79
  mode: ModeType;
78
80
  repoUnits: RepoUnitInfo[];
79
- apiKeys: ApiKey[];
81
+ apiKeys?: ApiKey[];
80
82
  createdAt: string;
81
83
  }
82
84
  export interface ApiKey {
@@ -125,3 +127,24 @@ export interface ValidateUnitResponse {
125
127
  status?: string;
126
128
  latency_ms?: number;
127
129
  }
130
+ export interface ValidateRepoUnitsRequest {
131
+ repoId: string;
132
+ mode: ModeType;
133
+ repoUnits: RepoUnitInfo[];
134
+ }
135
+ export interface ValidateRepoUnitsResponse {
136
+ success: boolean;
137
+ error_code?: RepoErrorCodes;
138
+ error_message?: string;
139
+ }
140
+ export declare enum RepoErrorCodes {
141
+ SUCCESS = "SUCCESS",
142
+ NOT_FOUND = "NOT_FOUND",
143
+ NAME_ALREADY_USED = "NAME_ALREADY_USED",
144
+ MIRROR_MASTER_UNIT_COUNT_INVALID = "MIRROR_MASTER_UNIT_COUNT_INVALID",
145
+ MIRROR_MASTER_UNIT_MISSING = "MIRROR_MASTER_UNIT_MISSING",
146
+ MIRROR_UNIT_ALREADY_IN_OTHER_REPO = "MIRROR_UNIT_ALREADY_IN_OTHER_REPO",
147
+ NORMAL_UNIT_FOLDER_ALREADY_USED = "NORMAL_UNIT_FOLDER_ALREADY_USED",
148
+ NORMAL_UNIT_CANNOT_DELETE = "NORMAL_UNIT_FOLDER_CANNOT_DELETE",
149
+ NORMAL_UNIT_CANNOT_EDIT_FOLDER = "NORMAL_UNIT_CANNOT_EDIT_FOLDER"
150
+ }
@@ -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,15 @@ 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["SUCCESS"] = "SUCCESS";
24
+ RepoErrorCodes["NOT_FOUND"] = "NOT_FOUND";
25
+ RepoErrorCodes["NAME_ALREADY_USED"] = "NAME_ALREADY_USED";
26
+ RepoErrorCodes["MIRROR_MASTER_UNIT_COUNT_INVALID"] = "MIRROR_MASTER_UNIT_COUNT_INVALID";
27
+ RepoErrorCodes["MIRROR_MASTER_UNIT_MISSING"] = "MIRROR_MASTER_UNIT_MISSING";
28
+ RepoErrorCodes["MIRROR_UNIT_ALREADY_IN_OTHER_REPO"] = "MIRROR_UNIT_ALREADY_IN_OTHER_REPO";
29
+ RepoErrorCodes["NORMAL_UNIT_FOLDER_ALREADY_USED"] = "NORMAL_UNIT_FOLDER_ALREADY_USED";
30
+ RepoErrorCodes["NORMAL_UNIT_CANNOT_DELETE"] = "NORMAL_UNIT_FOLDER_CANNOT_DELETE";
31
+ RepoErrorCodes["NORMAL_UNIT_CANNOT_EDIT_FOLDER"] = "NORMAL_UNIT_CANNOT_EDIT_FOLDER";
32
+ })(RepoErrorCodes || (exports.RepoErrorCodes = RepoErrorCodes = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.65",
3
+ "version": "0.0.67",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },