@tiledesk/tiledesk-voice-twilio-connector 0.1.20 → 0.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-voice-twilio-connector",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Tiledesk VOICE Twilio connector",
5
5
  "license": "MIT",
6
6
  "author": "Gabriele Panico",
@@ -84,6 +84,7 @@ router.get('/configure', async (req, res) => {
84
84
  } else {
85
85
 
86
86
  let proxy_url = BASE_URL + "/webhook/" + project_id
87
+ let status_url = BASE_URL + "/twilio/status"
87
88
 
88
89
  let CONTENT_KEY = CHANNEL_NAME + "-" + project_id;
89
90
 
@@ -111,6 +112,7 @@ router.get('/configure', async (req, res) => {
111
112
  project_id: project_id,
112
113
  token: token,
113
114
  proxy_url: proxy_url,
115
+ status_url: status_url,
114
116
  subscription_id: settings.subscriptionId,
115
117
  department_id: settings.department_id,
116
118
  account_sid: settings.account_sid,
@@ -138,6 +140,7 @@ router.get('/configure', async (req, res) => {
138
140
  project_id: project_id,
139
141
  token: token,
140
142
  proxy_url: proxy_url,
143
+ status_url: status_url,
141
144
  departments: departments,
142
145
  popup_view: popup_view,
143
146
  brand_name: BRAND_NAME
@@ -167,7 +170,8 @@ router.post('/update', async (req, res) => {
167
170
 
168
171
  winston.verbose("(voice) /update settings", settings);
169
172
 
170
- let proxy_url = BASE_URL + "/webhook/" + project_id
173
+ let proxy_url = BASE_URL + "/webhook/" + project_id;
174
+ let status_url = BASE_URL + "/twilio/status";
171
175
 
172
176
  // get departments
173
177
  const tdChannel = new TiledeskChannel({
@@ -199,6 +203,7 @@ router.post('/update', async (req, res) => {
199
203
  project_id: project_id,
200
204
  token: token,
201
205
  proxy_url: proxy_url,
206
+ status_url: status_url,
202
207
  show_success_modal: true,
203
208
  subscription_id: settings.subscriptionId,
204
209
  department_id: settings.department_id,
@@ -223,6 +228,7 @@ router.post('/update', async (req, res) => {
223
228
  project_id: project_id,
224
229
  token: token,
225
230
  proxy_url: proxy_url,
231
+ status_url: status_url,
226
232
  show_success_modal: true,
227
233
  subscription_id: subscription.subscriptionId,
228
234
  account_sid: account_sid,
@@ -243,6 +249,7 @@ router.post('/update', async (req, res) => {
243
249
  project_id: project_id,
244
250
  token: token,
245
251
  proxy_url: proxy_url,
252
+ status_url: status_url,
246
253
  departments: departments,
247
254
  show_error_modal: true,
248
255
  brand_name: BRAND_NAME
@@ -268,7 +275,8 @@ router.post('/disconnect', async (req, res) => {
268
275
  await db.remove(CONTENT_KEY);
269
276
  winston.verbose("(voice) Content deleted.");
270
277
 
271
- let proxy_url = BASE_URL + "/webhook/" + project_id
278
+ let proxy_url = BASE_URL + "/webhook/" + project_id;
279
+ let status_url = BASE_URL + "/twilio/status";
272
280
 
273
281
  // get departments
274
282
  const tdChannel = new TiledeskChannel({
@@ -293,6 +301,7 @@ router.post('/disconnect', async (req, res) => {
293
301
  project_id: project_id,
294
302
  token: token,
295
303
  proxy_url: proxy_url,
304
+ status_url: status_url,
296
305
  departments: departments,
297
306
  brand_name: BRAND_NAME
298
307
  }
@@ -177,7 +177,7 @@
177
177
  <div style="display: flex; flex-direction: row;">
178
178
  <div style="width: 522px;">
179
179
  <div style="display: flex; flex-direction: row; align-items: center;">
180
- <input type="text" readonly class="form-control copy-form custom-input" name="proxy_url" id="proxy_url" value="{{ proxy_url}}">
180
+ <input type="text" readonly class="form-control copy-form custom-input" name="proxy_url" id="proxy_url" value="{{proxy_url}}">
181
181
  <span style="margin-left: 10px;">
182
182
  <i class="fa fa-question-circle custom-tooltip">
183
183
  <span class="custom-tooltiptext">This is the endpoint to be reached by Twilio. Copy it to the Voice "Configuration URL" section in Configure Tab of your number. Please set "HTTP POST" as the method of the API call</span>
@@ -187,7 +187,31 @@
187
187
  </div>
188
188
 
189
189
  </div>
190
- <div id="copy-div" class="icon-btn-div" onclick="copyTextToClipboard()">
190
+ <div id="copy-div" class="icon-btn-div" onclick="copyTextToClipboard('proxy_url')">
191
+ <i class="fa fa-copy icon-btn"></i>
192
+ </div>
193
+ <div id="copied-div" class="icon-btn-div" style="visibility: hidden;">
194
+ <i class="fa fa-check icon-btn" style="margin-left: -74px; color: green;"></i>
195
+ </div>
196
+ </div>
197
+ </div>
198
+
199
+ <div class="form-group" style="width: 590px;">
200
+ <label class="input-label" for="proxy_url">Status callback URL</label>
201
+ <div style="display: flex; flex-direction: row;">
202
+ <div style="width: 522px;">
203
+ <div style="display: flex; flex-direction: row; align-items: center;">
204
+ <input type="text" readonly class="form-control copy-form custom-input" name="status_url" id="status_url" value="{{status_url}}">
205
+ <span style="margin-left: 10px;">
206
+ <i class="fa fa-question-circle custom-tooltip">
207
+ <span class="custom-tooltiptext">This is the endpoint to be reached by Twilio. Copy it to the Voice "Configuration URL" section in Configure Tab of your number. Please set "HTTP POST" as the method of the API call</span>
208
+ </i>
209
+ </span>
210
+
211
+ </div>
212
+
213
+ </div>
214
+ <div id="copy-div" class="icon-btn-div" onclick="copyTextToClipboard('status_url')">
191
215
  <i class="fa fa-copy icon-btn"></i>
192
216
  </div>
193
217
  <div id="copied-div" class="icon-btn-div" style="visibility: hidden;">
@@ -332,8 +356,8 @@
332
356
 
333
357
  <script>
334
358
 
335
- function copyTextToClipboard() {
336
- const proxyUrl = document.getElementById('proxy_url').select()
359
+ function copyTextToClipboard(element_id) {
360
+ const proxyUrl = document.getElementById(element_id).select()
337
361
 
338
362
  //document.querySelector('textarea').select();
339
363
  try {