@golemio/pid 4.3.2-dev.2132352828 → 4.3.2-dev.2136628876
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/integration-engine/data-retention/helpers/SelectRepositoryFactory.js +0 -2
- package/dist/integration-engine/data-retention/helpers/SelectRepositoryFactory.js.map +1 -1
- package/dist/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.d.ts +0 -1
- package/dist/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.js +0 -1
- package/dist/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.d.ts +2 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js +4 -5
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
- package/docs/implementation_documentation.md +2 -2
- package/package.json +1 -1
|
@@ -29,8 +29,6 @@ class SelectRepositoryFactory {
|
|
|
29
29
|
return new CisStopRepository_1.CisStopRepository();
|
|
30
30
|
case RepositoryTableNameEnum_1.RepositoryTableName.StopTimesHistory:
|
|
31
31
|
return new StopTimesHistoryRepository_1.StopTimesHistoryRepository();
|
|
32
|
-
case RepositoryTableNameEnum_1.RepositoryTableName.Descriptor:
|
|
33
|
-
return Di_1.VPContainer.resolve(VPContainerToken_1.VPContainerToken.DescriptorRepository);
|
|
34
32
|
case RepositoryTableNameEnum_1.RepositoryTableName.Metro:
|
|
35
33
|
return new MetroRunsMessagesRepository_1.MetroRunsMessagesRepository();
|
|
36
34
|
case RepositoryTableNameEnum_1.RepositoryTableName.RegionalBus:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectRepositoryFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/data-retention/helpers/SelectRepositoryFactory.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,uDAA2D;AAC3D,mFAA8E;AAC9E,uHAAkH;AAClH,yIAAoI;AACpI,yIAAoI;AACpI,iIAA4H;AAC5H,6EAAwE;AAExE,gHAA6G;AAC7G,8HAA2H;AAC3H,0IAAuI;
|
|
1
|
+
{"version":3,"file":"SelectRepositoryFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/data-retention/helpers/SelectRepositoryFactory.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,uDAA2D;AAC3D,mFAA8E;AAC9E,uHAAkH;AAClH,yIAAoI;AACpI,yIAAoI;AACpI,iIAA4H;AAC5H,6EAAwE;AAExE,gHAA6G;AAC7G,8HAA2H;AAC3H,0IAAuI;AACvI,2HAAwH;AAExH,0FAAmF;AAEnF,MAAa,uBAAuB;IACzB,MAAM,CAAC,IAAyB;QACnC,QAAQ,IAAI,EAAE;YACV,KAAK,6CAAmB,CAAC,KAAK;gBAC1B,OAAO,gBAAW,CAAC,OAAO,CAAkB,mCAAgB,CAAC,cAAc,CAAC,CAAC;YACjF,KAAK,6CAAmB,CAAC,YAAY;gBACjC,OAAO,IAAI,+CAAsB,EAAE,CAAC;YACxC,KAAK,6CAAmB,CAAC,SAAS;gBAC9B,OAAO,IAAI,yCAAmB,EAAE,CAAC;YACrC,KAAK,6CAAmB,CAAC,gBAAgB;gBACrC,OAAO,IAAI,uDAA0B,EAAE,CAAC;YAC5C,KAAK,6CAAmB,CAAC,QAAQ;gBAC7B,OAAO,IAAI,qCAAiB,EAAE,CAAC;YACnC,KAAK,6CAAmB,CAAC,gBAAgB;gBACrC,OAAO,IAAI,uDAA0B,EAAE,CAAC;YAC5C,KAAK,6CAAmB,CAAC,KAAK;gBAC1B,OAAO,IAAI,yDAA2B,EAAE,CAAC;YAC7C,KAAK,6CAAmB,CAAC,WAAW;gBAChC,OAAO,IAAI,qEAAiC,EAAE,CAAC;YACnD,KAAK,6CAAmB,CAAC,UAAU;gBAC/B,OAAO,IAAI,2CAAoB,EAAE,CAAC;YACtC,KAAK,6CAAmB,CAAC,IAAI;gBACzB,OAAO,gBAAW,CAAC,OAAO,CAAuB,2CAAoB,CAAC,mBAAmB,CAAC,CAAC;YAC/F;gBACI,MAAM,IAAI,6BAAY,CAAC,4BAA4B,CAAC,CAAC;SAC5D;IACL,CAAC;IAEM,6BAA6B,CAAC,IAAyB;QAC1D,QAAQ,IAAI,EAAE;YACV,KAAK,6CAAmB,CAAC,KAAK;gBAC1B,OAAO,mBAAmB,CAAC;YAC/B,KAAK,6CAAmB,CAAC,WAAW;gBAChC,OAAO,mBAAmB,CAAC;YAC/B,KAAK,6CAAmB,CAAC,UAAU;gBAC/B,OAAO,oBAAoB,CAAC;YAChC;gBACI,OAAO,EAAE,CAAC;SACjB;IACL,CAAC;CACJ;AAxCD,0DAwCC"}
|
package/dist/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare enum RepositoryTableName {
|
|
|
5
5
|
PositionsHistory = "PositionsHistoryRepository",
|
|
6
6
|
CisStops = "CisStopRepository",
|
|
7
7
|
StopTimesHistory = "StopTimesHistoryRepository",
|
|
8
|
-
Descriptor = "DescriptorRepository",
|
|
9
8
|
Metro = "MetroRunsMessagesRepository",
|
|
10
9
|
RegionalBus = "RegionalBusRunsMessagesRepository",
|
|
11
10
|
CommonRuns = "CommonRunsRepository",
|
|
@@ -9,7 +9,6 @@ var RepositoryTableName;
|
|
|
9
9
|
RepositoryTableName["PositionsHistory"] = "PositionsHistoryRepository";
|
|
10
10
|
RepositoryTableName["CisStops"] = "CisStopRepository";
|
|
11
11
|
RepositoryTableName["StopTimesHistory"] = "StopTimesHistoryRepository";
|
|
12
|
-
RepositoryTableName["Descriptor"] = "DescriptorRepository";
|
|
13
12
|
RepositoryTableName["Metro"] = "MetroRunsMessagesRepository";
|
|
14
13
|
RepositoryTableName["RegionalBus"] = "RegionalBusRunsMessagesRepository";
|
|
15
14
|
RepositoryTableName["CommonRuns"] = "CommonRunsRepository";
|
package/dist/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepositoryTableNameEnum.js","sourceRoot":"","sources":["../../../../../src/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"RepositoryTableNameEnum.js","sourceRoot":"","sources":["../../../../../src/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAWX;AAXD,WAAY,mBAAmB;IAC3B,gDAAyB,CAAA;IACzB,8DAAuC,CAAA;IACvC,wDAAiC,CAAA;IACjC,sEAA+C,CAAA;IAC/C,qDAA8B,CAAA;IAC9B,sEAA+C,CAAA;IAC/C,4DAAqC,CAAA;IACrC,wEAAiD,CAAA;IACjD,0DAAmC,CAAA;IACnC,mDAA4B,CAAA;AAChC,CAAC,EAXW,mBAAmB,mCAAnB,mBAAmB,QAW9B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { GTFSRouteTypeEnum } from "../../../../../helpers/RouteTypeEnums";
|
|
2
2
|
import { DescriptorModel } from "../../../../../schema-definitions/vehicle-descriptors/models";
|
|
3
|
-
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
4
3
|
import { IDescriptorOutputDto } from "../../../../../schema-definitions/vehicle-descriptors/models/interfaces";
|
|
5
4
|
import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
|
|
5
|
+
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
6
6
|
export declare class DescriptorRepository extends PostgresModel implements IModel {
|
|
7
7
|
private logger;
|
|
8
8
|
private static REPOSITORY_NAME;
|
|
9
9
|
constructor(logger: ILogger);
|
|
10
10
|
findAccessDescByRegistrationNumbers(registrationNumbers: number[], gtfsRouteType: GTFSRouteTypeEnum): Promise<DescriptorModel[]>;
|
|
11
|
-
|
|
11
|
+
refreshData(descriptors: IDescriptorOutputDto[]): Promise<void>;
|
|
12
12
|
deleteNHoursOldData: (hours: number) => Promise<number>;
|
|
13
13
|
}
|
|
@@ -37,14 +37,15 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
37
37
|
var DescriptorRepository_1;
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.DescriptorRepository = void 0;
|
|
40
|
+
const RepositoryUtils_1 = require("../../../../shared/RepositoryUtils");
|
|
40
41
|
const const_1 = require("../../../../../schema-definitions/const");
|
|
41
42
|
const models_1 = require("../../../../../schema-definitions/vehicle-descriptors/models");
|
|
43
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
42
44
|
const models_2 = require("@golemio/core/dist/integration-engine/models");
|
|
43
45
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
44
46
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
45
47
|
const sequelize_1 = __importStar(require("@golemio/core/dist/shared/sequelize"));
|
|
46
48
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
47
|
-
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
48
49
|
let DescriptorRepository = exports.DescriptorRepository = DescriptorRepository_1 = class DescriptorRepository extends models_2.PostgresModel {
|
|
49
50
|
constructor(logger) {
|
|
50
51
|
super(DescriptorRepository_1.REPOSITORY_NAME, {
|
|
@@ -83,7 +84,7 @@ let DescriptorRepository = exports.DescriptorRepository = DescriptorRepository_1
|
|
|
83
84
|
throw new golemio_errors_1.GeneralError("findAccessDescByRegistrationNumbers: failed to get descriptors", this.name, err);
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
async
|
|
87
|
+
async refreshData(descriptors) {
|
|
87
88
|
let transaction;
|
|
88
89
|
try {
|
|
89
90
|
await this.validate(descriptors);
|
|
@@ -97,10 +98,8 @@ let DescriptorRepository = exports.DescriptorRepository = DescriptorRepository_1
|
|
|
97
98
|
await transaction?.commit();
|
|
98
99
|
}
|
|
99
100
|
catch (err) {
|
|
100
|
-
const exception = new golemio_errors_1.GeneralError(`[${this.constructor.name}] Could not save data: ${err.message}`, this.constructor.name, err);
|
|
101
|
-
this.logger.error(exception);
|
|
102
101
|
await transaction?.rollback();
|
|
103
|
-
|
|
102
|
+
RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "refreshData");
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptorRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAuC;AACvC,yFAAkE;
|
|
1
|
+
{"version":3,"file":"DescriptorRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAA6D;AAC7D,mEAAuC;AACvC,yFAAkE;AAElE,wEAAqE;AAErE,yEAAqF;AACrF,6EAAwE;AACxE,mFAAkF;AAClF,iFAAiF;AACjF,iEAAwE;AAGjE,IAAM,oBAAoB,2DAA1B,MAAM,oBAAqB,SAAQ,sBAAa;IAGnD,YAAsC,MAAuB;QACzD,KAAK,CACD,sBAAoB,CAAC,eAAe,EACpC;YACI,WAAW,EAAE,wBAAe,CAAC,SAAS;YACtC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,wBAAe,CA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AW,EAAE,CAAC;YACjE,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;YAC9D,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAkB,WAAW,EAAE;gBAC/D,gBAAgB,EAAE,IAAI;gBACtB,SAAS,EAAE,KAAK;gBAChB,WAAW;aACd,CAAC,CAAC;YACH,MAAM,WAAW,EAAE,MAAM,EAAE,CAAC;SAC/B;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,WAAW,EAAE,QAAQ,EAAE,CAAC;YAC9B,iCAAe,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;SAChF;IACL,CAAC;;AAlDc,oCAAe,GAAG,wBAAwB,AAA3B,CAA4B;+BADjD,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GAH5B,oBAAoB,CAkEhC"}
|
|
@@ -41,7 +41,7 @@ let RefreshDescriptorsTask = exports.RefreshDescriptorsTask = class RefreshDescr
|
|
|
41
41
|
this.logger.warn(`${this.queueName}: no descriptors out of ${descriptorsResult.length} were transformed or were filtered out`);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
await this.descriptorRepository.
|
|
44
|
+
await this.descriptorRepository.refreshData(descriptorsFiltered);
|
|
45
45
|
this.logger.info(`${this.queueName}: ${descriptorsFiltered.length}/${descriptorsResult.length} vehicle descriptors were saved`);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshDescriptorsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAA8E;
|
|
1
|
+
{"version":3,"file":"RefreshDescriptorsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAA8E;AAE9E,8EAA0E;AAC1E,6FAA0F;AAC1F,iEAAwE;AACxE,4CAA2C;AAC3C,8EAA2E;AAC3E,4FAA6G;AAE7G,0FAAuF;AAGhF,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,sCAAiB;IAIzD,YAEI,iBAAsD,EAEtD,gBAA2C,EAE3C,oBAAkD,EAElD,wBAA0D,EAC3B,MAAuB;QAEtD,KAAK,CAAC,uBAAW,CAAC,CAAC;QATX,sBAAiB,GAAjB,iBAAiB,CAA6B;QAE9C,qBAAgB,GAAhB,gBAAgB,CAAmB;QAEnC,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,6BAAwB,GAAxB,wBAAwB,CAA0B;QACnB,WAAM,GAAN,MAAM,CAAS;QAZ1C,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAcxD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,gDAAkB,CAAC,cAAc,CAAC,CAAC;QAC3F,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;QACpD,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAChG,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAExG,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,2BAA2B,iBAAiB,CAAC,MAAM,wCAAwC,CAC/G,CAAC;YACF,OAAO;SACV;QAED,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,MAAM,IAAI,iBAAiB,CAAC,MAAM,iCAAiC,CAChH,CAAC;IACN,CAAC;CACJ,CAAA;iCApCY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,2BAA2B,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,gBAAgB,CAAC,CAAA;IAEzC,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,oBAAoB,CAAC,CAAA;IAE7C,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,wBAAwB,CAAC,CAAA;IAEjD,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAPH,yDAA2B,UAIxB,2CAAoB;QAEhB,mDAAwB;GAZrD,sBAAsB,CAoClC"}
|
|
@@ -1126,11 +1126,11 @@ Worker má na starost retenci dat tabulek Azure Table Storage
|
|
|
1126
1126
|
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
1127
1127
|
- žádné
|
|
1128
1128
|
- datové zdroje
|
|
1129
|
-
-
|
|
1129
|
+
- žádné
|
|
1130
1130
|
- transformace
|
|
1131
1131
|
- žádné
|
|
1132
1132
|
- data modely
|
|
1133
|
-
-
|
|
1133
|
+
- podle [`RepositoryTableNameEnum`](../src/integration-engine/data-retention/workers/constants/RepositoryTableNameEnum.ts)
|
|
1134
1134
|
|
|
1135
1135
|
#### _task: TableStorageRetentionTask_
|
|
1136
1136
|
|