survey-analytics 2.5.22 → 2.5.24
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/fesm/shared.mjs +1 -1
- package/fesm/shared2.mjs +10 -4
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +1 -1
- package/fesm/survey.analytics.mjs +1 -1
- package/fesm/survey.analytics.mongo.mjs +1 -1
- package/fesm/survey.analytics.tabulator.mjs +50 -8
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +17 -25
- package/survey-analytics-tabulator.types/tables/tabulator.d.ts +1 -0
- package/survey.analytics.core.css +57 -24
- package/survey.analytics.core.css.map +1 -1
- package/survey.analytics.core.js +16709 -18227
- package/survey.analytics.core.js.map +1 -1
- package/survey.analytics.core.min.css +1 -10
- package/survey.analytics.core.min.js +6 -2
- package/survey.analytics.core.min.js.LICENSE.txt +91 -22
- package/survey.analytics.css +57 -24
- package/survey.analytics.css.map +1 -1
- package/survey.analytics.js +17552 -19298
- package/survey.analytics.js.map +1 -1
- package/survey.analytics.min.css +1 -10
- package/survey.analytics.min.js +6 -2
- package/survey.analytics.min.js.LICENSE.txt +91 -22
- package/survey.analytics.mongo.js +219 -343
- package/survey.analytics.mongo.js.map +1 -1
- package/survey.analytics.mongo.min.js +6 -2
- package/survey.analytics.mongo.min.js.LICENSE.txt +91 -5
- package/survey.analytics.tabulator.css +83 -20
- package/survey.analytics.tabulator.css.map +1 -1
- package/survey.analytics.tabulator.js +5326 -6468
- package/survey.analytics.tabulator.js.map +1 -1
- package/survey.analytics.tabulator.min.css +1 -6
- package/survey.analytics.tabulator.min.js +6 -2
- package/survey.analytics.tabulator.min.js.LICENSE.txt +91 -5
|
@@ -1,359 +1,235 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/******/ var __webpack_modules__ = ({
|
|
19
|
-
|
|
20
|
-
/***/ "./src/mongo/index.ts":
|
|
21
|
-
/*!****************************!*\
|
|
22
|
-
!*** ./src/mongo/index.ts ***!
|
|
23
|
-
\****************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
/* harmony export */ MongoDbAdapter: () => (/* binding */ MongoDbAdapter)
|
|
29
|
-
/* harmony export */ });
|
|
30
|
-
/* harmony import */ var _result_transformers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./result-transformers */ "./src/mongo/result-transformers.ts");
|
|
31
|
-
/* harmony import */ var _pipelines__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pipelines */ "./src/mongo/pipelines.ts");
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var MongoDbAdapter = /** @class */ (function () {
|
|
35
|
-
function MongoDbAdapter(db, getId) {
|
|
36
|
-
this.db = db;
|
|
37
|
-
this.getId = getId;
|
|
38
|
-
}
|
|
39
|
-
MongoDbAdapter.prototype.create = function (collectionName, object) {
|
|
40
|
-
var _this = this;
|
|
41
|
-
object.id = object.id || this.getId();
|
|
42
|
-
return new Promise(function (resolve, reject) {
|
|
43
|
-
_this.db.collection(collectionName).insertOne(object)
|
|
44
|
-
.then(function (results) {
|
|
45
|
-
resolve(object.id);
|
|
46
|
-
})
|
|
47
|
-
.catch(function (e) {
|
|
48
|
-
reject(JSON.stringify(e));
|
|
49
|
-
});
|
|
2
|
+
surveyjs - SurveyJS Dashboard library v2.5.24
|
|
3
|
+
Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
|
+
License: SEE LICENSE IN LICENSE
|
|
5
|
+
*/
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SurveyAnalyticsMongo = {}));
|
|
10
|
+
})(this, (function (exports) { 'use strict';
|
|
11
|
+
|
|
12
|
+
function choiceTransformationPipeline(result) {
|
|
13
|
+
var res = {};
|
|
14
|
+
var totalCount = 0;
|
|
15
|
+
result.forEach(function (item) {
|
|
16
|
+
res[item._id] = item.count;
|
|
17
|
+
totalCount += item.count;
|
|
50
18
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
19
|
+
return { data: res, totalCount: totalCount };
|
|
20
|
+
}
|
|
21
|
+
function numberTransformationPipeline(result) {
|
|
22
|
+
if (result.length == 0)
|
|
23
|
+
return { value: 0, minValue: 0, maxValue: 0 };
|
|
24
|
+
return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };
|
|
25
|
+
}
|
|
26
|
+
function histogramTransformationPipeline(result) {
|
|
27
|
+
var res = [];
|
|
28
|
+
var totalCount = 0;
|
|
29
|
+
result.forEach(function (item) {
|
|
30
|
+
res.push(item.count);
|
|
31
|
+
totalCount += item.count;
|
|
65
32
|
});
|
|
33
|
+
return { data: res, intervals: result, totalCount: totalCount };
|
|
34
|
+
}
|
|
35
|
+
var transformers = {
|
|
36
|
+
"boolean": choiceTransformationPipeline,
|
|
37
|
+
"radiogroup": choiceTransformationPipeline,
|
|
38
|
+
"dropdown": choiceTransformationPipeline,
|
|
39
|
+
"checkbox": choiceTransformationPipeline,
|
|
40
|
+
"tagbox": choiceTransformationPipeline,
|
|
41
|
+
"number": numberTransformationPipeline,
|
|
42
|
+
"rating": numberTransformationPipeline,
|
|
43
|
+
"histogram": histogramTransformationPipeline
|
|
66
44
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
45
|
+
|
|
46
|
+
function createPipeline(surveyId, questionId, visualizerType, questionType) {
|
|
47
|
+
var singleChoicePipeline = [
|
|
48
|
+
{ $match: { postid: surveyId } },
|
|
49
|
+
{ $project: { value: "$json." + questionId } },
|
|
50
|
+
{ $match: { value: { $exists: true } } },
|
|
51
|
+
{
|
|
52
|
+
$group: {
|
|
53
|
+
_id: "$value",
|
|
54
|
+
count: { $sum: 1 },
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
var multipleChoicePipeline = [
|
|
59
|
+
{ $match: { postid: surveyId } },
|
|
60
|
+
{ $project: { value: "$json." + questionId } },
|
|
61
|
+
{ $match: { value: { $exists: true } } },
|
|
62
|
+
{ $unwind: "$value" },
|
|
63
|
+
{
|
|
64
|
+
$group: {
|
|
65
|
+
_id: "$value",
|
|
66
|
+
count: { $sum: 1 },
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
var numberPipeline = [
|
|
71
|
+
{ $match: { postid: surveyId } },
|
|
72
|
+
{ $project: { value: "$json." + questionId } },
|
|
73
|
+
{ $match: { value: { $exists: true } } },
|
|
74
|
+
{
|
|
75
|
+
$group: {
|
|
76
|
+
_id: null,
|
|
77
|
+
count: { $sum: 1 },
|
|
78
|
+
average: { $avg: "$value" },
|
|
79
|
+
min: { $min: "$value" },
|
|
80
|
+
max: { $max: "$value" },
|
|
81
|
+
values: { $push: "$value" }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
var histogramPipeline = [
|
|
86
|
+
{ $match: { postid: surveyId } },
|
|
87
|
+
{ $project: { value: "$json." + questionId } },
|
|
88
|
+
{ $match: { value: { $exists: true } } },
|
|
89
|
+
{
|
|
90
|
+
$bucketAuto: {
|
|
91
|
+
groupBy: "$value",
|
|
92
|
+
buckets: 10,
|
|
93
|
+
output: {
|
|
94
|
+
count: { $sum: 1 },
|
|
95
|
+
minValue: { $min: "$value" },
|
|
96
|
+
maxValue: { $max: "$value" }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
$project: {
|
|
102
|
+
_id: 0,
|
|
103
|
+
start: "$minValue",
|
|
104
|
+
end: "$maxValue",
|
|
105
|
+
label: {
|
|
106
|
+
$concat: [
|
|
107
|
+
{ $toString: { $round: ["$minValue", 2] } },
|
|
108
|
+
" - ",
|
|
109
|
+
{ $toString: { $round: ["$maxValue", 2] } }
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
count: 1
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
var mongoPipelines = {
|
|
117
|
+
"boolean": singleChoicePipeline,
|
|
118
|
+
"radiogroup": singleChoicePipeline,
|
|
119
|
+
"dropdown": singleChoicePipeline,
|
|
120
|
+
"checkbox": multipleChoicePipeline,
|
|
121
|
+
"tagbox": multipleChoicePipeline,
|
|
122
|
+
"number": numberPipeline,
|
|
123
|
+
"rating": numberPipeline,
|
|
124
|
+
"histogram": histogramPipeline
|
|
125
|
+
};
|
|
126
|
+
var pipeline = mongoPipelines[visualizerType] || mongoPipelines[questionType] || [];
|
|
127
|
+
return pipeline;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
var MongoDbAdapter = /** @class */ (function () {
|
|
131
|
+
function MongoDbAdapter(db, getId) {
|
|
132
|
+
this.db = db;
|
|
133
|
+
this.getId = getId;
|
|
134
|
+
}
|
|
135
|
+
MongoDbAdapter.prototype.create = function (collectionName, object) {
|
|
136
|
+
var _this = this;
|
|
137
|
+
object.id = object.id || this.getId();
|
|
138
|
+
return new Promise(function (resolve, reject) {
|
|
139
|
+
_this.db.collection(collectionName).insertOne(object)
|
|
140
|
+
.then(function (results) {
|
|
141
|
+
resolve(object.id);
|
|
142
|
+
})
|
|
143
|
+
.catch(function (e) {
|
|
144
|
+
reject(JSON.stringify(e));
|
|
145
|
+
});
|
|
76
146
|
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
147
|
+
};
|
|
148
|
+
MongoDbAdapter.prototype.retrieve = function (collectionName, filter) {
|
|
149
|
+
var _this = this;
|
|
150
|
+
filter = filter || [];
|
|
151
|
+
var query = {};
|
|
152
|
+
filter.forEach(function (fi) { return query[fi.field] = fi.value; });
|
|
153
|
+
return new Promise(function (resolve, reject) {
|
|
154
|
+
_this.db.collection(collectionName).find(query).toArray()
|
|
155
|
+
.then(function (results) {
|
|
156
|
+
resolve(results);
|
|
157
|
+
})
|
|
158
|
+
.catch(function (e) {
|
|
159
|
+
reject(JSON.stringify(e));
|
|
160
|
+
});
|
|
88
161
|
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var query = {};
|
|
95
|
-
filter.forEach(function (fi) {
|
|
96
|
-
if (!!fi.value) {
|
|
97
|
-
var val = fi.value;
|
|
98
|
-
query[fi.field] = val;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
var sort = {};
|
|
102
|
-
order.forEach(function (fi) {
|
|
103
|
-
sort[fi.field] = fi.value == "desc" ? -1 : 1;
|
|
104
|
-
});
|
|
105
|
-
return new Promise(function (resolve, reject) {
|
|
106
|
-
_this.db.collection(collectionName).count(query).then(function (count) {
|
|
107
|
-
_this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()
|
|
162
|
+
};
|
|
163
|
+
MongoDbAdapter.prototype.update = function (collectionName, object) {
|
|
164
|
+
var _this = this;
|
|
165
|
+
return new Promise(function (resolve, reject) {
|
|
166
|
+
_this.db.collection(collectionName).updateOne({ id: object.id }, { $set: object })
|
|
108
167
|
.then(function (results) {
|
|
109
|
-
|
|
110
|
-
resolve(result);
|
|
168
|
+
resolve(results);
|
|
111
169
|
})
|
|
112
170
|
.catch(function (e) {
|
|
113
171
|
reject(JSON.stringify(e));
|
|
114
172
|
});
|
|
115
173
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
.catch(function (e) {
|
|
129
|
-
reject(JSON.stringify(e));
|
|
174
|
+
};
|
|
175
|
+
MongoDbAdapter.prototype.delete = function (collectionName, id) {
|
|
176
|
+
var _this = this;
|
|
177
|
+
return new Promise(function (resolve, reject) {
|
|
178
|
+
_this.db.collection(collectionName).deleteMany({ id: id })
|
|
179
|
+
.then(function (results) {
|
|
180
|
+
resolve(results);
|
|
181
|
+
})
|
|
182
|
+
.catch(function (e) {
|
|
183
|
+
reject(JSON.stringify(e));
|
|
184
|
+
});
|
|
130
185
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/***/ "./src/mongo/pipelines.ts":
|
|
141
|
-
/*!********************************!*\
|
|
142
|
-
!*** ./src/mongo/pipelines.ts ***!
|
|
143
|
-
\********************************/
|
|
144
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
145
|
-
|
|
146
|
-
__webpack_require__.r(__webpack_exports__);
|
|
147
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148
|
-
/* harmony export */ createPipeline: () => (/* binding */ createPipeline)
|
|
149
|
-
/* harmony export */ });
|
|
150
|
-
function createPipeline(surveyId, questionId, visualizerType, questionType) {
|
|
151
|
-
var singleChoicePipeline = [
|
|
152
|
-
{ $match: { postid: surveyId } },
|
|
153
|
-
{ $project: { value: "$json." + questionId } },
|
|
154
|
-
{ $match: { value: { $exists: true } } },
|
|
155
|
-
{
|
|
156
|
-
$group: {
|
|
157
|
-
_id: "$value",
|
|
158
|
-
count: { $sum: 1 },
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
];
|
|
162
|
-
var multipleChoicePipeline = [
|
|
163
|
-
{ $match: { postid: surveyId } },
|
|
164
|
-
{ $project: { value: "$json." + questionId } },
|
|
165
|
-
{ $match: { value: { $exists: true } } },
|
|
166
|
-
{ $unwind: "$value" },
|
|
167
|
-
{
|
|
168
|
-
$group: {
|
|
169
|
-
_id: "$value",
|
|
170
|
-
count: { $sum: 1 },
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
];
|
|
174
|
-
var numberPipeline = [
|
|
175
|
-
{ $match: { postid: surveyId } },
|
|
176
|
-
{ $project: { value: "$json." + questionId } },
|
|
177
|
-
{ $match: { value: { $exists: true } } },
|
|
178
|
-
{
|
|
179
|
-
$group: {
|
|
180
|
-
_id: null,
|
|
181
|
-
count: { $sum: 1 },
|
|
182
|
-
average: { $avg: "$value" },
|
|
183
|
-
min: { $min: "$value" },
|
|
184
|
-
max: { $max: "$value" },
|
|
185
|
-
values: { $push: "$value" }
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
];
|
|
189
|
-
var histogramPipeline = [
|
|
190
|
-
{ $match: { postid: surveyId } },
|
|
191
|
-
{ $project: { value: "$json." + questionId } },
|
|
192
|
-
{ $match: { value: { $exists: true } } },
|
|
193
|
-
{
|
|
194
|
-
$bucketAuto: {
|
|
195
|
-
groupBy: "$value",
|
|
196
|
-
buckets: 10,
|
|
197
|
-
output: {
|
|
198
|
-
count: { $sum: 1 },
|
|
199
|
-
minValue: { $min: "$value" },
|
|
200
|
-
maxValue: { $max: "$value" }
|
|
186
|
+
};
|
|
187
|
+
MongoDbAdapter.prototype.retrievePaginated = function (collectionName, filter, order, offset, limit) {
|
|
188
|
+
var _this = this;
|
|
189
|
+
filter = filter || [];
|
|
190
|
+
var query = {};
|
|
191
|
+
filter.forEach(function (fi) {
|
|
192
|
+
if (!!fi.value) {
|
|
193
|
+
var val = fi.value;
|
|
194
|
+
query[fi.field] = val;
|
|
201
195
|
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
/***/ "./src/mongo/result-transformers.ts":
|
|
238
|
-
/*!******************************************!*\
|
|
239
|
-
!*** ./src/mongo/result-transformers.ts ***!
|
|
240
|
-
\******************************************/
|
|
241
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
242
|
-
|
|
243
|
-
__webpack_require__.r(__webpack_exports__);
|
|
244
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
245
|
-
/* harmony export */ transformers: () => (/* binding */ transformers)
|
|
246
|
-
/* harmony export */ });
|
|
247
|
-
function choiceTransformationPipeline(result) {
|
|
248
|
-
var res = {};
|
|
249
|
-
var totalCount = 0;
|
|
250
|
-
result.forEach(function (item) {
|
|
251
|
-
res[item._id] = item.count;
|
|
252
|
-
totalCount += item.count;
|
|
253
|
-
});
|
|
254
|
-
return { data: res, totalCount: totalCount };
|
|
255
|
-
}
|
|
256
|
-
function numberTransformationPipeline(result) {
|
|
257
|
-
if (result.length == 0)
|
|
258
|
-
return { value: 0, minValue: 0, maxValue: 0 };
|
|
259
|
-
return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };
|
|
260
|
-
}
|
|
261
|
-
function histogramTransformationPipeline(result) {
|
|
262
|
-
var res = [];
|
|
263
|
-
var totalCount = 0;
|
|
264
|
-
result.forEach(function (item) {
|
|
265
|
-
res.push(item.count);
|
|
266
|
-
totalCount += item.count;
|
|
267
|
-
});
|
|
268
|
-
return { data: res, intervals: result, totalCount: totalCount };
|
|
269
|
-
}
|
|
270
|
-
var transformers = {
|
|
271
|
-
"boolean": choiceTransformationPipeline,
|
|
272
|
-
"radiogroup": choiceTransformationPipeline,
|
|
273
|
-
"dropdown": choiceTransformationPipeline,
|
|
274
|
-
"checkbox": choiceTransformationPipeline,
|
|
275
|
-
"tagbox": choiceTransformationPipeline,
|
|
276
|
-
"number": numberTransformationPipeline,
|
|
277
|
-
"rating": numberTransformationPipeline,
|
|
278
|
-
"histogram": histogramTransformationPipeline
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
/***/ })
|
|
283
|
-
|
|
284
|
-
/******/ });
|
|
285
|
-
/************************************************************************/
|
|
286
|
-
/******/ // The module cache
|
|
287
|
-
/******/ var __webpack_module_cache__ = {};
|
|
288
|
-
/******/
|
|
289
|
-
/******/ // The require function
|
|
290
|
-
/******/ function __webpack_require__(moduleId) {
|
|
291
|
-
/******/ // Check if module is in cache
|
|
292
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
293
|
-
/******/ if (cachedModule !== undefined) {
|
|
294
|
-
/******/ return cachedModule.exports;
|
|
295
|
-
/******/ }
|
|
296
|
-
/******/ // Create a new module (and put it into the cache)
|
|
297
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
298
|
-
/******/ // no module.id needed
|
|
299
|
-
/******/ // no module.loaded needed
|
|
300
|
-
/******/ exports: {}
|
|
301
|
-
/******/ };
|
|
302
|
-
/******/
|
|
303
|
-
/******/ // Execute the module function
|
|
304
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
305
|
-
/******/
|
|
306
|
-
/******/ // Return the exports of the module
|
|
307
|
-
/******/ return module.exports;
|
|
308
|
-
/******/ }
|
|
309
|
-
/******/
|
|
310
|
-
/************************************************************************/
|
|
311
|
-
/******/ /* webpack/runtime/define property getters */
|
|
312
|
-
/******/ (() => {
|
|
313
|
-
/******/ // define getter functions for harmony exports
|
|
314
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
315
|
-
/******/ for(var key in definition) {
|
|
316
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
317
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
318
|
-
/******/ }
|
|
319
|
-
/******/ }
|
|
320
|
-
/******/ };
|
|
321
|
-
/******/ })();
|
|
322
|
-
/******/
|
|
323
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
324
|
-
/******/ (() => {
|
|
325
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
326
|
-
/******/ })();
|
|
327
|
-
/******/
|
|
328
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
329
|
-
/******/ (() => {
|
|
330
|
-
/******/ // define __esModule on exports
|
|
331
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
332
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
333
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
334
|
-
/******/ }
|
|
335
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
336
|
-
/******/ };
|
|
337
|
-
/******/ })();
|
|
338
|
-
/******/
|
|
339
|
-
/************************************************************************/
|
|
340
|
-
var __webpack_exports__ = {};
|
|
341
|
-
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
342
|
-
(() => {
|
|
343
|
-
/*!******************************!*\
|
|
344
|
-
!*** ./src/entries/mongo.ts ***!
|
|
345
|
-
\******************************/
|
|
346
|
-
__webpack_require__.r(__webpack_exports__);
|
|
347
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
348
|
-
/* harmony export */ MongoDbAdapter: () => (/* reexport safe */ _mongo__WEBPACK_IMPORTED_MODULE_0__.MongoDbAdapter)
|
|
349
|
-
/* harmony export */ });
|
|
350
|
-
/* harmony import */ var _mongo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mongo */ "./src/mongo/index.ts");
|
|
351
|
-
|
|
196
|
+
});
|
|
197
|
+
var sort = {};
|
|
198
|
+
order.forEach(function (fi) {
|
|
199
|
+
sort[fi.field] = fi.value == "desc" ? -1 : 1;
|
|
200
|
+
});
|
|
201
|
+
return new Promise(function (resolve, reject) {
|
|
202
|
+
_this.db.collection(collectionName).count(query).then(function (count) {
|
|
203
|
+
_this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()
|
|
204
|
+
.then(function (results) {
|
|
205
|
+
var result = { data: results, totalCount: count };
|
|
206
|
+
resolve(result);
|
|
207
|
+
})
|
|
208
|
+
.catch(function (e) {
|
|
209
|
+
reject(JSON.stringify(e));
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
MongoDbAdapter.prototype.retrieveSummary = function (collectionName, surveyId, questionId, questionType, visualizerType, filter) {
|
|
215
|
+
var _this = this;
|
|
216
|
+
var pipeline = createPipeline(surveyId, questionId, visualizerType, questionType);
|
|
217
|
+
return new Promise(function (resolve, reject) {
|
|
218
|
+
_this.db.collection(collectionName).aggregate(pipeline).toArray()
|
|
219
|
+
.then(function (results) {
|
|
220
|
+
var transformer = transformers[visualizerType] || transformers[questionType] || (function (r) { return r; });
|
|
221
|
+
var result = transformer(results);
|
|
222
|
+
resolve(result);
|
|
223
|
+
})
|
|
224
|
+
.catch(function (e) {
|
|
225
|
+
reject(JSON.stringify(e));
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
return MongoDbAdapter;
|
|
230
|
+
}());
|
|
352
231
|
|
|
353
|
-
|
|
232
|
+
exports.MongoDbAdapter = MongoDbAdapter;
|
|
354
233
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
;
|
|
358
|
-
});
|
|
359
|
-
//# sourceMappingURL=survey.analytics.mongo.js.map
|
|
234
|
+
}));
|
|
235
|
+
//# sourceMappingURL=survey.analytics.mongo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey.analytics.mongo.js","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;;;;ACTqD;AACR;AAI7C;IACE,wBAAoB,EAAM,EAAU,KAAmB;QAAnC,OAAE,GAAF,EAAE,CAAI;QAAU,UAAK,GAAL,KAAK,CAAc;IACvD,CAAC;IAED,+BAAM,GAAN,UAAO,cAAsB,EAAE,MAAM;QAArC,iBAWC;QAVC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACtC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,KAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;iBACjD,IAAI,CAAC,UAAC,OAAO;gBACZ,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrB,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAA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ACnB,MAAM,CAAC,OAAO,CAAC,cAAI;QACjB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAClE,CAAC;AAEM,IAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,4BAA4B;IACvC,YAAY,EAAE,4BAA4B;IAC1C,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,4BAA4B;IACxC,QAAQ,EAAE,4BAA4B;IACtC,QAAQ,EAAE,4BAA4B;IACtC,QAAQ,EAAE,4BAA4B;IACtC,WAAW,EAAE,+BAA+B;CAC7C,CAAC;;;;;;;UChCF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNyB","sources":["webpack://SurveyAnalyticsTabulator/webpack/universalModuleDefinition","webpack://SurveyAnalyticsMongo/./src/mongo/index.ts","webpack://SurveyAnalyticsMongo/./src/mongo/pipelines.ts","webpack://SurveyAnalyticsMongo/./src/mongo/result-transformers.ts","webpack://SurveyAnalyticsTabulator/webpack/bootstrap","webpack://SurveyAnalyticsTabulator/webpack/runtime/define property getters","webpack://SurveyAnalyticsTabulator/webpack/runtime/hasOwnProperty shorthand","webpack://SurveyAnalyticsTabulator/webpack/runtime/make namespace object","webpack://SurveyAnalyticsMongo/./src/entries/mongo.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"SurveyAnalyticsMongo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SurveyAnalyticsMongo\"] = factory();\n\telse\n\t\troot[\"SurveyAnalyticsMongo\"] = factory();\n})(this, () => {\nreturn ","import { Db } from \"mongodb\";\nimport { transformers } from \"./result-transformers\";\nimport { createPipeline } from \"./pipelines\";\n\nexport interface IFilterItem { field: string, value: any }\n\nexport class MongoDbAdapter {\n constructor(private db: Db, private getId: () => string) {\n }\n\n create(collectionName: string, object) {\n object.id = object.id || this.getId();\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).insertOne(object)\n .then((results) => {\n resolve(object.id);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrieve(collectionName: string, filter: Array<IFilterItem>) {\n filter = filter || [];\n const query = {};\n filter.forEach(fi => query[fi.field] = fi.value);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).find(query).toArray()\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n update(collectionName: string, object) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).updateOne({ id: object.id }, { $set: object })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n delete(collectionName: string, id) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).deleteMany({ id: id })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrievePaginated(collectionName: string, filter, order, offset: number, limit: number) {\n filter = filter || [];\n let query = {};\n filter.forEach(fi => {\n if(!!fi.value) {\n let val = fi.value;\n query[fi.field] = val;\n }\n });\n let sort = {};\n order.forEach(fi => {\n sort[fi.field] = fi.value == \"desc\" ? -1 : 1;\n });\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).count(query).then(count => {\n this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()\n .then((results) => {\n const result = { data: results, totalCount: count };\n resolve(result);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n });\n }\n\n retrieveSummary(collectionName: string, surveyId: string, questionId: string, questionType: string, visualizerType: string, filter: Array<IFilterItem>) {\n const pipeline = createPipeline(surveyId, questionId, visualizerType, questionType);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).aggregate(pipeline).toArray()\n .then((results) => {\n const transformer = transformers[visualizerType] || transformers[questionType] || (r => r);\n const result = transformer(results);\n resolve(result);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n}\n\n","export function createPipeline(surveyId: string, questionId: string, visualizerType: string, questionType: string): any[] {\n const singleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const multipleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n { $unwind: \"$value\" },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const numberPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: null,\n count: { $sum: 1 },\n average: { $avg: \"$value\" },\n min: { $min: \"$value\" },\n max: { $max: \"$value\" },\n values: { $push: \"$value\" }\n }\n }\n ];\n const histogramPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $bucketAuto: {\n groupBy: \"$value\",\n buckets: 10,\n output: {\n count: { $sum: 1 },\n minValue: { $min: \"$value\" },\n maxValue: { $max: \"$value\" }\n }\n }\n },\n {\n $project: {\n _id: 0,\n start: \"$minValue\",\n end: \"$maxValue\",\n label: {\n $concat: [\n { $toString: { $round: [\"$minValue\", 2] } },\n \" - \",\n { $toString: { $round: [\"$maxValue\", 2] } }\n ]\n },\n count: 1\n }\n }\n ];\n const mongoPipelines = {\n \"boolean\": singleChoicePipeline,\n \"radiogroup\": singleChoicePipeline,\n \"dropdown\": singleChoicePipeline,\n \"checkbox\": multipleChoicePipeline,\n \"tagbox\": multipleChoicePipeline,\n \"number\": numberPipeline,\n \"rating\": numberPipeline,\n \"histogram\": histogramPipeline\n };\n const pipeline = mongoPipelines[visualizerType] || mongoPipelines[questionType] || [];\n return pipeline;\n}\n","function choiceTransformationPipeline(result) {\n let res = {};\n let totalCount = 0;\n result.forEach(item => {\n res[item._id] = item.count;\n totalCount += item.count;\n });\n return { data: res, totalCount: totalCount };\n}\nfunction numberTransformationPipeline(result) {\n if(result.length == 0) return { value: 0, minValue: 0, maxValue: 0 };\n return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };\n}\nfunction histogramTransformationPipeline(result) {\n let res = [];\n let totalCount = 0;\n result.forEach(item => {\n res.push(item.count);\n totalCount += item.count;\n });\n return { data: res, intervals: result, totalCount: totalCount };\n}\n\nexport const transformers = {\n \"boolean\": choiceTransformationPipeline,\n \"radiogroup\": choiceTransformationPipeline,\n \"dropdown\": choiceTransformationPipeline,\n \"checkbox\": choiceTransformationPipeline,\n \"tagbox\": choiceTransformationPipeline,\n \"number\": numberTransformationPipeline,\n \"rating\": numberTransformationPipeline,\n \"histogram\": histogramTransformationPipeline\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"../mongo\";"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"survey.analytics.mongo.js","sources":["../src/mongo/result-transformers.ts","../src/mongo/pipelines.ts","../src/mongo/index.ts"],"sourcesContent":["function choiceTransformationPipeline(result) {\n let res = {};\n let totalCount = 0;\n result.forEach(item => {\n res[item._id] = item.count;\n totalCount += item.count;\n });\n return { data: res, totalCount: totalCount };\n}\nfunction numberTransformationPipeline(result) {\n if(result.length == 0) return { value: 0, minValue: 0, maxValue: 0 };\n return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };\n}\nfunction histogramTransformationPipeline(result) {\n let res = [];\n let totalCount = 0;\n result.forEach(item => {\n res.push(item.count);\n totalCount += item.count;\n });\n return { data: res, intervals: result, totalCount: totalCount };\n}\n\nexport const transformers = {\n \"boolean\": choiceTransformationPipeline,\n \"radiogroup\": choiceTransformationPipeline,\n \"dropdown\": choiceTransformationPipeline,\n \"checkbox\": choiceTransformationPipeline,\n \"tagbox\": choiceTransformationPipeline,\n \"number\": numberTransformationPipeline,\n \"rating\": numberTransformationPipeline,\n \"histogram\": histogramTransformationPipeline\n};\n","export function createPipeline(surveyId: string, questionId: string, visualizerType: string, questionType: string): any[] {\n const singleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const multipleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n { $unwind: \"$value\" },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const numberPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: null,\n count: { $sum: 1 },\n average: { $avg: \"$value\" },\n min: { $min: \"$value\" },\n max: { $max: \"$value\" },\n values: { $push: \"$value\" }\n }\n }\n ];\n const histogramPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $bucketAuto: {\n groupBy: \"$value\",\n buckets: 10,\n output: {\n count: { $sum: 1 },\n minValue: { $min: \"$value\" },\n maxValue: { $max: \"$value\" }\n }\n }\n },\n {\n $project: {\n _id: 0,\n start: \"$minValue\",\n end: \"$maxValue\",\n label: {\n $concat: [\n { $toString: { $round: [\"$minValue\", 2] } },\n \" - \",\n { $toString: { $round: [\"$maxValue\", 2] } }\n ]\n },\n count: 1\n }\n }\n ];\n const mongoPipelines = {\n \"boolean\": singleChoicePipeline,\n \"radiogroup\": singleChoicePipeline,\n \"dropdown\": singleChoicePipeline,\n \"checkbox\": multipleChoicePipeline,\n \"tagbox\": multipleChoicePipeline,\n \"number\": numberPipeline,\n \"rating\": numberPipeline,\n \"histogram\": histogramPipeline\n };\n const pipeline = mongoPipelines[visualizerType] || mongoPipelines[questionType] || [];\n return pipeline;\n}\n","import { Db } from \"mongodb\";\nimport { transformers } from \"./result-transformers\";\nimport { createPipeline } from \"./pipelines\";\n\nexport interface IFilterItem { field: string, value: any }\n\nexport class MongoDbAdapter {\n constructor(private db: Db, private getId: () => string) {\n }\n\n create(collectionName: string, object) {\n object.id = object.id || this.getId();\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).insertOne(object)\n .then((results) => {\n resolve(object.id);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrieve(collectionName: string, filter: Array<IFilterItem>) {\n filter = filter || [];\n const query = {};\n filter.forEach(fi => query[fi.field] = fi.value);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).find(query).toArray()\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n update(collectionName: string, object) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).updateOne({ id: object.id }, { $set: object })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n delete(collectionName: string, id) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).deleteMany({ id: id })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrievePaginated(collectionName: string, filter, order, offset: number, limit: number) {\n filter = filter || [];\n let query = {};\n filter.forEach(fi => {\n if(!!fi.value) {\n let val = fi.value;\n query[fi.field] = val;\n }\n });\n let sort = {};\n order.forEach(fi => {\n sort[fi.field] = fi.value == \"desc\" ? -1 : 1;\n });\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).count(query).then(count => {\n this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()\n .then((results) => {\n const result = { data: results, totalCount: count };\n resolve(result);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n });\n }\n\n retrieveSummary(collectionName: string, surveyId: string, questionId: string, questionType: string, visualizerType: string, filter: Array<IFilterItem>) {\n const pipeline = createPipeline(surveyId, questionId, visualizerType, questionType);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).aggregate(pipeline).toArray()\n .then((results) => {\n const transformer = transformers[visualizerType] || transformers[questionType] || (r => r);\n const result = transformer(results);\n resolve(result);\n })\n .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