quickblox 2.15.1 → 2.15.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/README.md +1 -1
- package/package.json +3 -3
- package/quickblox.js +18881 -18974
- package/quickblox.min.js +1 -1
- package/src/modules/chat/qbChat.js +98 -185
- package/src/modules/chat/qbDialog.js +12 -12
- package/src/modules/chat/qbMessage.js +18 -18
- package/src/modules/qbAddressBook.js +4 -4
- package/src/modules/qbContent.js +71 -71
- package/src/modules/qbData.js +65 -66
- package/src/modules/qbPushNotifications.js +77 -73
- package/src/modules/qbUsers.js +77 -77
- package/src/modules/webrtc/qbRTCPeerConnection.js +30 -4
- package/src/modules/webrtc/qbWebRTCClient.js +28 -15
- package/src/modules/webrtc/qbWebRTCSession.js +80 -50
- package/src/plugins/streamManagement.js +11 -8
- package/src/qbConfig.js +3 -2
- package/src/qbMain.js +17 -16
- package/src/qbUtils.js +5 -1
package/src/modules/qbData.js
CHANGED
|
@@ -13,13 +13,13 @@ function DataProxy(service){
|
|
|
13
13
|
|
|
14
14
|
DataProxy.prototype = {
|
|
15
15
|
/**
|
|
16
|
-
* Create new custom object
|
|
16
|
+
* Create new custom object({@link https://docs.quickblox.com/docs/js-custom-objects#create-records read more}).
|
|
17
17
|
*
|
|
18
18
|
* @memberof QB.data
|
|
19
19
|
*
|
|
20
|
-
* @param {string} className - A class name to which a new object belongs
|
|
21
|
-
* @param {object} data - Object of parameters (custom fields' names and their values)
|
|
22
|
-
* @param {createDataCallback} callback - The createDataCallback function
|
|
20
|
+
* @param {string} className - A class name to which a new object belongs.
|
|
21
|
+
* @param {object} data - Object of parameters (custom fields' names and their values).
|
|
22
|
+
* @param {createDataCallback} callback - The createDataCallback function.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* var data = {
|
|
@@ -43,10 +43,10 @@ DataProxy.prototype = {
|
|
|
43
43
|
*/
|
|
44
44
|
create: function(className, data, callback) {
|
|
45
45
|
/**
|
|
46
|
-
* Callback for QB.data.create(className, data, callback)
|
|
46
|
+
* Callback for QB.data.create(className, data, callback).
|
|
47
47
|
* @callback createDataCallback
|
|
48
|
-
* @param {object} error - The error object
|
|
49
|
-
* @param {object} response - An object
|
|
48
|
+
* @param {object} error - The error object.
|
|
49
|
+
* @param {object} response - An object.
|
|
50
50
|
*/
|
|
51
51
|
var ajaxParams = {
|
|
52
52
|
'type': 'POST',
|
|
@@ -66,16 +66,16 @@ DataProxy.prototype = {
|
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* Search for records of particular class
|
|
69
|
+
* Search for records of particular class({@link https://docs.quickblox.com/docs/js-custom-objects#retrieve-records read more}).
|
|
70
70
|
*
|
|
71
71
|
* @memberof QB.data
|
|
72
72
|
*
|
|
73
|
-
* @param {string} className - A class name to which a new record belongs
|
|
74
|
-
* @param {(object|string[])} filters - Search records with field which contains exactly specified value or by array of records' ids to retrieve
|
|
75
|
-
* @param {number} [filters.skip=0] - Skip N records in search results. Useful for pagination. Default (if not specified) - 0
|
|
76
|
-
* @param {number} [filters.limit=100] - Limit search results to N records. Useful for pagination. Default and max values - 100. If limit is equal to -1 only last record will be returned
|
|
77
|
-
* @param {string} [filters.*] - {@link https://
|
|
78
|
-
* @param {listOfDataCallback} callback - The listOfDataCallback function
|
|
73
|
+
* @param {string} className - A class name to which a new record belongs.
|
|
74
|
+
* @param {(object|string[])} filters - Search records with field which contains exactly specified value or by array of records' ids to retrieve.
|
|
75
|
+
* @param {number} [filters.skip=0] - Skip N records in search results. Useful for pagination. Default (if not specified) - 0.
|
|
76
|
+
* @param {number} [filters.limit=100] - Limit search results to N records. Useful for pagination. Default and max values - 100. If limit is equal to -1 only last record will be returned.
|
|
77
|
+
* @param {string} [filters.*] - {@link https://docs.quickblox.com/docs/js-custom-objects#search-operators See more filters' parameters}.
|
|
78
|
+
* @param {listOfDataCallback} callback - The listOfDataCallback function.
|
|
79
79
|
* @example
|
|
80
80
|
* var filter = {
|
|
81
81
|
* 'skip': 0,
|
|
@@ -99,10 +99,10 @@ DataProxy.prototype = {
|
|
|
99
99
|
*/
|
|
100
100
|
list: function(className, filters, callback) {
|
|
101
101
|
/**
|
|
102
|
-
* Callback for QB.data.list(className, filters, callback)
|
|
102
|
+
* Callback for QB.data.list(className, filters, callback).
|
|
103
103
|
* @callback listOfDataCallback
|
|
104
|
-
* @param {object} error - The error object
|
|
105
|
-
* @param {object} response - Object with Array of files
|
|
104
|
+
* @param {object} error - The error object.
|
|
105
|
+
* @param {object} response - Object with Array of files.
|
|
106
106
|
*/
|
|
107
107
|
|
|
108
108
|
// make filters an optional parameter
|
|
@@ -120,12 +120,12 @@ DataProxy.prototype = {
|
|
|
120
120
|
},
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Update record by ID of particular class
|
|
123
|
+
* Update record by ID of particular class({@link https://docs.quickblox.com/docs/js-custom-objects#update-records Read more}).
|
|
124
124
|
* @memberof QB.data
|
|
125
|
-
* @param {string} className - A class name of record
|
|
126
|
-
* @param {object} data - Object of parameters
|
|
127
|
-
* @param {string} data._id - An ID of record to update
|
|
128
|
-
* @param {updateDataCallback} callback - The updateDataCallback function
|
|
125
|
+
* @param {string} className - A class name of record.
|
|
126
|
+
* @param {object} data - Object of parameters.
|
|
127
|
+
* @param {string} data._id - An ID of record to update.
|
|
128
|
+
* @param {updateDataCallback} callback - The updateDataCallback function.
|
|
129
129
|
* @example
|
|
130
130
|
* QB.data.update('GameOfThrones', {
|
|
131
131
|
* '_id': '53aaa06f535c12cea9007496',
|
|
@@ -142,10 +142,10 @@ DataProxy.prototype = {
|
|
|
142
142
|
*/
|
|
143
143
|
update: function(className, data, callback) {
|
|
144
144
|
/**
|
|
145
|
-
* Callback for QB.data.update(className, data, callback)
|
|
145
|
+
* Callback for QB.data.update(className, data, callback).
|
|
146
146
|
* @callback updateDataCallback
|
|
147
|
-
* @param {object} error - The error object
|
|
148
|
-
* @param {object} response - An object
|
|
147
|
+
* @param {object} error - The error object.
|
|
148
|
+
* @param {object} response - An object.
|
|
149
149
|
*/
|
|
150
150
|
this.service.ajax({
|
|
151
151
|
'url': Utils.getUrl(config.urls.data, className + '/' + data._id),
|
|
@@ -163,14 +163,13 @@ DataProxy.prototype = {
|
|
|
163
163
|
},
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
|
-
* Delete record
|
|
167
|
-
* Check out {@link https://docsdev.quickblox.com/rest_api/CustomObjects_API.html#Delete_object official documentaion} to get detailed information.
|
|
166
|
+
* Delete record/records by ID, IDs or criteria (filters) of particular class({@link https://docs.quickblox.com/docs/js-custom-objects#delete-records read more}).
|
|
168
167
|
*
|
|
169
168
|
* @memberof QB.data
|
|
170
169
|
*
|
|
171
|
-
* @param {string} className - A class name of record
|
|
172
|
-
* @param {(string|array|object)} requestedData - An ID of record or an array of record's ids or object of criteria rules to delete
|
|
173
|
-
* @param {deletedDataCallback} callback - The deletedDataCallback function
|
|
170
|
+
* @param {string} className - A class name of record.
|
|
171
|
+
* @param {(string|array|object)} requestedData - An ID of record or an array of record's ids or object of criteria rules to delete.
|
|
172
|
+
* @param {deletedDataCallback} callback - The deletedDataCallback function.
|
|
174
173
|
*
|
|
175
174
|
* @example
|
|
176
175
|
* var className = 'Movie';
|
|
@@ -206,12 +205,12 @@ DataProxy.prototype = {
|
|
|
206
205
|
*/
|
|
207
206
|
delete: function(className, requestedData, callback) {
|
|
208
207
|
/**
|
|
209
|
-
* Callback for QB.data.delete(className, requestedData, callback)
|
|
208
|
+
* Callback for QB.data.delete(className, requestedData, callback).
|
|
210
209
|
* @callback deletedDataCallback
|
|
211
|
-
* @param {object} error - The error object
|
|
210
|
+
* @param {object} error - The error object.
|
|
212
211
|
* @param {object|null} response
|
|
213
212
|
* @param {array} response.deleted - Array of ids of deleted records. If you delete BY CRITERIA this property will be null.
|
|
214
|
-
* @param {number} response.deletedCount -
|
|
213
|
+
* @param {number} response.deletedCount - Count of deleted records.
|
|
215
214
|
*/
|
|
216
215
|
var typesData = {
|
|
217
216
|
id: 1,
|
|
@@ -276,21 +275,21 @@ DataProxy.prototype = {
|
|
|
276
275
|
},
|
|
277
276
|
|
|
278
277
|
/**
|
|
279
|
-
* Upload file to file field
|
|
278
|
+
* Upload file to file field({@link https://docs.quickblox.com/docs/js-custom-objects#files read more}).
|
|
280
279
|
* @memberof QB.data
|
|
281
|
-
* @param {string} className - A class name to which a new object belongs
|
|
282
|
-
* @param {object} params - Object of parameters
|
|
283
|
-
* @param {string} [params.field_name] - The file's field name
|
|
284
|
-
* @param {string} [params.name] - The file's name
|
|
285
|
-
* @param {object} [params.file] - File object
|
|
286
|
-
* @param {uploadFileToDataCallback} callback - The uploadFileToDataCallback function
|
|
280
|
+
* @param {string} className - A class name to which a new object belongs.
|
|
281
|
+
* @param {object} params - Object of parameters.
|
|
282
|
+
* @param {string} [params.field_name] - The file's field name.
|
|
283
|
+
* @param {string} [params.name] - The file's name.
|
|
284
|
+
* @param {object} [params.file] - File object.
|
|
285
|
+
* @param {uploadFileToDataCallback} callback - The uploadFileToDataCallback function.
|
|
287
286
|
*/
|
|
288
287
|
uploadFile: function(className, params, callback) {
|
|
289
288
|
/**
|
|
290
|
-
* Callback for QB.data.uploadFile(className, params, callback)
|
|
289
|
+
* Callback for QB.data.uploadFile(className, params, callback).
|
|
291
290
|
* @callback uploadFileToDataCallback
|
|
292
|
-
* @param {object} error - The error object
|
|
293
|
-
* @param {object} response - The file object
|
|
291
|
+
* @param {object} error - The error object.
|
|
292
|
+
* @param {object} response - The file object.
|
|
294
293
|
*/
|
|
295
294
|
var data = {
|
|
296
295
|
field_name: params.field_name,
|
|
@@ -316,20 +315,20 @@ DataProxy.prototype = {
|
|
|
316
315
|
},
|
|
317
316
|
|
|
318
317
|
/**
|
|
319
|
-
* Download file from file field by ID
|
|
318
|
+
* Download file from file field by ID({@link https://docs.quickblox.com/docs/js-custom-objects#download-file read more}).
|
|
320
319
|
* @memberof QB.data
|
|
321
|
-
* @param {string} className - A class name of record
|
|
322
|
-
* @param {object} params - Object of parameters
|
|
323
|
-
* @param {string} params.field_name - The file's field name
|
|
324
|
-
* @param {string} params.id - The record's ID
|
|
325
|
-
* @param {downloadFileFromDataCallback} callback - The downloadFileFromDataCallback function
|
|
320
|
+
* @param {string} className - A class name of record.
|
|
321
|
+
* @param {object} params - Object of parameters.
|
|
322
|
+
* @param {string} params.field_name - The file's field name.
|
|
323
|
+
* @param {string} params.id - The record's ID.
|
|
324
|
+
* @param {downloadFileFromDataCallback} callback - The downloadFileFromDataCallback function.
|
|
326
325
|
*/
|
|
327
326
|
downloadFile: function(className, params, callback) {
|
|
328
327
|
/**
|
|
329
|
-
* Callback for QB.data.downloadFile(className, params, callback)
|
|
328
|
+
* Callback for QB.data.downloadFile(className, params, callback).
|
|
330
329
|
* @callback downloadFileFromDataCallback
|
|
331
|
-
* @param {object} error - The error object
|
|
332
|
-
* @param {object} response - The file object
|
|
330
|
+
* @param {object} error - The error object.
|
|
331
|
+
* @param {object} response - The file object.
|
|
333
332
|
*/
|
|
334
333
|
var result = Utils.getUrl(config.urls.data, className + '/' + params.id + '/file');
|
|
335
334
|
result += '?field_name=' + params.field_name + '&token=' + this.service.getSession().token;
|
|
@@ -337,12 +336,12 @@ DataProxy.prototype = {
|
|
|
337
336
|
},
|
|
338
337
|
|
|
339
338
|
/**
|
|
340
|
-
* Return file's URL from file field by ID
|
|
339
|
+
* Return file's URL from file field by ID.
|
|
341
340
|
* @memberof QB.data
|
|
342
|
-
* @param {string} className - A class name of record
|
|
343
|
-
* @param {object} params - Object of parameters
|
|
344
|
-
* @param {string} params.field_name - The file's field name
|
|
345
|
-
* @param {string} params.id - The record's ID
|
|
341
|
+
* @param {string} className - A class name of record.
|
|
342
|
+
* @param {object} params - Object of parameters.
|
|
343
|
+
* @param {string} params.field_name - The file's field name.
|
|
344
|
+
* @param {string} params.id - The record's ID.
|
|
346
345
|
*/
|
|
347
346
|
fileUrl: function(className, params) {
|
|
348
347
|
var result = Utils.getUrl(config.urls.data, className + '/' + params.id + '/file');
|
|
@@ -351,20 +350,20 @@ DataProxy.prototype = {
|
|
|
351
350
|
},
|
|
352
351
|
|
|
353
352
|
/**
|
|
354
|
-
* Delete file from file field by ID
|
|
353
|
+
* Delete file from file field by ID({@link https://docs.quickblox.com/docs/js-custom-objects#delete-file read more}).
|
|
355
354
|
* @memberof QB.data
|
|
356
|
-
* @param {string} className - A class name of record
|
|
357
|
-
* @param {object} params - Object of parameters
|
|
358
|
-
* @param {string} params.field_name - The file's field name
|
|
359
|
-
* @param {string} params.id - The record's ID
|
|
360
|
-
* @param {deleteFileFromDataCallback} callback - The deleteFileFromDataCallback function
|
|
355
|
+
* @param {string} className - A class name of record.
|
|
356
|
+
* @param {object} params - Object of parameters.
|
|
357
|
+
* @param {string} params.field_name - The file's field name.
|
|
358
|
+
* @param {string} params.id - The record's ID.
|
|
359
|
+
* @param {deleteFileFromDataCallback} callback - The deleteFileFromDataCallback function.
|
|
361
360
|
*/
|
|
362
361
|
deleteFile: function(className, params, callback) {
|
|
363
362
|
/**
|
|
364
|
-
* Callback for QB.data.deleteFile(className, params, callback)
|
|
363
|
+
* Callback for QB.data.deleteFile(className, params, callback).
|
|
365
364
|
* @callback deleteFileFromDataCallback
|
|
366
|
-
* @param {object} error - The error object
|
|
367
|
-
* @param {object} response - Empty body
|
|
365
|
+
* @param {object} error - The error object.
|
|
366
|
+
* @param {object} response - Empty body.
|
|
368
367
|
*/
|
|
369
368
|
this.service.ajax({url: Utils.getUrl(config.urls.data, className + '/' + params.id + '/file'), data: {field_name: params.field_name},
|
|
370
369
|
dataType: 'text', type: 'DELETE'}, function(err, result) {
|
|
@@ -39,56 +39,56 @@ function SubscriptionsProxy(service){
|
|
|
39
39
|
SubscriptionsProxy.prototype = {
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Create device based subscription
|
|
42
|
+
* Create device based subscription.
|
|
43
43
|
* @memberof QB.pushnotifications.subscriptions
|
|
44
|
-
* @param {object} params - Object of parameters
|
|
45
|
-
* @param {string} params.notification_channel - Declare which notification channels could be used to notify user about events. Allowed values: apns, apns_voip, gcm, mpns, bbps and email
|
|
46
|
-
* @param {object} params.push_token - Object of parameters
|
|
47
|
-
* @param {string} params.push_token.environment - Determine application mode. It allows conveniently separate development and production modes. Allowed values: evelopment or production
|
|
48
|
-
* @param {string} [params.push_token.bundle_identifier] - A unique identifier for client's application. In iOS, this is the Bundle Identifier. In Android - package id
|
|
49
|
-
* @param {string} params.push_token.client_identification_sequence - Identifies client device in 3-rd party service like APNS, GCM/FCM, BBPS or MPNS. Initially retrieved from 3-rd service and should be send to QuickBlox to let it send push notifications to the client
|
|
50
|
-
* @param {object} params.device - Object of parameters
|
|
51
|
-
* @param {string} params.device.platform - Platform of device, which is the source of application running. Allowed values: ios, android, windows_phone, blackberry
|
|
52
|
-
* @param {string} params.device.udid - UDID (Unique Device identifier) of device, which is the source of application running. This must be anything sequence which uniquely identify particular device. This is needed to support schema: 1 User - Multiple devices
|
|
53
|
-
* @param {createPushSubscriptionCallback} callback - The createPushSubscriptionCallback function
|
|
44
|
+
* @param {object} params - Object of parameters.
|
|
45
|
+
* @param {string} params.notification_channel - Declare which notification channels could be used to notify user about events. Allowed values: apns, apns_voip, gcm, mpns, bbps and email.
|
|
46
|
+
* @param {object} params.push_token - Object of parameters.
|
|
47
|
+
* @param {string} params.push_token.environment - Determine application mode. It allows conveniently separate development and production modes. Allowed values: evelopment or production.
|
|
48
|
+
* @param {string} [params.push_token.bundle_identifier] - A unique identifier for client's application. In iOS, this is the Bundle Identifier. In Android - package id.
|
|
49
|
+
* @param {string} params.push_token.client_identification_sequence - Identifies client device in 3-rd party service like APNS, GCM/FCM, BBPS or MPNS. Initially retrieved from 3-rd service and should be send to QuickBlox to let it send push notifications to the client.
|
|
50
|
+
* @param {object} params.device - Object of parameters.
|
|
51
|
+
* @param {string} params.device.platform - Platform of device, which is the source of application running. Allowed values: ios, android, windows_phone, blackberry.
|
|
52
|
+
* @param {string} params.device.udid - UDID (Unique Device identifier) of device, which is the source of application running. This must be anything sequence which uniquely identify particular device. This is needed to support schema: 1 User - Multiple devices.
|
|
53
|
+
* @param {createPushSubscriptionCallback} callback - The createPushSubscriptionCallback function.
|
|
54
54
|
*/
|
|
55
55
|
create: function(params, callback) {
|
|
56
56
|
/**
|
|
57
|
-
* Callback for QB.pushnotifications.subscriptions.create(params, callback)
|
|
57
|
+
* Callback for QB.pushnotifications.subscriptions.create(params, callback).
|
|
58
58
|
* @callback createPushSubscriptionCallback
|
|
59
|
-
* @param {object} error - The error object
|
|
60
|
-
* @param {object} response - Array of all existent user's subscriptions
|
|
59
|
+
* @param {object} error - The error object.
|
|
60
|
+
* @param {object} response - Array of all existent user's subscriptions.
|
|
61
61
|
*/
|
|
62
62
|
this.service.ajax({url: Utils.getUrl(config.urls.subscriptions), type: 'POST', data: params}, callback);
|
|
63
63
|
},
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Retrieve subscriptions for the user which is specified in the session token
|
|
66
|
+
* Retrieve subscriptions for the user which is specified in the session token.
|
|
67
67
|
* @memberof QB.pushnotifications.subscriptions
|
|
68
|
-
* @param {listPushSubscriptionCallback} callback - The listPushSubscriptionCallback function
|
|
68
|
+
* @param {listPushSubscriptionCallback} callback - The listPushSubscriptionCallback function.
|
|
69
69
|
*/
|
|
70
70
|
list: function(callback) {
|
|
71
71
|
/**
|
|
72
|
-
* Callback for QB.pushnotifications.subscriptions.list(callback)
|
|
72
|
+
* Callback for QB.pushnotifications.subscriptions.list(callback).
|
|
73
73
|
* @callback listPushSubscriptionCallback
|
|
74
|
-
* @param {object} error - The error object
|
|
75
|
-
* @param {object} response - Array of all existent user's subscriptions
|
|
74
|
+
* @param {object} error - The error object.
|
|
75
|
+
* @param {object} response - Array of all existent user's subscriptions.
|
|
76
76
|
*/
|
|
77
77
|
this.service.ajax({url: Utils.getUrl(config.urls.subscriptions)}, callback);
|
|
78
78
|
},
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Remove a subscription by its identifier
|
|
81
|
+
* Remove a subscription by its identifier.
|
|
82
82
|
* @memberof QB.pushnotifications.subscriptions
|
|
83
|
-
* @param {number} id - An id of subscription to remove
|
|
84
|
-
* @param {deletePushSubscriptionCallback} callback - The deletePushSubscriptionCallback function
|
|
83
|
+
* @param {number} id - An id of subscription to remove.
|
|
84
|
+
* @param {deletePushSubscriptionCallback} callback - The deletePushSubscriptionCallback function.
|
|
85
85
|
*/
|
|
86
86
|
delete: function(id, callback) {
|
|
87
87
|
/**
|
|
88
|
-
* Callback for QB.pushnotifications.subscriptions.delete(id, callback)
|
|
88
|
+
* Callback for QB.pushnotifications.subscriptions.delete(id, callback).
|
|
89
89
|
* @callback deletePushSubscriptionCallback
|
|
90
|
-
* @param {object} error - The error object
|
|
91
|
-
* @param {object} response - Empty body
|
|
90
|
+
* @param {object} error - The error object.
|
|
91
|
+
* @param {object} response - Empty body.
|
|
92
92
|
*/
|
|
93
93
|
var attrAjax = {
|
|
94
94
|
'type': 'DELETE',
|
|
@@ -116,38 +116,38 @@ function EventsProxy(service){
|
|
|
116
116
|
|
|
117
117
|
EventsProxy.prototype = {
|
|
118
118
|
/**
|
|
119
|
-
* Create notification event. This request will immediately produce notification delivery (push notification or email) ({@link https://
|
|
119
|
+
* Create notification event. This request will immediately produce notification delivery (push notification or email) ({@link https://docs.quickblox.com/docs/js-push-notifications#send-push-notifications read more}).
|
|
120
120
|
* @memberof QB.pushnotifications.events
|
|
121
121
|
*
|
|
122
|
-
* @param {object} params - Object of parameters
|
|
123
|
-
* @param {string} params.notification_type - Type of notification. Allowed values: push or email
|
|
124
|
-
* @param {string} params.environment - An environment of the notification. Allowed values: development or production
|
|
125
|
-
* @param {string} params.message - A payload of event. For push notifications: if event[push_type] not present - should be Base64 encoded text.
|
|
122
|
+
* @param {object} params - Object of parameters.
|
|
123
|
+
* @param {string} params.notification_type - Type of notification. Allowed values: push or email.
|
|
124
|
+
* @param {string} params.environment - An environment of the notification. Allowed values: development or production.
|
|
125
|
+
* @param {string} params.message - A payload of event. For push notifications: if event[push_type] not present - should be Base64 encoded text.
|
|
126
126
|
*
|
|
127
|
-
* @param {string} [params.push_type] - Push Notification type. Used only if event[notification_type] = push, ignored in other cases. If not present - Notification will be delivered to all possible devices for specified users. Each platform has their own standard format.
|
|
128
|
-
* @param {string} [params.event_type] - Allowed values: one_shot, fixed_date or period_date. one_shot - a one-time event, which causes by an external object (the value is only valid if the 'date' is not specified). fixed_date - a one-time event, which occurs at a specified 'date' (the value is valid only if the 'date' is given). period_date - reusable event that occurs within a given 'period' from the initial 'date' (the value is only valid if the 'period' specified). By default: fixed_date, if 'date' is specified. period_date, if 'period' is specified. one_shot, if 'date' is not specified
|
|
129
|
-
* @param {string} [params.name] - The name of the event. Service information. Only for your own usage
|
|
130
|
-
* @param {number} [params.period] - The period of the event in seconds. Required if the event[event_type] = period_date. Possible values: 86400 (1 day). 604800 (1 week). 2592000 (1 month). 31557600 (1 year)
|
|
131
|
-
* @param {number} [params.date] - The date of the event to send on. Required if event[event_type] = fixed_date or period_date. If event[event_type] = fixed_date, the date can not be in the pas
|
|
127
|
+
* @param {string} [params.push_type] - Push Notification type. Used only if event[notification_type] = push, ignored in other cases. If not present - Notification will be delivered to all possible devices for specified users. Each platform has their own standard format. If specified - Notification will be delivered to the specified platform only. Allowed values: apns, apns_voip, gcm, mpns or bbps.
|
|
128
|
+
* @param {string} [params.event_type] - Allowed values: one_shot, fixed_date or period_date. one_shot - a one-time event, which causes by an external object (the value is only valid if the 'date' is not specified). fixed_date - a one-time event, which occurs at a specified 'date' (the value is valid only if the 'date' is given). period_date - reusable event that occurs within a given 'period' from the initial 'date' (the value is only valid if the 'period' specified). By default: fixed_date, if 'date' is specified. period_date, if 'period' is specified. one_shot, if 'date' is not specified.
|
|
129
|
+
* @param {string} [params.name] - The name of the event. Service information. Only for your own usage.
|
|
130
|
+
* @param {number} [params.period] - The period of the event in seconds. Required if the event[event_type] = period_date. Possible values: 86400 (1 day). 604800 (1 week). 2592000 (1 month). 31557600 (1 year).
|
|
131
|
+
* @param {number} [params.date] - The date of the event to send on. Required if event[event_type] = fixed_date or period_date. If event[event_type] = fixed_date, the date can not be in the pas.
|
|
132
132
|
*
|
|
133
|
-
* @param {object} [params.user] - User's object of parameters
|
|
134
|
-
* @param {number[]} [params.user.ids] - Notification's recipients - should contain a string of users' ids divided by commas
|
|
135
|
-
* @param {object} [params.user.tags] - User's object of tags
|
|
136
|
-
* @param {string[]} [params.user.tags.any] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) must have at least one tag that specified in the list
|
|
137
|
-
* @param {string[]} [params.user.tags.all] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) must exactly have only all tags that specified in list
|
|
138
|
-
* @param {string[]} [params.user.tags.exclude] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) mustn't have tags that specified in list
|
|
133
|
+
* @param {object} [params.user] - User's object of parameters.
|
|
134
|
+
* @param {number[]} [params.user.ids] - Notification's recipients - should contain a string of users' ids divided by commas.
|
|
135
|
+
* @param {object} [params.user.tags] - User's object of tags.
|
|
136
|
+
* @param {string[]} [params.user.tags.any] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) must have at least one tag that specified in the list.
|
|
137
|
+
* @param {string[]} [params.user.tags.all] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) must exactly have only all tags that specified in list.
|
|
138
|
+
* @param {string[]} [params.user.tags.exclude] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) mustn't have tags that specified in list.
|
|
139
139
|
*
|
|
140
|
-
* @param {object} [params.external_user] - External user's object of parameters
|
|
141
|
-
* @param {number[]} [params.external_user.ids] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) mustn't have tags that specified in list
|
|
140
|
+
* @param {object} [params.external_user] - External user's object of parameters.
|
|
141
|
+
* @param {number[]} [params.external_user.ids] - Notification's recipients - should contain a string of tags divided by commas. Recipients (users) mustn't have tags that specified in list.
|
|
142
142
|
*
|
|
143
|
-
* @param {createPushEventCallback} callback - The createPushEventCallback function
|
|
143
|
+
* @param {createPushEventCallback} callback - The createPushEventCallback function.
|
|
144
144
|
*/
|
|
145
145
|
create: function(params, callback) {
|
|
146
146
|
/**
|
|
147
|
-
* Callback for QB.pushnotifications.events.create(params, callback)
|
|
147
|
+
* Callback for QB.pushnotifications.events.create(params, callback).
|
|
148
148
|
* @callback createPushEventCallback
|
|
149
|
-
* @param {object} error - The error object
|
|
150
|
-
* @param {object} response - An event object
|
|
149
|
+
* @param {object} error - The error object.
|
|
150
|
+
* @param {object} response - An event object.
|
|
151
151
|
*/
|
|
152
152
|
this.service.ajax({
|
|
153
153
|
'url': Utils.getUrl(config.urls.events),
|
|
@@ -160,19 +160,20 @@ EventsProxy.prototype = {
|
|
|
160
160
|
}, callback);
|
|
161
161
|
},
|
|
162
162
|
|
|
163
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Get list of events which were created by current user.
|
|
164
165
|
* @memberof QB.pushnotifications.events
|
|
165
|
-
* @param {object} params - Object of parameters
|
|
166
|
-
* @param {number} [params.page=1] - Used to paginate the results when more than one page of events retrieved
|
|
167
|
-
* @param {number} [params.per_page=10] - The maximum number of events to return per page, if not specified then the default is 10
|
|
168
|
-
* @param {listPushEventsCallback} callback - The listOfFilesCallback function
|
|
166
|
+
* @param {object} params - Object of parameters.
|
|
167
|
+
* @param {number} [params.page=1] - Used to paginate the results when more than one page of events retrieved.
|
|
168
|
+
* @param {number} [params.per_page=10] - The maximum number of events to return per page, if not specified then the default is 10.
|
|
169
|
+
* @param {listPushEventsCallback} callback - The listOfFilesCallback function.
|
|
169
170
|
*/
|
|
170
171
|
list: function(params, callback) {
|
|
171
172
|
/**
|
|
172
|
-
* Callback for QB.pushnotifications.events.list(params, callback)
|
|
173
|
+
* Callback for QB.pushnotifications.events.list(params, callback).
|
|
173
174
|
* @callback listPushEventsCallback
|
|
174
|
-
* @param {object} error - The error object
|
|
175
|
-
* @param {object} response - An array of events' objects
|
|
175
|
+
* @param {object} error - The error object.
|
|
176
|
+
* @param {object} response - An array of events' objects.
|
|
176
177
|
*/
|
|
177
178
|
if (typeof params === 'function' && typeof callback ==='undefined') {
|
|
178
179
|
callback = params;
|
|
@@ -182,47 +183,50 @@ EventsProxy.prototype = {
|
|
|
182
183
|
this.service.ajax({url: Utils.getUrl(config.urls.events), data: params}, callback);
|
|
183
184
|
},
|
|
184
185
|
|
|
185
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* Retrieve an event by ID.
|
|
186
188
|
* @memberof QB.pushnotifications.events
|
|
187
|
-
* @param {number} id - An id of event to retrieve
|
|
188
|
-
* @param {getPushEventByIdCallback} callback - The getPushEventByIdCallback function
|
|
189
|
+
* @param {number} id - An id of event to retrieve.
|
|
190
|
+
* @param {getPushEventByIdCallback} callback - The getPushEventByIdCallback function.
|
|
189
191
|
*/
|
|
190
192
|
get: function(id, callback) {
|
|
191
193
|
/**
|
|
192
|
-
* Callback for QB.pushnotifications.events.get(id, callback)
|
|
194
|
+
* Callback for QB.pushnotifications.events.get(id, callback).
|
|
193
195
|
* @callback getPushEventByIdCallback
|
|
194
|
-
* @param {object} error - The error object
|
|
195
|
-
* @param {object} response - An array of events' objects
|
|
196
|
+
* @param {object} error - The error object.
|
|
197
|
+
* @param {object} response - An array of events' objects.
|
|
196
198
|
*/
|
|
197
199
|
this.service.ajax({url: Utils.getUrl(config.urls.events, id)}, callback);
|
|
198
200
|
},
|
|
199
201
|
|
|
200
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* Delete an event by ID.
|
|
201
204
|
* @memberof QB.pushnotifications.events
|
|
202
|
-
* @param {number} id - An id of event to delete
|
|
203
|
-
* @param {deletePushEventByIdCallback} callback - The deletePushEventByIdCallback function
|
|
205
|
+
* @param {number} id - An id of event to delete.
|
|
206
|
+
* @param {deletePushEventByIdCallback} callback - The deletePushEventByIdCallback function.
|
|
204
207
|
*/
|
|
205
208
|
delete: function(id, callback) {
|
|
206
209
|
/**
|
|
207
|
-
* Callback for QB.pushnotifications.events.delete(id, callback)
|
|
210
|
+
* Callback for QB.pushnotifications.events.delete(id, callback).
|
|
208
211
|
* @callback deletePushEventByIdCallback
|
|
209
|
-
* @param {object} error - The error object
|
|
210
|
-
* @param {object} response - Empty body
|
|
212
|
+
* @param {object} error - The error object.
|
|
213
|
+
* @param {object} response - Empty body.
|
|
211
214
|
*/
|
|
212
215
|
this.service.ajax({url: Utils.getUrl(config.urls.events, id), dataType: 'text', type: 'DELETE'}, callback);
|
|
213
216
|
},
|
|
214
217
|
|
|
215
|
-
/**
|
|
218
|
+
/**
|
|
219
|
+
* Retrieve an event's status by ID
|
|
216
220
|
* @memberof QB.pushnotifications.events
|
|
217
|
-
* @param {number} id - An id of event to retrieve its status
|
|
218
|
-
* @param {getPushEventStatusByIdCallback} callback - The getPushEventStatusByIdCallback function
|
|
221
|
+
* @param {number} id - An id of event to retrieve its status.
|
|
222
|
+
* @param {getPushEventStatusByIdCallback} callback - The getPushEventStatusByIdCallback function.
|
|
219
223
|
*/
|
|
220
224
|
status: function(id, callback) {
|
|
221
225
|
/**
|
|
222
|
-
* Callback for QB.pushnotifications.events.status(id, callback)
|
|
226
|
+
* Callback for QB.pushnotifications.events.status(id, callback).
|
|
223
227
|
* @callback getPushEventStatusByIdCallback
|
|
224
|
-
* @param {object} error - The error object
|
|
225
|
-
* @param {object} response - An array of events' objects
|
|
228
|
+
* @param {object} error - The error object.
|
|
229
|
+
* @param {object} response - An array of events' objects.
|
|
226
230
|
*/
|
|
227
231
|
this.service.ajax({url: Utils.getUrl(config.urls.events, id + '/status')}, callback);
|
|
228
232
|
}
|