@@ -18,7 +18,7 @@ const key = 'a';
18
18
* - has its own compilation part;
19
19
* - has its own sending part;
20
20
* - has no distinct representation in UI, therefore it's virtual.
21
- *
21
+ *
22
22
* Huawei push is only available on select Android devices, therefore it doesn't deserve a separate checkbox in UI from users perspective.
23
23
* Yet notification payload, provider communication and a few other things are different, therefore it's a virtual platform. You can send to huawei directly using
24
24
* API, but whenever you send to Android you'll also send to huawei if Huawei credentials are set.
@@ -27,20 +27,20 @@ const virtuals = ['h'];
27
27
28
28
/**
29
29
* Extract token & field from token_session request
30
- *
30
+ *
31
31
* @param {object } qstring request params
32
32
* @returns {string[]|undefined } array of [platform, field, token] if qstring has platform-specific token data, undefined otherwise
33
33
*/
34
34
function extractor ( qstring ) {
35
35
if ( qstring . android_token !== undefined && ( ! qstring . token_provider || qstring . token_provider === 'FCM' ) ) {
36
36
const token = qstring . android_token === 'BLACKLISTED' ? '' : qstring . android_token ;
37
- return [ key , FIELDS [ '0' ] , token , util . hashInt ( token ) ] ;
37
+ return [ key , FIELDS [ '0' ] , token , util . hash ( token ) ] ;
38
38
}
39
39
}
40
40
41
41
/**
42
42
* Make an estimated guess about request platform
43
- *
43
+ *
44
44
* @param {string } userAgent user-agent header
45
45
* @returns {string } platform key if it looks like request made by this platform
46
46
*/
@@ -56,7 +56,7 @@ class FCM extends Splitter {
56
56
* Standard constructor
57
57
* @param {string } log logger name
58
58
* @param {string } type type of connection: ap, at, id, ia, ip, ht, hp
59
- * @param {Credentials } creds FCM credentials
59
+ * @param {Credentials } creds FCM credentials
60
60
* @param {Object[] } messages initial array of messages to send
61
61
* @param {Object } options standard stream options
62
62
* @param {number } options.pool.pushes number of notifications which can be processed concurrently, this parameter is strictly set to 500
@@ -90,8 +90,8 @@ class FCM extends Splitter {
90
90
}
91
91
92
92
/**
93
- * Compile & send messages
94
- *
93
+ * Compile & send messages
94
+ *
95
95
* @param {Object[] } data pushes to send, no more than 500 per function call as enforced by stream writableHighWaterMark
96
96
* @param {integer } length number of bytes in data
97
97
* @returns {Promise } sending promise
@@ -217,7 +217,7 @@ class FCM extends Splitter {
217
217
218
218
/**
219
219
* Create new empty payload for the note object given
220
- *
220
+ *
221
221
* @param {Message } msg NMessageote object
222
222
* @returns {object } empty payload object
223
223
*/
@@ -227,7 +227,7 @@ function empty(msg) {
227
227
228
228
/**
229
229
* Finish data object after setting all the properties
230
- *
230
+ *
231
231
* @param {object } data platform-specific data to finalize
232
232
* @return {object } resulting object
233
233
*/
@@ -256,7 +256,7 @@ const fields = [
256
256
*/
257
257
const map = {
258
258
/**
259
- * Sends sound
259
+ * Sends sound
260
260
* @param {Template } t template
261
261
* @param {string } sound sound string
262
262
*/
@@ -267,7 +267,7 @@ const map = {
267
267
} ,
268
268
269
269
/**
270
- * Sends badge
270
+ * Sends badge
271
271
* @param {Template } t template
272
272
* @param {number } badge badge (0..N)
273
273
*/
@@ -278,7 +278,7 @@ const map = {
278
278
/**
279
279
* Sends buttons
280
280
* !NOTE! buttons & messagePerLocale are inter-dependent as buttons urls/titles are locale-specific
281
- *
281
+ *
282
282
* @param {Template } t template
283
283
* @param {number } buttons buttons (1..2)
284
284
*/
@@ -290,7 +290,7 @@ const map = {
290
290
291
291
/**
292
292
* Set title string
293
- *
293
+ *
294
294
* @param {Template } t template
295
295
* @param {String } title title string
296
296
*/
@@ -300,7 +300,7 @@ const map = {
300
300
301
301
/**
302
302
* Set message string
303
- *
303
+ *
304
304
* @param {Template } t template
305
305
* @param {String } message message string
306
306
*/
@@ -310,7 +310,7 @@ const map = {
310
310
311
311
/**
312
312
* Send collapse_key.
313
- *
313
+ *
314
314
* @param {Template } template template
315
315
* @param {boolean } ck collapseKey of the Content
316
316
*/
@@ -322,7 +322,7 @@ const map = {
322
322
323
323
/**
324
324
* Send timeToLive.
325
- *
325
+ *
326
326
* @param {Template } template template
327
327
* @param {boolean } ttl timeToLive of the Content
328
328
*/
@@ -334,7 +334,7 @@ const map = {
334
334
335
335
/**
336
336
* Send notification-tap url
337
- *
337
+ *
338
338
* @param {Template } template template
339
339
* @param {string } url on-tap url
340
340
*/
@@ -345,7 +345,7 @@ const map = {
345
345
/**
346
346
* Send media (picture, video, gif, etc) along with the message.
347
347
* Sets mutable-content in order for iOS extension to be run.
348
- *
348
+ *
349
349
* @param {Template } template template
350
350
* @param {string } media attached media url
351
351
*/
@@ -355,7 +355,7 @@ const map = {
355
355
356
356
/**
357
357
* Sends custom data along with the message
358
- *
358
+ *
359
359
* @param {Template } template template
360
360
* @param {Object } data data to be sent
361
361
*/
@@ -365,7 +365,7 @@ const map = {
365
365
366
366
/**
367
367
* Sends user props along with the message
368
- *
368
+ *
369
369
* @param {Template } template template
370
370
* @param {[string] } extras extra user props to be sent
371
371
* @param {Object } data personalization
@@ -381,7 +381,7 @@ const map = {
381
381
382
382
/**
383
383
* Sends platform specific fields
384
- *
384
+ *
385
385
* @param {Template } template template
386
386
* @param {object } specific platform specific props to be sent
387
387
*/
@@ -417,7 +417,7 @@ const CREDS = {
417
417
'fcm' : class FCMCreds extends Creds {
418
418
/**
419
419
* Validation scheme of this class
420
- *
420
+ *
421
421
* @returns {object } validateArgs scheme
422
422
*/
423
423
static get scheme ( ) {
@@ -429,7 +429,7 @@ const CREDS = {
429
429
430
430
/**
431
431
* Check credentials for correctness, throw PushError otherwise
432
- *
432
+ *
433
433
* @throws PushError in case the check fails
434
434
* @returns {undefined }
435
435
*/
@@ -469,7 +469,7 @@ const CREDS = {
469
469
470
470
/**
471
471
* "View" json, that is some truncated/simplified version of credentials that is "ok" to display
472
- *
472
+ *
473
473
* @returns {object } json without sensitive information
474
474
*/
475
475
get view ( ) {
0 commit comments