@flashbacktech/flashbackclient 0.0.22 → 0.0.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.
@@ -1,7 +1,9 @@
1
+ import { CreateUnitRequest, CreateUnitResponse } from './types';
1
2
  export declare class ApiClient {
2
3
  private apiClient;
3
4
  constructor(baseURL?: string);
4
5
  setAuthToken: (token: string | null) => void;
5
6
  authenticateGoogle: (token: string) => Promise<any>;
6
7
  authenticateGithub: (code: string) => Promise<any>;
8
+ createStorageUnit: (data: CreateUnitRequest) => Promise<CreateUnitResponse>;
7
9
  }
@@ -17,6 +17,10 @@ export class ApiClient {
17
17
  const response = await this.apiClient.post('/auth/github', { code });
18
18
  return response.data;
19
19
  };
20
+ this.createStorageUnit = async (data) => {
21
+ const response = await this.apiClient.post('/unit', data);
22
+ return response.data;
23
+ };
20
24
  this.apiClient = axios.create({
21
25
  baseURL: baseURL,
22
26
  headers: {
@@ -1,2 +1,3 @@
1
1
  import { ApiClient } from './client';
2
- export { ApiClient };
2
+ import * as ApiTypes from './types';
3
+ export { ApiClient, ApiTypes };
package/dist/api/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  import { ApiClient } from './client';
2
- export { ApiClient };
2
+ import * as ApiTypes from './types';
3
+ export { ApiClient, ApiTypes };
@@ -0,0 +1,37 @@
1
+ export declare enum StorageType {
2
+ S3 = "S3",
3
+ GCS = "GCS",
4
+ AZURE = "AZURE"
5
+ }
6
+ export interface CreateUnitRequest {
7
+ name: string;
8
+ bucket: string;
9
+ storageTypeId: string;
10
+ storageType: StorageType;
11
+ key: string;
12
+ secret: string;
13
+ endpoint?: string;
14
+ regionId?: string;
15
+ }
16
+ export interface CreateUnitResponse {
17
+ success: boolean;
18
+ unitId: string;
19
+ }
20
+ export interface CreateRepoRequest {
21
+ name: string;
22
+ storageUnitIds: string[];
23
+ }
24
+ export interface CreateRepoResponse {
25
+ success: boolean;
26
+ repoId: string;
27
+ }
28
+ export interface CreateRepoKeyRequest {
29
+ repoId: string;
30
+ keyName: string;
31
+ }
32
+ export interface CreateRepoKeyResponse {
33
+ success: boolean;
34
+ keyId: string;
35
+ keyValue: string;
36
+ keySecret: string;
37
+ }
@@ -0,0 +1,6 @@
1
+ export var StorageType;
2
+ (function (StorageType) {
3
+ StorageType["S3"] = "S3";
4
+ StorageType["GCS"] = "GCS";
5
+ StorageType["AZURE"] = "AZURE";
6
+ })(StorageType || (StorageType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },