playov2-js-utilities 0.2.2 → 0.2.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.
package/lib/index.js CHANGED
@@ -3,5 +3,5 @@ module.exports = {
3
3
  ratings : require('./ratings/index'),
4
4
  constants : require('./constants'),
5
5
  playoUtils : require('./util'),
6
- notificationTemplates = require('./notification-templates')
6
+ NotificationTemplates : require('./notification-templates')
7
7
  };
@@ -1,20 +1,69 @@
1
-
1
+ /**
2
+ * Template for sending notification whenever someone posts a questions on any activity.
3
+ * Notification is received by host and the co-host of the activity.
4
+ * text render only
5
+ * @param {String} user_first_name - first name of the user who posted the question
6
+ * @param {String} sport_name -
7
+ * @param {String} date - Activity's date
8
+ */
2
9
  const query_from_joinee = {
3
10
  heading: 'You have a new query! 🧐',
4
- text: '{{user_first_name}} has a query for your {{sport_name}} game on {{date}}. Tap to respond.'
11
+ text: '{{user_first_name}} has a query for your {{sport_name}} game on {{date}}. Tap to respond.',
12
+ buttons: []
5
13
  };
6
14
 
15
+ /**
16
+ * Template for sending notification whenever host/ cohost respond to an activity query.
17
+ * Notification is received by OP.
18
+ * text render only
19
+ * @param {String} host_first_name - first name of the host/ cohost who responded to the question
20
+ * @param {String} sport_name -
21
+ * @param {String} date - Activity's date
22
+ */
7
23
  const host_response_to_query = {
8
24
  heading: 'Your query has been answered! ✅',
9
25
  text: '{{host_first_name}} has responded to your query for the {{sport_name}} game on {{date}}. Tap to read.'
10
26
  };
11
27
 
28
+ /**
29
+ * Template for sending notification whenever any user sends a request to join any activity.
30
+ * Notification is received by host & / cohost.
31
+ * text render only
32
+ * @param {String} user_first_name - first name of the user who posted the question
33
+ * @param {String} sport_name -
34
+ * @param {String} date - Activity's date
35
+ */
12
36
  const activity_join_request = {
13
- heading: '{{user_first_name}} wants to join your game! 🙌',
14
- text: '!!'
37
+ heading: 'You have a new game request! 🙌',
38
+ text: '{{user_first_name}} has requested to join your {{sport_name}} game happening on {{date}}.',
39
+ additional_message_text: {
40
+ text: 'They have a message for you! Tap to read',
41
+ default: 'Let them know if you\'re game.'
42
+ }
43
+ };
44
+
45
+ /**
46
+ * Template for sending notification whenever any host/cohost accepts an user's request to join any activity.
47
+ * Notification is received by the request joinee .
48
+ * heading render also!
49
+ * @param {String} host_first_name - first name of the host/cohost who accepted the request
50
+ * @param {String} sport_name -
51
+ * @param {String} date - Activity's date
52
+ */
53
+ const activity_request_accepted = {
54
+ heading: '{{host_first_name}} has accepted your request! 🥳',
55
+ text: 'You\'re on for the {{sport_name}} game on {{date}}. You can now chat with your game squad.'
15
56
  };
16
57
 
