skapi-js 1.2.14-beta.3 → 1.2.14-beta.6

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.
Files changed (92) hide show
  1. package/dist/bundle-report-commonjs.html +2 -2
  2. package/dist/bundle-report-esm.html +2 -2
  3. package/dist/bundle-report-node-esm.html +2 -2
  4. package/dist/bundle-report.html +2 -2
  5. package/dist/skapi.cjs +1 -1
  6. package/dist/skapi.cjs.map +1 -1
  7. package/dist/skapi.js +1 -1
  8. package/dist/skapi.js.map +1 -1
  9. package/dist/skapi.mjs +1 -1
  10. package/dist/skapi.mjs.map +1 -1
  11. package/dist/skapi.node.mjs +1 -1
  12. package/dist/skapi.node.mjs.map +1 -1
  13. package/js/package.json +6 -5
  14. package/js/src/Types.d.ts +40 -2
  15. package/js/src/main/skapi.d.ts +41 -29
  16. package/js/src/main/skapi.js +48 -60
  17. package/js/src/main/skapi.js.map +1 -1
  18. package/js/src/methods/admin.d.ts +2 -4
  19. package/js/src/methods/database.d.ts +8 -0
  20. package/js/src/methods/database.js +285 -8
  21. package/js/src/methods/database.js.map +1 -1
  22. package/js/src/methods/param_restrictions.d.ts +8 -4
  23. package/js/src/methods/param_restrictions.js +72 -6
  24. package/js/src/methods/param_restrictions.js.map +1 -1
  25. package/js/src/methods/request.js +1 -1
  26. package/js/src/methods/request.js.map +1 -1
  27. package/js/src/methods/subscription.d.ts +0 -6
  28. package/js/src/methods/subscription.js +0 -28
  29. package/js/src/methods/subscription.js.map +1 -1
  30. package/js/src/methods/vivian.d.ts +18 -3
  31. package/js/src/methods/vivian.js +20 -10
  32. package/js/src/methods/vivian.js.map +1 -1
  33. package/js/src/utils/network.js +16 -11
  34. package/js/src/utils/network.js.map +1 -1
  35. package/js/src/utils/utils.d.ts +3 -1
  36. package/js/src/utils/utils.js +15 -3
  37. package/js/src/utils/utils.js.map +1 -1
  38. package/package.json +6 -5
  39. package/js/Main.d.ts +0 -6
  40. package/js/Main.js +0 -6
  41. package/js/Main.js.map +0 -1
  42. package/js/Types.d.ts +0 -305
  43. package/js/Types.js +0 -2
  44. package/js/Types.js.map +0 -1
  45. package/js/main/error.d.ts +0 -9
  46. package/js/main/error.js +0 -46
  47. package/js/main/error.js.map +0 -1
  48. package/js/main/skapi.d.ts +0 -443
  49. package/js/main/skapi.js +0 -853
  50. package/js/main/skapi.js.map +0 -1
  51. package/js/methods/admin.d.ts +0 -61
  52. package/js/methods/admin.js +0 -325
  53. package/js/methods/admin.js.map +0 -1
  54. package/js/methods/database.d.ts +0 -65
  55. package/js/methods/database.js +0 -947
  56. package/js/methods/database.js.map +0 -1
  57. package/js/methods/notification.d.ts +0 -21
  58. package/js/methods/notification.js +0 -81
  59. package/js/methods/notification.js.map +0 -1
  60. package/js/methods/param_restrictions.d.ts +0 -21
  61. package/js/methods/param_restrictions.js +0 -144
  62. package/js/methods/param_restrictions.js.map +0 -1
  63. package/js/methods/realtime.d.ts +0 -35
  64. package/js/methods/realtime.js +0 -408
  65. package/js/methods/realtime.js.map +0 -1
  66. package/js/methods/request.d.ts +0 -43
  67. package/js/methods/request.js +0 -132
  68. package/js/methods/request.js.map +0 -1
  69. package/js/methods/subscription.d.ts +0 -53
  70. package/js/methods/subscription.js +0 -337
  71. package/js/methods/subscription.js.map +0 -1
  72. package/js/methods/user.d.ts +0 -176
  73. package/js/methods/user.js +0 -1120
  74. package/js/methods/user.js.map +0 -1
  75. package/js/methods/vivian.d.ts +0 -3
  76. package/js/methods/vivian.js +0 -36
  77. package/js/methods/vivian.js.map +0 -1
  78. package/js/methods/webrtc.d.ts +0 -26
  79. package/js/methods/webrtc.js +0 -608
  80. package/js/methods/webrtc.js.map +0 -1
  81. package/js/polyfills/global.d.ts +0 -3
  82. package/js/polyfills/global.js +0 -235
  83. package/js/polyfills/global.js.map +0 -1
  84. package/js/utils/network.d.ts +0 -24
  85. package/js/utils/network.js +0 -707
  86. package/js/utils/network.js.map +0 -1
  87. package/js/utils/utils.d.ts +0 -40
  88. package/js/utils/utils.js +0 -651
  89. package/js/utils/utils.js.map +0 -1
  90. package/js/utils/validator.d.ts +0 -24
  91. package/js/utils/validator.js +0 -293
  92. package/js/utils/validator.js.map +0 -1
