skapi-js 0.2.0 → 0.2.2
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/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/Main.d.ts +3 -0
- package/js/Main.js +3 -0
- package/js/Types.d.ts +194 -0
- package/js/Types.js +1 -0
- package/js/main/error.d.ts +8 -0
- package/js/main/error.js +38 -0
- package/js/main/skapi.d.ts +79 -0
- package/js/main/skapi.js +285 -0
- package/js/methods/database.d.ts +83 -0
- package/js/methods/database.js +915 -0
- package/js/methods/request.d.ts +36 -0
- package/js/methods/request.js +656 -0
- package/js/methods/subscription.d.ts +46 -0
- package/js/methods/subscription.js +240 -0
- package/js/methods/user.d.ts +67 -0
- package/js/methods/user.js +747 -0
- package/js/utils/utils.d.ts +20 -0
- package/js/utils/utils.js +286 -0
- package/js/utils/validator.d.ts +19 -0
- package/js/utils/validator.js +294 -0
- package/package.json +5 -3
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { RecordData, Form, FormSubmitCallback, FetchOptions, DatabaseResponse, GetRecordQuery, Condition, PostRecordConfig, ProgressCallback } from '../Types';
|
|
2
|
+
export declare function deleteFiles(params: {
|
|
3
|
+
service?: string;
|
|
4
|
+
endpoints: string | string[];
|
|
5
|
+
storage?: 'records' | 'host';
|
|
6
|
+
}): Promise<any>;
|
|
7
|
+
export declare function uploadFiles(fileList: Form<FileList | File[]>, params: {
|
|
8
|
+
service?: string;
|
|
9
|
+
record_id: string;
|
|
10
|
+
request?: 'post' | 'host';
|
|
11
|
+
progress: ProgressCallback;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
completed: File[];
|
|
14
|
+
failed: File[];
|
|
15
|
+
}>;
|
|
16
|
+
export declare function getFile(url: string, config?: {
|
|
17
|
+
noCdn?: boolean;
|
|
18
|
+
dataType?: 'base64' | 'download' | 'endpoint' | 'blob';
|
|
19
|
+
expiration?: number;
|
|
20
|
+
progress?: ProgressCallback;
|
|
21
|
+
}): Promise<Blob | string>;
|
|
22
|
+
export declare function getRecords(query: GetRecordQuery, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RecordData>>;
|
|
23
|
+
export declare function postRecord(form: Form<Record<string, any>> | null | undefined, config: PostRecordConfig & FormSubmitCallback): Promise<RecordData>;
|
|
24
|
+
export declare function getTables(query: {
|
|
25
|
+
table: string;
|
|
26
|
+
condition?: Condition;
|
|
27
|
+
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
28
|
+
number_of_records: number;
|
|
29
|
+
table: string;
|
|
30
|
+
size: number;
|
|
31
|
+
}>>;
|
|
32
|
+
export declare function getIndexes(query: {
|
|
33
|
+
table: string;
|
|
34
|
+
index?: string;
|
|
35
|
+
order?: {
|
|
36
|
+
by: 'average_number' | 'total_number' | 'number_count' | 'average_bool' | 'total_bool' | 'bool_count' | 'string_count' | 'index_name';
|
|
37
|
+
value?: number | boolean | string;
|
|
38
|
+
condition?: Condition;
|
|
39
|
+
};
|
|
40
|
+
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
41
|
+
table: string;
|
|
42
|
+
index: string;
|
|
43
|
+
number_of_records: number;
|
|
44
|
+
string_count: number;
|
|
45
|
+
number_count: number;
|
|
46
|
+
boolean_count: number;
|
|
47
|
+
total_number: number;
|
|
48
|
+
total_bool: number;
|
|
49
|
+
average_number: number;
|
|
50
|
+
average_bool: number;
|
|
51
|
+
}>>;
|
|
52
|
+
export declare function getTags(query: {
|
|
53
|
+
table: string;
|
|
54
|
+
tag?: string;
|
|
55
|
+
condition?: Condition;
|
|
56
|
+
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
57
|
+
table: string;
|
|
58
|
+
tag: string;
|
|
59
|
+
number_of_records: string;
|
|
60
|
+
}>>;
|
|
61
|
+
export declare function deleteRecords(params: {
|
|
62
|
+
service?: string;
|
|
63
|
+
record_id?: string | string[];
|
|
64
|
+
table?: {
|
|
65
|
+
name: string;
|
|
66
|
+
access_group?: number | 'private' | 'public' | 'authorized';
|
|
67
|
+
subscription?: string;
|
|
68
|
+
subscription_group?: number;
|
|
69
|
+
};
|
|
70
|
+
}): Promise<string>;
|
|
71
|
+
export declare function grantPrivateRecordAccess(params: {
|
|
72
|
+
record_id: string;
|
|
73
|
+
user_id: string | string[];
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
export declare function removePrivateRecordAccess(params: {
|
|
76
|
+
record_id: string;
|
|
77
|
+
user_id: string | string[];
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
export declare function listPrivateRecordAccess(params: {
|
|
80
|
+
record_id: string;
|
|
81
|
+
user_id: string | string[];
|
|
82
|
+
}): Promise<void>;
|
|
83
|
+
export declare function requestPrivateRecordAccessKey(record_id: string): Promise<void>;
|