@driveflux/search 5.0.76 → 5.0.77
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/search-mongodb.js +16 -8
- package/dist/search.js +29 -12
- package/package.json +13 -13
package/dist/search-mongodb.js
CHANGED
|
@@ -49,9 +49,17 @@ function _ts_generator(thisArg, body) {
|
|
|
49
49
|
},
|
|
50
50
|
trys: [],
|
|
51
51
|
ops: []
|
|
52
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
53
|
-
return
|
|
54
|
-
|
|
52
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
53
|
+
return d(g, "next", {
|
|
54
|
+
value: verb(0)
|
|
55
|
+
}), d(g, "throw", {
|
|
56
|
+
value: verb(1)
|
|
57
|
+
}), d(g, "return", {
|
|
58
|
+
value: verb(2)
|
|
59
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
60
|
+
value: function() {
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
55
63
|
}), g;
|
|
56
64
|
function verb(n) {
|
|
57
65
|
return function(v) {
|
|
@@ -134,7 +142,7 @@ function _ts_generator(thisArg, body) {
|
|
|
134
142
|
import { prisma } from '@driveflux/db';
|
|
135
143
|
import { instantiateSingleton, singleton } from '@driveflux/singleton';
|
|
136
144
|
import { MongoClient } from 'mongodb';
|
|
137
|
-
var getClient = function() {
|
|
145
|
+
var getClient = function getClient() {
|
|
138
146
|
return _async_to_generator(function() {
|
|
139
147
|
var client, isConnected;
|
|
140
148
|
return _ts_generator(this, function(_state) {
|
|
@@ -171,13 +179,13 @@ var getClient = function() {
|
|
|
171
179
|
});
|
|
172
180
|
})();
|
|
173
181
|
};
|
|
174
|
-
var getCollectionName = function(model) {
|
|
182
|
+
var getCollectionName = function getCollectionName(model) {
|
|
175
183
|
var _prisma__runtimeDataModel_models_model;
|
|
176
184
|
// TODO
|
|
177
185
|
// @ts-expect-error - This is a private property
|
|
178
186
|
return (_prisma__runtimeDataModel_models_model = prisma._runtimeDataModel.models[model]) === null || _prisma__runtimeDataModel_models_model === void 0 ? void 0 : _prisma__runtimeDataModel_models_model.dbName;
|
|
179
187
|
};
|
|
180
|
-
export var searchMongodb = function(model, search) {
|
|
188
|
+
export var searchMongodb = function searchMongodb(model, search) {
|
|
181
189
|
return _async_to_generator(function() {
|
|
182
190
|
var data;
|
|
183
191
|
return _ts_generator(this, function(_state) {
|
|
@@ -201,7 +209,7 @@ export var searchMongodb = function(model, search) {
|
|
|
201
209
|
});
|
|
202
210
|
})();
|
|
203
211
|
};
|
|
204
|
-
export var searchMongoDbFull = function(model, search, fields) {
|
|
212
|
+
export var searchMongoDbFull = function searchMongoDbFull(model, search, fields) {
|
|
205
213
|
var skip = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, limit = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 10;
|
|
206
214
|
return _async_to_generator(function() {
|
|
207
215
|
var client, collectionName, projectionFields, result;
|
|
@@ -252,7 +260,7 @@ export var searchMongoDbFull = function(model, search, fields) {
|
|
|
252
260
|
});
|
|
253
261
|
})();
|
|
254
262
|
};
|
|
255
|
-
export var getMongoDbSearchResultCount = function(model, search) {
|
|
263
|
+
export var getMongoDbSearchResultCount = function getMongoDbSearchResultCount(model, search) {
|
|
256
264
|
return _async_to_generator(function() {
|
|
257
265
|
var client, collectionName, count;
|
|
258
266
|
return _ts_generator(this, function(_state) {
|
package/dist/search.js
CHANGED
|
@@ -116,12 +116,22 @@ function _object_spread_props(target, source) {
|
|
|
116
116
|
}
|
|
117
117
|
function _object_without_properties(source, excluded) {
|
|
118
118
|
if (source == null) return {};
|
|
119
|
-
var target =
|
|
120
|
-
|
|
119
|
+
var target = {}, sourceKeys, key, i;
|
|
120
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
121
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
122
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
123
|
+
key = sourceKeys[i];
|
|
124
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
125
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
126
|
+
target[key] = source[key];
|
|
127
|
+
}
|
|
128
|
+
return target;
|
|
129
|
+
}
|
|
130
|
+
target = _object_without_properties_loose(source, excluded);
|
|
121
131
|
if (Object.getOwnPropertySymbols) {
|
|
122
|
-
|
|
123
|
-
for(i = 0; i <
|
|
124
|
-
key =
|
|
132
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
133
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
134
|
+
key = sourceKeys[i];
|
|
125
135
|
if (excluded.indexOf(key) >= 0) continue;
|
|
126
136
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
127
137
|
target[key] = source[key];
|
|
@@ -131,12 +141,11 @@ function _object_without_properties(source, excluded) {
|
|
|
131
141
|
}
|
|
132
142
|
function _object_without_properties_loose(source, excluded) {
|
|
133
143
|
if (source == null) return {};
|
|
134
|
-
var target = {};
|
|
135
|
-
var sourceKeys = Object.keys(source);
|
|
136
|
-
var key, i;
|
|
144
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
137
145
|
for(i = 0; i < sourceKeys.length; i++){
|
|
138
146
|
key = sourceKeys[i];
|
|
139
147
|
if (excluded.indexOf(key) >= 0) continue;
|
|
148
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
140
149
|
target[key] = source[key];
|
|
141
150
|
}
|
|
142
151
|
return target;
|
|
@@ -161,9 +170,17 @@ function _ts_generator(thisArg, body) {
|
|
|
161
170
|
},
|
|
162
171
|
trys: [],
|
|
163
172
|
ops: []
|
|
164
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
165
|
-
return
|
|
166
|
-
|
|
173
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
174
|
+
return d(g, "next", {
|
|
175
|
+
value: verb(0)
|
|
176
|
+
}), d(g, "throw", {
|
|
177
|
+
value: verb(1)
|
|
178
|
+
}), d(g, "return", {
|
|
179
|
+
value: verb(2)
|
|
180
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
181
|
+
value: function() {
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
167
184
|
}), g;
|
|
168
185
|
function verb(n) {
|
|
169
186
|
return function(v) {
|
|
@@ -262,7 +279,7 @@ var ID_PREFIXES = Object.entries(ID_PREFIX_MAP).filter(function(param) {
|
|
|
262
279
|
var _param = _sliced_to_array(param, 2), _ = _param[0], prefix = _param[1];
|
|
263
280
|
return prefix;
|
|
264
281
|
});
|
|
265
|
-
export var search = function(req) {
|
|
282
|
+
export var search = function search(req) {
|
|
266
283
|
return _async_to_generator(function() {
|
|
267
284
|
var _Query_parse, q, take, matches, targetModel, id, prefix, result, results;
|
|
268
285
|
return _ts_generator(this, function(_state) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/search",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@driveflux/db": "4.1.19",
|
|
16
|
-
"@driveflux/result": "6.0.
|
|
16
|
+
"@driveflux/result": "6.0.2",
|
|
17
17
|
"change-case": "^5.4.4",
|
|
18
|
-
"mongodb": "^
|
|
19
|
-
"zod": "^4.
|
|
18
|
+
"mongodb": "^7.2.0",
|
|
19
|
+
"zod": "^4.4.3"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@driveflux/fab": "4.0.
|
|
23
|
-
"@driveflux/singleton": "3.0.
|
|
24
|
-
"@driveflux/tsconfig": "3.0.
|
|
25
|
-
"@swc/cli": "^0.
|
|
26
|
-
"@swc/core": "^1.
|
|
27
|
-
"@types/lodash": "^4.17.
|
|
28
|
-
"@types/node": "^
|
|
22
|
+
"@driveflux/fab": "4.0.1",
|
|
23
|
+
"@driveflux/singleton": "3.0.1",
|
|
24
|
+
"@driveflux/tsconfig": "3.0.1",
|
|
25
|
+
"@swc/cli": "^0.8.1",
|
|
26
|
+
"@swc/core": "^1.15.33",
|
|
27
|
+
"@types/lodash": "^4.17.24",
|
|
28
|
+
"@types/node": "^25.7.0",
|
|
29
29
|
"del-cli": "^7.0.0",
|
|
30
|
-
"next": "16.
|
|
31
|
-
"typescript": "^
|
|
30
|
+
"next": "16.2.6",
|
|
31
|
+
"typescript": "^6.0.3"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "fab",
|