17
- const activity_request_accepted = {
58
+ /**
59
+ * Template for sending notification whenever any host/cohost declines an user's request to join any activity.
60
+ * Notification is received by the request joinee .
61
+ * text render only
62
+ * @param {String} host_first_name - first name of the host/cohost who rejected the request
63
+ * @param {String} sport_name -
64
+ * @param {String} date - Activity's date
65
+ */
66
+ const activity_request_declined = {
18
67
  heading: 'Your request has been declined. 😟',
19
68
  text: '{{host_first_name}} declined your request to join the {{sport_name}} game on {{date}}.',
20
69
  additional_message_text: {
@@ -23,16 +72,40 @@ const activity_request_accepted = {
23
72
  }
24
73
  };
25
74
 
75
+ /**
76
+ * Template for sending notification whenever any host/cohost invites an user to join any activity.
77
+ * Notification is received by the requested joinee .
78
+ * text render only
79
+ * @param {String} host_first_name - first name of the host/cohost who invited the user
80
+ * @param {String} sport_name -
81
+ * @param {String} date - Activity's date
82
+ */
26
83
  const user_invited_by_host = {
27
84
  heading: 'You have a new invite! 📩',
28
85
  text: '{{host_first_name}} has invited you to the {{sport_name}} game on {{date}}. Are you game? 💪'
29
86
  };
30
87
 
88
+ /**
89
+ * Template for sending notification whenever any requested joinee accepts the request to join the activity.
90
+ * Notification is received by the host/cohost .
91
+ * text render only
92
+ * @param {String} user_first_name - first name of the user who accepted the request
93
+ * @param {String} sport_name -
94
+ * @param {String} date - Activity's date
95
+ */
31
96
  const user_accepted_invite = {
32
97
  heading: 'Your invite has been accepted! 🤝',
33
98
  text: '{{user_first_name}} has accepted your request for the {{sport_name}} game on {{date}}.'
34
99
  };
35
100
 
101
+ /**
102
+ * Template for sending notification whenever any requested joinee declines the request to join the activity.
103
+ * Notification is received by the requested host/cohost .
104
+ * text render only
105
+ * @param {String} user_first_name - first name of the user who rejected the request
106
+ * @param {String} sport_name -
107
+ * @param {String} date - Activity's date
108
+ */
36
109
  const user_declined_invite = {
37
110
  heading: 'Your invite has been declined. 😟',
38
111
  text: '{{user_first_name}} has declined your request for the {{sport_name}} game on {{date}}.',
@@ -42,6 +115,14 @@ const user_declined_invite = {
42
115
  }
43
116
  };
44
117
 
118
+ /**
119
+ * Template for sending notification whenever any host/cohost revokes the request to join the activity.
120
+ * Notification is received by the requested joinee .
121
+ * text render only
122
+ * @param {String} host_first_name - first name of the user who cancelled the invite
123
+ * @param {String} sport_name -
124
+ * @param {String} date - Activity's date
125
+ */
45
126
  const host_revoked_invite = {
46
127
  heading: 'Your invite has been cancelled 😕 ',
47
128
  text: '{{host_first_name}} has cancelled your invitation to the {{sport_name}} game on {{date}}.',
@@ -51,6 +132,14 @@ const host_revoked_invite = {
51
132
  }
52
133
  };
53
134
 
135
+ /**
136
+ * Template for sending notification whenever any host/cohost retires an user for an activity.
137
+ * Notification is received by the joinee .
138
+ * text render only
139
+ * @param {String} host_first_name - first name of the host/cohost who retired the user
140
+ * @param {String} sport_name -
141
+ * @param {String} date - Activity's date
142
+ */
54
143
  const host_retired_user = {
55
144
  heading: 'You have been made to retire. 😕 ',
56
145
  text: 'You are no longer a part of {{sport_name}} game on {{date}}.',
@@ -60,6 +149,14 @@ const host_retired_user = {
60
149
  }
61
150
  };
62
151
 
152
+ /**
153
+ * Template for sending notification whenever any user leaves an activity.
154
+ * Notification is received by the host/cohost .
155
+ * text render only
156
+ * @param {String} user_first_name - first name of the user who left the game
157
+ * @param {String} sport_name -
158
+ * @param {String} date - Activity's date
159
+ */
63
160
  const user_left_game = {
64
161
  heading: 'Player has left the game.',
65
162
  text: '{{user_first_name}} has left {{date}}\'s {{sport_name}} game.',
@@ -69,6 +166,14 @@ const user_left_game = {
69
166
  }
70
167
  };
71
168
 
169
+ /**
170
+ * Template for sending notification whenever any activity is cancelled.
171
+ * Notification is received by all the players of the activity (except the host) .
172
+ * text render only
173
+ * @param {String} host_first_name - first name of the user who left the request
174
+ * @param {String} sport_name -
175
+ * @param {String} date - Activity's date
176
+ */
72
177
  const host_cancelled_activity = {
73
178
  heading: 'Oops, your game has been cancelled! 😩',
74
179
  text: '{{host_first_name}} has cancelled your {{sport_name}} for {{date}}. Wanna join another game? '
@@ -91,6 +196,7 @@ module.exports = {
91
196
  host_response_to_query,
92
197
  activity_join_request,
93
198
  activity_request_accepted,
199
+ activity_request_declined,
94
200
  user_accepted_invite,
95
201
  user_declined_invite,
96
202
  user_invited_by_host,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playov2-js-utilities",
3
- "version": "0.2.2",
3
+ "version": "0.2.6",
4
4
  "description": "Private package for JS utility functions",
5
5
  "main": "index.js",
6
6
  "scripts": {