@punks/backend-entity-manager 0.0.349 → 0.0.350
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 +304 -161
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/actions.d.ts +5 -0
- package/dist/cjs/types/abstractions/commands.d.ts +4 -0
- package/dist/cjs/types/abstractions/import.d.ts +8 -0
- package/dist/cjs/types/abstractions/index.d.ts +4 -3
- package/dist/cjs/types/abstractions/manager.d.ts +2 -1
- package/dist/cjs/types/abstractions/parse.d.ts +24 -0
- package/dist/cjs/types/abstractions/serializer.d.ts +20 -3
- package/dist/cjs/types/actions/parse.d.ts +9 -0
- package/dist/cjs/types/base/serializer.d.ts +1 -0
- package/dist/cjs/types/commands/parse.d.ts +14 -0
- package/dist/cjs/types/concrete/index.d.ts +4 -2
- package/dist/cjs/types/platforms/nest/__test__/server/app/foos/foo.controller.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/foos/foo.dto.d.ts +7 -0
- package/dist/cjs/types/platforms/nest/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/models/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/models/parsing.d.ts +12 -0
- package/dist/cjs/types/providers/{services.d.ts → services/entities-locator.d.ts} +33 -72
- package/dist/cjs/types/providers/services/entity-locator.d.ts +73 -0
- package/dist/cjs/types/providers/services/index.d.ts +2 -0
- package/dist/cjs/types/symbols/ioc.d.ts +2 -0
- package/dist/esm/index.js +303 -162
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/actions.d.ts +5 -0
- package/dist/esm/types/abstractions/commands.d.ts +4 -0
- package/dist/esm/types/abstractions/import.d.ts +8 -0
- package/dist/esm/types/abstractions/index.d.ts +4 -3
- package/dist/esm/types/abstractions/manager.d.ts +2 -1
- package/dist/esm/types/abstractions/parse.d.ts +24 -0
- package/dist/esm/types/abstractions/serializer.d.ts +20 -3
- package/dist/esm/types/actions/parse.d.ts +9 -0
- package/dist/esm/types/base/serializer.d.ts +1 -0
- package/dist/esm/types/commands/parse.d.ts +14 -0
- package/dist/esm/types/concrete/index.d.ts +4 -2
- package/dist/esm/types/platforms/nest/__test__/server/app/foos/foo.controller.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/foos/foo.dto.d.ts +7 -0
- package/dist/esm/types/platforms/nest/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/models/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/models/parsing.d.ts +12 -0
- package/dist/esm/types/providers/{services.d.ts → services/entities-locator.d.ts} +33 -72
- package/dist/esm/types/providers/services/entity-locator.d.ts +73 -0
- package/dist/esm/types/providers/services/index.d.ts +2 -0
- package/dist/esm/types/symbols/ioc.d.ts +2 -0
- package/dist/index.d.ts +562 -485
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { SchedulerRegistry } from '@nestjs/schedule';
|
|
|
15
15
|
import require$$0 from 'child_process';
|
|
16
16
|
import { CommandBus, CommandHandler } from '@nestjs/cqrs';
|
|
17
17
|
import require$$1 from 'fs';
|
|
18
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
18
19
|
import { ListObjectsCommand, PutObjectCommand, GetObjectCommand, DeleteObjectCommand, CopyObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
|
19
20
|
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
20
21
|
import { SendEmailCommand, SESClient } from '@aws-sdk/client-ses';
|
|
@@ -210,13 +211,13 @@ class EntitySerializer {
|
|
|
210
211
|
}
|
|
211
212
|
parseCsv(data, definition) {
|
|
212
213
|
const records = csvParse(data, DEFAULT_DELIMITER);
|
|
213
|
-
return records.map((x) => this.convertSheetRecord(x, definition));
|
|
214
|
+
return records.map((x, i) => this.convertSheetRecord(x, definition, i));
|
|
214
215
|
}
|
|
215
216
|
parseXlsx(data, definition) {
|
|
216
217
|
const records = excelParse(data);
|
|
217
|
-
return records.map((x) => this.convertSheetRecord(x, definition));
|
|
218
|
+
return records.map((x, i) => this.convertSheetRecord(x, definition, i));
|
|
218
219
|
}
|
|
219
|
-
convertSheetRecord(record, definition) {
|
|
220
|
+
convertSheetRecord(record, definition, rowIndex) {
|
|
220
221
|
if (!record._type || record._type !== this.entityName) {
|
|
221
222
|
throw new Error(`Invalid record type ${record._type} -> record: \n${JSON.stringify(record)}`);
|
|
222
223
|
}
|
|
@@ -229,10 +230,26 @@ class EntitySerializer {
|
|
|
229
230
|
entity[column.selector] = this.parseColumnValue(record, column);
|
|
230
231
|
}
|
|
231
232
|
}
|
|
233
|
+
const validationErrors = [];
|
|
234
|
+
for (const column of definition.columns) {
|
|
235
|
+
for (const validator of column.validators ?? []) {
|
|
236
|
+
const result = validator.fn((item) => item[column.selector]);
|
|
237
|
+
if (!result.isValid) {
|
|
238
|
+
validationErrors.push({
|
|
239
|
+
errorCode: validator.key,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
232
244
|
const idField = definition.columns.find((x) => x.idColumn || x.selector === "id");
|
|
233
245
|
return {
|
|
234
246
|
id: idField ? entity[idField.selector] : undefined,
|
|
235
247
|
item: entity,
|
|
248
|
+
rowIndex,
|
|
249
|
+
status: {
|
|
250
|
+
isValid: validationErrors.length === 0,
|
|
251
|
+
validationErrors,
|
|
252
|
+
},
|
|
236
253
|
};
|
|
237
254
|
}
|
|
238
255
|
parseColumnValue(row, definition) {
|
|
@@ -294,6 +311,7 @@ class EntitySerializer {
|
|
|
294
311
|
async serialize(data, format) {
|
|
295
312
|
return await this.buildExportFile(data, format);
|
|
296
313
|
}
|
|
314
|
+
validateSheetItem(item, allItems, context) { }
|
|
297
315
|
async getContext() {
|
|
298
316
|
return (await this.services
|
|
299
317
|
.resolveAuthenticationContextProvider()
|
|
@@ -484,6 +502,19 @@ class EntitiesImportAction {
|
|
|
484
502
|
}
|
|
485
503
|
}
|
|
486
504
|
|
|
505
|
+
class EntitiesParseAction {
|
|
506
|
+
constructor(services) {
|
|
507
|
+
this.services = services;
|
|
508
|
+
this.logger = Log.getLogger(`${services.getEntityName()} -> Import`);
|
|
509
|
+
}
|
|
510
|
+
async execute(input) {
|
|
511
|
+
this.logger.debug("Parse action started", { input });
|
|
512
|
+
const result = await this.services.resolveParseCommand().execute(input);
|
|
513
|
+
this.logger.debug("Parse action completed", { input });
|
|
514
|
+
return result;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
487
518
|
class EntitiesSampleDownloadAction {
|
|
488
519
|
constructor(services) {
|
|
489
520
|
this.services = services;
|
|
@@ -798,6 +829,12 @@ class EntitiesExportCommand {
|
|
|
798
829
|
}
|
|
799
830
|
}
|
|
800
831
|
|
|
832
|
+
var InvalidEntityHandling;
|
|
833
|
+
(function (InvalidEntityHandling) {
|
|
834
|
+
InvalidEntityHandling["Skip"] = "skip";
|
|
835
|
+
InvalidEntityHandling["Fail"] = "fail";
|
|
836
|
+
})(InvalidEntityHandling || (InvalidEntityHandling = {}));
|
|
837
|
+
|
|
801
838
|
class EntitiesImportCommand {
|
|
802
839
|
constructor(services, settings) {
|
|
803
840
|
this.services = services;
|
|
@@ -810,10 +847,19 @@ class EntitiesImportCommand {
|
|
|
810
847
|
fileName: input.file.fileName,
|
|
811
848
|
});
|
|
812
849
|
const importEntities = await this.parseImportFile(input.file.content, input.format);
|
|
813
|
-
|
|
850
|
+
const validEntities = importEntities.filter((x) => x.status.isValid);
|
|
851
|
+
const invalidEntities = importEntities.filter((x) => !x.status.isValid);
|
|
852
|
+
if (invalidEntities.length > 0 &&
|
|
853
|
+
input.options?.invalidEntitiesHandling !== InvalidEntityHandling.Skip) {
|
|
854
|
+
throw new Error(`Cannot import file due to invalid entities: ${invalidEntities
|
|
855
|
+
.map((x) => x.id)
|
|
856
|
+
.join(", ")}`);
|
|
857
|
+
}
|
|
858
|
+
await this.services.resolveSerializer().import(validEntities.map((x) => x.item), input.payload);
|
|
814
859
|
return {
|
|
815
860
|
statistics: {
|
|
816
|
-
importedCount:
|
|
861
|
+
importedCount: validEntities.length,
|
|
862
|
+
skippedCount: invalidEntities.length,
|
|
817
863
|
createdCount: 0,
|
|
818
864
|
unchangedCount: 0,
|
|
819
865
|
updatedCount: 0,
|
|
@@ -839,6 +885,41 @@ class EntitiesImportCommand {
|
|
|
839
885
|
}
|
|
840
886
|
}
|
|
841
887
|
|
|
888
|
+
class EntitiesParseCommand {
|
|
889
|
+
constructor(services, settings) {
|
|
890
|
+
this.services = services;
|
|
891
|
+
this.settings = settings;
|
|
892
|
+
}
|
|
893
|
+
async execute(input) {
|
|
894
|
+
await this.uploadImportFile({
|
|
895
|
+
content: input.file.content,
|
|
896
|
+
contentType: input.file.contentType,
|
|
897
|
+
fileName: input.file.fileName,
|
|
898
|
+
});
|
|
899
|
+
const entries = await this.parseImportFile(input.file.content, input.format);
|
|
900
|
+
return {
|
|
901
|
+
entries,
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
async parseImportFile(content, format) {
|
|
905
|
+
return await this.services.resolveSerializer().parse(content, format);
|
|
906
|
+
}
|
|
907
|
+
async uploadImportFile(file) {
|
|
908
|
+
await this.bucket.fileUpload({
|
|
909
|
+
bucket: this.settings.exportBucket.bucket,
|
|
910
|
+
filePath: this.buildAbsoluteBucketPath(file.fileName),
|
|
911
|
+
content: file.content,
|
|
912
|
+
contentType: file.contentType,
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
buildAbsoluteBucketPath(relativePath) {
|
|
916
|
+
return `${this.settings.exportBucket.rootFolderPath ?? ""}/parsers/${createDayPath$1(new Date())}/${relativePath}`;
|
|
917
|
+
}
|
|
918
|
+
get bucket() {
|
|
919
|
+
return this.services.getRootServices().resolveDefaultBucketProvider();
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
842
923
|
class EntitiesSampleDownloadCommand {
|
|
843
924
|
constructor(services, settings) {
|
|
844
925
|
this.services = services;
|
|
@@ -1115,6 +1196,9 @@ class EntityManager {
|
|
|
1115
1196
|
get import() {
|
|
1116
1197
|
return this.services.resolveImportCommand();
|
|
1117
1198
|
}
|
|
1199
|
+
get parse() {
|
|
1200
|
+
return this.services.resolveParseCommand();
|
|
1201
|
+
}
|
|
1118
1202
|
get sampleDownload() {
|
|
1119
1203
|
return this.services.resolveSampleDownloadCommand();
|
|
1120
1204
|
}
|
|
@@ -1159,6 +1243,9 @@ class EntityActions {
|
|
|
1159
1243
|
get import() {
|
|
1160
1244
|
return this.services.resolveImportAction();
|
|
1161
1245
|
}
|
|
1246
|
+
get parse() {
|
|
1247
|
+
return this.services.resolveParseAction();
|
|
1248
|
+
}
|
|
1162
1249
|
get sampleDownload() {
|
|
1163
1250
|
return this.services.resolveSampleDownloadAction();
|
|
1164
1251
|
}
|
|
@@ -1247,6 +1334,7 @@ const EntityServices = {
|
|
|
1247
1334
|
IEntityDeleteAction: "IEntityDeleteAction",
|
|
1248
1335
|
IEntityMergeAction: "IEntityMergeAction",
|
|
1249
1336
|
IEntitiesExportAction: "IEntitiesExportAction",
|
|
1337
|
+
IEntitiesParseAction: "IEntitiesParseAction",
|
|
1250
1338
|
IEntitiesImportAction: "IEntitiesImportAction",
|
|
1251
1339
|
IEntitiesSampleDownloadAction: "IEntitiesSampleDownloadAction",
|
|
1252
1340
|
IEntityVersionsSearchAction: "IEntityVersionsSearchAction",
|
|
@@ -1265,6 +1353,7 @@ const EntityServices = {
|
|
|
1265
1353
|
IEntitiesDeleteCommand: "IEntitiesDeleteCommand",
|
|
1266
1354
|
IEntitiesExportCommand: "IEntitiesExportCommand",
|
|
1267
1355
|
IEntitiesImportCommand: "IEntitiesImportCommand",
|
|
1356
|
+
IEntitiesParseCommand: "IEntitiesParseCommand",
|
|
1268
1357
|
IEntitiesSampleDownloadCommand: "IEntitiesSampleDownloadCommand",
|
|
1269
1358
|
},
|
|
1270
1359
|
Converters: {
|
|
@@ -1345,162 +1434,6 @@ const GlobalServices = {
|
|
|
1345
1434
|
},
|
|
1346
1435
|
};
|
|
1347
1436
|
|
|
1348
|
-
class EntityServiceLocator {
|
|
1349
|
-
constructor(services, entityName) {
|
|
1350
|
-
this.services = services;
|
|
1351
|
-
this.entityName = entityName;
|
|
1352
|
-
}
|
|
1353
|
-
getRootServices() {
|
|
1354
|
-
return this.services;
|
|
1355
|
-
}
|
|
1356
|
-
resolveAuthenticationContextProvider() {
|
|
1357
|
-
return this.services.resolveAuthenticationContextProvider();
|
|
1358
|
-
}
|
|
1359
|
-
resolveEntityManager() {
|
|
1360
|
-
return this.services.resolveEntityManager(this.entityName);
|
|
1361
|
-
}
|
|
1362
|
-
resolveEntityActions() {
|
|
1363
|
-
return this.services.resolveEntityActions(this.entityName);
|
|
1364
|
-
}
|
|
1365
|
-
resolveRepository() {
|
|
1366
|
-
return this.services.resolveRepository(this.entityName);
|
|
1367
|
-
}
|
|
1368
|
-
resolveEventsManager() {
|
|
1369
|
-
return this.services.resolveEventsManager(this.entityName);
|
|
1370
|
-
}
|
|
1371
|
-
resolveVersioningProvider() {
|
|
1372
|
-
return this.services.resolveEntityVersioningProvider();
|
|
1373
|
-
}
|
|
1374
|
-
resolveEntityConfiguration() {
|
|
1375
|
-
return this.services.resolveEntityConfiguration(this.entityName);
|
|
1376
|
-
}
|
|
1377
|
-
resolveReplicaSyncManager() {
|
|
1378
|
-
return this.services.resolveReplicaSyncManager(this.entityName);
|
|
1379
|
-
}
|
|
1380
|
-
resolveReplicaConfiguration() {
|
|
1381
|
-
return this.services.resolveReplicaConfiguration(this.entityName);
|
|
1382
|
-
}
|
|
1383
|
-
resolveReplicaDeleteManager() {
|
|
1384
|
-
return this.services.resolveReplicaDeleteManager(this.entityName);
|
|
1385
|
-
}
|
|
1386
|
-
resolveConnectorSyncManager() {
|
|
1387
|
-
return this.services.resolveConnectorSyncManager(this.entityName);
|
|
1388
|
-
}
|
|
1389
|
-
resolveConnectorDeleteManager() {
|
|
1390
|
-
return this.services.resolveConnectorDeleteManager(this.entityName);
|
|
1391
|
-
}
|
|
1392
|
-
resolveConnectorsConfiguration() {
|
|
1393
|
-
return this.services.resolveConnectorsConfiguration(this.entityName);
|
|
1394
|
-
}
|
|
1395
|
-
resolveConverter() {
|
|
1396
|
-
return this.services.resolveConverter(this.entityName);
|
|
1397
|
-
}
|
|
1398
|
-
resolveSerializer() {
|
|
1399
|
-
return this.services.resolveSerializer(this.entityName);
|
|
1400
|
-
}
|
|
1401
|
-
resolveSnapshotService() {
|
|
1402
|
-
return this.services.resolveSnapshotService(this.entityName);
|
|
1403
|
-
}
|
|
1404
|
-
resolveAdapter() {
|
|
1405
|
-
return this.services.resolveAdapter(this.entityName);
|
|
1406
|
-
}
|
|
1407
|
-
resolveAuthorizationMiddleware() {
|
|
1408
|
-
return this.services.resolveAuthorizationMiddleware(this.entityName);
|
|
1409
|
-
}
|
|
1410
|
-
resolveGetQuery() {
|
|
1411
|
-
return this.services.resolveGetQuery(this.entityName);
|
|
1412
|
-
}
|
|
1413
|
-
resolveExistsQuery() {
|
|
1414
|
-
return this.services.resolveExistsQuery(this.entityName);
|
|
1415
|
-
}
|
|
1416
|
-
resolveCountQuery() {
|
|
1417
|
-
return this.services.resolveCountQuery(this.entityName);
|
|
1418
|
-
}
|
|
1419
|
-
resolveVersionsSearchQuery() {
|
|
1420
|
-
return this.services.resolveVersionsSearchQuery(this.entityName);
|
|
1421
|
-
}
|
|
1422
|
-
resolveSearchQuery() {
|
|
1423
|
-
return this.services.resolveSearchQuery(this.entityName);
|
|
1424
|
-
}
|
|
1425
|
-
resolveFindQuery() {
|
|
1426
|
-
return this.services.resolveFindQuery(this.entityName);
|
|
1427
|
-
}
|
|
1428
|
-
resolveCreateCommand() {
|
|
1429
|
-
return this.services.resolveCreateCommand(this.entityName);
|
|
1430
|
-
}
|
|
1431
|
-
resolveUpdateCommand() {
|
|
1432
|
-
return this.services.resolveUpdateCommand(this.entityName);
|
|
1433
|
-
}
|
|
1434
|
-
resolveUpsertCommand() {
|
|
1435
|
-
return this.services.resolveUpsertCommand(this.entityName);
|
|
1436
|
-
}
|
|
1437
|
-
resolveUpsertByCommand() {
|
|
1438
|
-
return this.services.resolveUpsertByCommand(this.entityName);
|
|
1439
|
-
}
|
|
1440
|
-
resolveDeleteCommand() {
|
|
1441
|
-
return this.services.resolveDeleteCommand(this.entityName);
|
|
1442
|
-
}
|
|
1443
|
-
resolveDeleteItemsCommand() {
|
|
1444
|
-
return this.services.resolveDeleteItemsCommand(this.entityName);
|
|
1445
|
-
}
|
|
1446
|
-
resolveVersionCommand() {
|
|
1447
|
-
return this.services.resolveVersionCommand(this.entityName);
|
|
1448
|
-
}
|
|
1449
|
-
resolveSampleDownloadCommand() {
|
|
1450
|
-
return this.services.resolveSampleDownloadCommand(this.entityName);
|
|
1451
|
-
}
|
|
1452
|
-
resolveImportCommand() {
|
|
1453
|
-
return this.services.resolveImportCommand(this.entityName);
|
|
1454
|
-
}
|
|
1455
|
-
resolveExportCommand() {
|
|
1456
|
-
return this.services.resolveExportCommand(this.entityName);
|
|
1457
|
-
}
|
|
1458
|
-
resolveGetAction() {
|
|
1459
|
-
return this.services.resolveGetAction(this.entityName);
|
|
1460
|
-
}
|
|
1461
|
-
resolveExistsAction() {
|
|
1462
|
-
return this.services.resolveExistsAction(this.entityName);
|
|
1463
|
-
}
|
|
1464
|
-
resolveCountAction() {
|
|
1465
|
-
return this.services.resolveCountAction(this.entityName);
|
|
1466
|
-
}
|
|
1467
|
-
resolveSearchAction() {
|
|
1468
|
-
return this.services.resolveSearchAction(this.entityName);
|
|
1469
|
-
}
|
|
1470
|
-
resolveVersionsSearchAction() {
|
|
1471
|
-
return this.services.resolveVersionsSearchAction(this.entityName);
|
|
1472
|
-
}
|
|
1473
|
-
resolveCreateAction() {
|
|
1474
|
-
return this.services.resolveCreateAction(this.entityName);
|
|
1475
|
-
}
|
|
1476
|
-
resolveUpdateAction() {
|
|
1477
|
-
return this.services.resolveUpdateAction(this.entityName);
|
|
1478
|
-
}
|
|
1479
|
-
resolveUpsertAction() {
|
|
1480
|
-
return this.services.resolveUpsertAction(this.entityName);
|
|
1481
|
-
}
|
|
1482
|
-
resolveDeleteAction() {
|
|
1483
|
-
return this.services.resolveDeleteAction(this.entityName);
|
|
1484
|
-
}
|
|
1485
|
-
resolveDeleteItemsAction() {
|
|
1486
|
-
return this.services.resolveDeleteItemsAction(this.entityName);
|
|
1487
|
-
}
|
|
1488
|
-
resolveImportAction() {
|
|
1489
|
-
return this.services.resolveImportAction(this.entityName);
|
|
1490
|
-
}
|
|
1491
|
-
resolveSampleDownloadAction() {
|
|
1492
|
-
return this.services.resolveSampleDownloadAction(this.entityName);
|
|
1493
|
-
}
|
|
1494
|
-
resolveExportAction() {
|
|
1495
|
-
return this.services.resolveExportAction(this.entityName);
|
|
1496
|
-
}
|
|
1497
|
-
resolveQueryBuilder() {
|
|
1498
|
-
return this.services.resolveQueryBuilder(this.entityName);
|
|
1499
|
-
}
|
|
1500
|
-
getEntityName() {
|
|
1501
|
-
return this.entityName;
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
1437
|
class EntitiesServiceLocator {
|
|
1505
1438
|
constructor(provider) {
|
|
1506
1439
|
this.provider = provider;
|
|
@@ -1852,6 +1785,12 @@ class EntitiesServiceLocator {
|
|
|
1852
1785
|
registerImportCommand(entityName, instance) {
|
|
1853
1786
|
this.provider.registerEntityService(EntityServices.Commands.IEntitiesImportCommand, entityName, instance);
|
|
1854
1787
|
}
|
|
1788
|
+
resolveParseCommand(entityName) {
|
|
1789
|
+
return this.provider.resolveEntityService(EntityServices.Commands.IEntitiesParseCommand, entityName);
|
|
1790
|
+
}
|
|
1791
|
+
registerParseCommand(entityName, instance) {
|
|
1792
|
+
this.provider.registerEntityService(EntityServices.Commands.IEntitiesParseCommand, entityName, instance);
|
|
1793
|
+
}
|
|
1855
1794
|
resolveSampleDownloadCommand(entityName) {
|
|
1856
1795
|
return this.provider.resolveEntityService(EntityServices.Commands.IEntitiesSampleDownloadCommand, entityName);
|
|
1857
1796
|
}
|
|
@@ -1936,6 +1875,12 @@ class EntitiesServiceLocator {
|
|
|
1936
1875
|
registerImportAction(entityName, instance) {
|
|
1937
1876
|
this.provider.registerEntityService(EntityServices.Actions.IEntitiesImportAction, entityName, instance);
|
|
1938
1877
|
}
|
|
1878
|
+
resolveParseAction(entityName) {
|
|
1879
|
+
return this.provider.resolveEntityService(EntityServices.Actions.IEntitiesParseAction, entityName);
|
|
1880
|
+
}
|
|
1881
|
+
registerParseAction(entityName, instance) {
|
|
1882
|
+
this.provider.registerEntityService(EntityServices.Actions.IEntitiesParseAction, entityName, instance);
|
|
1883
|
+
}
|
|
1939
1884
|
resolveQueryBuilder(entityName) {
|
|
1940
1885
|
return this.provider.resolveEntityService(EntityServices.Queries.IEntitiesQueryBuilder, entityName);
|
|
1941
1886
|
}
|
|
@@ -1944,6 +1889,169 @@ class EntitiesServiceLocator {
|
|
|
1944
1889
|
}
|
|
1945
1890
|
}
|
|
1946
1891
|
|
|
1892
|
+
class EntityServiceLocator {
|
|
1893
|
+
constructor(services, entityName) {
|
|
1894
|
+
this.services = services;
|
|
1895
|
+
this.entityName = entityName;
|
|
1896
|
+
}
|
|
1897
|
+
getRootServices() {
|
|
1898
|
+
return this.services;
|
|
1899
|
+
}
|
|
1900
|
+
resolveAuthenticationContextProvider() {
|
|
1901
|
+
return this.services.resolveAuthenticationContextProvider();
|
|
1902
|
+
}
|
|
1903
|
+
resolveEntityManager() {
|
|
1904
|
+
return this.services.resolveEntityManager(this.entityName);
|
|
1905
|
+
}
|
|
1906
|
+
resolveEntityActions() {
|
|
1907
|
+
return this.services.resolveEntityActions(this.entityName);
|
|
1908
|
+
}
|
|
1909
|
+
resolveRepository() {
|
|
1910
|
+
return this.services.resolveRepository(this.entityName);
|
|
1911
|
+
}
|
|
1912
|
+
resolveEventsManager() {
|
|
1913
|
+
return this.services.resolveEventsManager(this.entityName);
|
|
1914
|
+
}
|
|
1915
|
+
resolveVersioningProvider() {
|
|
1916
|
+
return this.services.resolveEntityVersioningProvider();
|
|
1917
|
+
}
|
|
1918
|
+
resolveEntityConfiguration() {
|
|
1919
|
+
return this.services.resolveEntityConfiguration(this.entityName);
|
|
1920
|
+
}
|
|
1921
|
+
resolveReplicaSyncManager() {
|
|
1922
|
+
return this.services.resolveReplicaSyncManager(this.entityName);
|
|
1923
|
+
}
|
|
1924
|
+
resolveReplicaConfiguration() {
|
|
1925
|
+
return this.services.resolveReplicaConfiguration(this.entityName);
|
|
1926
|
+
}
|
|
1927
|
+
resolveReplicaDeleteManager() {
|
|
1928
|
+
return this.services.resolveReplicaDeleteManager(this.entityName);
|
|
1929
|
+
}
|
|
1930
|
+
resolveConnectorSyncManager() {
|
|
1931
|
+
return this.services.resolveConnectorSyncManager(this.entityName);
|
|
1932
|
+
}
|
|
1933
|
+
resolveConnectorDeleteManager() {
|
|
1934
|
+
return this.services.resolveConnectorDeleteManager(this.entityName);
|
|
1935
|
+
}
|
|
1936
|
+
resolveConnectorsConfiguration() {
|
|
1937
|
+
return this.services.resolveConnectorsConfiguration(this.entityName);
|
|
1938
|
+
}
|
|
1939
|
+
resolveConverter() {
|
|
1940
|
+
return this.services.resolveConverter(this.entityName);
|
|
1941
|
+
}
|
|
1942
|
+
resolveSerializer() {
|
|
1943
|
+
return this.services.resolveSerializer(this.entityName);
|
|
1944
|
+
}
|
|
1945
|
+
resolveSnapshotService() {
|
|
1946
|
+
return this.services.resolveSnapshotService(this.entityName);
|
|
1947
|
+
}
|
|
1948
|
+
resolveAdapter() {
|
|
1949
|
+
return this.services.resolveAdapter(this.entityName);
|
|
1950
|
+
}
|
|
1951
|
+
resolveAuthorizationMiddleware() {
|
|
1952
|
+
return this.services.resolveAuthorizationMiddleware(this.entityName);
|
|
1953
|
+
}
|
|
1954
|
+
resolveGetQuery() {
|
|
1955
|
+
return this.services.resolveGetQuery(this.entityName);
|
|
1956
|
+
}
|
|
1957
|
+
resolveExistsQuery() {
|
|
1958
|
+
return this.services.resolveExistsQuery(this.entityName);
|
|
1959
|
+
}
|
|
1960
|
+
resolveCountQuery() {
|
|
1961
|
+
return this.services.resolveCountQuery(this.entityName);
|
|
1962
|
+
}
|
|
1963
|
+
resolveVersionsSearchQuery() {
|
|
1964
|
+
return this.services.resolveVersionsSearchQuery(this.entityName);
|
|
1965
|
+
}
|
|
1966
|
+
resolveSearchQuery() {
|
|
1967
|
+
return this.services.resolveSearchQuery(this.entityName);
|
|
1968
|
+
}
|
|
1969
|
+
resolveFindQuery() {
|
|
1970
|
+
return this.services.resolveFindQuery(this.entityName);
|
|
1971
|
+
}
|
|
1972
|
+
resolveCreateCommand() {
|
|
1973
|
+
return this.services.resolveCreateCommand(this.entityName);
|
|
1974
|
+
}
|
|
1975
|
+
resolveUpdateCommand() {
|
|
1976
|
+
return this.services.resolveUpdateCommand(this.entityName);
|
|
1977
|
+
}
|
|
1978
|
+
resolveUpsertCommand() {
|
|
1979
|
+
return this.services.resolveUpsertCommand(this.entityName);
|
|
1980
|
+
}
|
|
1981
|
+
resolveUpsertByCommand() {
|
|
1982
|
+
return this.services.resolveUpsertByCommand(this.entityName);
|
|
1983
|
+
}
|
|
1984
|
+
resolveDeleteCommand() {
|
|
1985
|
+
return this.services.resolveDeleteCommand(this.entityName);
|
|
1986
|
+
}
|
|
1987
|
+
resolveDeleteItemsCommand() {
|
|
1988
|
+
return this.services.resolveDeleteItemsCommand(this.entityName);
|
|
1989
|
+
}
|
|
1990
|
+
resolveVersionCommand() {
|
|
1991
|
+
return this.services.resolveVersionCommand(this.entityName);
|
|
1992
|
+
}
|
|
1993
|
+
resolveSampleDownloadCommand() {
|
|
1994
|
+
return this.services.resolveSampleDownloadCommand(this.entityName);
|
|
1995
|
+
}
|
|
1996
|
+
resolveImportCommand() {
|
|
1997
|
+
return this.services.resolveImportCommand(this.entityName);
|
|
1998
|
+
}
|
|
1999
|
+
resolveParseCommand() {
|
|
2000
|
+
return this.services.resolveParseCommand(this.entityName);
|
|
2001
|
+
}
|
|
2002
|
+
resolveExportCommand() {
|
|
2003
|
+
return this.services.resolveExportCommand(this.entityName);
|
|
2004
|
+
}
|
|
2005
|
+
resolveGetAction() {
|
|
2006
|
+
return this.services.resolveGetAction(this.entityName);
|
|
2007
|
+
}
|
|
2008
|
+
resolveExistsAction() {
|
|
2009
|
+
return this.services.resolveExistsAction(this.entityName);
|
|
2010
|
+
}
|
|
2011
|
+
resolveCountAction() {
|
|
2012
|
+
return this.services.resolveCountAction(this.entityName);
|
|
2013
|
+
}
|
|
2014
|
+
resolveSearchAction() {
|
|
2015
|
+
return this.services.resolveSearchAction(this.entityName);
|
|
2016
|
+
}
|
|
2017
|
+
resolveVersionsSearchAction() {
|
|
2018
|
+
return this.services.resolveVersionsSearchAction(this.entityName);
|
|
2019
|
+
}
|
|
2020
|
+
resolveCreateAction() {
|
|
2021
|
+
return this.services.resolveCreateAction(this.entityName);
|
|
2022
|
+
}
|
|
2023
|
+
resolveUpdateAction() {
|
|
2024
|
+
return this.services.resolveUpdateAction(this.entityName);
|
|
2025
|
+
}
|
|
2026
|
+
resolveUpsertAction() {
|
|
2027
|
+
return this.services.resolveUpsertAction(this.entityName);
|
|
2028
|
+
}
|
|
2029
|
+
resolveDeleteAction() {
|
|
2030
|
+
return this.services.resolveDeleteAction(this.entityName);
|
|
2031
|
+
}
|
|
2032
|
+
resolveDeleteItemsAction() {
|
|
2033
|
+
return this.services.resolveDeleteItemsAction(this.entityName);
|
|
2034
|
+
}
|
|
2035
|
+
resolveImportAction() {
|
|
2036
|
+
return this.services.resolveImportAction(this.entityName);
|
|
2037
|
+
}
|
|
2038
|
+
resolveParseAction() {
|
|
2039
|
+
return this.services.resolveParseAction(this.entityName);
|
|
2040
|
+
}
|
|
2041
|
+
resolveSampleDownloadAction() {
|
|
2042
|
+
return this.services.resolveSampleDownloadAction(this.entityName);
|
|
2043
|
+
}
|
|
2044
|
+
resolveExportAction() {
|
|
2045
|
+
return this.services.resolveExportAction(this.entityName);
|
|
2046
|
+
}
|
|
2047
|
+
resolveQueryBuilder() {
|
|
2048
|
+
return this.services.resolveQueryBuilder(this.entityName);
|
|
2049
|
+
}
|
|
2050
|
+
getEntityName() {
|
|
2051
|
+
return this.entityName;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
|
|
1947
2055
|
class EntitiesCountQuery {
|
|
1948
2056
|
constructor(services) {
|
|
1949
2057
|
this.services = services;
|
|
@@ -2500,7 +2608,9 @@ class EntityManagerServiceCollection {
|
|
|
2500
2608
|
this.locator.registerExportCommand(this.entityName, new EntitiesExportCommand(this.resolver, settings));
|
|
2501
2609
|
this.locator.registerExportAction(this.entityName, new EntitiesExportAction(this.resolver));
|
|
2502
2610
|
this.locator.registerImportCommand(this.entityName, new EntitiesImportCommand(this.resolver, settings));
|
|
2611
|
+
this.locator.registerParseCommand(this.entityName, new EntitiesParseCommand(this.resolver, settings));
|
|
2503
2612
|
this.locator.registerImportAction(this.entityName, new EntitiesImportAction(this.resolver));
|
|
2613
|
+
this.locator.registerParseAction(this.entityName, new EntitiesParseAction(this.resolver));
|
|
2504
2614
|
this.locator.registerSampleDownloadCommand(this.entityName, new EntitiesSampleDownloadCommand(this.resolver, settings));
|
|
2505
2615
|
this.locator.registerSampleDownloadAction(this.entityName, new EntitiesSampleDownloadAction(this.resolver));
|
|
2506
2616
|
return this;
|
|
@@ -34707,6 +34817,37 @@ class AppExceptionsFilterBase {
|
|
|
34707
34817
|
}
|
|
34708
34818
|
}
|
|
34709
34819
|
|
|
34820
|
+
class EntityParseValidationError {
|
|
34821
|
+
}
|
|
34822
|
+
__decorate([
|
|
34823
|
+
ApiProperty(),
|
|
34824
|
+
__metadata("design:type", String)
|
|
34825
|
+
], EntityParseValidationError.prototype, "errorCode", void 0);
|
|
34826
|
+
class EntityParseStatus {
|
|
34827
|
+
}
|
|
34828
|
+
__decorate([
|
|
34829
|
+
ApiProperty(),
|
|
34830
|
+
__metadata("design:type", Boolean)
|
|
34831
|
+
], EntityParseStatus.prototype, "isValid", void 0);
|
|
34832
|
+
__decorate([
|
|
34833
|
+
ApiProperty({ type: [EntityParseValidationError] }),
|
|
34834
|
+
__metadata("design:type", Array)
|
|
34835
|
+
], EntityParseStatus.prototype, "validationErrors", void 0);
|
|
34836
|
+
class EntityParseResult {
|
|
34837
|
+
}
|
|
34838
|
+
__decorate([
|
|
34839
|
+
ApiProperty(),
|
|
34840
|
+
__metadata("design:type", Number)
|
|
34841
|
+
], EntityParseResult.prototype, "rowIndex", void 0);
|
|
34842
|
+
__decorate([
|
|
34843
|
+
ApiProperty({ type: Object }),
|
|
34844
|
+
__metadata("design:type", Object)
|
|
34845
|
+
], EntityParseResult.prototype, "item", void 0);
|
|
34846
|
+
__decorate([
|
|
34847
|
+
ApiProperty(),
|
|
34848
|
+
__metadata("design:type", EntityParseStatus)
|
|
34849
|
+
], EntityParseResult.prototype, "status", void 0);
|
|
34850
|
+
|
|
34710
34851
|
const buildCompletedStepsSequence = (step) => {
|
|
34711
34852
|
const steps = [];
|
|
34712
34853
|
let currentStep = step;
|
|
@@ -44167,5 +44308,5 @@ class TestingAppSessionService {
|
|
|
44167
44308
|
}
|
|
44168
44309
|
}
|
|
44169
44310
|
|
|
44170
|
-
export { AUTHENTICATION_EVENTS_NAMESPACE, ApiKeyAccess, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSession, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsBucketModule, AwsDynamoDbModule, AwsEmailModule, AwsJobsModule, AwsS3BucketError, AwsS3BucketProvider, AwsS3MediaError, AwsS3MediaModule, AwsS3MediaProvider, AwsSecretsModule, AwsSecretsProvider, AwsSesEmailTemplate, BucketItemType, CacheService, ConnectorMode, CurrentUser, CustomDiscoveryModule, CustomDiscoveryService, DynamoDbCacheInstance, DynamoDbCollection, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EntitySerializationFormat, EntitySerializer, EntitySnapshotService, EntityVersionOperation, EventsService, ExclusiveOperationResult, FilesManager, IEntityVersionsCursor, InMemoryBucketProvider, InMemoryEmailProvider, InMemoryFileProvider, InMemoryMediaProvider, InMemorySecretsProvider, InvalidCredentialsError, JobConcurrency, JobInstance, JobProviderState, JobRunType, JobSchedule, JobStatus, JobsModule, JobsService, LockNotFoundError, MediaLibraryService, MemberOf, MissingEntityIdError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestEntitySerializer, NestEntitySnapshotService, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationLockService, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, Permissions, PipelineController, PipelineErrorType, PipelineInvocationError, PipelineStatus, PipelineStepErrorType, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, QueryBuilderOperation, ReplicationMode, Roles, SanityMediaError, SanityMediaModule, SanityMediaProvider, SecretsService, SendgridEmailModule, SendgridEmailTemplate, SortDirection, TestingAppSessionService, TrackingService, TypeOrmQueryBuilder, TypeOrmRepository, TypeormCacheInstance, TypeormOperationLockRepository, UserCreationError, UserRegistrationError, WpApiKeysService, WpAppInitializer, WpAwsSesEmailTemplate, WpBucketProvider, WpCacheInstance, WpEmailLogger, WpEmailProvider, WpEmailTemplate, WpEmailTemplateMiddleware, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConnectorMapper, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEntitySerializer, WpEntitySnapshotService, WpEntityVersioningProvider, WpEventsTracker, WpFileProvider, WpFileReferenceRepository, WpGlobalAuthenticationMiddleware, WpMediaFolderRepository, WpMediaProvider, WpMediaReferenceRepository, WpPermissionsService, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, awsBatchSettings, buildPermissionsGuard, buildProviderToken, buildRolesGuard, createContainer, createExpressFileResponse, getEntityManagerProviderToken, getLocalizedText, newUuid, renderHandlebarsTemplate, sessionStorage, toEntitiesImportInput };
|
|
44311
|
+
export { AUTHENTICATION_EVENTS_NAMESPACE, ApiKeyAccess, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSession, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsBucketModule, AwsDynamoDbModule, AwsEmailModule, AwsJobsModule, AwsS3BucketError, AwsS3BucketProvider, AwsS3MediaError, AwsS3MediaModule, AwsS3MediaProvider, AwsSecretsModule, AwsSecretsProvider, AwsSesEmailTemplate, BucketItemType, CacheService, ConnectorMode, CurrentUser, CustomDiscoveryModule, CustomDiscoveryService, DynamoDbCacheInstance, DynamoDbCollection, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntityParseResult, EntityParseValidationError, EntitySeeder, EntitySerializationFormat, EntitySerializer, EntitySnapshotService, EntityVersionOperation, EventsService, ExclusiveOperationResult, FilesManager, IEntityVersionsCursor, InMemoryBucketProvider, InMemoryEmailProvider, InMemoryFileProvider, InMemoryMediaProvider, InMemorySecretsProvider, InvalidCredentialsError, JobConcurrency, JobInstance, JobProviderState, JobRunType, JobSchedule, JobStatus, JobsModule, JobsService, LockNotFoundError, MediaLibraryService, MemberOf, MissingEntityIdError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestEntitySerializer, NestEntitySnapshotService, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationLockService, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, Permissions, PipelineController, PipelineErrorType, PipelineInvocationError, PipelineStatus, PipelineStepErrorType, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, QueryBuilderOperation, ReplicationMode, Roles, SanityMediaError, SanityMediaModule, SanityMediaProvider, SecretsService, SendgridEmailModule, SendgridEmailTemplate, SortDirection, TestingAppSessionService, TrackingService, TypeOrmQueryBuilder, TypeOrmRepository, TypeormCacheInstance, TypeormOperationLockRepository, UserCreationError, UserRegistrationError, WpApiKeysService, WpAppInitializer, WpAwsSesEmailTemplate, WpBucketProvider, WpCacheInstance, WpEmailLogger, WpEmailProvider, WpEmailTemplate, WpEmailTemplateMiddleware, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConnectorMapper, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEntitySerializer, WpEntitySnapshotService, WpEntityVersioningProvider, WpEventsTracker, WpFileProvider, WpFileReferenceRepository, WpGlobalAuthenticationMiddleware, WpMediaFolderRepository, WpMediaProvider, WpMediaReferenceRepository, WpPermissionsService, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, awsBatchSettings, buildPermissionsGuard, buildProviderToken, buildRolesGuard, createContainer, createExpressFileResponse, getEntityManagerProviderToken, getLocalizedText, newUuid, renderHandlebarsTemplate, sessionStorage, toEntitiesImportInput };
|
|
44171
44312
|
//# sourceMappingURL=index.js.map
|