package/js/main/skapi.js DELETED
@@ -1,853 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { CognitoUserPool } from 'amazon-cognito-identity-js';
8
- import SkapiError from './error';
9
- import validator from '../utils/validator';
10
- import { getRecords, postRecord, deleteRecords, getTables, getIndexes, getTags, getFile, grantPrivateRecordAccess, removePrivateRecordAccess, listPrivateRecordAccess, requestPrivateRecordAccessKey, deleteFiles, getUniqueId } from '../methods/database';
11
- import { connectRealtime, joinRealtime, postRealtime, closeRealtime, getRealtimeUsers, getRealtimeGroups, } from '../methods/realtime';
12
- import { closeRTC, connectRTC } from '../methods/webrtc';
13
- import { secureRequest, mock, clientSecretRequest, sendInquiry } from '../methods/request';
14
- import { request, getFormResponse, formHandler, uploadFiles, terminatePendingRequests } from '../utils/network';
15
- import { subscribe, unsubscribe, blockSubscriber, unblockSubscriber, getSubscriptions, subscribeNewsletter, getNewsletters, unsubscribeNewsletter, adminNewsletterRequest, getNewsletterSubscription, getFeed, registerNewsletterGroup, newsletterGroupEndpoint, } from '../methods/subscription';
16
- import { getProfile, logout, recoverAccount, resendSignupConfirmation, authentication, login, signup, disableAccount, resetPassword, verifyEmail, verifyPhoneNumber, forgotPassword, changePassword, updateProfile, getUsers, lastVerifiedEmail, requestUsernameChange, consumeTicket, getConsumedTickets, getTickets, registerTicket, unregisterTicket, _out, openIdLogin, loginWithToken } from '../methods/user';
17
- import { extractFormData, fromBase62, generateRandom, toBase62, MD5, decodeServiceId, formatServiceId, } from '../utils/utils';
18
- import { blockAccount, unblockAccount, deleteAccount, inviteUser, createAccount, grantAccess, getInvitations, cancelInvitation, resendInvitation } from '../methods/admin';
19
- import { subscribeNotification, vapidPublicKey, pushNotification, unsubscribeNotification } from '../methods/notification';
20
- import { spellcast, dopamine, getspell } from '../methods/vivian';
21
- export default class Skapi {
22
- get user() {
23
- if (this.__user && Object.keys(this.__user).length) {
24
- return JSON.parse(JSON.stringify(this.__user));
25
- }
26
- else {
27
- return null;
28
- }
29
- }
30
- set user(value) {
31
- }
32
- get onLogin() {
33
- return this._onLoginListeners;
34
- }
35
- set onLogin(listener) {
36
- if (typeof listener === 'function') {
37
- this._onLoginListeners.push(listener);
38
- }
39
- }
40
- get onUserUpdate() {
41
- return this._userProfileListeners;
42
- }
43
- set onUserUpdate(listener) {
44
- if (typeof listener === 'function') {
45
- this._userProfileListeners.push(listener);
46
- }
47
- }
48
- _runOnUserUpdateListeners(user) {
49
- for (let listener of this._userProfileListeners) {
50
- if (typeof listener === 'function') {
51
- listener(user);
52
- }
53
- }
54
- }
55
- _runOnLoginListeners(user) {
56
- for (let listener of this._onLoginListeners) {
57
- if (typeof listener === 'function') {
58
- listener(user);
59
- }
60
- }
61
- }
62
- get onBatchProcess() {
63
- return this._onBatchProcessListeners;
64
- }
65
- set onBatchProcess(listener) {
66
- if (typeof listener === 'function') {
67
- this._onBatchProcessListeners.push(listener);
68
- }
69
- }
70
- _alert(message) {
71
- if (typeof window !== 'undefined' && typeof window.alert === 'function') {
72
- window.alert(message);
73
- }
74
- }
75
- constructor(service, owner, options, __etc) {
76
- this.__version = "1.2.14";
77
- this.session = null;
78
- this.connection = null;
79
- this.__my_unique_ids = {};
80
- this.userPool = null;
81
- this.__socket = null;
82
- this.__mediaStream = null;
83
- this.host = 'skapi';
84
- this.hostDomain = 'skapi.com';
85
- this.target_cdn = 'd3e9syvbtso631';
86
- this.customApiDomain = 'skapi.dev';
87
- this.requestBatchSize = 30;
88
- this.__disabledAccount = null;
89
- this.__cached_requests = {};
90
- this.__startKeyHistory = {};
91
- this.__request_signup_confirmation = null;
92
- this.__private_access_key = {};
93
- this.__class_properties_has_been_cached = false;
94
- this.__user = null;
95
- this._userProfileListeners = [];
96
- this._onLoginListeners = [];
97
- this._onBatchProcessListeners = [];
98
- this.validate = {
99
- userId(val) {
100
- try {
101
- validator.UserId(val);
102
- return true;
103
- }
104
- catch (err) {
105
- return false;
106
- }
107
- },
108
- url(val) {
109
- try {
110
- validator.Url(val);
111
- return true;
112
- }
113
- catch (err) {
114
- return false;
115
- }
116
- },
117
- phoneNumber(val) {
118
- try {
119
- validator.PhoneNumber(val);
120
- return true;
121
- }
122
- catch (err) {
123
- return false;
124
- }
125
- },
126
- birthdate(val) {
127
- try {
128
- validator.Birthdate(val);
129
- return true;
130
- }
131
- catch (err) {
132
- return false;
133
- }
134
- },
135
- email(val) {
136
- try {
137
- validator.Email(val);
138
- return true;
139
- }
140
- catch (err) {
141
- return false;
142
- }
143
- },
144
- params(val, schema, required) {
145
- return validator.Params(val, schema, required);
146
- }
147
- };
148
- this.util = {
149
- MD5,
150
- generateRandom,
151
- toBase62,
152
- fromBase62,
153
- decodeServiceId,
154
- formatServiceId,
155
- extractFormData,
156
- terminatePendingRequests,
157
- request: (url, data, options) => request.bind(this)(url, data, options, { ignoreService: true })
158
- };
159
- this.__network_logs = false;
160
- this.__endpoint_version = 'v1';
161
- this.__public_identifier = '';
162
- this.bearerToken = '';
163
- this.registerTicket = registerTicket.bind(this);
164
- this.unregisterTicket = unregisterTicket.bind(this);
165
- if (!service || typeof service !== 'string') {
166
- this._alert("Service ID is required.");
167
- throw new SkapiError('Service ID is required.', { code: 'INVALID_PARAMETER' });
168
- }
169
- if (service.startsWith('s1_') || service.split("-").length === 7) {
170
- try {
171
- let decoded = decodeServiceId(service);
172
- if (options && typeof options === 'object') {
173
- __etc = options;
174
- }
175
- if (owner && typeof owner === 'object') {
176
- options = owner;
177
- }
178
- owner = decoded.owner;
179
- service = decoded.service;
180
- }
181
- catch (err) {
182
- this._alert("Service ID is invalid.");
183
- throw new SkapiError('Service ID is invalid.', { code: 'INVALID_PARAMETER' });
184
- }
185
- }
186
- if (!owner || typeof owner !== 'string') {
187
- this._alert("Owner ID is invalid.");
188
- throw new SkapiError('Owner ID is invalid.', { code: 'INVALID_PARAMETER' });
189
- }
190
- if (service.toLowerCase() === 'service_id') {
191
- this._alert('Replace "service_id" with your actual Service ID.');
192
- throw new SkapiError('Service ID is required.', { code: 'INVALID_PARAMETER' });
193
- }
194
- if (owner !== this.host) {
195
- try {
196
- validator.UserId(owner, '"owner"');
197
- }
198
- catch (err) {
199
- this._alert("Owner ID is invalid.");
200
- throw new SkapiError('Owner ID is invalid.', { code: 'INVALID_PARAMETER' });
201
- }
202
- }
203
- this.service = service;
204
- this.owner = owner;
205
- let autoLogin = true;
206
- if (options) {
207
- if (typeof options.autoLogin === 'boolean') {
208
- autoLogin = options.autoLogin;
209
- }
210
- if (typeof options.requestBatchSize === 'number') {
211
- if (options.requestBatchSize < 1) {
212
- throw new SkapiError('"requestBatchSize" must be greater than 0.', { code: 'INVALID_PARAMETER' });
213
- }
214
- this.requestBatchSize = options.requestBatchSize;
215
- }
216
- }
217
- if (options?.eventListener && typeof options.eventListener === 'object') {
218
- if (options.eventListener?.onLogin && typeof options.eventListener.onLogin === 'function') {
219
- this.onLogin = options.eventListener.onLogin;
220
- }
221
- if (options.eventListener?.onUserUpdate && typeof options.eventListener.onUserUpdate === 'function') {
222
- this.onUserUpdate = options.eventListener.onUserUpdate;
223
- }
224
- if (options.eventListener?.onBatchProcess && typeof options.eventListener.onBatchProcess === 'function') {
225
- this.onBatchProcess = options.eventListener.onBatchProcess;
226
- }
227
- }
228
- this.target_cdn = __etc?.target_cdn || this.target_cdn;
229
- this.hostDomain = __etc?.hostDomain || this.hostDomain;
230
- this.customApiDomain = __etc?.customApiDomain || this.customApiDomain;
231
- this.__network_logs = !!__etc?.network_logs;
232
- const cdn_domain = `https://${this.target_cdn}.cloudfront.net`;
233
- let sreg = service.substring(0, 4);
234
- this.admin_endpoint = fetch(`${cdn_domain}/${sreg}/admin-${this.__endpoint_version}.json`)
235
- .then(response => response.blob())
236
- .then(blob => new Promise((resolve, reject) => {
237
- const reader = new FileReader();
238
- reader.onloadend = () => resolve(reader.result);
239
- reader.onerror = reject;
240
- reader.readAsDataURL(blob);
241
- }))
242
- .then(data => {
243
- try {
244
- return typeof data === 'string' ? JSON.parse(atob(data.split(',')[1])) : null;
245
- }
246
- catch (err) {
247
- throw new SkapiError('Service does not exist. Create your service from skapi.com', { code: 'NOT_EXISTS' });
248
- }
249
- });
250
- this.record_endpoint = fetch(`${cdn_domain}/${sreg}/record-${this.__endpoint_version}.json`)
251
- .then(response => response.blob())
252
- .then(blob => new Promise((resolve, reject) => {
253
- const reader = new FileReader();
254
- reader.onloadend = () => resolve(reader.result);
255
- reader.onerror = reject;
256
- reader.readAsDataURL(blob);
257
- }))
258
- .then(data => {
259
- try {
260
- return typeof data === 'string' ? JSON.parse(atob(data.split(',')[1])) : null;
261
- }
262
- catch (err) {
263
- throw new SkapiError('Service does not exist. Create your service from skapi.com', { code: 'NOT_EXISTS' });
264
- }
265
- });
266
- const hasWindow = typeof window !== 'undefined';
267
- if (!hasWindow || !window.sessionStorage) {
268
- this._alert('This browser is not supported.');
269
- throw new Error(`This browser is not supported.`);
270
- }
271
- const restore = hasWindow ? JSON.parse(window.sessionStorage.getItem(`${service}#${owner}`) || 'null') : null;
272
- this.log('constructor:restore', restore);
273
- if (restore?.connection) {
274
- for (let k in restore) {
275
- this[k] = restore[k];
276
- }
277
- if (!restore.__public_identifier) {
278
- this.__public_identifier = `${this.service}:${this.owner}:${generateRandom(16)}`;
279
- }
280
- }
281
- this.__authConnection = (async () => {
282
- const admin_endpoint = await this.admin_endpoint;
283
- const poolSetting = {
284
- UserPoolId: admin_endpoint.userpool_id,
285
- ClientId: admin_endpoint.userpool_client
286
- };
287
- if (window._runningInNodeJS) {
288
- poolSetting.Storage = window.localStorage;
289
- }
290
- this.userPool = new CognitoUserPool(poolSetting);
291
- try {
292
- if (!this.user) {
293
- await authentication.bind(this)().getSession({
294
- skipUserUpdateEventTrigger: true
295
- });
296
- }
297
- if (this.user) {
298
- if (!restore?.connection && !autoLogin) {
299
- _out.bind(this)();
300
- }
301
- else {
302
- this._runOnLoginListeners(this.user);
303
- this._runOnUserUpdateListeners(this.user);
304
- }
305
- }
306
- }
307
- catch (err) {
308
- }
309
- })();
310
- let uniqueids = hasWindow ? window.sessionStorage.getItem(`${this.service}:uniqueids`) : null;
311
- if (uniqueids) {
312
- try {
313
- this.__my_unique_ids = JSON.parse(uniqueids);
314
- }
315
- catch (err) {
316
- this.__my_unique_ids = {};
317
- }
318
- }
319
- this.__connection = (async () => {
320
- let connection = null;
321
- await this.record_endpoint;
322
- if (!restore?.connection) {
323
- connection = this._updateConnection();
324
- }
325
- const storeClassProperties = () => {
326
- if (this.__class_properties_has_been_cached) {
327
- return;
328
- }
329
- let exec = () => {
330
- let data = {};
331
- const to_be_cached = [
332
- '__startKeyHistory',
333
- '__disabledAccount',
334
- '__cached_requests',
335
- '__request_signup_confirmation',
336
- '__public_identifier',
337
- 'connection',
338
- ];
339
- if (this.connection) {
340
- for (let k of to_be_cached) {
341
- data[k] = this[k];
342
- }
343
- if (hasWindow) {
344
- window.sessionStorage.setItem(`${service}#${owner}`, JSON.stringify(data));
345
- }
346
- this.__class_properties_has_been_cached = true;
347
- }
348
- };
349
- return (connection instanceof Promise) ? connection.then(() => exec()) : exec();
350
- };
351
- if (hasWindow) {
352
- window.addEventListener('beforeunload', () => {
353
- this.closeRealtime();
354
- storeClassProperties();
355
- });
356
- window.addEventListener("visibilitychange", () => {
357
- storeClassProperties();
358
- });
359
- }
360
- await connection;
361
- await this.__authConnection;
362
- return this.connection;
363
- })();
364
- this.__connection.then(conn => {
365
- if ((conn?.group || 0) < 3 || this.__network_logs) {
366
- this.version();
367
- }
368
- });
369
- }
370
- async getConnectionInfo() {
371
- let conn = await this.__connection;
372
- let ua = conn?.user_agent || (typeof window !== 'undefined' ? window.navigator.userAgent : `skapi-node/${globalThis?.process?.versions?.node || 'unknown'}`);
373
- return {
374
- user_ip: conn.ip,
375
- user_agent: ua,
376
- user_location: conn.locale,
377
- service_name: conn.service_name,
378
- version: this.__version
379
- };
380
- }
381
- async _updateConnection() {
382
- try {
383
- this.connection = await request.bind(this)('service', {
384
- service: this.service,
385
- owner: this.owner
386
- }, { bypassAwaitConnection: true, method: 'get' });
387
- }
388
- catch (err) {
389
- this.log('connection fail', err);
390
- this._alert('Service is not available: ' + (err.message || err.toString()));
391
- this.connection = null;
392
- throw err;
393
- }
394
- return this.connection;
395
- }
396
- async version() {
397
- await this.__connection;
398
- let skapi = `%c\r\n $$\\ $$\\ \r\n $$ | \\__|\r\n $$$$$$$\\ $$ | $$\\ $$$$$$\\ $$$$$$\\ $$\\ \r\n$$ _____|$$ | $$ |\\____$$\\ $$ __$$\\ $$ |\r\n\\$$$$$$\\ $$$$$$ \/ $$$$$$$ |$$ \/ $$ |$$ |\r\n \\____$$\\ $$ _$$< $$ __$$ |$$ | $$ |$$ |\r\n$$$$$$$ |$$ | \\$$\\\\$$$$$$$ |$$$$$$$ |$$ |\r\n\\_______\/ \\__| \\__|\\_______|$$ ____\/ \\__|\r\n $$ | \r\n $$ | \r\n \\__| \r\n`;
399
- console.log(`Built with:\n${skapi}Version: ${this.__version}\n\nFull Documentation: https://docs.skapi.com/skapi.md`, `font-family: monospace; color:blue;`);
400
- if (this.connection.group === 1) {
401
- console.log(`%cSKAPI: THE SERVICE IS IN TRIAL MODE. ALL THE USERS AND DATA WILL BE INITIALIZED EVERY 30 DAYS.`, `font-family: monospace; color:red;`);
402
- }
403
- return this.__version;
404
- }
405
- log(n, v) {
406
- if (this.__network_logs) {
407
- if (typeof v === 'object') {
408
- try {
409
- v = JSON.parse(JSON.stringify(v));
410
- }
411
- catch (err) {
412
- v = String(v);
413
- }
414
- }
415
- else if (typeof v === 'string' && v.length > 100) {
416
- v = v.substring(0, 100) + '...';
417
- }
418
- console.log(`%c${n}:`, 'color: blue;', v);
419
- }
420
- }
421
- getFeed(params, fetchOptions) {
422
- return getFeed.bind(this)(params, fetchOptions);
423
- }
424
- closeRTC(params) {
425
- return closeRTC.bind(this)(params);
426
- }
427
- connectRTC(params, callback) {
428
- return connectRTC.bind(this)(params, callback);
429
- }
430
- connectRealtime(callback) {
431
- return connectRealtime.bind(this)(callback);
432
- }
433
- spellcast(params) {
434
- return spellcast.bind(this)(params);
435
- }
436
- getspell(params) {
437
- return getspell.bind(this)(params);
438
- }
439
- dopamine(params) {
440
- return dopamine.bind(this)(params);
441
- }
442
- getUniqueId(params, fetchOptions) {
443
- return getUniqueId.bind(this)(params, fetchOptions);
444
- }
445
- resendInvitation(params) {
446
- return resendInvitation.bind(this)(params);
447
- }
448
- cancelInvitation(params) {
449
- return cancelInvitation.bind(this)(params);
450
- }
451
- getInvitations(params, fetchOptions) {
452
- return getInvitations.bind(this)(params, fetchOptions);
453
- }
454
- openIdLogin(params) {
455
- return openIdLogin.bind(this)(params);
456
- }
457
- loginWithToken(params) {
458
- return loginWithToken.bind(this)(params);
459
- }
460
- registerNewsletterGroup(params) {
461
- return registerNewsletterGroup.bind(this)(params);
462
- }
463
- clientSecretRequest(params) {
464
- return clientSecretRequest.bind(this)(params);
465
- }
466
- consumeTicket(params) {
467
- return consumeTicket.bind(this)(params);
468
- }
469
- getConsumedTickets(params, fetchOptions) {
470
- return getConsumedTickets.bind(this)(params, fetchOptions);
471
- }
472
- getTickets(params, fetchOptions) {
473
- return getTickets.bind(this)(params, fetchOptions);
474
- }
475
- closeRealtime() {
476
- return closeRealtime.bind(this)();
477
- }
478
- getRealtimeUsers(params, fetchOptions) {
479
- return getRealtimeUsers.bind(this)(params, fetchOptions);
480
- }
481
- sendInquiry(data) {
482
- return sendInquiry.bind(this)(data);
483
- }
484
- blockAccount(form) {
485
- return blockAccount.bind(this)(form);
486
- }
487
- unblockAccount(form) {
488
- return unblockAccount.bind(this)(form);
489
- }
490
- deleteAccount(form) {
491
- return deleteAccount.bind(this)(form);
492
- }
493
- inviteUser(form, options) {
494
- return inviteUser.bind(this)(form, options);
495
- }
496
- createAccount(form) {
497
- return createAccount.bind(this)(form);
498
- }
499
- grantAccess(params) {
500
- return grantAccess.bind(this)(params);
501
- }
502
- getRealtimeGroups(params, fetchOptions) {
503
- return getRealtimeGroups.bind(this)(params, fetchOptions);
504
- }
505
- newsletterGroupEndpoint(params) {
506
- return newsletterGroupEndpoint.bind(this)(params);
507
- }
508
- postRealtime(message, recipient, notification) {
509
- return postRealtime.bind(this)(message, recipient, notification);
510
- }
511
- joinRealtime(params) {
512
- return joinRealtime.bind(this)(params);
513
- }
514
- getConnection() {
515
- return this.__connection;
516
- }
517
- getProfile(options) {
518
- return getProfile.bind(this)(options);
519
- }
520
- getFile(url, config) {
521
- return getFile.bind(this)(url, config);
522
- }
523
- secureRequest(params, url) {
524
- return secureRequest.bind(this)(params, url);
525
- }
526
- getFormResponse() {
527
- return getFormResponse.bind(this)();
528
- }
529
- getRecords(query, fetchOptions) {
530
- return getRecords.bind(this)(query, fetchOptions);
531
- }
532
- getTables(query, fetchOptions) {
533
- return getTables.bind(this)(query, fetchOptions);
534
- }
535
- getIndexes(query, fetchOptions) { return getIndexes.bind(this)(query, fetchOptions); }
536
- getTags(query, fetchOptions) { return getTags.bind(this)(query, fetchOptions); }
537
- deleteRecords(params, fetchOptions) { return deleteRecords.bind(this)(params, fetchOptions); }
538
- resendSignupConfirmation() {
539
- return resendSignupConfirmation.bind(this)();
540
- }
541
- recoverAccount(redirect = false) {
542
- return recoverAccount.bind(this)(redirect);
543
- }
544
- getUsers(params, fetchOptions) {
545
- return getUsers.bind(this)(params, fetchOptions);
546
- }
547
- disableAccount() {
548
- return disableAccount.bind(this)();
549
- }
550
- lastVerifiedEmail(params) {
551
- return lastVerifiedEmail.bind(this)(params);
552
- }
553
- unsubscribeNewsletter(params) {
554
- return unsubscribeNewsletter.bind(this)(params);
555
- }
556
- adminNewsletterRequest(params) {
557
- return adminNewsletterRequest.bind(this)(params);
558
- }
559
- subscribeNotification(endpoint, keys) {
560
- return subscribeNotification.bind(this)({ endpoint, keys });
561
- }
562
- unsubscribeNotification(endpoint, keys) {
563
- return unsubscribeNotification.bind(this)({ endpoint, keys });
564
- }
565
- vapidPublicKey() {
566
- return vapidPublicKey.bind(this)();
567
- }
568
- pushNotification(form, user_ids) {
569
- return pushNotification.bind(this)(form, user_ids);
570
- }
571
- getNewsletters(params, fetchOptions) {
572
- return getNewsletters.bind(this)(params, fetchOptions);
573
- }
574
- getNewsletterSubscription(params, fetchOptions) {
575
- return getNewsletterSubscription.bind(this)(params, fetchOptions);
576
- }
577
- requestUsernameChange(params) { return requestUsernameChange.bind(this)(params); }
578
- grantPrivateRecordAccess(params) { return grantPrivateRecordAccess.bind(this)(params); }
579
- removePrivateRecordAccess(params) {
580
- return removePrivateRecordAccess.bind(this)(params);
581
- }
582
- listPrivateRecordAccess(params) { return listPrivateRecordAccess.bind(this)(params); }
583
- requestPrivateRecordAccessKey(params) {
584
- return requestPrivateRecordAccessKey.bind(this)(params);
585
- }
586
- deleteFiles(params) {
587
- return deleteFiles.bind(this)(params);
588
- }
589
- uploadFiles(fileList, params) { return uploadFiles.bind(this)(fileList, params); }
590
- mock(data, options) { return mock.bind(this)(data, options); }
591
- login(form) { return login.bind(this)(form); }
592
- logout(form) { return logout.bind(this)(form); }
593
- signup(form, option) {
594
- return signup.bind(this)(form, option);
595
- }
596
- resetPassword(form) { return resetPassword.bind(this)(form); }
597
- verifyEmail(form) {
598
- return verifyEmail.bind(this)(form);
599
- }
600
- verifyPhoneNumber(form) {
601
- return verifyPhoneNumber.bind(this)(form);
602
- }
603
- forgotPassword(form) {
604
- return forgotPassword.bind(this)(form);
605
- }
606
- changePassword(params) { return changePassword.bind(this)(params); }
607
- updateProfile(form) { return updateProfile.bind(this)(form); }
608
- postRecord(form, config, files) { return postRecord.bind(this)(form, config, files); }
609
- getSubscriptions(params, fetchOptions) {
610
- return getSubscriptions.bind(this)(params, fetchOptions);
611
- }
612
- subscribe(params) {
613
- return subscribe.bind(this)(params);
614
- }
615
- unsubscribe(params) {
616
- return unsubscribe.bind(this)(params);
617
- }
618
- blockSubscriber(params) {
619
- return blockSubscriber.bind(this)(params);
620
- }
621
- unblockSubscriber(params) {
622
- return unblockSubscriber.bind(this)(params);
623
- }
624
- subscribeNewsletter(params) {
625
- return subscribeNewsletter.bind(this)(params);
626
- }
627
- }
628
- __decorate([
629
- formHandler()
630
- ], Skapi.prototype, "getFeed", null);
631
- __decorate([
632
- formHandler()
633
- ], Skapi.prototype, "closeRTC", null);
634
- __decorate([
635
- formHandler()
636
- ], Skapi.prototype, "connectRTC", null);
637
- __decorate([
638
- formHandler()
639
- ], Skapi.prototype, "spellcast", null);
640
- __decorate([
641
- formHandler()
642
- ], Skapi.prototype, "getspell", null);
643
- __decorate([
644
- formHandler()
645
- ], Skapi.prototype, "dopamine", null);
646
- __decorate([
647
- formHandler()
648
- ], Skapi.prototype, "getUniqueId", null);
649
- __decorate([
650
- formHandler()
651
- ], Skapi.prototype, "resendInvitation", null);
652
- __decorate([
653
- formHandler()
654
- ], Skapi.prototype, "cancelInvitation", null);
655
- __decorate([
656
- formHandler()
657
- ], Skapi.prototype, "getInvitations", null);
658
- __decorate([
659
- formHandler()
660
- ], Skapi.prototype, "openIdLogin", null);
661
- __decorate([
662
- formHandler()
663
- ], Skapi.prototype, "loginWithToken", null);
664
- __decorate([
665
- formHandler()
666
- ], Skapi.prototype, "registerNewsletterGroup", null);
667
- __decorate([
668
- formHandler()
669
- ], Skapi.prototype, "clientSecretRequest", null);
670
- __decorate([
671
- formHandler()
672
- ], Skapi.prototype, "consumeTicket", null);
673
- __decorate([
674
- formHandler()
675
- ], Skapi.prototype, "getConsumedTickets", null);
676
- __decorate([
677
- formHandler()
678
- ], Skapi.prototype, "getTickets", null);
679
- __decorate([
680
- formHandler()
681
- ], Skapi.prototype, "getRealtimeUsers", null);
682
- __decorate([
683
- formHandler()
684
- ], Skapi.prototype, "sendInquiry", null);
685
- __decorate([
686
- formHandler()
687
- ], Skapi.prototype, "blockAccount", null);
688
- __decorate([
689
- formHandler()
690
- ], Skapi.prototype, "unblockAccount", null);
691
- __decorate([
692
- formHandler()
693
- ], Skapi.prototype, "deleteAccount", null);
694
- __decorate([
695
- formHandler()
696
- ], Skapi.prototype, "inviteUser", null);
697
- __decorate([
698
- formHandler()
699
- ], Skapi.prototype, "createAccount", null);
700
- __decorate([
701
- formHandler()
702
- ], Skapi.prototype, "grantAccess", null);
703
- __decorate([
704
- formHandler()
705
- ], Skapi.prototype, "getRealtimeGroups", null);
706
- __decorate([
707
- formHandler()
708
- ], Skapi.prototype, "newsletterGroupEndpoint", null);
709
- __decorate([
710
- formHandler()
711
- ], Skapi.prototype, "postRealtime", null);
712
- __decorate([
713
- formHandler()
714
- ], Skapi.prototype, "joinRealtime", null);
715
- __decorate([
716
- formHandler()
717
- ], Skapi.prototype, "getProfile", null);
718
- __decorate([
719
- formHandler()
720
- ], Skapi.prototype, "getFile", null);
721
- __decorate([
722
- formHandler()
723
- ], Skapi.prototype, "secureRequest", null);
724
- __decorate([
725
- formHandler()
726
- ], Skapi.prototype, "getFormResponse", null);
727
- __decorate([
728
- formHandler()
729
- ], Skapi.prototype, "getRecords", null);
730
- __decorate([
731
- formHandler()
732
- ], Skapi.prototype, "getTables", null);
733
- __decorate([
734
- formHandler()
735
- ], Skapi.prototype, "getIndexes", null);
736
- __decorate([
737
- formHandler()
738
- ], Skapi.prototype, "getTags", null);
739
- __decorate([
740
- formHandler()
741
- ], Skapi.prototype, "deleteRecords", null);
742
- __decorate([
743
- formHandler()
744
- ], Skapi.prototype, "resendSignupConfirmation", null);
745
- __decorate([
746
- formHandler()
747
- ], Skapi.prototype, "recoverAccount", null);
748
- __decorate([
749
- formHandler()
750
- ], Skapi.prototype, "getUsers", null);
751
- __decorate([
752
- formHandler()
753
- ], Skapi.prototype, "disableAccount", null);
754
- __decorate([
755
- formHandler()
756
- ], Skapi.prototype, "lastVerifiedEmail", null);
757
- __decorate([
758
- formHandler()
759
- ], Skapi.prototype, "unsubscribeNewsletter", null);
760
- __decorate([
761
- formHandler()
762
- ], Skapi.prototype, "adminNewsletterRequest", null);
763
- __decorate([
764
- formHandler()
765
- ], Skapi.prototype, "subscribeNotification", null);
766
- __decorate([
767
- formHandler()
768
- ], Skapi.prototype, "unsubscribeNotification", null);
769
- __decorate([
770
- formHandler()
771
- ], Skapi.prototype, "vapidPublicKey", null);
772
- __decorate([
773
- formHandler()
774
- ], Skapi.prototype, "pushNotification", null);
775
- __decorate([
776
- formHandler()
777
- ], Skapi.prototype, "getNewsletters", null);
778
- __decorate([
779
- formHandler()
780
- ], Skapi.prototype, "getNewsletterSubscription", null);
781
- __decorate([
782
- formHandler()
783
- ], Skapi.prototype, "requestUsernameChange", null);
784
- __decorate([
785
- formHandler()
786
- ], Skapi.prototype, "grantPrivateRecordAccess", null);
787
- __decorate([
788
- formHandler()
789
- ], Skapi.prototype, "removePrivateRecordAccess", null);
790
- __decorate([
791
- formHandler()
792
- ], Skapi.prototype, "listPrivateRecordAccess", null);
793
- __decorate([
794
- formHandler()
795
- ], Skapi.prototype, "requestPrivateRecordAccessKey", null);
796
- __decorate([
797
- formHandler()
798
- ], Skapi.prototype, "deleteFiles", null);
799
- __decorate([
800
- formHandler()
801
- ], Skapi.prototype, "uploadFiles", null);
802
- __decorate([
803
- formHandler()
804
- ], Skapi.prototype, "mock", null);
805
- __decorate([
806
- formHandler({ preventMultipleCalls: true })
807
- ], Skapi.prototype, "login", null);
808
- __decorate([
809
- formHandler()
810
- ], Skapi.prototype, "logout", null);
811
- __decorate([
812
- formHandler({ preventMultipleCalls: true })
813
- ], Skapi.prototype, "signup", null);
814
- __decorate([
815
- formHandler({ preventMultipleCalls: true })
816
- ], Skapi.prototype, "resetPassword", null);
817
- __decorate([
818
- formHandler({ preventMultipleCalls: true })
819
- ], Skapi.prototype, "verifyEmail", null);
820
- __decorate([
821
- formHandler({ preventMultipleCalls: true })
822
- ], Skapi.prototype, "verifyPhoneNumber", null);
823
- __decorate([
824
- formHandler({ preventMultipleCalls: true })
825
- ], Skapi.prototype, "forgotPassword", null);
826
- __decorate([
827
- formHandler({ preventMultipleCalls: true })
828
- ], Skapi.prototype, "changePassword", null);
829
- __decorate([
830
- formHandler({ preventMultipleCalls: true })
831
- ], Skapi.prototype, "updateProfile", null);
832
- __decorate([
833
- formHandler()
834
- ], Skapi.prototype, "postRecord", null);
835
- __decorate([
836
- formHandler()
837
- ], Skapi.prototype, "getSubscriptions", null);
838
- __decorate([
839
- formHandler()
840
- ], Skapi.prototype, "subscribe", null);
841
- __decorate([
842
- formHandler()
843
- ], Skapi.prototype, "unsubscribe", null);
844
- __decorate([
845
- formHandler()
846
- ], Skapi.prototype, "blockSubscriber", null);
847
- __decorate([
848
- formHandler()
849
- ], Skapi.prototype, "unblockSubscriber", null);
850
- __decorate([
851
- formHandler()
852
- ], Skapi.prototype, "subscribeNewsletter", null);
853
- //# sourceMappingURL=skapi.js.map