blixify-server 0.1.65 → 0.1.67
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/dist/apis/fbWrapper.d.ts.map +1 -1
- package/dist/apis/fbWrapper.js +820 -1
- package/dist/apis/index.js +13 -1
- package/dist/apis/mondayWrapper.js +387 -14
- package/dist/apis/mongoWrapper.js +943 -1
- package/dist/apis/security.js +80 -1
- package/dist/apis/uploadWrapper.js +396 -1
- package/dist/apis/utils.js +21 -1
- package/dist/model/QueryModel.js +118 -1
- package/dist/model/SecurityConfig.js +2 -1
- package/package.json +2 -2
package/dist/apis/index.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadWrapper = exports.SecurityMiddleware = exports.MondayWrapper = exports.MongoWrapper = exports.FirebaseWrapper = void 0;
|
|
4
|
+
var fbWrapper_1 = require("./fbWrapper");
|
|
5
|
+
Object.defineProperty(exports, "FirebaseWrapper", { enumerable: true, get: function () { return fbWrapper_1.FirebaseWrapper; } });
|
|
6
|
+
var mongoWrapper_1 = require("./mongoWrapper");
|
|
7
|
+
Object.defineProperty(exports, "MongoWrapper", { enumerable: true, get: function () { return mongoWrapper_1.MongoWrapper; } });
|
|
8
|
+
var mondayWrapper_1 = require("./mondayWrapper");
|
|
9
|
+
Object.defineProperty(exports, "MondayWrapper", { enumerable: true, get: function () { return mondayWrapper_1.MondayWrapper; } });
|
|
10
|
+
var security_1 = require("./security");
|
|
11
|
+
Object.defineProperty(exports, "SecurityMiddleware", { enumerable: true, get: function () { return security_1.SecurityMiddleware; } });
|
|
12
|
+
var uploadWrapper_1 = require("./uploadWrapper");
|
|
13
|
+
Object.defineProperty(exports, "UploadWrapper", { enumerable: true, get: function () { return uploadWrapper_1.UploadWrapper; } });
|
|
@@ -1,4 +1,89 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.MondayWrapper = exports.queryMondayApi = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const QueryModel_1 = require("../model/QueryModel");
|
|
18
|
+
const queryMondayApi = (token, query, variables) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const mondayResponse = yield axios_1.default.post("https://api.monday.com/v2", { query, variables }, {
|
|
20
|
+
headers: {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
Authorization: token !== null && token !== void 0 ? token : "",
|
|
23
|
+
"API-version": "2023-10",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return mondayResponse;
|
|
27
|
+
});
|
|
28
|
+
exports.queryMondayApi = queryMondayApi;
|
|
29
|
+
/**
|
|
30
|
+
* @Wrapper
|
|
31
|
+
* collection - Monday Collection
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
class MondayWrapper {
|
|
35
|
+
constructor(mondayToken, boardId, groupId, config, modelChecker, modelType, lib) {
|
|
36
|
+
this.mondayToken = "";
|
|
37
|
+
this.boardId = "";
|
|
38
|
+
this.groupId = "";
|
|
39
|
+
this.config = {
|
|
40
|
+
baseConfig: [],
|
|
41
|
+
opsConfig: {
|
|
42
|
+
read: [],
|
|
43
|
+
create: [],
|
|
44
|
+
update: [],
|
|
45
|
+
delete: [],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
// eslint-disable-next-line
|
|
49
|
+
this.modelChecker = (obj) => {
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
this.modelType = () => {
|
|
53
|
+
return {
|
|
54
|
+
read: [],
|
|
55
|
+
write: {},
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
this.parseModel = (mondayData) => {
|
|
59
|
+
const data = {
|
|
60
|
+
id: mondayData.id,
|
|
61
|
+
name: mondayData.name,
|
|
62
|
+
};
|
|
63
|
+
mondayData.column_values.map((eachColumn) => {
|
|
64
|
+
if (eachColumn.id === "subitems")
|
|
65
|
+
return;
|
|
66
|
+
let retrieveText = true;
|
|
67
|
+
const modelType = this.modelType().read;
|
|
68
|
+
if (modelType.includes(eachColumn.id))
|
|
69
|
+
retrieveText = false;
|
|
70
|
+
data[eachColumn.id] = retrieveText ? eachColumn.text : eachColumn.value;
|
|
71
|
+
});
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
this.initCreate = (req, res, workflow) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
try {
|
|
77
|
+
const valid = this.modelChecker(req.body.data);
|
|
78
|
+
if (valid) {
|
|
79
|
+
//INFO : Security Checker
|
|
80
|
+
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
81
|
+
const validOpsConfig = (0, QueryModel_1.checkOpsConfig)(this.config, "create", req, req.body.data);
|
|
82
|
+
if (!validBaseConfig || !validOpsConfig) {
|
|
83
|
+
res.status(400).json({ err: "Invalid Security Configuration" });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const query = `
|
|
2
87
|
mutation ($boardId: ID!, $groupId: String!, $itemName: String!, $columnValues: JSON!) {
|
|
3
88
|
create_item (
|
|
4
89
|
board_id: $boardId,
|
|
@@ -9,9 +94,39 @@
|
|
|
9
94
|
id
|
|
10
95
|
}
|
|
11
96
|
}
|
|
12
|
-
|
|
97
|
+
`;
|
|
98
|
+
const data = req.body.data;
|
|
99
|
+
if (workflow)
|
|
100
|
+
yield workflow(data);
|
|
101
|
+
const variables = {
|
|
102
|
+
boardId: this.boardId,
|
|
103
|
+
groupId: this.groupId,
|
|
104
|
+
itemName: (_a = req.body.data.name) !== null && _a !== void 0 ? _a : "Item",
|
|
105
|
+
columnValues: JSON.stringify(data),
|
|
106
|
+
};
|
|
107
|
+
const mondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
108
|
+
const itemId = mondayResponse.data.data.create_item.id;
|
|
109
|
+
const resBody = { success: itemId };
|
|
110
|
+
if ((_b = req.body) === null || _b === void 0 ? void 0 : _b.stopRes)
|
|
111
|
+
return resBody;
|
|
112
|
+
res.send(resBody);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
res.status(400).json({ err: "Invalid Model Structure" });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
res.status(400).json({ err: err });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
this.initGet = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
var _c;
|
|
124
|
+
try {
|
|
125
|
+
const valid = req.body.id;
|
|
126
|
+
if (valid) {
|
|
127
|
+
const query = `query {
|
|
13
128
|
boards(ids: ${this.boardId}) {
|
|
14
|
-
items_page (limit: 1, query_params: {ids:${
|
|
129
|
+
items_page (limit: 1, query_params: {ids:${req.body.id}}) {
|
|
15
130
|
cursor
|
|
16
131
|
items {
|
|
17
132
|
id
|
|
@@ -24,8 +139,58 @@
|
|
|
24
139
|
}
|
|
25
140
|
}
|
|
26
141
|
}
|
|
27
|
-
}
|
|
28
|
-
|
|
142
|
+
}`;
|
|
143
|
+
const mondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, query);
|
|
144
|
+
const mondayData = mondayResponse.data.data.boards[0].items_page.items;
|
|
145
|
+
if (mondayData.length > 0) {
|
|
146
|
+
const parsedData = this.parseModel(mondayData[0]);
|
|
147
|
+
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
148
|
+
const validOpsConfig = (0, QueryModel_1.checkOpsConfig)(this.config, "read", req, parsedData);
|
|
149
|
+
if (!validBaseConfig || !validOpsConfig) {
|
|
150
|
+
res.status(400).json({ err: "Invalid Security Configuration" });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const resBody = { data: parsedData };
|
|
154
|
+
if ((_c = req.body) === null || _c === void 0 ? void 0 : _c.stopRes)
|
|
155
|
+
return resBody;
|
|
156
|
+
res.send(resBody);
|
|
157
|
+
}
|
|
158
|
+
else
|
|
159
|
+
res.send({ data: null });
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
res.status(400).json({ err: "Invalid Fields" });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
res.status(400).json({ err: err });
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
this.initList = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _d;
|
|
171
|
+
try {
|
|
172
|
+
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
173
|
+
if (validBaseConfig) {
|
|
174
|
+
//INFO : Monday can only support 1 query & "=" condition only
|
|
175
|
+
const reqQuery = req.body.query;
|
|
176
|
+
let mondayDataList = [];
|
|
177
|
+
let mondayResponse = undefined;
|
|
178
|
+
let query = "";
|
|
179
|
+
let limitQuery = "";
|
|
180
|
+
let cursorQuery = "";
|
|
181
|
+
if (req.body.limit)
|
|
182
|
+
limitQuery = `limit: ${req.body.limit}`;
|
|
183
|
+
if (req.body.cursor)
|
|
184
|
+
cursorQuery = `cursor: "${String(req.body.cursor)}"`;
|
|
185
|
+
let combinedString = "";
|
|
186
|
+
if (limitQuery && cursorQuery) {
|
|
187
|
+
combinedString = limitQuery + ", " + cursorQuery;
|
|
188
|
+
}
|
|
189
|
+
else
|
|
190
|
+
combinedString = limitQuery ? limitQuery : cursorQuery;
|
|
191
|
+
if (cursorQuery) {
|
|
192
|
+
query = `query {
|
|
193
|
+
next_items_page(${combinedString}) {
|
|
29
194
|
cursor
|
|
30
195
|
items {
|
|
31
196
|
id
|
|
@@ -37,9 +202,17 @@
|
|
|
37
202
|
}
|
|
38
203
|
}
|
|
39
204
|
}
|
|
40
|
-
}
|
|
205
|
+
}`;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
if (reqQuery && reqQuery.length > 0) {
|
|
209
|
+
const selectedQuery = reqQuery[0];
|
|
210
|
+
query = `query { items_page_by_column_values (${limitQuery} board_id: ${this.boardId}, columns: [{column_id: "${selectedQuery.queryId}", column_values: ["${selectedQuery.value}"]}]) { cursor items {id name column_values {id text value} }}}`;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
query = `query {
|
|
41
214
|
boards(ids:${this.boardId}){
|
|
42
|
-
items_page(${
|
|
215
|
+
items_page(${limitQuery}) {
|
|
43
216
|
cursor
|
|
44
217
|
items {
|
|
45
218
|
id
|
|
@@ -52,9 +225,73 @@
|
|
|
52
225
|
}
|
|
53
226
|
}
|
|
54
227
|
}
|
|
55
|
-
}
|
|
228
|
+
}`;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
mondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, query);
|
|
232
|
+
if (cursorQuery) {
|
|
233
|
+
mondayDataList = mondayResponse.data.data.next_items_page.items;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
if (reqQuery && reqQuery.length > 0) {
|
|
237
|
+
mondayDataList =
|
|
238
|
+
mondayResponse.data.data.items_page_by_column_values.items;
|
|
239
|
+
}
|
|
240
|
+
else
|
|
241
|
+
mondayDataList =
|
|
242
|
+
mondayResponse.data.data.boards[0].items_page.items;
|
|
243
|
+
}
|
|
244
|
+
let validOpsConfig = true;
|
|
245
|
+
const dataList = [];
|
|
246
|
+
mondayDataList.map((eachMondayData) => {
|
|
247
|
+
const eachData = this.parseModel(eachMondayData);
|
|
248
|
+
dataList.push(eachData);
|
|
249
|
+
if (!(0, QueryModel_1.checkOpsConfig)(this.config, "read", req, eachData)) {
|
|
250
|
+
validOpsConfig = false;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
if (!validBaseConfig || !validOpsConfig) {
|
|
254
|
+
res.status(400).json({ err: "Invalid Security Configuration" });
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
let cursor = null;
|
|
258
|
+
if (dataList.length === req.body.limit) {
|
|
259
|
+
if (cursorQuery) {
|
|
260
|
+
cursor = mondayResponse.data.data.next_items_page.cursor;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
if (reqQuery && reqQuery.length > 0) {
|
|
264
|
+
cursor =
|
|
265
|
+
mondayResponse.data.data.items_page_by_column_values.cursor;
|
|
266
|
+
}
|
|
267
|
+
else
|
|
268
|
+
cursor = mondayResponse.data.data.boards[0].items_page.cursor;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const resBody = {
|
|
272
|
+
data: dataList,
|
|
273
|
+
count: cursor,
|
|
274
|
+
};
|
|
275
|
+
if ((_d = req.body) === null || _d === void 0 ? void 0 : _d.stopRes)
|
|
276
|
+
return resBody;
|
|
277
|
+
res.send(resBody);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
res.status(400).json({ err: "Invalid Fields" });
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
catch (err) {
|
|
284
|
+
res.status(400).json({ err: err });
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
this.initUpdate = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
288
|
+
var _e;
|
|
289
|
+
try {
|
|
290
|
+
const valid = this.modelChecker(req.body.data) && req.body.id;
|
|
291
|
+
if (valid) {
|
|
292
|
+
const getQuery = `query {
|
|
56
293
|
boards(ids: ${this.boardId}) {
|
|
57
|
-
items_page (limit: 1, query_params: {ids:${
|
|
294
|
+
items_page (limit: 1, query_params: {ids:${req.body.id}}) {
|
|
58
295
|
cursor
|
|
59
296
|
items {
|
|
60
297
|
id
|
|
@@ -67,7 +304,20 @@
|
|
|
67
304
|
}
|
|
68
305
|
}
|
|
69
306
|
}
|
|
70
|
-
}
|
|
307
|
+
}`;
|
|
308
|
+
const getMondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, getQuery);
|
|
309
|
+
const mondayData = getMondayResponse.data.data.boards[0].items_page.items;
|
|
310
|
+
if (mondayData.length <= 0)
|
|
311
|
+
throw "Error";
|
|
312
|
+
const parsedData = this.parseModel(mondayData[0]);
|
|
313
|
+
//INFO : Security Checker
|
|
314
|
+
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
315
|
+
const validOpsConfig = (0, QueryModel_1.checkOpsConfig)(this.config, "update", req, parsedData);
|
|
316
|
+
if (!validBaseConfig || !validOpsConfig) {
|
|
317
|
+
res.status(400).json({ err: "Invalid Security Configuration" });
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const query = `
|
|
71
321
|
mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
|
|
72
322
|
change_multiple_column_values(
|
|
73
323
|
item_id: $itemId,
|
|
@@ -77,9 +327,50 @@
|
|
|
77
327
|
id
|
|
78
328
|
}
|
|
79
329
|
}
|
|
80
|
-
|
|
330
|
+
`;
|
|
331
|
+
const data = req.body.data;
|
|
332
|
+
const variables = {
|
|
333
|
+
boardId: this.boardId,
|
|
334
|
+
itemId: req.body.id,
|
|
335
|
+
columnValues: {},
|
|
336
|
+
};
|
|
337
|
+
Object.keys(data).map((eachKey) => {
|
|
338
|
+
if (eachKey === "id")
|
|
339
|
+
return;
|
|
340
|
+
const modelType = this.modelType().write;
|
|
341
|
+
let typeAvailable = "";
|
|
342
|
+
if (modelType[eachKey])
|
|
343
|
+
typeAvailable = modelType[eachKey];
|
|
344
|
+
if (typeAvailable)
|
|
345
|
+
variables["columnValues"][eachKey] = {
|
|
346
|
+
[typeAvailable]: data[eachKey],
|
|
347
|
+
};
|
|
348
|
+
else
|
|
349
|
+
variables["columnValues"][eachKey] = data[eachKey];
|
|
350
|
+
});
|
|
351
|
+
variables["columnValues"] = JSON.stringify(variables["columnValues"]);
|
|
352
|
+
yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
353
|
+
const resBody = { success: true };
|
|
354
|
+
if ((_e = req.body) === null || _e === void 0 ? void 0 : _e.stopRes)
|
|
355
|
+
return resBody;
|
|
356
|
+
res.send(resBody);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
res.status(400).json({ err: "Invalid Fields" });
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
catch (err) {
|
|
363
|
+
res.status(400).json({ err: err });
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
this.initDelete = (req, res, workflow) => __awaiter(this, void 0, void 0, function* () {
|
|
367
|
+
var _f;
|
|
368
|
+
try {
|
|
369
|
+
const valid = req.body.id;
|
|
370
|
+
if (valid) {
|
|
371
|
+
const getQuery = `query {
|
|
81
372
|
boards(ids: ${this.boardId}) {
|
|
82
|
-
items_page (limit: 1, query_params: {ids:${
|
|
373
|
+
items_page (limit: 1, query_params: {ids:${req.body.id}}) {
|
|
83
374
|
cursor
|
|
84
375
|
items {
|
|
85
376
|
id
|
|
@@ -92,10 +383,92 @@
|
|
|
92
383
|
}
|
|
93
384
|
}
|
|
94
385
|
}
|
|
95
|
-
}
|
|
386
|
+
}`;
|
|
387
|
+
const getMondayResponse = yield (0, exports.queryMondayApi)(this.mondayToken, getQuery);
|
|
388
|
+
const mondayData = getMondayResponse.data.data.boards[0].items_page.items;
|
|
389
|
+
if (mondayData.length <= 0)
|
|
390
|
+
throw "Error";
|
|
391
|
+
const parsedData = this.parseModel(mondayData[0]);
|
|
392
|
+
const validBaseConfig = (0, QueryModel_1.checkBaseConfig)(this.config, req);
|
|
393
|
+
const validOpsConfig = (0, QueryModel_1.checkOpsConfig)(this.config, "delete", req, parsedData);
|
|
394
|
+
if (!validBaseConfig || !validOpsConfig) {
|
|
395
|
+
res.status(400).json({ err: "Invalid Security Configuration" });
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (workflow)
|
|
399
|
+
yield workflow(parsedData);
|
|
400
|
+
const query = `
|
|
96
401
|
mutation ($itemId: ID!){
|
|
97
402
|
delete_item (item_id: $itemId) {
|
|
98
403
|
id
|
|
99
404
|
}
|
|
100
405
|
}
|
|
101
|
-
|
|
406
|
+
`;
|
|
407
|
+
const variables = {
|
|
408
|
+
itemId: req.body.id,
|
|
409
|
+
};
|
|
410
|
+
yield (0, exports.queryMondayApi)(this.mondayToken, query, variables);
|
|
411
|
+
const resBody = { success: true };
|
|
412
|
+
if ((_f = req.body) === null || _f === void 0 ? void 0 : _f.stopRes)
|
|
413
|
+
return resBody;
|
|
414
|
+
res.send(resBody);
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
res.status(400).json({ err: "Invalid Model Structure" });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
catch (err) {
|
|
421
|
+
res.status(400).json({ err: err });
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
this.init = () => {
|
|
425
|
+
const router = this.lib.express.Router();
|
|
426
|
+
/**
|
|
427
|
+
* @Input :
|
|
428
|
+
* data - Model
|
|
429
|
+
*/
|
|
430
|
+
router.post("/create", (req, res) => {
|
|
431
|
+
this.initCreate(req, res);
|
|
432
|
+
});
|
|
433
|
+
/**
|
|
434
|
+
* @Input :
|
|
435
|
+
* id - string
|
|
436
|
+
*/
|
|
437
|
+
router.post("/get", (req, res) => {
|
|
438
|
+
this.initGet(req, res);
|
|
439
|
+
});
|
|
440
|
+
/**
|
|
441
|
+
* @Input
|
|
442
|
+
* query - Query interface (Optional)
|
|
443
|
+
* limit - number (Optional)
|
|
444
|
+
*/
|
|
445
|
+
router.post("/list", (req, res) => {
|
|
446
|
+
this.initList(req, res);
|
|
447
|
+
});
|
|
448
|
+
/**
|
|
449
|
+
* @Input :
|
|
450
|
+
* data - Model
|
|
451
|
+
* id - string
|
|
452
|
+
*/
|
|
453
|
+
router.post("/update", (req, res) => {
|
|
454
|
+
this.initUpdate(req, res);
|
|
455
|
+
});
|
|
456
|
+
/**
|
|
457
|
+
* @Input :
|
|
458
|
+
* id - string
|
|
459
|
+
*/
|
|
460
|
+
router.post("/delete", (req, res) => {
|
|
461
|
+
this.initDelete(req, res);
|
|
462
|
+
});
|
|
463
|
+
return router;
|
|
464
|
+
};
|
|
465
|
+
this.mondayToken = mondayToken;
|
|
466
|
+
this.boardId = boardId;
|
|
467
|
+
this.groupId = groupId;
|
|
468
|
+
this.config = config;
|
|
469
|
+
this.modelChecker = modelChecker;
|
|
470
|
+
this.modelType = modelType;
|
|
471
|
+
this.lib = lib;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
exports.MondayWrapper = MondayWrapper;
|