@flashbacktech/flashbackclient 0.0.42 → 0.0.44

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 } from './types';
1
+ import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse } from './types/storage';
2
2
  import { IApiClient, ProviderType } from './interfaces';
3
3
  export declare class ApiClient implements IApiClient {
4
4
  private baseURL;
@@ -1,4 +1,5 @@
1
1
  import { ApiClient } from './client';
2
- import * as ApiTypes from './types';
2
+ import * as ApiTypes from './types/storage';
3
+ import * as AuthTypes from './types/auth';
3
4
  import * as ApiInterfaces from './interfaces';
4
- export { ApiClient, ApiTypes, ApiInterfaces };
5
+ export { ApiClient, ApiTypes, AuthTypes, ApiInterfaces };
package/dist/api/index.js CHANGED
@@ -33,10 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.ApiInterfaces = exports.ApiTypes = exports.ApiClient = void 0;
36
+ exports.ApiInterfaces = 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
- const ApiTypes = __importStar(require("./types"));
39
+ const ApiTypes = __importStar(require("./types/storage"));
40
40
  exports.ApiTypes = ApiTypes;
41
+ const AuthTypes = __importStar(require("./types/auth"));
42
+ exports.AuthTypes = AuthTypes;
41
43
  const ApiInterfaces = __importStar(require("./interfaces"));
42
44
  exports.ApiInterfaces = ApiInterfaces;
@@ -1,4 +1,4 @@
1
- import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse } from "./types";
1
+ import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse } from "./types/storage";
2
2
  export declare enum ProviderType {
3
3
  GOOGLE = "GOOGLE",
4
4
  GITHUB = "GITHUB",
@@ -0,0 +1,16 @@
1
+ export interface AuthState {
2
+ user: {
3
+ email: string;
4
+ name: string;
5
+ imageUrl: string;
6
+ } | null;
7
+ token: string | null;
8
+ accessToken: string | null;
9
+ refreshToken?: string | null;
10
+ expiresAt?: number | null;
11
+ provider?: 'google' | 'github';
12
+ }
13
+ export interface OAuth2ResponseDTO {
14
+ success: boolean;
15
+ authState: AuthState;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,89 @@
1
+ export declare enum StorageType {
2
+ S3 = "S3",
3
+ GCS = "GCS",
4
+ AZURE = "AZURE"
5
+ }
6
+ export declare enum AccessType {
7
+ READ = "READ",
8
+ WRITE = "WRITE",
9
+ ADMIN = "ADMIN"
10
+ }
11
+ export declare enum ModeType {
12
+ NORMAL = "NORMAL",
13
+ MIRROR = "MIRROR"
14
+ }
15
+ export interface CreateUnitRequest {
16
+ name: string;
17
+ bucket: string;
18
+ storageType: StorageType;
19
+ key: string;
20
+ secret: string;
21
+ endpoint?: string;
22
+ regionId?: string;
23
+ }
24
+ export interface CreateUnitResponse {
25
+ success: boolean;
26
+ unitId: string;
27
+ }
28
+ export interface RepoUnitInfo {
29
+ id: string;
30
+ folder: string;
31
+ }
32
+ export interface CreateRepoRequest {
33
+ name: string;
34
+ storageType: StorageType;
35
+ mode: ModeType;
36
+ repoUnits: RepoUnitInfo[];
37
+ }
38
+ export interface CreateRepoResponse {
39
+ success: boolean;
40
+ repoId: string;
41
+ }
42
+ export interface CreateRepoKeyRequest {
43
+ repoId: string;
44
+ name: string;
45
+ accessType: AccessType;
46
+ }
47
+ export interface CreateRepoKeyResponse {
48
+ success: boolean;
49
+ id: string;
50
+ key: string;
51
+ secret: string;
52
+ }
53
+ export interface StorageRepo {
54
+ id: string;
55
+ name: string;
56
+ storageType: StorageType;
57
+ mode: ModeType;
58
+ repoUnits: RepoUnitInfo[];
59
+ apiKeys: ApiKey[];
60
+ }
61
+ export interface ApiKey {
62
+ id: string;
63
+ name: string;
64
+ accessType: AccessType;
65
+ key: string;
66
+ secret: string;
67
+ }
68
+ export interface StorageUnit {
69
+ id: string;
70
+ name: string;
71
+ bucket: string;
72
+ storageType: StorageType;
73
+ key: string;
74
+ secret: string;
75
+ endpoint?: string;
76
+ regionId?: string;
77
+ }
78
+ export interface GetUnitsResponse {
79
+ success: boolean;
80
+ units: StorageUnit[];
81
+ }
82
+ export interface GetReposResponse {
83
+ success: boolean;
84
+ repos: StorageRepo[];
85
+ }
86
+ export interface GetRepoKeysResponse {
87
+ success: boolean;
88
+ keys: ApiKey[];
89
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModeType = exports.AccessType = exports.StorageType = void 0;
4
+ var StorageType;
5
+ (function (StorageType) {
6
+ StorageType["S3"] = "S3";
7
+ StorageType["GCS"] = "GCS";
8
+ StorageType["AZURE"] = "AZURE";
9
+ })(StorageType || (exports.StorageType = StorageType = {}));
10
+ var AccessType;
11
+ (function (AccessType) {
12
+ AccessType["READ"] = "READ";
13
+ AccessType["WRITE"] = "WRITE";
14
+ AccessType["ADMIN"] = "ADMIN";
15
+ })(AccessType || (exports.AccessType = AccessType = {}));
16
+ var ModeType;
17
+ (function (ModeType) {
18
+ ModeType["NORMAL"] = "NORMAL";
19
+ ModeType["MIRROR"] = "MIRROR";
20
+ })(ModeType || (exports.ModeType = ModeType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },