@hostlink/light 1.2.5 → 2.0.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
@@ -1,11 +1,14 @@
1
- export declare const login: (username: string, password: string, code?: string) => Promise<boolean>;
2
- export declare const logout: () => Promise<boolean>;
3
- /**
4
- * Updates the user's password.
5
- * @param oldPassword The user's current password.
6
- * @param newPassword The user's new password.
7
- * @returns A Promise that resolves to a boolean indicating whether the password was successfully updated.
8
- */
9
- export declare const updatePassword: (oldPassword: string, newPassword: string) => Promise<boolean>;
10
- export declare const resetPassword: (email: string, password: string, code: string) => Promise<boolean>;
11
- export declare const forgetPassword: (email: string) => Promise<boolean>;
1
+ import { AxiosInstance } from 'axios';
2
+ declare const _default: (axios: AxiosInstance) => {
3
+ WebAuthn: {
4
+ login: (username: string) => Promise<void>;
5
+ register: () => Promise<void>;
6
+ };
7
+ login: (username: string, password: string, code?: string) => Promise<boolean>;
8
+ logout: () => Promise<boolean>;
9
+ updatePassword: (oldPassword: string, newPassword: string) => Promise<boolean>;
10
+ resetPassword: (email: string, password: string, code: string) => Promise<boolean>;
11
+ forgetPassword: (email: string) => Promise<boolean>;
12
+ granted: (rights: string[]) => Promise<string[]>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,4 @@
1
+ declare const _default: (query: any) => {
2
+ get: (name: string) => Promise<any>;
3
+ };
4
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { default as auth } from './auth';
2
+ import { AxiosInstance } from 'axios';
3
+ import { Fields } from '.';
4
+ import { default as _config } from './config';
5
+ import { default as _mail } from './mail';
6
+ import { default as _users } from './users';
7
+ import { default as _fs } from './fs';
8
+ import { default as models } from './models';
9
+ import { default as model } from './model';
10
+ import { default as roles } from './roles';
11
+ export interface LightClient {
12
+ baseURL: string;
13
+ axios: AxiosInstance;
14
+ auth: ReturnType<typeof auth>;
15
+ mutation: (operation: string, args: {
16
+ [key: string]: any;
17
+ } | null, fields: Fields) => Promise<any>;
18
+ query: (q: Object | Array<string | Object | string>) => Promise<any>;
19
+ config: ReturnType<typeof _config>;
20
+ mail: ReturnType<typeof _mail>;
21
+ users: ReturnType<typeof _users>;
22
+ fs: ReturnType<typeof _fs>;
23
+ models: ReturnType<typeof models>;
24
+ model(name: string): ReturnType<typeof model>;
25
+ roles: ReturnType<typeof roles>;
26
+ }
27
+ declare const _default: (baseURL: string) => LightClient;
28
+ export default _default;
package/dist/fs.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AxiosInstance } from 'axios';
1
2
  export type FSFile = {
2
3
  name: string;
3
4
  path: string;
@@ -10,13 +11,21 @@ export type FSFolder = {
10
11
  name: String;
11
12
  path: String;
12
13
  };
13
- export declare const fsListFiles: (path: string) => Promise<Array<File>>;
14
- export declare const fsListFolders: (path: string) => Promise<Array<FSFolder>>;
15
- export declare const fsReadFile: (path: string) => Promise<string>;
16
- export declare const fsWriteFile: (path: string, content: string) => Promise<boolean>;
17
- export declare const fsDeleteFile: (path: string) => Promise<boolean>;
18
- export declare const fsCreateFolder: (path: string) => Promise<boolean>;
19
- export declare const fsDeleteFolder: (path: string) => Promise<boolean>;
20
- export declare const fsRenameFile: (path: string, name: string) => Promise<boolean>;
21
- export declare const fsRenameFolder: (path: string, name: string) => Promise<boolean>;
22
- export declare const fsMoveFile: (source: string, target: string) => Promise<boolean>;
14
+ declare const _default: (axios: AxiosInstance) => {
15
+ uploadTempFile: (file: File) => Promise<any>;
16
+ folders: {
17
+ list: (path: string) => Promise<any>;
18
+ create: (path: string) => Promise<any>;
19
+ delete: (path: string) => Promise<any>;
20
+ rename: (path: string, name: string) => Promise<any>;
21
+ };
22
+ files: {
23
+ list: (path: string) => Promise<any>;
24
+ read: (path: string) => Promise<string>;
25
+ write: (path: string, content: string) => Promise<any>;
26
+ delete: (path: string) => Promise<any>;
27
+ rename: (path: string, name: string) => Promise<any>;
28
+ move: (source: string, target: string) => Promise<any>;
29
+ };
30
+ };
31
+ export default _default;
@@ -1,5 +1,6 @@
1
- export default function (): {
1
+ declare const _default: () => {
2
2
  merge: (obj1: any, obj2: any) => any;
3
3
  add: (f: any) => void;
4
4
  get(): any;
5
5
  };
6
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -1,16 +1,9 @@
1
1
  export * from './auth';
2
- export * from './axios';
3
- export * from './granted';
4
2
  export * from './model';
5
3
  export * from './file';
6
4
  export { default as query } from './query';
7
5
  export { default as mutation } from './mutation';
8
6
  export { default as toQuery } from './toQuery';
9
- export * from './apiUrl';
10
- export { default as uploadFile } from './uploadFile';
11
- export { default as sendMail } from './sendMail';
12
- export { default as getConfig } from './getConfig';
13
- export { default as webauthnLogin } from './webauthnLogin';
14
- export { default as webauthnRegister } from './webauthnRegister';
15
7
  export type Fields = Object | Array<string | Object> | string;
16
8
  export * from './fs';
9
+ export { default as createClient } from './createClient';