@hostlink/light 3.0.6 → 3.0.8

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
@@ -10,7 +10,7 @@ export declare const forgetPassword: (username: string, email: string) => Promis
10
10
  export declare const verifyCode: (jwt: string, code: string) => Promise<boolean>;
11
11
  export declare const isGranted: (right: string) => Promise<boolean>;
12
12
  export declare const getGrantedRights: (rights: string[]) => Promise<string[]>;
13
- declare const _default: () => {
13
+ declare const _default: {
14
14
  getCurrentUser: (fields?: QueryUserFieldsUserFields) => Promise<any>;
15
15
  webAuthn: typeof webAuthn;
16
16
  google: {
@@ -1,32 +1,38 @@
1
1
  import { default as auth } from './auth';
2
2
  import { getDrive } from './drive';
3
- import { AxiosInstance } from 'axios';
4
- import { Fields } from '.';
3
+ import { default as axios } from 'axios';
4
+ import { default as mutation } from './mutation';
5
+ import { default as query } from './query';
5
6
  import { getConfig } from './config';
6
7
  import { default as mail } from './mail';
8
+ import { getModel } from './models';
7
9
  import { default as roles } from './role';
8
10
  import { default as createCollection } from './createCollection';
9
11
  import { default as createList } from './createList';
10
12
  import { default as users } from './users';
11
- export interface LightClient {
13
+ type ClientType = {
14
+ post: typeof axios.post;
12
15
  baseURL: string;
13
- axios: AxiosInstance;
14
- auth: ReturnType<typeof auth>;
15
- mutation: (q: Record<string, any>) => Promise<any>;
16
- query: (q: Record<string, any>) => Promise<any>;
16
+ axios: ReturnType<typeof axios.create>;
17
+ auth: typeof auth;
18
+ mutation: typeof mutation;
19
+ query: typeof query;
17
20
  config: typeof getConfig;
18
21
  mail: typeof mail;
19
- users: ReturnType<typeof users>;
22
+ users: typeof users;
23
+ model: (name: string) => ReturnType<typeof getModel>;
20
24
  roles: ReturnType<typeof roles>;
21
- collect(name: string, fields: Record<string, any>): ReturnType<typeof createCollection>;
22
- drive(index: number): ReturnType<typeof getDrive>;
23
- collects(collections: {
25
+ collect: (name: string, fields: Record<string, any>) => ReturnType<typeof createCollection> & {
26
+ data_path: string;
27
+ };
28
+ list: (entity: string, fields: Record<string, any>) => ReturnType<typeof createList>;
29
+ drive: typeof getDrive;
30
+ collects: (collections: {
24
31
  [key: string]: any;
25
- }): Promise<{
32
+ }) => Promise<{
26
33
  [key: string]: any;
27
34
  }>;
28
- list(entity: string, fields: Fields): ReturnType<typeof createList>;
29
- post: AxiosInstance['post'];
30
- }
31
- declare const _default: (baseURL: string) => LightClient;
32
- export default _default;
35
+ };
36
+ export declare const createClient: (baseURL: string) => ClientType;
37
+ export type LightClient = ReturnType<typeof createClient>;
38
+ export {};
package/dist/drive.d.ts CHANGED
@@ -1,5 +1,21 @@
1
1
  export declare const listDrives: () => Promise<any>;
2
2
  export declare const getDrive: (index: number) => {
3
+ folders: {
4
+ list: (path: string, fields?: import('./folder').QueryFolderFields) => Promise<Record<keyof import('./folder').FolderFields, any>[]>;
5
+ create: (path: string) => Promise<any>;
6
+ delete: (path: string) => Promise<any>;
7
+ rename: (path: string, name: string) => Promise<any>;
8
+ };
9
+ files: {
10
+ list: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
11
+ get: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
12
+ readFileAsBase64(path: string): Promise<string>;
13
+ read: (path: string) => Promise<any>;
14
+ write: (path: string, content: string) => Promise<any>;
15
+ delete: (path: string) => Promise<any>;
16
+ rename: (path: string, name: string) => Promise<any>;
17
+ move: (source: string, destination: string) => Promise<any>;
18
+ };
3
19
  listFiles: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
4
20
  getFile: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
5
21
  readFile: (path: string) => Promise<any>;
@@ -17,22 +33,6 @@ export declare const getDrive: (index: number) => {
17
33
  size: number;
18
34
  mime: string;
19
35
  }>;
20
- folders: {
21
- list: (path: string, fields?: import('./folder').QueryFolderFields) => Promise<Record<keyof import('./folder').FolderFields, any>[]>;
22
- create: (path: string) => Promise<any>;
23
- delete: (path: string) => Promise<any>;
24
- rename: (path: string, name: string) => Promise<any>;
25
- };
26
- files: {
27
- list: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
28
- get: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
29
- readFileAsBase64(path: string): Promise<string>;
30
- read: (path: string) => Promise<any>;
31
- write: (path: string, content: string) => Promise<any>;
32
- delete: (path: string) => Promise<any>;
33
- rename: (path: string, name: string) => Promise<any>;
34
- move: (source: string, destination: string) => Promise<any>;
35
- };
36
36
  };
37
37
  declare const _default: () => {
38
38
  list: Promise<Array<{
@@ -40,6 +40,22 @@ declare const _default: () => {
40
40
  name: string;
41
41
  }>>;
42
42
  get: (index: number) => {
43
+ folders: {
44
+ list: (path: string, fields?: import('./folder').QueryFolderFields) => Promise<Record<keyof import('./folder').FolderFields, any>[]>;
45
+ create: (path: string) => Promise<any>;
46
+ delete: (path: string) => Promise<any>;
47
+ rename: (path: string, name: string) => Promise<any>;
48
+ };
49
+ files: {
50
+ list: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
51
+ get: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
52
+ readFileAsBase64(path: string): Promise<string>;
53
+ read: (path: string) => Promise<any>;
54
+ write: (path: string, content: string) => Promise<any>;
55
+ delete: (path: string) => Promise<any>;
56
+ rename: (path: string, name: string) => Promise<any>;
57
+ move: (source: string, destination: string) => Promise<any>;
58
+ };
43
59
  listFiles: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
44
60
  getFile: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
45
61
  readFile: (path: string) => Promise<any>;
@@ -57,22 +73,6 @@ declare const _default: () => {
57
73
  size: number;
58
74
  mime: string;
59
75
  }>;
60
- folders: {
61
- list: (path: string, fields?: import('./folder').QueryFolderFields) => Promise<Record<keyof import('./folder').FolderFields, any>[]>;
62
- create: (path: string) => Promise<any>;
63
- delete: (path: string) => Promise<any>;
64
- rename: (path: string, name: string) => Promise<any>;
65
- };
66
- files: {
67
- list: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
68
- get: (path: string, fields?: import('./file').QueryFileFields) => Promise<any>;
69
- readFileAsBase64(path: string): Promise<string>;
70
- read: (path: string) => Promise<any>;
71
- write: (path: string, content: string) => Promise<any>;
72
- delete: (path: string) => Promise<any>;
73
- rename: (path: string, name: string) => Promise<any>;
74
- move: (source: string, destination: string) => Promise<any>;
75
- };
76
76
  };
77
77
  };
78
78
  export default _default;
package/dist/index.d.ts CHANGED
@@ -17,8 +17,7 @@ export { default as query } from './query';
17
17
  export { default as mutation } from './mutation';
18
18
  export { default as toQuery } from './toQuery';
19
19
  export type Fields = Record<string, any>;
20
- export { default as createClient } from './createClient';
21
- export type { LightClient } from './createClient';
20
+ export * from './createClient';
22
21
  export { default as createCollection } from './createCollection';
23
22
  export { default as createList } from './createList';
24
23
  export declare const list: typeof createList;