@ztimson/momentum 0.0.0 → 0.13.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/actions.d.ts +52 -51
- package/dist/api.d.ts +22 -21
- package/dist/auth.d.ts +61 -60
- package/dist/core.d.ts +7 -7
- package/dist/data.d.ts +21 -20
- package/dist/email.d.ts +22 -21
- package/dist/groups.d.ts +20 -19
- package/dist/index.d.ts +14 -14
- package/dist/logger.d.ts +53 -52
- package/dist/momentum.cjs.map +1 -1
- package/dist/momentum.d.ts +35 -34
- package/dist/momentum.mjs.map +1 -1
- package/dist/settings.d.ts +44 -43
- package/dist/sockets.d.ts +14 -13
- package/dist/static.d.ts +16 -15
- package/dist/storage.d.ts +39 -38
- package/dist/users.d.ts +23 -22
- package/package.json +1 -1
package/dist/settings.d.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypedEmitter,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
value
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
3
|
+
import { Api } from './api';
|
|
4
|
+
|
|
5
|
+
/** Momentum variable */
|
|
6
|
+
export type Setting<T> = {
|
|
7
|
+
/** Internal ID */
|
|
8
|
+
_id?: string;
|
|
9
|
+
/** Variable name */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Variable value */
|
|
12
|
+
value: T;
|
|
13
|
+
/** Visible without authenticating */
|
|
14
|
+
public?: boolean;
|
|
15
|
+
/** Momentum variable, cannot be deleted */
|
|
16
|
+
system?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type SettingEvents = TypedEvents & {
|
|
19
|
+
LIST: (variables: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}) => any;
|
|
22
|
+
DELETE: (key: string) => any;
|
|
23
|
+
READ: (variable: Setting<any> | null) => any;
|
|
24
|
+
UPDATE: (variable: Setting<any>) => any;
|
|
25
|
+
};
|
|
26
|
+
export declare class Settings extends TypedEmitter<SettingEvents> {
|
|
27
|
+
private readonly api;
|
|
28
|
+
$cache: BehaviorSubject<{
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>;
|
|
31
|
+
get cache(): {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
set cache(val: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
});
|
|
37
|
+
constructor(api: Api | string);
|
|
38
|
+
list(detailed?: boolean): Promise<{
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>;
|
|
41
|
+
delete(key: string): Promise<void>;
|
|
42
|
+
read(key: string, reload?: boolean): Promise<Setting<any> | null>;
|
|
43
|
+
update(variable: Setting<any>): Promise<Setting<any>>;
|
|
44
|
+
}
|
|
44
45
|
//# sourceMappingURL=settings.d.ts.map
|
package/dist/sockets.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Api } from './api';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Api } from './api';
|
|
2
|
+
|
|
3
|
+
export declare class Socket {
|
|
4
|
+
static readonly timeout = 10000;
|
|
5
|
+
private readonly api;
|
|
6
|
+
readonly url: string;
|
|
7
|
+
private connection;
|
|
8
|
+
open: boolean;
|
|
9
|
+
constructor(api: Api | string);
|
|
10
|
+
close(): void;
|
|
11
|
+
connect(retry?: number): void;
|
|
12
|
+
private handle;
|
|
13
|
+
send(channel: string, payload?: any): void;
|
|
14
|
+
}
|
|
14
15
|
//# sourceMappingURL=sockets.d.ts.map
|
package/dist/static.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypedEmitter,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { FileMeta } from './storage';
|
|
2
|
+
import { TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
3
|
+
import { Api } from './api';
|
|
4
|
+
|
|
5
|
+
export type StaticEvents = TypedEvents & {
|
|
6
|
+
LIST: (path: string, response: string[] | FileMeta) => any;
|
|
7
|
+
DELETE: (path: string) => any;
|
|
8
|
+
UPLOAD: (files: FileMeta[]) => any;
|
|
9
|
+
};
|
|
10
|
+
export declare class Static extends TypedEmitter<StaticEvents> {
|
|
11
|
+
private readonly api;
|
|
12
|
+
constructor(api: Api | string);
|
|
13
|
+
delete(path: string): Promise<void>;
|
|
14
|
+
list(path: string): Promise<string[] | FileMeta>;
|
|
15
|
+
upload(files: File | File[], path?: string): Promise<FileMeta[]>;
|
|
16
|
+
}
|
|
16
17
|
//# sourceMappingURL=static.d.ts.map
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
open(path: string, target
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
1
|
+
import { PromiseProgress, RequestOptions, TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
2
|
+
import { Meta } from './core';
|
|
3
|
+
import { Api } from './api';
|
|
4
|
+
|
|
5
|
+
export type DirMeta = {
|
|
6
|
+
children: (DirMeta | FileMeta)[];
|
|
7
|
+
path: string;
|
|
8
|
+
name: string;
|
|
9
|
+
mime: 'directory';
|
|
10
|
+
size: number;
|
|
11
|
+
};
|
|
12
|
+
export type FileMeta = Meta & {
|
|
13
|
+
path: string;
|
|
14
|
+
name: string;
|
|
15
|
+
mime: string;
|
|
16
|
+
size: number;
|
|
17
|
+
};
|
|
18
|
+
export type StorageEvents = TypedEvents & {
|
|
19
|
+
LIST: (path: string, response: DirMeta | FileMeta) => any;
|
|
20
|
+
DELETE: (path: string) => any;
|
|
21
|
+
DOWNLOAD: (path: string, data: Blob) => any;
|
|
22
|
+
OPEN: (path: string) => any;
|
|
23
|
+
UPLOAD: (files: FileMeta[]) => any;
|
|
24
|
+
};
|
|
25
|
+
export declare class Storage extends TypedEmitter<StorageEvents> {
|
|
26
|
+
readonly api: Api;
|
|
27
|
+
constructor(api: Api | string);
|
|
28
|
+
delete(path: string): Promise<void>;
|
|
29
|
+
list(path: string): Promise<DirMeta | FileMeta>;
|
|
30
|
+
open(path: string, target: false): string;
|
|
31
|
+
open(path: string, target?: '_blank' | '_self'): Window | null;
|
|
32
|
+
mkdir(path: string): Promise<DirMeta>;
|
|
33
|
+
download(path: string, opts?: RequestOptions): PromiseProgress<Blob>;
|
|
34
|
+
upload(files?: File | File[] | null, opts?: string | {
|
|
35
|
+
path?: string;
|
|
36
|
+
accept?: string;
|
|
37
|
+
multiple?: boolean;
|
|
38
|
+
}): Promise<FileMeta[]>;
|
|
39
|
+
}
|
|
39
40
|
//# sourceMappingURL=storage.d.ts.map
|
package/dist/users.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
3
|
+
import { User } from './auth';
|
|
4
|
+
import { Api } from './api';
|
|
5
|
+
|
|
6
|
+
export type UserEvents = TypedEvents & {
|
|
7
|
+
LIST: (users: User[]) => any;
|
|
8
|
+
READ: (user: User) => any;
|
|
9
|
+
UPDATE: (user: User) => any;
|
|
10
|
+
DELETE: (username: string) => any;
|
|
11
|
+
};
|
|
12
|
+
export declare class Users extends TypedEmitter<UserEvents> {
|
|
13
|
+
private readonly api;
|
|
14
|
+
private listed;
|
|
15
|
+
$cache: BehaviorSubject<User[]>;
|
|
16
|
+
get cache(): User[];
|
|
17
|
+
set cache(val: User[]);
|
|
18
|
+
constructor(api: Api | string);
|
|
19
|
+
delete(username: string): Promise<void>;
|
|
20
|
+
list(reload?: boolean): Promise<User[]>;
|
|
21
|
+
read(username: string, reload?: boolean): Promise<User>;
|
|
22
|
+
update(user: User): Promise<User>;
|
|
23
|
+
}
|
|
23
24
|
//# sourceMappingURL=users.d.ts.map
|