@hostlink/light 2.3.8 → 2.5.0

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/auth.d.ts CHANGED
@@ -4,9 +4,21 @@ declare const _default: (axios: AxiosInstance) => {
4
4
  login: (username: string) => Promise<void>;
5
5
  register: () => Promise<void>;
6
6
  };
7
- facebookLogin: (accessToken: string) => Promise<boolean>;
8
- microsoftLogin: (accessToken: string) => Promise<boolean>;
9
- googleLogin: (credential: string) => Promise<boolean>;
7
+ google: {
8
+ unlink: () => Promise<boolean>;
9
+ login: (accessToken: string) => Promise<boolean>;
10
+ register: (credential: string) => Promise<boolean>;
11
+ };
12
+ facebook: {
13
+ unlink: () => Promise<boolean>;
14
+ login: (accessToken: string) => Promise<boolean>;
15
+ register: (accessToken: string) => Promise<boolean>;
16
+ };
17
+ microsoft: {
18
+ unlink: () => Promise<boolean>;
19
+ login: (accessToken: string) => Promise<boolean>;
20
+ register: (account_id: string) => Promise<boolean>;
21
+ };
10
22
  login: (username: string, password: string, code?: string) => Promise<boolean>;
11
23
  logout: () => Promise<boolean>;
12
24
  changeExpiredPassword: (username: string, oldPassword: string, newPassword: string) => Promise<boolean>;
@@ -9,6 +9,7 @@ import { default as models } from './models';
9
9
  import { default as model } from './model';
10
10
  import { default as roles } from './roles';
11
11
  import { default as createCollection } from './createCollection';
12
+ import { default as drive } from './drive';
12
13
  export interface LightClient {
13
14
  baseURL: string;
14
15
  axios: AxiosInstance;
@@ -25,6 +26,7 @@ export interface LightClient {
25
26
  model(name: string): ReturnType<typeof model>;
26
27
  roles: ReturnType<typeof roles>;
27
28
  collect(name: string, fields: Object): ReturnType<typeof createCollection>;
29
+ drive(index: number): ReturnType<typeof drive>;
28
30
  }
29
31
  declare const _default: (baseURL: string) => LightClient;
30
32
  export default _default;
@@ -0,0 +1,30 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export type FolderFields = {
3
+ name?: boolean;
4
+ path?: boolean;
5
+ };
6
+ export type FileFields = {
7
+ name?: boolean;
8
+ path?: boolean;
9
+ size?: boolean;
10
+ mime?: boolean;
11
+ url?: boolean;
12
+ };
13
+ declare const _default: (index: number, axios: AxiosInstance) => {
14
+ folders: {
15
+ list: (path: string, fields?: FolderFields) => Promise<any>;
16
+ create: (path: string) => Promise<any>;
17
+ delete: (path: string) => Promise<any>;
18
+ rename: (path: string, name: string) => Promise<any>;
19
+ };
20
+ files: {
21
+ list: (path: string, fields?: FileFields) => Promise<any>;
22
+ get: (path: string, fields?: FileFields) => Promise<any>;
23
+ read: (path: string) => Promise<string>;
24
+ write: (path: string, content: string) => Promise<any>;
25
+ delete: (path: string) => Promise<any>;
26
+ rename: (path: string, name: string) => Promise<any>;
27
+ move: (source: string, destination: string) => Promise<any>;
28
+ };
29
+ };
30
+ export default _default;