@punks/backend-entity-manager 0.0.349 → 0.0.351
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 +322 -170
- 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 +7 -1
- 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 +4 -2
- 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 +321 -171
- 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 +7 -1
- 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 +4 -2
- 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 +568 -486
- 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';
|
|
@@ -178,8 +179,9 @@ class EntitySeeder {
|
|
|
178
179
|
|
|
179
180
|
const DEFAULT_DELIMITER = ";";
|
|
180
181
|
class EntitySerializer {
|
|
181
|
-
constructor(services) {
|
|
182
|
+
constructor(services, options) {
|
|
182
183
|
this.services = services;
|
|
184
|
+
this.options = options;
|
|
183
185
|
this.entityName = services.getEntityName();
|
|
184
186
|
this.logger = Log.getLogger(`${services.getEntityName()} -> Serializer`);
|
|
185
187
|
}
|
|
@@ -210,13 +212,13 @@ class EntitySerializer {
|
|
|
210
212
|
}
|
|
211
213
|
parseCsv(data, definition) {
|
|
212
214
|
const records = csvParse(data, DEFAULT_DELIMITER);
|
|
213
|
-
return records.map((x) => this.convertSheetRecord(x, definition));
|
|
215
|
+
return records.map((x, i) => this.convertSheetRecord(x, definition, i));
|
|
214
216
|
}
|
|
215
217
|
parseXlsx(data, definition) {
|
|
216
218
|
const records = excelParse(data);
|
|
217
|
-
return records.map((x) => this.convertSheetRecord(x, definition));
|
|
219
|
+
return records.map((x, i) => this.convertSheetRecord(x, definition, i));
|
|
218
220
|
}
|
|
219
|
-
convertSheetRecord(record, definition) {
|
|
221
|
+
convertSheetRecord(record, definition, rowIndex) {
|
|
220
222
|
if (!record._type || record._type !== this.entityName) {
|
|
221
223
|
throw new Error(`Invalid record type ${record._type} -> record: \n${JSON.stringify(record)}`);
|
|
222
224
|
}
|
|
@@ -229,10 +231,26 @@ class EntitySerializer {
|
|
|
229
231
|
entity[column.selector] = this.parseColumnValue(record, column);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
234
|
+
const validationErrors = [];
|
|
235
|
+
for (const column of definition.columns) {
|
|
236
|
+
for (const validator of column.validators ?? []) {
|
|
237
|
+
const result = validator.fn((item) => item[column.selector]);
|
|
238
|
+
if (!result.isValid) {
|
|
239
|
+
validationErrors.push({
|
|
240
|
+
errorCode: validator.key,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
232
245
|
const idField = definition.columns.find((x) => x.idColumn || x.selector === "id");
|
|
233
246
|
return {
|
|
234
247
|
id: idField ? entity[idField.selector] : undefined,
|
|
235
248
|
item: entity,
|
|
249
|
+
rowIndex,
|
|
250
|
+
status: {
|
|
251
|
+
isValid: validationErrors.length === 0,
|
|
252
|
+
validationErrors,
|
|
253
|
+
},
|
|
236
254
|
};
|
|
237
255
|
}
|
|
238
256
|
parseColumnValue(row, definition) {
|
|
@@ -255,10 +273,14 @@ class EntitySerializer {
|
|
|
255
273
|
fileName,
|
|
256
274
|
contentType: "text/csv",
|
|
257
275
|
content: Buffer.from(csvBuild([{}], [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
276
|
+
...(this.options?.useTypeColumn
|
|
277
|
+
? [
|
|
278
|
+
{
|
|
279
|
+
name: "_type",
|
|
280
|
+
value: () => this.entityName,
|
|
281
|
+
},
|
|
282
|
+
]
|
|
283
|
+
: []),
|
|
262
284
|
...definition.columns.map((c) => ({
|
|
263
285
|
name: c.name,
|
|
264
286
|
value: () => c.sampleValue ?? "",
|
|
@@ -275,10 +297,14 @@ class EntitySerializer {
|
|
|
275
297
|
data: [{}],
|
|
276
298
|
sheetName: this.entityName,
|
|
277
299
|
columns: [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
300
|
+
...(this.options?.useTypeColumn
|
|
301
|
+
? [
|
|
302
|
+
{
|
|
303
|
+
header: "_type",
|
|
304
|
+
value: () => this.entityName,
|
|
305
|
+
},
|
|
306
|
+
]
|
|
307
|
+
: []),
|
|
282
308
|
...definition.columns.map((c) => ({
|
|
283
309
|
header: c.name,
|
|
284
310
|
value: () => c.sampleValue ?? "",
|
|
@@ -294,6 +320,7 @@ class EntitySerializer {
|
|
|
294
320
|
async serialize(data, format) {
|
|
295
321
|
return await this.buildExportFile(data, format);
|
|
296
322
|
}
|
|
323
|
+
validateSheetItem(item, allItems, context) { }
|
|
297
324
|
async getContext() {
|
|
298
325
|
return (await this.services
|
|
299
326
|
.resolveAuthenticationContextProvider()
|
|
@@ -484,6 +511,19 @@ class EntitiesImportAction {
|
|
|
484
511
|
}
|
|
485
512
|
}
|
|
486
513
|
|
|
514
|
+
class EntitiesParseAction {
|
|
515
|
+
constructor(services) {
|
|
516
|
+
this.services = services;
|
|
517
|
+
this.logger = Log.getLogger(`${services.getEntityName()} -> Import`);
|
|
518
|
+
}
|
|
519
|
+
async execute(input) {
|
|
520
|
+
this.logger.debug("Parse action started", { input });
|
|
521
|
+
const result = await this.services.resolveParseCommand().execute(input);
|
|
522
|
+
this.logger.debug("Parse action completed", { input });
|
|
523
|
+
return result;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
487
527
|
class EntitiesSampleDownloadAction {
|
|
488
528
|
constructor(services) {
|
|
489
529
|
this.services = services;
|
|
@@ -798,6 +838,12 @@ class EntitiesExportCommand {
|
|
|
798
838
|
}
|
|
799
839
|
}
|
|
800
840
|
|
|
841
|
+
var InvalidEntityHandling;
|
|
842
|
+
(function (InvalidEntityHandling) {
|
|
843
|
+
InvalidEntityHandling["Skip"] = "skip";
|
|
844
|
+
InvalidEntityHandling["Fail"] = "fail";
|
|
845
|
+
})(InvalidEntityHandling || (InvalidEntityHandling = {}));
|
|
846
|
+
|
|
801
847
|
class EntitiesImportCommand {
|
|
802
848
|
constructor(services, settings) {
|
|
803
849
|
this.services = services;
|
|
@@ -810,10 +856,19 @@ class EntitiesImportCommand {
|
|
|
810
856
|
fileName: input.file.fileName,
|
|
811
857
|
});
|
|
812
858
|
const importEntities = await this.parseImportFile(input.file.content, input.format);
|
|
813
|
-
|
|
859
|
+
const validEntities = importEntities.filter((x) => x.status.isValid);
|
|
860
|
+
const invalidEntities = importEntities.filter((x) => !x.status.isValid);
|
|
861
|
+
if (invalidEntities.length > 0 &&
|
|
862
|
+
input.options?.invalidEntitiesHandling !== InvalidEntityHandling.Skip) {
|
|
863
|
+
throw new Error(`Cannot import file due to invalid entities: ${invalidEntities
|
|
864
|
+
.map((x) => x.id)
|
|
865
|
+
.join(", ")}`);
|
|
866
|
+
}
|
|
867
|
+
await this.services.resolveSerializer().import(validEntities.map((x) => x.item), input.payload);
|
|
814
868
|
return {
|
|
815
869
|
statistics: {
|
|
816
|
-
importedCount:
|
|
870
|
+
importedCount: validEntities.length,
|
|
871
|
+
skippedCount: invalidEntities.length,
|
|
817
872
|
createdCount: 0,
|
|
818
873
|
unchangedCount: 0,
|
|
819
874
|
updatedCount: 0,
|
|
@@ -839,6 +894,41 @@ class EntitiesImportCommand {
|
|
|
839
894
|
}
|
|
840
895
|
}
|
|
841
896
|
|
|
897
|
+
class EntitiesParseCommand {
|
|
898
|
+
constructor(services, settings) {
|
|
899
|
+
this.services = services;
|
|
900
|
+
this.settings = settings;
|
|
901
|
+
}
|
|
902
|
+
async execute(input) {
|
|
903
|
+
await this.uploadImportFile({
|
|
904
|
+
content: input.file.content,
|
|
905
|
+
contentType: input.file.contentType,
|
|
906
|
+
fileName: input.file.fileName,
|
|
907
|
+
});
|
|
908
|
+
const entries = await this.parseImportFile(input.file.content, input.format);
|
|
909
|
+
return {
|
|
910
|
+
entries,
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
async parseImportFile(content, format) {
|
|
914
|
+
return await this.services.resolveSerializer().parse(content, format);
|
|
915
|
+
}
|
|
916
|
+
async uploadImportFile(file) {
|
|
917
|
+
await this.bucket.fileUpload({
|
|
918
|
+
bucket: this.settings.exportBucket.bucket,
|
|
919
|
+
filePath: this.buildAbsoluteBucketPath(file.fileName),
|
|
920
|
+
content: file.content,
|
|
921
|
+
contentType: file.contentType,
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
buildAbsoluteBucketPath(relativePath) {
|
|
925
|
+
return `${this.settings.exportBucket.rootFolderPath ?? ""}/parsers/${createDayPath$1(new Date())}/${relativePath}`;
|
|
926
|
+
}
|
|
927
|
+
get bucket() {
|
|
928
|
+
return this.services.getRootServices().resolveDefaultBucketProvider();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
842
932
|
class EntitiesSampleDownloadCommand {
|
|
843
933
|
constructor(services, settings) {
|
|
844
934
|
this.services = services;
|
|
@@ -1115,6 +1205,9 @@ class EntityManager {
|
|
|
1115
1205
|
get import() {
|
|
1116
1206
|
return this.services.resolveImportCommand();
|
|
1117
1207
|
}
|
|
1208
|
+
get parse() {
|
|
1209
|
+
return this.services.resolveParseCommand();
|
|
1210
|
+
}
|
|
1118
1211
|
get sampleDownload() {
|
|
1119
1212
|
return this.services.resolveSampleDownloadCommand();
|
|
1120
1213
|
}
|
|
@@ -1159,6 +1252,9 @@ class EntityActions {
|
|
|
1159
1252
|
get import() {
|
|
1160
1253
|
return this.services.resolveImportAction();
|
|
1161
1254
|
}
|
|
1255
|
+
get parse() {
|
|
1256
|
+
return this.services.resolveParseAction();
|
|
1257
|
+
}
|
|
1162
1258
|
get sampleDownload() {
|
|
1163
1259
|
return this.services.resolveSampleDownloadAction();
|
|
1164
1260
|
}
|
|
@@ -1247,6 +1343,7 @@ const EntityServices = {
|
|
|
1247
1343
|
IEntityDeleteAction: "IEntityDeleteAction",
|
|
1248
1344
|
IEntityMergeAction: "IEntityMergeAction",
|
|
1249
1345
|
IEntitiesExportAction: "IEntitiesExportAction",
|
|
1346
|
+
IEntitiesParseAction: "IEntitiesParseAction",
|
|
1250
1347
|
IEntitiesImportAction: "IEntitiesImportAction",
|
|
1251
1348
|
IEntitiesSampleDownloadAction: "IEntitiesSampleDownloadAction",
|
|
1252
1349
|
IEntityVersionsSearchAction: "IEntityVersionsSearchAction",
|
|
@@ -1265,6 +1362,7 @@ const EntityServices = {
|
|
|
1265
1362
|
IEntitiesDeleteCommand: "IEntitiesDeleteCommand",
|
|
1266
1363
|
IEntitiesExportCommand: "IEntitiesExportCommand",
|
|
1267
1364
|
IEntitiesImportCommand: "IEntitiesImportCommand",
|
|
1365
|
+
IEntitiesParseCommand: "IEntitiesParseCommand",
|
|
1268
1366
|
IEntitiesSampleDownloadCommand: "IEntitiesSampleDownloadCommand",
|
|
1269
1367
|
},
|
|
1270
1368
|
Converters: {
|
|
@@ -1345,162 +1443,6 @@ const GlobalServices = {
|
|
|
1345
1443
|
},
|
|
1346
1444
|
};
|
|
1347
1445
|
|
|
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
1446
|
class EntitiesServiceLocator {
|
|
1505
1447
|
constructor(provider) {
|
|
1506
1448
|
this.provider = provider;
|
|
@@ -1852,6 +1794,12 @@ class EntitiesServiceLocator {
|
|
|
1852
1794
|
registerImportCommand(entityName, instance) {
|
|
1853
1795
|
this.provider.registerEntityService(EntityServices.Commands.IEntitiesImportCommand, entityName, instance);
|
|
1854
1796
|
}
|
|
1797
|
+
resolveParseCommand(entityName) {
|
|
1798
|
+
return this.provider.resolveEntityService(EntityServices.Commands.IEntitiesParseCommand, entityName);
|
|
1799
|
+
}
|
|
1800
|
+
registerParseCommand(entityName, instance) {
|
|
1801
|
+
this.provider.registerEntityService(EntityServices.Commands.IEntitiesParseCommand, entityName, instance);
|
|
1802
|
+
}
|
|
1855
1803
|
resolveSampleDownloadCommand(entityName) {
|
|
1856
1804
|
return this.provider.resolveEntityService(EntityServices.Commands.IEntitiesSampleDownloadCommand, entityName);
|
|
1857
1805
|
}
|
|
@@ -1936,6 +1884,12 @@ class EntitiesServiceLocator {
|
|
|
1936
1884
|
registerImportAction(entityName, instance) {
|
|
1937
1885
|
this.provider.registerEntityService(EntityServices.Actions.IEntitiesImportAction, entityName, instance);
|
|
1938
1886
|
}
|
|
1887
|
+
resolveParseAction(entityName) {
|
|
1888
|
+
return this.provider.resolveEntityService(EntityServices.Actions.IEntitiesParseAction, entityName);
|
|
1889
|
+
}
|
|
1890
|
+
registerParseAction(entityName, instance) {
|
|
1891
|
+
this.provider.registerEntityService(EntityServices.Actions.IEntitiesParseAction, entityName, instance);
|
|
1892
|
+
}
|
|
1939
1893
|
resolveQueryBuilder(entityName) {
|
|
1940
1894
|
return this.provider.resolveEntityService(EntityServices.Queries.IEntitiesQueryBuilder, entityName);
|
|
1941
1895
|
}
|
|
@@ -1944,6 +1898,169 @@ class EntitiesServiceLocator {
|
|
|
1944
1898
|
}
|
|
1945
1899
|
}
|
|
1946
1900
|
|
|
1901
|
+
class EntityServiceLocator {
|
|
1902
|
+
constructor(services, entityName) {
|
|
1903
|
+
this.services = services;
|
|
1904
|
+
this.entityName = entityName;
|
|
1905
|
+
}
|
|
1906
|
+
getRootServices() {
|
|
1907
|
+
return this.services;
|
|
1908
|
+
}
|
|
1909
|
+
resolveAuthenticationContextProvider() {
|
|
1910
|
+
return this.services.resolveAuthenticationContextProvider();
|
|
1911
|
+
}
|
|
1912
|
+
resolveEntityManager() {
|
|
1913
|
+
return this.services.resolveEntityManager(this.entityName);
|
|
1914
|
+
}
|
|
1915
|
+
resolveEntityActions() {
|
|
1916
|
+
return this.services.resolveEntityActions(this.entityName);
|
|
1917
|
+
}
|
|
1918
|
+
resolveRepository() {
|
|
1919
|
+
return this.services.resolveRepository(this.entityName);
|
|
1920
|
+
}
|
|
1921
|
+
resolveEventsManager() {
|
|
1922
|
+
return this.services.resolveEventsManager(this.entityName);
|
|
1923
|
+
}
|
|
1924
|
+
resolveVersioningProvider() {
|
|
1925
|
+
return this.services.resolveEntityVersioningProvider();
|
|
1926
|
+
}
|
|
1927
|
+
resolveEntityConfiguration() {
|
|
1928
|
+
return this.services.resolveEntityConfiguration(this.entityName);
|
|
1929
|
+
}
|
|
1930
|
+
resolveReplicaSyncManager() {
|
|
1931
|
+
return this.services.resolveReplicaSyncManager(this.entityName);
|
|
1932
|
+
}
|
|
1933
|
+
resolveReplicaConfiguration() {
|
|
1934
|
+
return this.services.resolveReplicaConfiguration(this.entityName);
|
|
1935
|
+
}
|
|
1936
|
+
resolveReplicaDeleteManager() {
|
|
1937
|
+
return this.services.resolveReplicaDeleteManager(this.entityName);
|
|
1938
|
+
}
|
|
1939
|
+
resolveConnectorSyncManager() {
|
|
1940
|
+
return this.services.resolveConnectorSyncManager(this.entityName);
|
|
1941
|
+
}
|
|
1942
|
+
resolveConnectorDeleteManager() {
|
|
1943
|
+
return this.services.resolveConnectorDeleteManager(this.entityName);
|
|
1944
|
+
}
|
|
1945
|
+
resolveConnectorsConfiguration() {
|
|
1946
|
+
return this.services.resolveConnectorsConfiguration(this.entityName);
|
|
1947
|
+
}
|
|
1948
|
+
resolveConverter() {
|
|
1949
|
+
return this.services.resolveConverter(this.entityName);
|
|
1950
|
+
}
|
|
1951
|
+
resolveSerializer() {
|
|
1952
|
+
return this.services.resolveSerializer(this.entityName);
|
|
1953
|
+
}
|
|
1954
|
+
resolveSnapshotService() {
|
|
1955
|
+
return this.services.resolveSnapshotService(this.entityName);
|
|
1956
|
+
}
|
|
1957
|
+
resolveAdapter() {
|
|
1958
|
+
return this.services.resolveAdapter(this.entityName);
|
|
1959
|
+
}
|
|
1960
|
+
resolveAuthorizationMiddleware() {
|
|
1961
|
+
return this.services.resolveAuthorizationMiddleware(this.entityName);
|
|
1962
|
+
}
|
|
1963
|
+
resolveGetQuery() {
|
|
1964
|
+
return this.services.resolveGetQuery(this.entityName);
|
|
1965
|
+
}
|
|
1966
|
+
resolveExistsQuery() {
|
|
1967
|
+
return this.services.resolveExistsQuery(this.entityName);
|
|
1968
|
+
}
|
|
1969
|
+
resolveCountQuery() {
|
|
1970
|
+
return this.services.resolveCountQuery(this.entityName);
|
|
1971
|
+
}
|
|
1972
|
+
resolveVersionsSearchQuery() {
|
|
1973
|
+
return this.services.resolveVersionsSearchQuery(this.entityName);
|
|
1974
|
+
}
|
|
1975
|
+
resolveSearchQuery() {
|
|
1976
|
+
return this.services.resolveSearchQuery(this.entityName);
|
|
1977
|
+
}
|
|
1978
|
+
resolveFindQuery() {
|
|
1979
|
+
return this.services.resolveFindQuery(this.entityName);
|
|
1980
|
+
}
|
|
1981
|
+
resolveCreateCommand() {
|
|
1982
|
+
return this.services.resolveCreateCommand(this.entityName);
|
|
1983
|
+
}
|
|
1984
|
+
resolveUpdateCommand() {
|
|
1985
|
+
return this.services.resolveUpdateCommand(this.entityName);
|
|
1986
|
+
}
|
|
1987
|
+
resolveUpsertCommand() {
|
|
1988
|
+
return this.services.resolveUpsertCommand(this.entityName);
|
|
1989
|
+
}
|
|
1990
|
+
resolveUpsertByCommand() {
|
|
1991
|
+
return this.services.resolveUpsertByCommand(this.entityName);
|
|
1992
|
+
}
|
|
1993
|
+
resolveDeleteCommand() {
|
|
1994
|
+
return this.services.resolveDeleteCommand(this.entityName);
|
|
1995
|
+
}
|
|
1996
|
+
resolveDeleteItemsCommand() {
|
|
1997
|
+
return this.services.resolveDeleteItemsCommand(this.entityName);
|
|
1998
|
+
}
|
|
1999
|
+
resolveVersionCommand() {
|
|
2000
|
+
return this.services.resolveVersionCommand(this.entityName);
|
|
2001
|
+
}
|
|
2002
|
+
resolveSampleDownloadCommand() {
|
|
2003
|
+
return this.services.resolveSampleDownloadCommand(this.entityName);
|
|
2004
|
+
}
|
|
2005
|
+
resolveImportCommand() {
|
|
2006
|
+
return this.services.resolveImportCommand(this.entityName);
|
|
2007
|
+
}
|
|
2008
|
+
resolveParseCommand() {
|
|
2009
|
+
return this.services.resolveParseCommand(this.entityName);
|
|
2010
|
+
}
|
|
2011
|
+
resolveExportCommand() {
|
|
2012
|
+
return this.services.resolveExportCommand(this.entityName);
|
|
2013
|
+
}
|
|
2014
|
+
resolveGetAction() {
|
|
2015
|
+
return this.services.resolveGetAction(this.entityName);
|
|
2016
|
+
}
|
|
2017
|
+
resolveExistsAction() {
|
|
2018
|
+
return this.services.resolveExistsAction(this.entityName);
|
|
2019
|
+
}
|
|
2020
|
+
resolveCountAction() {
|
|
2021
|
+
return this.services.resolveCountAction(this.entityName);
|
|
2022
|
+
}
|
|
2023
|
+
resolveSearchAction() {
|
|
2024
|
+
return this.services.resolveSearchAction(this.entityName);
|
|
2025
|
+
}
|
|
2026
|
+
resolveVersionsSearchAction() {
|
|
2027
|
+
return this.services.resolveVersionsSearchAction(this.entityName);
|
|
2028
|
+
}
|
|
2029
|
+
resolveCreateAction() {
|
|
2030
|
+
return this.services.resolveCreateAction(this.entityName);
|
|
2031
|
+
}
|
|
2032
|
+
resolveUpdateAction() {
|
|
2033
|
+
return this.services.resolveUpdateAction(this.entityName);
|
|
2034
|
+
}
|
|
2035
|
+
resolveUpsertAction() {
|
|
2036
|
+
return this.services.resolveUpsertAction(this.entityName);
|
|
2037
|
+
}
|
|
2038
|
+
resolveDeleteAction() {
|
|
2039
|
+
return this.services.resolveDeleteAction(this.entityName);
|
|
2040
|
+
}
|
|
2041
|
+
resolveDeleteItemsAction() {
|
|
2042
|
+
return this.services.resolveDeleteItemsAction(this.entityName);
|
|
2043
|
+
}
|
|
2044
|
+
resolveImportAction() {
|
|
2045
|
+
return this.services.resolveImportAction(this.entityName);
|
|
2046
|
+
}
|
|
2047
|
+
resolveParseAction() {
|
|
2048
|
+
return this.services.resolveParseAction(this.entityName);
|
|
2049
|
+
}
|
|
2050
|
+
resolveSampleDownloadAction() {
|
|
2051
|
+
return this.services.resolveSampleDownloadAction(this.entityName);
|
|
2052
|
+
}
|
|
2053
|
+
resolveExportAction() {
|
|
2054
|
+
return this.services.resolveExportAction(this.entityName);
|
|
2055
|
+
}
|
|
2056
|
+
resolveQueryBuilder() {
|
|
2057
|
+
return this.services.resolveQueryBuilder(this.entityName);
|
|
2058
|
+
}
|
|
2059
|
+
getEntityName() {
|
|
2060
|
+
return this.entityName;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
|
|
1947
2064
|
class EntitiesCountQuery {
|
|
1948
2065
|
constructor(services) {
|
|
1949
2066
|
this.services = services;
|
|
@@ -2500,7 +2617,9 @@ class EntityManagerServiceCollection {
|
|
|
2500
2617
|
this.locator.registerExportCommand(this.entityName, new EntitiesExportCommand(this.resolver, settings));
|
|
2501
2618
|
this.locator.registerExportAction(this.entityName, new EntitiesExportAction(this.resolver));
|
|
2502
2619
|
this.locator.registerImportCommand(this.entityName, new EntitiesImportCommand(this.resolver, settings));
|
|
2620
|
+
this.locator.registerParseCommand(this.entityName, new EntitiesParseCommand(this.resolver, settings));
|
|
2503
2621
|
this.locator.registerImportAction(this.entityName, new EntitiesImportAction(this.resolver));
|
|
2622
|
+
this.locator.registerParseAction(this.entityName, new EntitiesParseAction(this.resolver));
|
|
2504
2623
|
this.locator.registerSampleDownloadCommand(this.entityName, new EntitiesSampleDownloadCommand(this.resolver, settings));
|
|
2505
2624
|
this.locator.registerSampleDownloadAction(this.entityName, new EntitiesSampleDownloadAction(this.resolver));
|
|
2506
2625
|
return this;
|
|
@@ -34707,6 +34826,37 @@ class AppExceptionsFilterBase {
|
|
|
34707
34826
|
}
|
|
34708
34827
|
}
|
|
34709
34828
|
|
|
34829
|
+
class EntityParseValidationError {
|
|
34830
|
+
}
|
|
34831
|
+
__decorate([
|
|
34832
|
+
ApiProperty(),
|
|
34833
|
+
__metadata("design:type", String)
|
|
34834
|
+
], EntityParseValidationError.prototype, "errorCode", void 0);
|
|
34835
|
+
class EntityParseStatus {
|
|
34836
|
+
}
|
|
34837
|
+
__decorate([
|
|
34838
|
+
ApiProperty(),
|
|
34839
|
+
__metadata("design:type", Boolean)
|
|
34840
|
+
], EntityParseStatus.prototype, "isValid", void 0);
|
|
34841
|
+
__decorate([
|
|
34842
|
+
ApiProperty({ type: [EntityParseValidationError] }),
|
|
34843
|
+
__metadata("design:type", Array)
|
|
34844
|
+
], EntityParseStatus.prototype, "validationErrors", void 0);
|
|
34845
|
+
class EntityParseResult {
|
|
34846
|
+
}
|
|
34847
|
+
__decorate([
|
|
34848
|
+
ApiProperty(),
|
|
34849
|
+
__metadata("design:type", Number)
|
|
34850
|
+
], EntityParseResult.prototype, "rowIndex", void 0);
|
|
34851
|
+
__decorate([
|
|
34852
|
+
ApiProperty({ type: Object }),
|
|
34853
|
+
__metadata("design:type", Object)
|
|
34854
|
+
], EntityParseResult.prototype, "item", void 0);
|
|
34855
|
+
__decorate([
|
|
34856
|
+
ApiProperty(),
|
|
34857
|
+
__metadata("design:type", EntityParseStatus)
|
|
34858
|
+
], EntityParseResult.prototype, "status", void 0);
|
|
34859
|
+
|
|
34710
34860
|
const buildCompletedStepsSequence = (step) => {
|
|
34711
34861
|
const steps = [];
|
|
34712
34862
|
let currentStep = step;
|
|
@@ -44167,5 +44317,5 @@ class TestingAppSessionService {
|
|
|
44167
44317
|
}
|
|
44168
44318
|
}
|
|
44169
44319
|
|
|
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 };
|
|
44320
|
+
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
44321
|
//# sourceMappingURL=index.js.map
|