@punks/backend-entity-manager 0.0.486 → 0.0.488
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/cjs/index.js +8 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/base/serializer.d.ts +1 -0
- package/dist/cjs/types/integrations/repository/typeorm/queryClauseBuilder.d.ts +1 -1
- package/dist/esm/index.js +8 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/base/serializer.d.ts +1 -0
- package/dist/esm/types/integrations/repository/typeorm/queryClauseBuilder.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -259,10 +259,7 @@ class EntitySerializer {
|
|
|
259
259
|
async import(items, payload) {
|
|
260
260
|
this.logger.info(`Entities import -> started (${items.length} items)`);
|
|
261
261
|
const context = await this.getContext();
|
|
262
|
-
|
|
263
|
-
await this.importItem(item, context, payload);
|
|
264
|
-
this.logger.info(`Entity imported -> ${index + 1}/${items.length}`);
|
|
265
|
-
}
|
|
262
|
+
await this.importItems(items, context, payload);
|
|
266
263
|
this.logger.info(`Entities import -> completed (${items.length} items)`);
|
|
267
264
|
}
|
|
268
265
|
async parse(data, format, payload) {
|
|
@@ -277,6 +274,12 @@ class EntitySerializer {
|
|
|
277
274
|
throw new Error(`Format ${format} not supported`);
|
|
278
275
|
}
|
|
279
276
|
}
|
|
277
|
+
async importItems(items, context, payload) {
|
|
278
|
+
for (const [index, item] of items.entries()) {
|
|
279
|
+
await this.importItem(item, context, payload);
|
|
280
|
+
this.logger.info(`Entity imported -> ${index + 1}/${items.length}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
280
283
|
parseCsv(data, definition) {
|
|
281
284
|
const records = backendCore.csvParse(data, DEFAULT_DELIMITER$1);
|
|
282
285
|
return records.map((x, i) => this.convertSheetRecord(x, definition, i));
|
|
@@ -3611,7 +3614,7 @@ class QueryBuilderBase {
|
|
|
3611
3614
|
}
|
|
3612
3615
|
|
|
3613
3616
|
class QueryClauseBuilder {
|
|
3614
|
-
|
|
3617
|
+
stringArrayFilter(filter) {
|
|
3615
3618
|
if (filter.eq) {
|
|
3616
3619
|
return `{${filter.eq
|
|
3617
3620
|
.map((v) => `"${v}"`)
|