flamerest 1.0.78 → 1.0.79
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/REST.d.ts +7 -1
- package/REST.js +7 -2
- package/package.json +1 -1
package/REST.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ interface IREST {
|
|
|
25
25
|
*/
|
|
26
26
|
unauthorized_callback: () => {},
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Токен приложения конкретного клиента для отправки пуш уведомлений именно ему
|
|
30
|
+
*/
|
|
31
|
+
pushNotificationToken: string | null;
|
|
32
|
+
|
|
33
|
+
|
|
28
34
|
/**
|
|
29
35
|
* Стандартное число запросов на страницу
|
|
30
36
|
* @type {number}
|
|
@@ -116,7 +122,7 @@ interface IREST {
|
|
|
116
122
|
* @param password
|
|
117
123
|
* @param name
|
|
118
124
|
*/
|
|
119
|
-
signup(email: string | null, username: string | null, password: string, name: string | null): Promise<Authorized>,
|
|
125
|
+
signup(email: string | null, username: string | null, password: string, name: string | null, pushNotificationToken: string | null): Promise<Authorized>,
|
|
120
126
|
|
|
121
127
|
|
|
122
128
|
/**
|
package/REST.js
CHANGED
|
@@ -25,6 +25,11 @@ class FLAMEREST {
|
|
|
25
25
|
*/
|
|
26
26
|
this.unauthorized_callback = unauthorized_callback;
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Токен приложения конкретного клиента для отправки пуш уведомлений именно ему
|
|
30
|
+
*/
|
|
31
|
+
this.pushNotificationToken = null;
|
|
32
|
+
|
|
28
33
|
/**
|
|
29
34
|
* Версия api
|
|
30
35
|
*/
|
|
@@ -499,9 +504,9 @@ class FLAMEREST {
|
|
|
499
504
|
|
|
500
505
|
}
|
|
501
506
|
|
|
502
|
-
async signup(email, username, password, name) {
|
|
507
|
+
async signup(email, username, password, name, pushNotificationToken) {
|
|
503
508
|
|
|
504
|
-
let resp = await this.request(this.SERVER + '/auth/signup', JSON.stringify({ login: username, email: email, password: password, name: name }), 'POST', 'json', false);
|
|
509
|
+
let resp = await this.request(this.SERVER + '/auth/signup', JSON.stringify({ login: username, email: email, password: password, name: name, pushNotificationToken: (pushNotificationToken ?? this.pushNotificationToken ?? null) }), 'POST', 'json', false);
|
|
505
510
|
|
|
506
511
|
if (resp.errors) return resp;
|
|
507
512
|
if (resp.data.length === 0) { resp.errors = []; return resp; }
|