Skip to content

Commit af7b5b9

Browse files
authored
Merge pull request #3217 from Countly/push-better-docs
[push] Docs: naming in line with other plugins, a few fixes
2 parents 01e8653 + 87464ce commit af7b5b9

File tree

4 files changed

+188
-187
lines changed

4 files changed

+188
-187
lines changed

plugins/push/api/api-dashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ function add(from, to) {
2020
*
2121
* @param {object} params params object
2222
*
23-
* @api {get} o/push/dashboard dashboard
23+
* @api {get} o/push/dashboard Get dashboard data
2424
* @apiName dashboard
2525
* @apiDescription Get push notification dashboard data
26-
* @apiGroup push
26+
* @apiGroup Push Notifications
2727
*
2828
* @apiQuery {ObjectID} app_id application id
2929
*

plugins/push/api/api-message.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ async function validate(args, draft = false) {
131131
*
132132
* @param {object} params params object
133133
*
134-
* @api {POST} i/push/message/test message/test
134+
* @api {POST} i/push/message/test Message / test
135135
* @apiName message/test
136136
* @apiDescription Send push notification to test users specified in application plugin configuration
137-
* @apiGroup push
137+
* @apiGroup Push Notifications
138138
*
139139
* @apiQuery {ObjectID} app_id application id
140140
* @apiUse PushMessageBody
@@ -238,11 +238,11 @@ module.exports.test = async params => {
238238
*
239239
* @param {object} params params object
240240
*
241-
* @api {POST} i/push/message/create message/create
241+
* @api {POST} i/push/message/create Message / create
242242
* @apiName message/create
243243
* @apiDescription Create push notification.
244244
* Set status to "draft" to create a draft, leave it unspecified otherwise.
245-
* @apiGroup push
245+
* @apiGroup Push Notifications
246246
*
247247
* @apiQuery {ObjectID} app_id application id
248248
* @apiUse PushMessageBody
@@ -290,10 +290,10 @@ module.exports.create = async params => {
290290
*
291291
* @param {object} params params object
292292
*
293-
* @api {POST} i/push/message/update message/update
293+
* @api {POST} i/push/message/update Message / update
294294
* @apiName message/update
295295
* @apiDescription Update push notification
296-
* @apiGroup push
296+
* @apiGroup Push Notifications
297297
*
298298
* @apiQuery {ObjectID} app_id application id
299299
* @apiUse PushMessageBody
@@ -350,10 +350,10 @@ module.exports.update = async params => {
350350
*
351351
* @param {object} params params object
352352
*
353-
* @api {POST} i/push/message/remove message/remove
353+
* @api {POST} i/push/message/remove Message / remove
354354
* @apiName message/remove
355-
* @apiDescription Remove push notification
356-
* @apiGroup push
355+
* @apiDescription Remove message by marking it as deleted (it stays in the database for consistency)
356+
* @apiGroup Push Notifications
357357
*
358358
* @apiQuery {ObjectID} _id message id
359359
* @apiSuccessExample {json} Success
@@ -408,12 +408,12 @@ module.exports.remove = async params => {
408408
*
409409
* @param {object} params params object
410410
*
411-
* @api {POST} i/push/message/toggle message/toggle
411+
* @api {POST} i/push/message/toggle Message / API or Automated / toggle
412412
* @apiName message/toggle
413-
* @apiDescription Stop or start automated message
414-
* @apiGroup push
413+
* @apiDescription Stop active or start inactive API or automated message
414+
* @apiGroup Push Notifications
415415
*
416-
* @apiQuery {ObjectID} _id message id
416+
* @apiQuery {ObjectID} _id message ID
417417
* @apiQuery {Boolean} active true to start the message, false to stop it
418418
* @apiUse PushMessage
419419
* @apiUse PushValidationError
@@ -490,10 +490,10 @@ module.exports.toggle = async params => {
490490
*
491491
* @param {object} params params object
492492
*
493-
* @api {POST} o/push/message/estimate message/estimate
493+
* @api {POST} o/push/message/estimate Message / estimate audience
494494
* @apiName message/estimate
495495
* @apiDescription Estimate message audience
496-
* @apiGroup push
496+
* @apiGroup Push Notifications
497497
*
498498
* @apiBody {ObjectID} app Application ID
499499
* @apiBody {String[]} platforms Array of platforms to send to
@@ -585,10 +585,10 @@ module.exports.estimate = async params => {
585585
*
586586
* @param {object} params params object
587587
*
588-
* @api {GET} o/push/message/mime message/mime
588+
* @api {GET} o/push/message/mime Message / attachment MIME
589589
* @apiName message/mime
590590
* @apiDescription Get MIME information of the URL specified by sending HEAD request and then GET if HEAD doesn't work. Respects proxy setting, follows redirects and returns end URL along with content type & length.
591-
* @apiGroup push
591+
* @apiGroup Push Notifications
592592
*
593593
* @apiQuery {String} url URL to check
594594
*
@@ -644,10 +644,10 @@ module.exports.mime = async params => {
644644
*
645645
* @param {object} params params object
646646
*
647-
* @api {GET} o/push/message/GET message/GET
647+
* @api {GET} o/push/message/GET Message / GET
648648
* @apiName message/GET
649-
* @apiDescription Get message by id
650-
* @apiGroup push
649+
* @apiDescription Get message by ID
650+
* @apiGroup Push Notifications
651651
*
652652
* @apiQuery {ObjectID} _id Message ID
653653
*
@@ -689,11 +689,11 @@ module.exports.one = async params => {
689689
* @param {object} params params
690690
* @returns {Promise} resolves to true
691691
*
692-
* @api {GET} o/push/user user
692+
* @api {GET} o/push/user User notifications
693693
* @apiName user
694694
* @apiDescription Get notifications sent to a particular user.
695695
* Makes a look up either by user id (uid) or did (device id). Returns ids of messages & dates, optionally returns corresponding message objects.
696-
* @apiGroup push
696+
* @apiGroup Push Notifications
697697
*
698698
* @apiQuery {String} app_id Application ID
699699
* @apiQuery {Boolean} messages Whether to return Message objects as well
@@ -773,11 +773,11 @@ module.exports.user = async params => {
773773
* @param {object} params params
774774
* @returns {Promise} resolves to true
775775
*
776-
* @api {GET} o/push/message/all message/all
776+
* @api {GET} o/push/message/all Message / find
777777
* @apiName message/all
778778
* @apiDescription Get messages
779779
* Returns one of three groups: one time messages (neither auto, nor api params set or set to false), automated messages (auto = "true"), API messages (api = "true")
780-
* @apiGroup push
780+
* @apiGroup Push Notifications
781781
*
782782
* @apiQuery {String} app_id Application ID
783783
* @apiQuery {Boolean} auto Whether to return only automated messages

plugins/push/api/api-tx.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ async function check(params, push) {
6969
*
7070
* @param {object} params params object
7171
*
72-
* @api {POST} i/push/message/push message/push
72+
* @api {POST} i/push/message/push Message / API / add users
7373
* @apiName message/push
7474
* @apiDescription Add notifications to previously created message with API trigger
75-
* @apiGroup push
75+
* @apiGroup Push Notifications
7676
*
7777
* @apiBody {ObjectID} _id Message ID
7878
* @apiBody {Date} start Date to send notifications on
@@ -107,14 +107,14 @@ module.exports.apiPush = async params => {
107107
};
108108

109109
/**
110-
* Add notification to API message
110+
* Remove notifications from API message
111111
*
112112
* @param {object} params params object
113113
*
114-
* @api {POST} i/push/message/pop message/pop
114+
* @api {POST} i/push/message/pop Message / API / remove users
115115
* @apiName message/pop
116116
* @apiDescription Remove notifications from previously created message with API trigger
117-
* @apiGroup push
117+
* @apiGroup Push Notifications
118118
*
119119
* @apiBody {ObjectID} _id Message ID
120120
* @apiBody {Object} filter User profile filter to limit recipients of this message, must not be empty

0 commit comments

Comments
 (0)