skapi-js 1.2.12-beta.5 → 1.2.12
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/README.md +0 -13
- package/dist/bundle-report-commonjs.html +2 -2
- package/dist/bundle-report.html +2 -2
- package/dist/skapi.cjs +1 -1
- package/dist/skapi.cjs.map +1 -1
- package/dist/skapi.d.mts +1534 -0
- package/dist/skapi.d.ts +1534 -0
- package/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.mjs +234 -0
- package/dist/skapi.mjs.map +1 -0
- package/js/Main.d.ts +0 -1
- package/js/Types.d.ts +1 -8
- package/js/main/skapi.d.ts +10 -9
- package/js/main/skapi.js +44 -43
- package/js/main/skapi.js.map +1 -1
- package/js/methods/admin.d.ts +2 -4
- package/js/methods/admin.js +9 -9
- package/js/methods/admin.js.map +1 -1
- package/js/methods/database.js +17 -10
- package/js/methods/database.js.map +1 -1
- package/js/methods/notification.js +0 -12
- package/js/methods/notification.js.map +1 -1
- package/js/methods/realtime.js +2 -17
- package/js/methods/realtime.js.map +1 -1
- package/js/methods/subscription.js +1 -1
- package/js/methods/subscription.js.map +1 -1
- package/js/methods/user.d.ts +2 -5
- package/js/methods/user.js +10 -47
- package/js/methods/user.js.map +1 -1
- package/js/methods/vivian.js +1 -1
- package/js/methods/vivian.js.map +1 -1
- package/js/methods/webrtc.js +3 -9
- package/js/methods/webrtc.js.map +1 -1
- package/js/polyfills/global.js +1 -173
- package/js/polyfills/global.js.map +1 -1
- package/js/utils/network.js +7 -19
- package/js/utils/network.js.map +1 -1
- package/js/utils/utils.js +4 -5
- package/js/utils/utils.js.map +1 -1
- package/js/utils/validator.js +4 -4
- package/js/utils/validator.js.map +1 -1
- package/package.json +1 -2
- package/js/node_modules/qpass/index.d.ts +0 -25
- package/js/src/Main.d.ts +0 -6
- package/js/src/Types.d.ts +0 -266
- package/js/src/main/error.d.ts +0 -9
- package/js/src/main/skapi.d.ts +0 -477
- package/js/src/methods/admin.d.ts +0 -61
- package/js/src/methods/database.d.ts +0 -87
- package/js/src/methods/notification.d.ts +0 -21
- package/js/src/methods/param_restrictions.d.ts +0 -21
- package/js/src/methods/realtime.d.ts +0 -35
- package/js/src/methods/request.d.ts +0 -43
- package/js/src/methods/subscription.d.ts +0 -69
- package/js/src/methods/user.d.ts +0 -174
- package/js/src/methods/vivian.d.ts +0 -3
- package/js/src/methods/webrtc.d.ts +0 -26
- package/js/src/polyfills/global.d.ts +0 -0
- package/js/src/utils/network.d.ts +0 -24
- package/js/src/utils/utils.d.ts +0 -32
- package/js/src/utils/validator.d.ts +0 -24
package/js/src/main/skapi.d.ts
DELETED
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import { DatabaseResponse, Connection, ProgressCallback, GetRecordQuery, FetchOptions, RecordData, Condition, UserAttributes, UserProfile, Newsletters, Form, PostRecordConfig, UserPublic, UserProfilePublicSettings, FileInfo, RTCEvent, RealtimeCallback, RTCConnectorParams, RTCConnector, DelRecordQuery, ConnectionInfo } from '../Types';
|
|
2
|
-
import { terminatePendingRequests } from '../utils/network';
|
|
3
|
-
import { extractFormData, fromBase62, generateRandom, toBase62, MD5 } from '../utils/utils';
|
|
4
|
-
type Options = {
|
|
5
|
-
autoLogin: boolean;
|
|
6
|
-
requestBatchSize?: number;
|
|
7
|
-
bearerToken?: string;
|
|
8
|
-
eventListener?: {
|
|
9
|
-
onLogin?: (user: UserProfile | null) => void;
|
|
10
|
-
onUserUpdate?: (user: UserProfile | null) => void;
|
|
11
|
-
onBatchProcess?: (process: {
|
|
12
|
-
batchToProcess: number;
|
|
13
|
-
itemsToProcess: number;
|
|
14
|
-
completed: any[];
|
|
15
|
-
}) => void;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default class Skapi {
|
|
19
|
-
private __version;
|
|
20
|
-
service: string;
|
|
21
|
-
owner: string;
|
|
22
|
-
session: Record<string, any> | null;
|
|
23
|
-
connection: Connection | null;
|
|
24
|
-
private __my_unique_ids;
|
|
25
|
-
private userPool;
|
|
26
|
-
private __socket;
|
|
27
|
-
private __mediaStream;
|
|
28
|
-
private host;
|
|
29
|
-
private hostDomain;
|
|
30
|
-
private target_cdn;
|
|
31
|
-
private customApiDomain;
|
|
32
|
-
private requestBatchSize;
|
|
33
|
-
private __disabledAccount;
|
|
34
|
-
private __cached_requests;
|
|
35
|
-
private __startKeyHistory;
|
|
36
|
-
private __request_signup_confirmation;
|
|
37
|
-
private __private_access_key;
|
|
38
|
-
private __class_properties_has_been_cached;
|
|
39
|
-
private __user;
|
|
40
|
-
get user(): UserProfile | null;
|
|
41
|
-
set user(value: UserProfile | null);
|
|
42
|
-
private _userProfileListeners;
|
|
43
|
-
private _onLoginListeners;
|
|
44
|
-
get onLogin(): Function[];
|
|
45
|
-
set onLogin(listener: (user: UserProfile | null) => void);
|
|
46
|
-
get onUserUpdate(): Function[];
|
|
47
|
-
set onUserUpdate(listener: (user: UserProfile | null) => void);
|
|
48
|
-
private _runOnUserUpdateListeners;
|
|
49
|
-
private _runOnLoginListeners;
|
|
50
|
-
private admin_endpoint;
|
|
51
|
-
private record_endpoint;
|
|
52
|
-
private _onBatchProcessListeners;
|
|
53
|
-
get onBatchProcess(): ((process: {
|
|
54
|
-
batchToProcess: number;
|
|
55
|
-
itemsToProcess: number;
|
|
56
|
-
completed: any[];
|
|
57
|
-
}) => void)[];
|
|
58
|
-
set onBatchProcess(listener: (process: {
|
|
59
|
-
batchToProcess: number;
|
|
60
|
-
itemsToProcess: number;
|
|
61
|
-
completed: any[];
|
|
62
|
-
}) => void);
|
|
63
|
-
validate: {
|
|
64
|
-
userId(val: string): boolean;
|
|
65
|
-
url(val: string | string[]): boolean;
|
|
66
|
-
phoneNumber(val: string): boolean;
|
|
67
|
-
birthdate(val: string): boolean;
|
|
68
|
-
email(val: string): boolean;
|
|
69
|
-
params(val: any, schema: Record<string, any>, required?: string[]): any;
|
|
70
|
-
};
|
|
71
|
-
util: {
|
|
72
|
-
MD5: typeof MD5;
|
|
73
|
-
generateRandom: typeof generateRandom;
|
|
74
|
-
toBase62: typeof toBase62;
|
|
75
|
-
fromBase62: typeof fromBase62;
|
|
76
|
-
extractFormData: typeof extractFormData;
|
|
77
|
-
terminatePendingRequests: typeof terminatePendingRequests;
|
|
78
|
-
request: (url: string, data?: Form<any>, options?: {
|
|
79
|
-
fetchOptions?: FetchOptions;
|
|
80
|
-
auth?: boolean;
|
|
81
|
-
method?: string;
|
|
82
|
-
bypassAwaitConnection?: boolean;
|
|
83
|
-
responseType?: "json" | "blob" | "text" | "arrayBuffer" | "formData" | "document";
|
|
84
|
-
contentType?: string;
|
|
85
|
-
}) => Promise<any>;
|
|
86
|
-
};
|
|
87
|
-
private __connection;
|
|
88
|
-
private __authConnection;
|
|
89
|
-
private __network_logs;
|
|
90
|
-
private __endpoint_version;
|
|
91
|
-
private __public_identifier;
|
|
92
|
-
private bearerToken;
|
|
93
|
-
constructor(service: string, owner?: string | Options, options?: Options | any, __etc?: any);
|
|
94
|
-
getConnectionInfo(): Promise<ConnectionInfo>;
|
|
95
|
-
private _updateConnection;
|
|
96
|
-
private registerTicket;
|
|
97
|
-
private unregisterTicket;
|
|
98
|
-
version(): Promise<string>;
|
|
99
|
-
private log;
|
|
100
|
-
getFeed(params?: {
|
|
101
|
-
access_group?: number;
|
|
102
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RecordData>>;
|
|
103
|
-
closeRTC(params: {
|
|
104
|
-
cid?: string;
|
|
105
|
-
close_all?: boolean;
|
|
106
|
-
}): Promise<void>;
|
|
107
|
-
connectRTC(params: RTCConnectorParams, callback?: RTCEvent): Promise<RTCConnector>;
|
|
108
|
-
connectRealtime(callback: RealtimeCallback): Promise<WebSocket>;
|
|
109
|
-
spellcast(params: any): Promise<any>;
|
|
110
|
-
getspell(params: any): Promise<any>;
|
|
111
|
-
dopamine(params: any): Promise<void>;
|
|
112
|
-
getUniqueId(params: Form<{
|
|
113
|
-
unique_id?: string;
|
|
114
|
-
condition?: Condition;
|
|
115
|
-
}>, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
116
|
-
unique_id: string;
|
|
117
|
-
record_id: string;
|
|
118
|
-
}>>;
|
|
119
|
-
resendInvitation(params: Form<{
|
|
120
|
-
email: string;
|
|
121
|
-
confirmation_url?: string;
|
|
122
|
-
}>): Promise<"SUCCESS: Invitation has been re-sent. (User ID: xxx...)">;
|
|
123
|
-
cancelInvitation(params: Form<{
|
|
124
|
-
email: string;
|
|
125
|
-
}>): Promise<"SUCCESS: Invitation has been canceled.">;
|
|
126
|
-
getInvitations(params: Form<{
|
|
127
|
-
email?: string;
|
|
128
|
-
}>, fetchOptions: FetchOptions): Promise<DatabaseResponse<UserProfile>>;
|
|
129
|
-
openIdLogin(params: {
|
|
130
|
-
token: string;
|
|
131
|
-
id: string;
|
|
132
|
-
merge?: boolean | string[];
|
|
133
|
-
}): Promise<{
|
|
134
|
-
userProfile: UserProfile;
|
|
135
|
-
openid: {
|
|
136
|
-
[attribute: string]: string;
|
|
137
|
-
};
|
|
138
|
-
}>;
|
|
139
|
-
loginWithToken(params: {
|
|
140
|
-
idToken: string;
|
|
141
|
-
}): Promise<UserProfile>;
|
|
142
|
-
registerNewsletterGroup(params: Form<{
|
|
143
|
-
group: string;
|
|
144
|
-
restriction: number;
|
|
145
|
-
}>): Promise<"SUCCESS: Your newsletter group has been registered.">;
|
|
146
|
-
clientSecretRequest(params: {
|
|
147
|
-
url: string;
|
|
148
|
-
clientSecretName: string;
|
|
149
|
-
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
150
|
-
headers?: {
|
|
151
|
-
[key: string]: string;
|
|
152
|
-
};
|
|
153
|
-
data?: {
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
};
|
|
156
|
-
params?: {
|
|
157
|
-
[key: string]: string;
|
|
158
|
-
};
|
|
159
|
-
}): Promise<any>;
|
|
160
|
-
consumeTicket(params: {
|
|
161
|
-
ticket_id: string;
|
|
162
|
-
method: string;
|
|
163
|
-
auth?: boolean;
|
|
164
|
-
data?: {
|
|
165
|
-
[key: string]: any;
|
|
166
|
-
};
|
|
167
|
-
}): Promise<any>;
|
|
168
|
-
getConsumedTickets(params: {
|
|
169
|
-
ticket_id?: string;
|
|
170
|
-
}, fetchOptions: FetchOptions): Promise<DatabaseResponse<any[]>>;
|
|
171
|
-
getTickets(params: {
|
|
172
|
-
ticket_id?: string;
|
|
173
|
-
}, fetchOptions: FetchOptions): Promise<DatabaseResponse<any[]>>;
|
|
174
|
-
closeRealtime(): Promise<void>;
|
|
175
|
-
getRealtimeUsers(params: {
|
|
176
|
-
group: string;
|
|
177
|
-
user_id?: string;
|
|
178
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
179
|
-
user_id: string;
|
|
180
|
-
cid: string;
|
|
181
|
-
}[]>>;
|
|
182
|
-
sendInquiry(data: Form<{
|
|
183
|
-
name: string;
|
|
184
|
-
email: string;
|
|
185
|
-
subject: string;
|
|
186
|
-
message: string;
|
|
187
|
-
}>): Promise<"SUCCESS: Inquiry has been sent.">;
|
|
188
|
-
blockAccount(form: {
|
|
189
|
-
user_id: string;
|
|
190
|
-
}): Promise<"SUCCESS: The user has been blocked.">;
|
|
191
|
-
unblockAccount(form: {
|
|
192
|
-
user_id: string;
|
|
193
|
-
}): Promise<"SUCCESS: The user has been unblocked.">;
|
|
194
|
-
deleteAccount(form: {
|
|
195
|
-
user_id: string;
|
|
196
|
-
}): Promise<"SUCCESS: Account has been deleted.">;
|
|
197
|
-
inviteUser(form: {
|
|
198
|
-
email: string;
|
|
199
|
-
} & UserAttributes & UserProfilePublicSettings, options?: {
|
|
200
|
-
confirmation_url?: string;
|
|
201
|
-
email_subscription?: boolean;
|
|
202
|
-
template?: {
|
|
203
|
-
url: string;
|
|
204
|
-
subject: string;
|
|
205
|
-
};
|
|
206
|
-
}): Promise<'SUCCESS: Invitation has been sent.'>;
|
|
207
|
-
createAccount(form: {
|
|
208
|
-
email: string;
|
|
209
|
-
password: string;
|
|
210
|
-
} & UserAttributes & UserProfilePublicSettings): Promise<UserProfile & UserPublic & {
|
|
211
|
-
email_admin: string;
|
|
212
|
-
approved: string;
|
|
213
|
-
log: number;
|
|
214
|
-
username: string;
|
|
215
|
-
}>;
|
|
216
|
-
grantAccess(params: {
|
|
217
|
-
user_id: string;
|
|
218
|
-
access_group: number;
|
|
219
|
-
}): Promise<'SUCCESS: Access has been granted to the user.'>;
|
|
220
|
-
getRealtimeGroups(params?: {
|
|
221
|
-
searchFor: 'group' | 'number_of_users';
|
|
222
|
-
value: string | number;
|
|
223
|
-
condition?: '>' | '>=' | '=' | '<' | '<=' | '!=' | 'gt' | 'gte' | 'eq' | 'lt' | 'lte' | 'ne';
|
|
224
|
-
range?: string | number;
|
|
225
|
-
} | null, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
226
|
-
group: string;
|
|
227
|
-
number_of_users: number;
|
|
228
|
-
}>>;
|
|
229
|
-
newsletterGroupEndpoint(params: any): Promise<any>;
|
|
230
|
-
postRealtime(message: any, recipient: string, notification?: {
|
|
231
|
-
config?: {
|
|
232
|
-
always: boolean;
|
|
233
|
-
};
|
|
234
|
-
title: string;
|
|
235
|
-
body: string;
|
|
236
|
-
}): Promise<{
|
|
237
|
-
type: 'success';
|
|
238
|
-
message: 'Message sent.';
|
|
239
|
-
}>;
|
|
240
|
-
joinRealtime(params: {
|
|
241
|
-
group: string | null;
|
|
242
|
-
}): Promise<{
|
|
243
|
-
type: 'success';
|
|
244
|
-
message: string;
|
|
245
|
-
}>;
|
|
246
|
-
getConnection(): Promise<Connection>;
|
|
247
|
-
getProfile(options?: {
|
|
248
|
-
refreshToken: boolean;
|
|
249
|
-
}): Promise<UserProfile | null>;
|
|
250
|
-
getFile(url: string, config?: {
|
|
251
|
-
dataType?: 'base64' | 'download' | 'endpoint' | 'blob' | 'text' | 'info';
|
|
252
|
-
expires?: number;
|
|
253
|
-
progress?: ProgressCallback;
|
|
254
|
-
}): Promise<Blob | string | void | FileInfo>;
|
|
255
|
-
secureRequest<Params = {
|
|
256
|
-
url: string;
|
|
257
|
-
data?: any;
|
|
258
|
-
sync?: boolean;
|
|
259
|
-
}, Response = {
|
|
260
|
-
response: any;
|
|
261
|
-
statusCode: number;
|
|
262
|
-
url: string;
|
|
263
|
-
}>(params: Params[] | Form<Params>, url?: string): Promise<Response | Response[]>;
|
|
264
|
-
getFormResponse(): Promise<any>;
|
|
265
|
-
getRecords(query: GetRecordQuery, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RecordData>>;
|
|
266
|
-
getTables(query: {
|
|
267
|
-
table: string;
|
|
268
|
-
condition?: Condition;
|
|
269
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
270
|
-
number_of_records: number;
|
|
271
|
-
table: string;
|
|
272
|
-
size: number;
|
|
273
|
-
}>>;
|
|
274
|
-
getIndexes(query: {
|
|
275
|
-
table: string;
|
|
276
|
-
index?: string;
|
|
277
|
-
order?: {
|
|
278
|
-
by: 'average_number' | 'total_number' | 'number_count' | 'average_bool' | 'total_bool' | 'bool_count' | 'string_count' | 'index_name';
|
|
279
|
-
value?: number | boolean | string;
|
|
280
|
-
condition?: Condition;
|
|
281
|
-
};
|
|
282
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
283
|
-
table: string;
|
|
284
|
-
index: string;
|
|
285
|
-
number_of_records: number;
|
|
286
|
-
string_count?: number;
|
|
287
|
-
number_count?: number;
|
|
288
|
-
boolean_count?: number;
|
|
289
|
-
total_number?: number;
|
|
290
|
-
total_bool?: number;
|
|
291
|
-
average_number?: number;
|
|
292
|
-
average_bool?: number;
|
|
293
|
-
}>>;
|
|
294
|
-
getTags(query: {
|
|
295
|
-
table: string;
|
|
296
|
-
tag?: string;
|
|
297
|
-
condition?: Condition;
|
|
298
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
299
|
-
table: string;
|
|
300
|
-
tag: string;
|
|
301
|
-
number_of_records: string;
|
|
302
|
-
}>>;
|
|
303
|
-
deleteRecords(params: DelRecordQuery, fetchOptions?: FetchOptions): Promise<string | DatabaseResponse<RecordData>>;
|
|
304
|
-
resendSignupConfirmation(): Promise<'SUCCESS: Signup confirmation e-mail has been sent.'>;
|
|
305
|
-
recoverAccount(redirect?: boolean | string): Promise<"SUCCESS: Recovery e-mail has been sent.">;
|
|
306
|
-
getUsers(params?: {
|
|
307
|
-
searchFor: 'user_id' | 'email' | 'phone_number' | 'locale' | 'name' | 'address' | 'gender' | 'birthdate' | 'subscribers' | 'timestamp' | 'approved';
|
|
308
|
-
value: string | number | boolean | string[];
|
|
309
|
-
condition?: '>' | '>=' | '=' | '<' | '<=' | 'gt' | 'gte' | 'eq' | 'lt' | 'lte';
|
|
310
|
-
range?: string | number | boolean;
|
|
311
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<UserPublic>>;
|
|
312
|
-
disableAccount(): Promise<'SUCCESS: account has been disabled.'>;
|
|
313
|
-
lastVerifiedEmail(params?: {
|
|
314
|
-
revert: boolean;
|
|
315
|
-
}): Promise<string | UserProfile>;
|
|
316
|
-
unsubscribeNewsletter(params: {
|
|
317
|
-
group: number | 'public' | 'authorized' | null;
|
|
318
|
-
}): Promise<string>;
|
|
319
|
-
adminNewsletterRequest(params: any): Promise<any>;
|
|
320
|
-
subscribeNotification(endpoint: string, keys: {
|
|
321
|
-
p256dh: string;
|
|
322
|
-
auth: string;
|
|
323
|
-
}): Promise<'SUCCESS: Subscribed to receive notifications.'>;
|
|
324
|
-
unsubscribeNotification(endpoint: string, keys: {
|
|
325
|
-
p256dh: string;
|
|
326
|
-
auth: string;
|
|
327
|
-
}): Promise<'SUCCESS: Unsubscribed from notifications.'>;
|
|
328
|
-
vapidPublicKey(): Promise<{
|
|
329
|
-
VAPIDPublicKey: string;
|
|
330
|
-
}>;
|
|
331
|
-
pushNotification(form: {
|
|
332
|
-
title: string;
|
|
333
|
-
body: string;
|
|
334
|
-
}, user_ids?: string | string[]): Promise<"SUCCESS: Notification sent.">;
|
|
335
|
-
getNewsletters(params?: {
|
|
336
|
-
searchFor: 'message_id' | 'timestamp' | 'read' | 'complaint' | 'subject';
|
|
337
|
-
value: string | number;
|
|
338
|
-
range: string | number;
|
|
339
|
-
condition?: '>' | '>=' | '=' | '<' | '<=' | 'gt' | 'gte' | 'eq' | 'lt' | 'lte';
|
|
340
|
-
group: 'public' | 'authorized' | number;
|
|
341
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Newsletters>>;
|
|
342
|
-
getNewsletterSubscription(params: {
|
|
343
|
-
group?: number | 'public' | 'authorized';
|
|
344
|
-
}, fetchOptions?: FetchOptions): Promise<{
|
|
345
|
-
active: boolean;
|
|
346
|
-
timestamp: number;
|
|
347
|
-
group: number;
|
|
348
|
-
subscribed_email: string;
|
|
349
|
-
}[]>;
|
|
350
|
-
requestUsernameChange(params: {
|
|
351
|
-
redirect?: string;
|
|
352
|
-
username: string;
|
|
353
|
-
}): Promise<'SUCCESS: confirmation e-mail has been sent.'>;
|
|
354
|
-
grantPrivateRecordAccess(params: {
|
|
355
|
-
record_id: string;
|
|
356
|
-
user_id: string | string[];
|
|
357
|
-
}): Promise<string>;
|
|
358
|
-
removePrivateRecordAccess(params: {
|
|
359
|
-
record_id: string;
|
|
360
|
-
user_id: string | string[];
|
|
361
|
-
}): Promise<string>;
|
|
362
|
-
listPrivateRecordAccess(params: {
|
|
363
|
-
record_id?: string;
|
|
364
|
-
user_id?: string | string[];
|
|
365
|
-
}): Promise<DatabaseResponse<{
|
|
366
|
-
record_id: string;
|
|
367
|
-
user_id: string;
|
|
368
|
-
}>>;
|
|
369
|
-
requestPrivateRecordAccessKey(params: {
|
|
370
|
-
record_id: string;
|
|
371
|
-
reference_id?: string;
|
|
372
|
-
}): Promise<string>;
|
|
373
|
-
deleteFiles(params: {
|
|
374
|
-
endpoints: string | string[];
|
|
375
|
-
}): Promise<RecordData[]>;
|
|
376
|
-
uploadFiles(fileList: FormData | HTMLFormElement | SubmitEvent, params: {
|
|
377
|
-
record_id: string;
|
|
378
|
-
progress?: ProgressCallback;
|
|
379
|
-
}): Promise<{
|
|
380
|
-
completed: File[];
|
|
381
|
-
failed: File[];
|
|
382
|
-
bin_endpoints: string[];
|
|
383
|
-
}>;
|
|
384
|
-
mock(data: Form<any | {
|
|
385
|
-
raise: 'ERR_INVALID_REQUEST' | 'ERR_INVALID_PARAMETER' | 'SOMETHING_WENT_WRONG' | 'ERR_EXISTS' | 'ERR_NOT_EXISTS';
|
|
386
|
-
}>, options?: {
|
|
387
|
-
auth?: boolean;
|
|
388
|
-
method?: string;
|
|
389
|
-
responseType?: 'blob' | 'json' | 'text' | 'arrayBuffer' | 'formData' | 'document';
|
|
390
|
-
contentType?: string;
|
|
391
|
-
progress?: ProgressCallback;
|
|
392
|
-
}): Promise<{
|
|
393
|
-
[key: string]: any;
|
|
394
|
-
}>;
|
|
395
|
-
login(form: Form<{
|
|
396
|
-
username?: string;
|
|
397
|
-
email: string;
|
|
398
|
-
password: string;
|
|
399
|
-
}>): Promise<UserProfile>;
|
|
400
|
-
logout(form?: Form<{
|
|
401
|
-
global: boolean;
|
|
402
|
-
}>): Promise<'SUCCESS: The user has been logged out.'>;
|
|
403
|
-
signup(form: Form<{
|
|
404
|
-
email: String;
|
|
405
|
-
password: String;
|
|
406
|
-
username?: string;
|
|
407
|
-
} & UserAttributes>, option?: {
|
|
408
|
-
signup_confirmation?: boolean | string;
|
|
409
|
-
email_subscription?: boolean;
|
|
410
|
-
login?: boolean;
|
|
411
|
-
}): Promise<UserProfile | "SUCCESS: The account has been created. User's signup confirmation is required." | 'SUCCESS: The account has been created.'>;
|
|
412
|
-
resetPassword(form: Form<{
|
|
413
|
-
email: string;
|
|
414
|
-
code: string | number;
|
|
415
|
-
new_password: string;
|
|
416
|
-
}>): Promise<"SUCCESS: New password has been set.">;
|
|
417
|
-
verifyEmail(form?: Form<{
|
|
418
|
-
code: string;
|
|
419
|
-
}>): Promise<string>;
|
|
420
|
-
verifyPhoneNumber(form?: Form<{
|
|
421
|
-
code: string;
|
|
422
|
-
}>): Promise<string>;
|
|
423
|
-
forgotPassword(form: Form<{
|
|
424
|
-
email: string;
|
|
425
|
-
}>): Promise<"SUCCESS: Verification code has been sent.">;
|
|
426
|
-
changePassword(params: {
|
|
427
|
-
new_password: string;
|
|
428
|
-
current_password: string;
|
|
429
|
-
}): Promise<'SUCCESS: Password has been changed.'>;
|
|
430
|
-
updateProfile(form: Form<UserAttributes>): Promise<UserProfile>;
|
|
431
|
-
postRecord(form: Form<Record<string, any>> | null | undefined, config: PostRecordConfig, files?: {
|
|
432
|
-
name: string;
|
|
433
|
-
file: File;
|
|
434
|
-
}[]): Promise<RecordData>;
|
|
435
|
-
getSubscriptions(params: {
|
|
436
|
-
subscriber?: string;
|
|
437
|
-
subscription?: string;
|
|
438
|
-
blocked?: boolean;
|
|
439
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
440
|
-
subscriber: string;
|
|
441
|
-
subscription: string;
|
|
442
|
-
timestamp: number;
|
|
443
|
-
blocked: boolean;
|
|
444
|
-
get_feed: boolean;
|
|
445
|
-
get_notified: boolean;
|
|
446
|
-
get_email: boolean;
|
|
447
|
-
}>>;
|
|
448
|
-
subscribe(params: {
|
|
449
|
-
user_id: string;
|
|
450
|
-
get_feed?: boolean;
|
|
451
|
-
get_notified?: boolean;
|
|
452
|
-
get_email?: boolean;
|
|
453
|
-
}): Promise<{
|
|
454
|
-
subscriber: string;
|
|
455
|
-
subscription: string;
|
|
456
|
-
timestamp: number;
|
|
457
|
-
blocked: boolean;
|
|
458
|
-
get_feed: boolean;
|
|
459
|
-
get_notified: boolean;
|
|
460
|
-
get_email: boolean;
|
|
461
|
-
}>;
|
|
462
|
-
unsubscribe(params: {
|
|
463
|
-
user_id: string;
|
|
464
|
-
}): Promise<'SUCCESS: The user has unsubscribed.'>;
|
|
465
|
-
blockSubscriber(params: {
|
|
466
|
-
user_id: string;
|
|
467
|
-
}): Promise<'SUCCESS: Blocked user ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'>;
|
|
468
|
-
unblockSubscriber(params: {
|
|
469
|
-
user_id: string;
|
|
470
|
-
}): Promise<'SUCCESS: Unblocked user ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'>;
|
|
471
|
-
subscribeNewsletter(params: Form<{
|
|
472
|
-
email?: string;
|
|
473
|
-
group: number | 'public' | 'authorized' | 'admin';
|
|
474
|
-
redirect?: string;
|
|
475
|
-
}>): Promise<string>;
|
|
476
|
-
}
|
|
477
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Form, UserAttributes, UserProfilePublicSettings, UserProfile, UserPublic, DatabaseResponse, FetchOptions } from '../Types';
|
|
2
|
-
export declare function blockAccount(form: Form<{
|
|
3
|
-
user_id: string;
|
|
4
|
-
owner?: string;
|
|
5
|
-
service?: string;
|
|
6
|
-
}>): Promise<'SUCCESS: The user has been blocked.'>;
|
|
7
|
-
export declare function unblockAccount(form: Form<{
|
|
8
|
-
user_id: string;
|
|
9
|
-
owner?: string;
|
|
10
|
-
service?: string;
|
|
11
|
-
}>): Promise<'SUCCESS: The user has been unblocked.'>;
|
|
12
|
-
export declare function deleteAccount(form: Form<{
|
|
13
|
-
user_id: string;
|
|
14
|
-
owner?: string;
|
|
15
|
-
service?: string;
|
|
16
|
-
}>): Promise<'SUCCESS: Account has been deleted.'>;
|
|
17
|
-
export declare function inviteUser(form: Form<UserAttributes & UserProfilePublicSettings & {
|
|
18
|
-
email: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
owner?: string;
|
|
21
|
-
}>, options?: {
|
|
22
|
-
confirmation_url?: string;
|
|
23
|
-
email_subscription?: boolean;
|
|
24
|
-
template?: {
|
|
25
|
-
url: string;
|
|
26
|
-
subject: string;
|
|
27
|
-
};
|
|
28
|
-
}): Promise<'SUCCESS: Invitation has been sent.'>;
|
|
29
|
-
export declare function createAccount(form: Form<UserAttributes & UserProfilePublicSettings & {
|
|
30
|
-
email: string;
|
|
31
|
-
password: string;
|
|
32
|
-
} & {
|
|
33
|
-
service?: string;
|
|
34
|
-
owner?: string;
|
|
35
|
-
}>): Promise<UserProfile & UserPublic & {
|
|
36
|
-
email_admin: string;
|
|
37
|
-
approved: string;
|
|
38
|
-
log: number;
|
|
39
|
-
username: string;
|
|
40
|
-
}>;
|
|
41
|
-
export declare function grantAccess(params: Form<{
|
|
42
|
-
user_id: string;
|
|
43
|
-
access_group: number;
|
|
44
|
-
service?: string;
|
|
45
|
-
owner?: string;
|
|
46
|
-
}>): Promise<'SUCCESS: Access has been granted to the user.'>;
|
|
47
|
-
export declare function getInvitations(params?: Form<{
|
|
48
|
-
service?: string;
|
|
49
|
-
owner?: string;
|
|
50
|
-
email?: string;
|
|
51
|
-
}>, fetchOptions?: FetchOptions): Promise<DatabaseResponse<UserProfile>>;
|
|
52
|
-
export declare function cancelInvitation(params: Form<{
|
|
53
|
-
service?: string;
|
|
54
|
-
owner?: string;
|
|
55
|
-
email: string;
|
|
56
|
-
}>): Promise<"SUCCESS: Invitation has been canceled.">;
|
|
57
|
-
export declare function resendInvitation(params: Form<{
|
|
58
|
-
service?: string;
|
|
59
|
-
owner?: string;
|
|
60
|
-
email: string;
|
|
61
|
-
}>): Promise<"SUCCESS: Invitation has been re-sent. (User ID: xxx...)">;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { RecordData, Form, FetchOptions, DatabaseResponse, GetRecordQuery, Condition, PostRecordConfig, ProgressCallback, FileInfo, DelRecordQuery } from '../Types';
|
|
2
|
-
export declare function normalizeRecord(record: Record<string, any>, _called_from?: any): Promise<RecordData>;
|
|
3
|
-
export declare function deleteFiles(params: {
|
|
4
|
-
endpoints: string | string[];
|
|
5
|
-
}): Promise<RecordData[]>;
|
|
6
|
-
export declare function getFile(url: string, config?: {
|
|
7
|
-
dataType?: 'base64' | 'download' | 'endpoint' | 'blob' | 'text' | 'info';
|
|
8
|
-
expires?: number;
|
|
9
|
-
progress?: ProgressCallback;
|
|
10
|
-
_ref?: string;
|
|
11
|
-
_update?: any;
|
|
12
|
-
}): Promise<Blob | string | void | FileInfo>;
|
|
13
|
-
export declare function getRecords(query: GetRecordQuery & {
|
|
14
|
-
private_key?: string;
|
|
15
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RecordData>>;
|
|
16
|
-
export declare function postRecord(form: Form<Record<string, any>> | null | undefined, config: PostRecordConfig & {
|
|
17
|
-
reference_private_key?: string;
|
|
18
|
-
}, files?: {
|
|
19
|
-
name: string;
|
|
20
|
-
file: File;
|
|
21
|
-
}[]): Promise<RecordData>;
|
|
22
|
-
export declare function getTables(query: {
|
|
23
|
-
table: string;
|
|
24
|
-
condition?: Condition;
|
|
25
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
26
|
-
number_of_records: number;
|
|
27
|
-
table: string;
|
|
28
|
-
size: number;
|
|
29
|
-
}>>;
|
|
30
|
-
export declare function getIndexes(query: {
|
|
31
|
-
table: string;
|
|
32
|
-
index?: string;
|
|
33
|
-
order?: {
|
|
34
|
-
by: 'average_number' | 'total_number' | 'number_count' | 'average_bool' | 'total_bool' | 'bool_count' | 'string_count' | 'index_name';
|
|
35
|
-
value?: number | boolean | string;
|
|
36
|
-
condition?: Condition;
|
|
37
|
-
};
|
|
38
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
39
|
-
table: string;
|
|
40
|
-
index: string;
|
|
41
|
-
number_of_records: number;
|
|
42
|
-
string_count?: number;
|
|
43
|
-
number_count?: number;
|
|
44
|
-
boolean_count?: number;
|
|
45
|
-
total_number?: number;
|
|
46
|
-
total_bool?: number;
|
|
47
|
-
average_number?: number;
|
|
48
|
-
average_bool?: number;
|
|
49
|
-
}>>;
|
|
50
|
-
export declare function getTags(query?: {
|
|
51
|
-
table: string;
|
|
52
|
-
tag?: string;
|
|
53
|
-
condition?: Condition;
|
|
54
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
55
|
-
table: string;
|
|
56
|
-
tag: string;
|
|
57
|
-
number_of_records: string;
|
|
58
|
-
}>>;
|
|
59
|
-
export declare function getUniqueId(query?: Form<{
|
|
60
|
-
unique_id?: string;
|
|
61
|
-
condition?: Condition;
|
|
62
|
-
}>, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
63
|
-
unique_id: string;
|
|
64
|
-
record_id: string;
|
|
65
|
-
}>>;
|
|
66
|
-
export declare function deleteRecords(query: DelRecordQuery & {
|
|
67
|
-
private_key?: string;
|
|
68
|
-
}, fetchOptions?: FetchOptions): Promise<string | DatabaseResponse<RecordData>>;
|
|
69
|
-
export declare function grantPrivateRecordAccess(params: {
|
|
70
|
-
record_id: string;
|
|
71
|
-
user_id: string | string[];
|
|
72
|
-
}): Promise<any>;
|
|
73
|
-
export declare function removePrivateRecordAccess(params: {
|
|
74
|
-
record_id: string;
|
|
75
|
-
user_id: string | string[];
|
|
76
|
-
}): Promise<any>;
|
|
77
|
-
export declare function listPrivateRecordAccess(p: {
|
|
78
|
-
record_id?: string;
|
|
79
|
-
user_id?: string | string[];
|
|
80
|
-
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<{
|
|
81
|
-
record_id: string;
|
|
82
|
-
user_id: string;
|
|
83
|
-
}>>;
|
|
84
|
-
export declare function requestPrivateRecordAccessKey(params: {
|
|
85
|
-
record_id: string;
|
|
86
|
-
reference_id?: string;
|
|
87
|
-
}): Promise<string>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare function subscribeNotification(params: {
|
|
2
|
-
endpoint: string;
|
|
3
|
-
keys: {
|
|
4
|
-
p256dh: string;
|
|
5
|
-
auth: string;
|
|
6
|
-
};
|
|
7
|
-
}): Promise<"SUCCESS: Subscribed to receive notifications.">;
|
|
8
|
-
export declare function unsubscribeNotification(params: {
|
|
9
|
-
endpoint: string;
|
|
10
|
-
keys: {
|
|
11
|
-
p256dh: string;
|
|
12
|
-
auth: string;
|
|
13
|
-
};
|
|
14
|
-
}): Promise<"SUCCESS: Unsubscribed from notifications.">;
|
|
15
|
-
export declare function vapidPublicKey(): Promise<{
|
|
16
|
-
VAPIDPublicKey: any;
|
|
17
|
-
}>;
|
|
18
|
-
export declare function pushNotification(form: {
|
|
19
|
-
title: string;
|
|
20
|
-
body: string;
|
|
21
|
-
}, user_ids?: string | string[]): Promise<"SUCCESS: Notification sent.">;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare function recordIdOrUniqueId(query: any): any;
|
|
2
|
-
export declare function cannotBeEmptyString(v: any, paramName?: string, allowPeriods?: boolean, allowWhiteSpace?: boolean): string | string[];
|
|
3
|
-
export declare function accessGroup(v: any): any;
|
|
4
|
-
export declare function indexValue(v: any): string | number | boolean | string[];
|
|
5
|
-
export declare function indexRange(v: any, query: any): any;
|
|
6
|
-
export declare function getStruct(query: any): {
|
|
7
|
-
table: {
|
|
8
|
-
name: ((v: any) => string | string[])[];
|
|
9
|
-
access_group: (typeof accessGroup)[];
|
|
10
|
-
subscription: (v: any) => string;
|
|
11
|
-
};
|
|
12
|
-
reference: string;
|
|
13
|
-
index: {
|
|
14
|
-
name: (string | ((v: string) => string | string[]))[];
|
|
15
|
-
value: (v: number | boolean | string) => any;
|
|
16
|
-
condition: string[];
|
|
17
|
-
range: (v: number | boolean | string) => any;
|
|
18
|
-
};
|
|
19
|
-
tag: (v: string) => string | string[];
|
|
20
|
-
private_key: string;
|
|
21
|
-
};
|