blixify-server 0.3.10 → 0.3.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mondayWrapper.d.ts","sourceRoot":"","sources":["../../src/apis/mondayWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA0B5C,eAAO,MAAM,cAAc,UAClB,MAAM,SACN,GAAG,cACE,GAAG,qDAchB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,aAAa;IACxB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,OAAO,SAAM;IACb,MAAM,EAAE,cAAc,CAQpB;IACF,GAAG,EAAE,UAAU,CAAC;IAEhB,YAAY,QAAS,GAAG,aAEtB;IACF,SAAS;cAAe,MAAM,EAAE;;;;MAK9B;gBAGA,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,EACrD,SAAS,EAAE,MAAM;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE;YAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,EACpE,GAAG,EAAE,UAAU;IAWjB,UAAU,eAAgB;QACxB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,MAAM,CAAC;QACb,aAAa,EAAE;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,EAAE,CAAC;KACL,SAiBC;IAEF,UAA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mBA+DtC;IAEF,OAAO,QAAe,GAAG,OAAO,GAAG;;mBAiDjC;IAEF,QAAQ,QAAe,GAAG,OAAO,GAAG;;;mBAsOlC;IAEF,UAAU,QAAe,GAAG,OAAO,GAAG;;mBAsFpC;IAEF,UAAU,QACH,GAAG,OACH,GAAG,qBACU,GAAG,KAAK,QAAQ,GAAG,CAAC;;mBA8DtC;IAEF,IAAI,YA8CF;CACH"}
|
|
@@ -89,7 +89,7 @@ class MondayWrapper {
|
|
|
89
89
|
return data;
|
|
90
90
|
};
|
|
91
91
|
this.initCreate = (req, res, workflow) => __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
var _a, _b;
|
|
92
|
+
var _a, _b, _c, _d, _e;
|
|
93
93
|
try {
|
|
94
94
|
const valid = this.modelChecker(req.body.data);
|
|
95
95
|
if (valid) {
|
|
@@ -122,11 +122,19 @@ class MondayWrapper {
|
|
|
122
122
|
columnValues: JSON.stringify(data),
|
|
123
123
|
};
|
|
124
124
|
const mondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
if ((_c = (_b = mondayResponse.data.data) === null || _b === void 0 ? void 0 : _b.create_item) === null || _c === void 0 ? void 0 : _c.id) {
|
|
126
|
+
const itemId = mondayResponse.data.data.create_item.id;
|
|
127
|
+
const resBody = { success: itemId };
|
|
128
|
+
if ((_d = req.body) === null || _d === void 0 ? void 0 : _d.stopRes)
|
|
129
|
+
return resBody;
|
|
130
|
+
res.send(resBody);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
res.status(400).json({
|
|
134
|
+
err: JSON.stringify((_e = mondayResponse.data.errors) === null || _e === void 0 ? void 0 : _e[0].message) ||
|
|
135
|
+
"Monday Internal Structure Errors",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
130
138
|
}
|
|
131
139
|
else {
|
|
132
140
|
res.status(400).json({ err: "Invalid Model Structure" });
|
|
@@ -137,7 +145,7 @@ class MondayWrapper {
|
|
|
137
145
|
}
|
|
138
146
|
});
|
|
139
147
|
this.initGet = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
var
|
|
148
|
+
var _f;
|
|
141
149
|
try {
|
|
142
150
|
const valid = req.body.id;
|
|
143
151
|
if (valid) {
|
|
@@ -170,7 +178,7 @@ class MondayWrapper {
|
|
|
170
178
|
return;
|
|
171
179
|
}
|
|
172
180
|
const resBody = { data: parsedData };
|
|
173
|
-
if ((
|
|
181
|
+
if ((_f = req.body) === null || _f === void 0 ? void 0 : _f.stopRes)
|
|
174
182
|
return resBody;
|
|
175
183
|
res.send(resBody);
|
|
176
184
|
}
|
|
@@ -186,7 +194,7 @@ class MondayWrapper {
|
|
|
186
194
|
}
|
|
187
195
|
});
|
|
188
196
|
this.initList = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
189
|
-
var
|
|
197
|
+
var _g;
|
|
190
198
|
try {
|
|
191
199
|
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
192
200
|
if (validBaseConfig) {
|
|
@@ -406,7 +414,7 @@ class MondayWrapper {
|
|
|
406
414
|
data: dataList,
|
|
407
415
|
count: cursor,
|
|
408
416
|
};
|
|
409
|
-
if ((
|
|
417
|
+
if ((_g = req.body) === null || _g === void 0 ? void 0 : _g.stopRes)
|
|
410
418
|
return resBody;
|
|
411
419
|
res.send(resBody);
|
|
412
420
|
}
|
|
@@ -419,7 +427,7 @@ class MondayWrapper {
|
|
|
419
427
|
}
|
|
420
428
|
});
|
|
421
429
|
this.initUpdate = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
422
|
-
var
|
|
430
|
+
var _h;
|
|
423
431
|
try {
|
|
424
432
|
const valid = this.modelChecker(req.body.data) && req.body.id;
|
|
425
433
|
if (valid) {
|
|
@@ -485,7 +493,7 @@ class MondayWrapper {
|
|
|
485
493
|
variables["columnValues"] = JSON.stringify(variables["columnValues"]);
|
|
486
494
|
yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
487
495
|
const resBody = { success: true };
|
|
488
|
-
if ((
|
|
496
|
+
if ((_h = req.body) === null || _h === void 0 ? void 0 : _h.stopRes)
|
|
489
497
|
return resBody;
|
|
490
498
|
res.send(resBody);
|
|
491
499
|
}
|
|
@@ -498,7 +506,7 @@ class MondayWrapper {
|
|
|
498
506
|
}
|
|
499
507
|
});
|
|
500
508
|
this.initDelete = (req, res, workflow) => __awaiter(this, void 0, void 0, function* () {
|
|
501
|
-
var
|
|
509
|
+
var _j;
|
|
502
510
|
try {
|
|
503
511
|
const valid = req.body.id;
|
|
504
512
|
if (valid) {
|
|
@@ -543,7 +551,7 @@ class MondayWrapper {
|
|
|
543
551
|
};
|
|
544
552
|
yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
545
553
|
const resBody = { success: true };
|
|
546
|
-
if ((
|
|
554
|
+
if ((_j = req.body) === null || _j === void 0 ? void 0 : _j.stopRes)
|
|
547
555
|
return resBody;
|
|
548
556
|
res.send(resBody);
|
|
549
557
|
}
|
|
@@ -837,11 +837,11 @@ class MongoWrapper {
|
|
|
837
837
|
const isDuration = date.length === 2;
|
|
838
838
|
const isValidStartDate = (0, moment_timezone_1.default)(startDate, "DD/MM/YYYY").isValid();
|
|
839
839
|
const isValidEndDate = (0, moment_timezone_1.default)(endDate, "DD/MM/YYYY").isValid();
|
|
840
|
-
const isoStartDate = moment_timezone_1.default
|
|
841
|
-
.tz(
|
|
840
|
+
const isoStartDate = (0, moment_timezone_1.default)(startDate, "DD/MM/YYYY HH:mm:ss")
|
|
841
|
+
.tz(timezone)
|
|
842
842
|
.toDate();
|
|
843
|
-
const isoEndDate = moment_timezone_1.default
|
|
844
|
-
.tz(
|
|
843
|
+
const isoEndDate = (0, moment_timezone_1.default)(endDate, "DD/MM/YYYY HH:mm:ss")
|
|
844
|
+
.tz(timezone)
|
|
845
845
|
.toDate();
|
|
846
846
|
if (!isValidStartDate || !isValidEndDate) {
|
|
847
847
|
res
|