@tiledesk/tiledesk-voice-twilio-connector 0.1.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/index.js +1029 -0
- package/package.json +45 -0
- package/routes/manageApp.js +400 -0
- package/template/configure.html +355 -0
- package/template/css/configure.css +422 -0
- package/template/css/error.css +67 -0
- package/template/css/style.css +315 -0
- package/template/error.html +92 -0
- package/tiledesk/KVBaseMongo.js +102 -0
- package/tiledesk/TiledeskChannel.js +335 -0
- package/tiledesk/TiledeskSubscriptionClient.js +135 -0
- package/tiledesk/TiledeskTwilioTranslator.js +563 -0
- package/tiledesk/VoiceChannel.js +115 -0
- package/tiledesk/constants.js +38 -0
- package/tiledesk/utils-message.js +64 -0
- package/tiledesk/utils.js +16 -0
- package/winston.js +41 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.input-label {
|
|
5
|
+
margin-bottom: 2px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.subtitle {
|
|
9
|
+
margin-bottom: 6px;
|
|
10
|
+
color: #929292bd;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.custom-tooltip {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Tooltip text */
|
|
19
|
+
.custom-tooltip .custom-tooltiptext {
|
|
20
|
+
font-family: 'Poppins';
|
|
21
|
+
visibility: hidden;
|
|
22
|
+
width: 300px;
|
|
23
|
+
background-color: #8c8e8fbd;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
color: #fff;
|
|
26
|
+
text-align: center;
|
|
27
|
+
padding: 8px 8px;
|
|
28
|
+
border-radius: 6px;
|
|
29
|
+
|
|
30
|
+
/* Position the tooltip text */
|
|
31
|
+
position: absolute;
|
|
32
|
+
z-index: 1;
|
|
33
|
+
margin-left: 8px;
|
|
34
|
+
margin-top: -15px;
|
|
35
|
+
|
|
36
|
+
/* Fade in tooltip */
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity 0.5s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Tooltip arrow */
|
|
42
|
+
.custom-tooltip .custom-tooltiptext::after {
|
|
43
|
+
content: " ";
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 50%;
|
|
46
|
+
right: 100%; /* To the left of the tooltip */
|
|
47
|
+
margin-top: -5px;
|
|
48
|
+
border-width: 5px;
|
|
49
|
+
border-style: solid;
|
|
50
|
+
border-color: transparent #8c8e8fbd transparent transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Show the tooltip text when you mouse over the tooltip container */
|
|
54
|
+
.custom-tooltip:hover .custom-tooltiptext {
|
|
55
|
+
visibility: visible;
|
|
56
|
+
opacity: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
/* New page */
|
|
61
|
+
.header {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 120px;
|
|
64
|
+
background-color: #10739e;
|
|
65
|
+
display: flex;
|
|
66
|
+
position: fixed;
|
|
67
|
+
top: 0px;
|
|
68
|
+
flex-direction: row;
|
|
69
|
+
justify-content: flex-start;
|
|
70
|
+
align-items: center;
|
|
71
|
+
box-shadow: 0px 2px 5px 0px #003349;
|
|
72
|
+
/*border-radius: 0px 80px 0px 0px;*/
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.header p {
|
|
76
|
+
color: white;
|
|
77
|
+
font-size: 22px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.content {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
margin-top: 20px;
|
|
84
|
+
padding: 100px 0px 0px 0px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.left-panel {
|
|
88
|
+
width: 100%;
|
|
89
|
+
padding: 20px 30px;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.info-box {
|
|
96
|
+
padding: 20px;
|
|
97
|
+
font-size: 16px;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
min-width: 600px;
|
|
100
|
+
max-width: 800px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.list-element {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: row;
|
|
106
|
+
justify-content: flex-start;
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.docs-section {
|
|
111
|
+
width: 82%;
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.vertical-divider {
|
|
117
|
+
margin-top: 25px;
|
|
118
|
+
width: 6px;
|
|
119
|
+
background-color: #d9d9d9;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
.right-panel {
|
|
124
|
+
width: 100%;
|
|
125
|
+
padding: 40px 30px;
|
|
126
|
+
display: flex;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.divider {
|
|
130
|
+
margin-top: 12px;
|
|
131
|
+
margin-bottom: 12px;
|
|
132
|
+
width: 600px;
|
|
133
|
+
margin-left: 0px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.panel-divider {
|
|
137
|
+
margin-top: 40px;
|
|
138
|
+
width: 100%;
|
|
139
|
+
margin-left: 0px;
|
|
140
|
+
display: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/* On screens that are 992px or less, set the background color to blue */
|
|
145
|
+
@media screen and (max-width: 1200px) {
|
|
146
|
+
.content {
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.docs-section {
|
|
151
|
+
align-items: center;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.divider {
|
|
155
|
+
margin-left: auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.panel-divider {
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.right-panel {
|
|
163
|
+
justify-content: center;
|
|
164
|
+
padding: 20px 30px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.success-modal {
|
|
170
|
+
display: flex;
|
|
171
|
+
z-index: 99;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
position: fixed;
|
|
175
|
+
text-align: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
padding-top: 100px;
|
|
178
|
+
left: 0;
|
|
179
|
+
top: 0;
|
|
180
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.success-modal .modal-content {
|
|
184
|
+
width: 400px;
|
|
185
|
+
height: 200px;
|
|
186
|
+
background-color: white;
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.error-modal {
|
|
194
|
+
display: flex;
|
|
195
|
+
z-index: 99;
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 100%;
|
|
198
|
+
position: fixed;
|
|
199
|
+
text-align: center;
|
|
200
|
+
justify-content: center;
|
|
201
|
+
padding-top: 100px;
|
|
202
|
+
left: 0;
|
|
203
|
+
top: 0;
|
|
204
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.error-modal .modal-content {
|
|
208
|
+
width: 400px;
|
|
209
|
+
height: 200px;
|
|
210
|
+
background-color: white;
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.cancel-btn {
|
|
218
|
+
width: 120px;
|
|
219
|
+
margin-top: 5px;
|
|
220
|
+
color: white;
|
|
221
|
+
border-color: #c0c0c0;
|
|
222
|
+
background-color: #c0c0c0;
|
|
223
|
+
letter-spacing: 0.5px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.cancel-btn:hover {
|
|
227
|
+
width: 120px;
|
|
228
|
+
margin-top: 5px;
|
|
229
|
+
color: white;
|
|
230
|
+
border-color: #929292;
|
|
231
|
+
background-color: #929292;
|
|
232
|
+
letter-spacing: 0.5px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.cancel-btn:focus {
|
|
236
|
+
width: 120px;
|
|
237
|
+
margin-top: 5px;
|
|
238
|
+
color: white;
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
border-color: #929292;
|
|
241
|
+
background-color: #929292;
|
|
242
|
+
letter-spacing: 0.5px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.disconnect-button {
|
|
246
|
+
width: 120px;
|
|
247
|
+
margin-top: 5px;
|
|
248
|
+
color: white;
|
|
249
|
+
border-color: #f0593d;
|
|
250
|
+
background-color: #f0593d;
|
|
251
|
+
letter-spacing: 0.5px;
|
|
252
|
+
font-size: 13px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.disconnect-button:hover {
|
|
256
|
+
width: 120px;
|
|
257
|
+
margin-top: 5px;
|
|
258
|
+
color: white;
|
|
259
|
+
border-color: #d53e21;
|
|
260
|
+
background-color: #d53e21;
|
|
261
|
+
letter-spacing: 0.5px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.disconnect-button:focus {
|
|
265
|
+
width: 120px;
|
|
266
|
+
margin-top: 5px;
|
|
267
|
+
color: white;
|
|
268
|
+
font-weight: 500;
|
|
269
|
+
border-color: #d53e21;
|
|
270
|
+
background-color: #d53e21;
|
|
271
|
+
letter-spacing: 0.5px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
.btn:focus {
|
|
276
|
+
outline: none !important;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.icon-btn-div {
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
padding: 2px 5px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.icon-btn {
|
|
285
|
+
background-color: #eeeeee;
|
|
286
|
+
border: none;
|
|
287
|
+
color: grey;
|
|
288
|
+
padding: 0px 8px;
|
|
289
|
+
cursor: pointer;
|
|
290
|
+
margin-top: 12px;
|
|
291
|
+
margin-left: -63px;
|
|
292
|
+
font-size: 18px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.icon-btn:hover {
|
|
296
|
+
background-color: #eeeeee;
|
|
297
|
+
color: black; /* White text */
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.copy-form {
|
|
301
|
+
padding: 6px 36px 6px 14px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.custom-input {
|
|
305
|
+
height: 45px;
|
|
306
|
+
border: solid 2px #d8d8d8;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.custom-input:hover {
|
|
310
|
+
border-color: #0ba2dc;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.custom-input:focus {
|
|
314
|
+
border-color: #0ba2dc;
|
|
315
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
|
|
9
|
+
<!-- Latest compiled and minified CSS -->
|
|
10
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
|
|
11
|
+
integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
|
|
12
|
+
|
|
13
|
+
<!-- Optional theme -->
|
|
14
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css"
|
|
15
|
+
integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
|
|
16
|
+
|
|
17
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
18
|
+
|
|
19
|
+
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
|
|
20
|
+
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
|
|
21
|
+
|
|
22
|
+
<!-- Latest compiled and minified JavaScript -->
|
|
23
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
|
|
24
|
+
integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous">
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
28
|
+
<link rel="stylesheet" href="./css/error.css">
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
body {
|
|
32
|
+
font-family: 'Poppins', serif;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
|
|
36
|
+
</head>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<body>
|
|
40
|
+
|
|
41
|
+
<!-- Success modal -->
|
|
42
|
+
<!--
|
|
43
|
+
{{#if show_success_modal}}
|
|
44
|
+
<div id="success-update-modal" class="success-modal">
|
|
45
|
+
<div class="modal-content">
|
|
46
|
+
<img src="https://www.pngall.com/wp-content/uploads/9/Green-Tick-Vector-PNG-Images.png" width="80" height="auto" />
|
|
47
|
+
<p class="modal-text" style="margin-top: 20px; margin-bottom: 20px;">Configuration updated successfully</p>
|
|
48
|
+
<button class="btn cancel-btn" onclick="document.getElementById('success-update-modal').style.display='none'">Close</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
{{/if}}
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
<!-- Error modal -->
|
|
55
|
+
<!--
|
|
56
|
+
{{#if show_error_modal}}
|
|
57
|
+
<div id="error-update-modal" class="error-modal">
|
|
58
|
+
<div class="modal-content">
|
|
59
|
+
<img src="https://cdn-icons-png.flaticon.com/512/148/148766.png" width="80" height="auto" />
|
|
60
|
+
<p style="margin-top: 20px; margin-bottom: 20px;">An error occurred while updating the configuration</p>
|
|
61
|
+
<button class="btn cancel-btn" onclick="document.getElementById('error-update-modal').style.display='none'">Close</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
{{/if}}
|
|
65
|
+
-->
|
|
66
|
+
|
|
67
|
+
<!-- HEADER -->
|
|
68
|
+
<div class="header">
|
|
69
|
+
<div class="header-content">
|
|
70
|
+
<div class="logo-title">
|
|
71
|
+
<div class="logo-container">
|
|
72
|
+
<img src="https://raw.githubusercontent.com/gab-95/images-host/main/sms.png" width="60px" height="60px">
|
|
73
|
+
</div>
|
|
74
|
+
<div class="title-version">
|
|
75
|
+
<p class="title">SMS Connector</p>
|
|
76
|
+
<div class="status-box" style="padding: 0px 8px; letter-spacing: 1px; height: 18px;">
|
|
77
|
+
<p style="margin-bottom: 0px;">{{ app_version }}</p>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="error">
|
|
85
|
+
<div class="error-box">
|
|
86
|
+
<p class="error-title">Ops! Something went wrong.</p>
|
|
87
|
+
<p>{{ error_message }}</p>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</body>
|
|
92
|
+
</html>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const mongodb = require("mongodb");
|
|
2
|
+
var winston = require('../winston');
|
|
3
|
+
|
|
4
|
+
class KVBaseMongo {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Constructor for KVBaseMongo object
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const { KVBaseMongo } = require('./KVBaseMongo');
|
|
11
|
+
* let db = new KVBaseMongo("kvstore");
|
|
12
|
+
*
|
|
13
|
+
* @param {KVBASE_COLLECTION} The name of the Mongodb collection used as key-value store. Mandatory.
|
|
14
|
+
*/
|
|
15
|
+
constructor(KVBASE_COLLECTION) {
|
|
16
|
+
if (!KVBASE_COLLECTION) {
|
|
17
|
+
throw new Error('KVBASE_COLLECTION (the name of the Mongodb collection used as key-value store) is mandatory.');
|
|
18
|
+
}
|
|
19
|
+
this.KV_COLLECTION = KVBASE_COLLECTION;
|
|
20
|
+
winston.debug("KV_COLLECTION: " + this.KV_COLLECTION)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
connect(MONGODB_URI, callback) {
|
|
24
|
+
mongodb.MongoClient.connect(MONGODB_URI, { useNewUrlParser: true, useUnifiedTopology: true }, (err, client) => {
|
|
25
|
+
if (err) {
|
|
26
|
+
winston.error(err);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
} else {
|
|
29
|
+
this.db = client.db();
|
|
30
|
+
this.db.collection(this.KV_COLLECTION).createIndex(
|
|
31
|
+
{ "key": 1 }, { unique: true }
|
|
32
|
+
);
|
|
33
|
+
//winston.debug("[mongodb] db: ", this.db);
|
|
34
|
+
callback();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
set(k, v) {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
//this.db.set(k, v).then(() => {resolve();});
|
|
42
|
+
this.db.collection(this.KV_COLLECTION).updateOne({key: k}, { $set: { value: v, key: k } }, { upsert: true }, function(err, doc) {
|
|
43
|
+
if (err) {
|
|
44
|
+
reject(err);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
resolve();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
reuseConnection(db, callback) {
|
|
54
|
+
this.db = db;
|
|
55
|
+
this.db.collection(this.KV_COLLECTION).createIndex(
|
|
56
|
+
{ "key": 1 }, { unique: true }
|
|
57
|
+
)
|
|
58
|
+
callback();
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get(k) {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
//this.db.get(k).then(value => {resolve(value)});
|
|
65
|
+
|
|
66
|
+
winston.debug("Searching on " + this.db)
|
|
67
|
+
winston.verbose("Searching on Collection " + this.KV_COLLECTION + ' for key: ', k)
|
|
68
|
+
|
|
69
|
+
this.db.collection(this.KV_COLLECTION).findOne({ key: k }, function(err, doc) {
|
|
70
|
+
if (err) {
|
|
71
|
+
winston.error("Error reading mongodb value", err);
|
|
72
|
+
reject(err);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (doc) {
|
|
76
|
+
winston.verbose("Doc found with key: " + doc.key);
|
|
77
|
+
resolve(doc.value);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
winston.verbose("No Doc found!");
|
|
81
|
+
resolve(null);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
remove(k) {
|
|
89
|
+
return new Promise((resolve, reject) => {
|
|
90
|
+
this.db.collection(this.KV_COLLECTION).deleteOne({key: k}, function(err) {
|
|
91
|
+
if (err) {
|
|
92
|
+
reject(err);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
resolve();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = { KVBaseMongo };
|