drapcode-utility 1.8.6 → 1.8.8
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.
|
@@ -121,7 +121,7 @@ var processItemEncryptDecrypt = function (item, fields, encryption, decrypt, enc
|
|
|
121
121
|
if (!drapcode_constant_1.BelongsCreatedByRefField.includes(field === null || field === void 0 ? void 0 : field.type)) return [3 /*break*/, 6];
|
|
122
122
|
refField = field;
|
|
123
123
|
if (!refField.refCollection &&
|
|
124
|
-
|
|
124
|
+
[drapcode_constant_1.FieldTypes.createdBy.id, drapcode_constant_1.FieldTypes.updatedBy.id].includes(field.type)) {
|
|
125
125
|
refField.refCollection = {
|
|
126
126
|
collectionField: "userName",
|
|
127
127
|
collectionName: "user",
|
|
@@ -17,7 +17,8 @@ var getEncryptedReferenceFieldsQuery = function (collectionFields, projectId) {
|
|
|
17
17
|
return drapcode_constant_1.BelongsCreatedByRefField.includes(field.type);
|
|
18
18
|
});
|
|
19
19
|
collectionFields.forEach(function (field) {
|
|
20
|
-
if (!field.refCollection &&
|
|
20
|
+
if (!field.refCollection &&
|
|
21
|
+
[drapcode_constant_1.FieldTypes.createdBy.id, drapcode_constant_1.FieldTypes.updatedBy.id].includes(field.type)) {
|
|
21
22
|
collectionsNamesArr.push("user");
|
|
22
23
|
}
|
|
23
24
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const queryParser: (collectionName: string, query: any, constants: any[], externalParams: any, currentUser: any, timezone: string, searchObj: any, refCollectionFieldsInItems: any, searchQueryTypeObj: any, currentTenant: any, currentUserSetting: any, lookupConfig: any, rowLevelSecurityFilter: any) => Promise<
|
|
1
|
+
export declare const queryParser: (collectionName: string, query: any, constants: any[], externalParams: any, currentUser: any, timezone: string, searchObj: any, refCollectionFieldsInItems: any, searchQueryTypeObj: any, currentTenant: any, currentUserSetting: any, lookupConfig: any, rowLevelSecurityFilter: any) => Promise<any>;
|
|
2
2
|
export declare const isEntityInCondition: (value: any) => boolean;
|
|
3
3
|
export declare const isFixedValueQuery: (value: any) => boolean;
|
|
4
4
|
export declare const getMinMaxValue: (value: any) => {
|
|
@@ -63,7 +63,7 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
|
|
|
63
63
|
if (currentUserSetting === void 0) { currentUserSetting = {}; }
|
|
64
64
|
if (lookupConfig === void 0) { lookupConfig = []; }
|
|
65
65
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var filterQuery, rlsFilterQuery, aggregateQuery, queryStr, searchQueryObj, _a, searchAggregateQuery, likeQuery, finalQuery, _b, searchAggregateQuery, likeQuery, projection, finder, sortBy, orderBy, offset, limit, resetLimit, direction
|
|
66
|
+
var filterQuery, rlsFilterQuery, aggregateQuery, queryStr, searchQueryObj, _a, searchAggregateQuery, likeQuery, finalQuery, _b, searchAggregateQuery, likeQuery, projection, finder, sortBy, orderBy, offset, limit, resetLimit, direction;
|
|
67
67
|
var _c, _d, _e;
|
|
68
68
|
return __generator(this, function (_f) {
|
|
69
69
|
switch (_f.label) {
|
|
@@ -166,11 +166,7 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
|
|
|
166
166
|
aggregateQuery.push({ $skip: +offset }, { $limit: +limit });
|
|
167
167
|
}
|
|
168
168
|
console.log("==> aggregateQuery", aggregateQuery);
|
|
169
|
-
|
|
170
|
-
queryStr = ".aggregate(".concat(JSON.stringify(aggregateQuery), ", { collation: { locale: \"en\" }, allowDiskUse: true })");
|
|
171
|
-
str = "req.db.collection('".concat(collectionName, "')").concat(queryStr);
|
|
172
|
-
str += ".toArray()";
|
|
173
|
-
return [2 /*return*/, str];
|
|
169
|
+
return [2 /*return*/, aggregateQuery];
|
|
174
170
|
}
|
|
175
171
|
});
|
|
176
172
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const queryParserNew: (collectionName: string, query: any, constants: any[], externalParams: any, currentUser: any, timezone: string, searchObj?: any, refCollectionFieldsInItems?: any, searchQueryTypeObj?: any, lookupConfig?: any) => Promise<
|
|
1
|
+
export declare const queryParserNew: (collectionName: string, query: any, constants: any[], externalParams: any, currentUser: any, timezone: string, searchObj?: any, refCollectionFieldsInItems?: any, searchQueryTypeObj?: any, lookupConfig?: any) => Promise<any>;
|
|
@@ -57,7 +57,7 @@ var queryParserNew = function (collectionName, query, constants, externalParams,
|
|
|
57
57
|
if (searchQueryTypeObj === void 0) { searchQueryTypeObj = {}; }
|
|
58
58
|
if (lookupConfig === void 0) { lookupConfig = []; }
|
|
59
59
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
60
|
-
var filterQuery, aggregateQuery, queryStr, searchQueryObj_1, finalQuery, likeQuery_1, projection, finder, sortBy, orderBy, aggregateFunctionField, offset, limit, direction
|
|
60
|
+
var filterQuery, aggregateQuery, queryStr, searchQueryObj_1, finalQuery, likeQuery_1, projection, finder, sortBy, orderBy, aggregateFunctionField, offset, limit, direction;
|
|
61
61
|
var _a;
|
|
62
62
|
return __generator(this, function (_b) {
|
|
63
63
|
switch (_b.label) {
|
|
@@ -256,10 +256,8 @@ var queryParserNew = function (collectionName, query, constants, externalParams,
|
|
|
256
256
|
if (finder != "COUNT" && limit) {
|
|
257
257
|
aggregateQuery.push({ $skip: +offset }, { $limit: +limit });
|
|
258
258
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
str += ".toArray()";
|
|
262
|
-
return [2 /*return*/, str];
|
|
259
|
+
console.log("==> aggregateQuery", JSON.stringify(aggregateQuery, null, 2));
|
|
260
|
+
return [2 /*return*/, aggregateQuery];
|
|
263
261
|
}
|
|
264
262
|
});
|
|
265
263
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drapcode-utility",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@types/voca": "^1.4.2",
|
|
38
38
|
"axios": "^1.1.2",
|
|
39
39
|
"dompurify": "^3.1.7",
|
|
40
|
-
"drapcode-constant": "^1.6.
|
|
41
|
-
"drapcode-logger": "^1.3.
|
|
42
|
-
"drapcode-redis": "^1.2.
|
|
40
|
+
"drapcode-constant": "^1.6.6",
|
|
41
|
+
"drapcode-logger": "^1.3.2",
|
|
42
|
+
"drapcode-redis": "^1.2.1",
|
|
43
43
|
"exiftool-vendored": "^28.2.1",
|
|
44
44
|
"express": "^4.17.1",
|
|
45
45
|
"gm": "^1.25.0",
|