@spytecgps/nova-orm 1.0.64 → 1.0.66
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/entities/airflow/acumaticaExportImeiIccidData copy.d.ts +28 -0
- package/dist/entities/airflow/acumaticaExportImeiIccidData copy.js +147 -0
- package/dist/entities/airflow/acumaticaExportImeiIccidData copy.js.map +1 -0
- package/dist/entities/airflow/acumaticaExportImeiIccidData.d.ts +15 -0
- package/dist/entities/airflow/acumaticaExportImeiIccidData.js +82 -0
- package/dist/entities/airflow/acumaticaExportImeiIccidData.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/novaDataSource.d.ts +2 -2
- package/dist/novaDataSource.js +1 -1
- package/dist/novaDataSource.js.map +1 -1
- package/dist/repositories/acumatica/getAcumaticaImeiIccidData.js +7 -2
- package/dist/repositories/acumatica/getAcumaticaImeiIccidData.js.map +1 -1
- package/dist/repositories/acumatica/getAcumaticaShipmentDetails.js +8 -3
- package/dist/repositories/acumatica/getAcumaticaShipmentDetails.js.map +1 -1
- package/dist/repositories/acumatica/getLastAcumaticaShipmentDetails.js +7 -2
- package/dist/repositories/acumatica/getLastAcumaticaShipmentDetails.js.map +1 -1
- package/dist/repositories/aempToken/getAempTokens.js +10 -3
- package/dist/repositories/aempToken/getAempTokens.js.map +1 -1
- package/dist/repositories/alertTypes/getAlertTypes.js +7 -2
- package/dist/repositories/alertTypes/getAlertTypes.js.map +1 -1
- package/dist/repositories/alerts/getAlertsReportByClient.js +4 -0
- package/dist/repositories/alerts/getAlertsReportByClient.js.map +1 -1
- package/dist/repositories/alerts/getAlertsReportByUser.js +4 -0
- package/dist/repositories/alerts/getAlertsReportByUser.js.map +1 -1
- package/dist/repositories/appFeatures/getClientAppFeatures.js +7 -2
- package/dist/repositories/appFeatures/getClientAppFeatures.js.map +1 -1
- package/dist/repositories/assetCategories/getAssetCategories.d.ts +1 -1
- package/dist/repositories/assetCategories/getAssetCategories.js +14 -4
- package/dist/repositories/assetCategories/getAssetCategories.js.map +1 -1
- package/dist/repositories/assetCategories/index.d.ts +1 -1
- package/dist/repositories/assetCategories/index.js +2 -2
- package/dist/repositories/assetCategories/index.js.map +1 -1
- package/dist/repositories/billing/getBillingCustomerBraintreeById.js +7 -2
- package/dist/repositories/billing/getBillingCustomerBraintreeById.js.map +1 -1
- package/dist/repositories/billing/getBillingDeviceTypePlans.js +9 -4
- package/dist/repositories/billing/getBillingDeviceTypePlans.js.map +1 -1
- package/dist/repositories/billing/getBillingKlarnaOrderByImei.js +7 -2
- package/dist/repositories/billing/getBillingKlarnaOrderByImei.js.map +1 -1
- package/dist/repositories/billing/getBillingPlans.js +7 -2
- package/dist/repositories/billing/getBillingPlans.js.map +1 -1
- package/dist/repositories/billing/getBillingSubscriptionBraintreeByImei.js +7 -2
- package/dist/repositories/billing/getBillingSubscriptionBraintreeByImei.js.map +1 -1
- package/dist/repositories/billing/getBillingSubscriptionsBraintree.js +7 -2
- package/dist/repositories/billing/getBillingSubscriptionsBraintree.js.map +1 -1
- package/dist/repositories/billing/getBillings.js +7 -2
- package/dist/repositories/billing/getBillings.js.map +1 -1
- package/dist/repositories/billing/getCanceledImeis.js +7 -2
- package/dist/repositories/billing/getCanceledImeis.js.map +1 -1
- package/dist/repositories/billing/getCanceledImeisMatchingMagentoData.js +17 -8
- package/dist/repositories/billing/getCanceledImeisMatchingMagentoData.js.map +1 -1
- package/dist/repositories/billing/getChurnStatusByClientId.js +7 -2
- package/dist/repositories/billing/getChurnStatusByClientId.js.map +1 -1
- package/dist/repositories/billing/getClientIdFromBraintreeCustomer.js +7 -2
- package/dist/repositories/billing/getClientIdFromBraintreeCustomer.js.map +1 -1
- package/dist/repositories/billing/getMagentoPlan.js +7 -2
- package/dist/repositories/billing/getMagentoPlan.js.map +1 -1
- package/dist/repositories/billing/getUserByBraintreeCustomerId.js +7 -2
- package/dist/repositories/billing/getUserByBraintreeCustomerId.js.map +1 -1
- package/dist/repositories/blacklist/getBlacklists.js +7 -2
- package/dist/repositories/blacklist/getBlacklists.js.map +1 -1
- package/dist/repositories/bleMeshConfiguration/getBLEMeshConfiguration.js +7 -2
- package/dist/repositories/bleMeshConfiguration/getBLEMeshConfiguration.js.map +1 -1
- package/dist/repositories/boundaries/getBoundariesByClientId.js +13 -7
- package/dist/repositories/boundaries/getBoundariesByClientId.js.map +1 -1
- package/dist/repositories/boundaries/getBoundariesIdsByClientId.js +11 -7
- package/dist/repositories/boundaries/getBoundariesIdsByClientId.js.map +1 -1
- package/dist/repositories/boundaries/getBoundariesReport.js +7 -2
- package/dist/repositories/boundaries/getBoundariesReport.js.map +1 -1
- package/dist/repositories/boundaries/getBoundaryById.js +10 -2
- package/dist/repositories/boundaries/getBoundaryById.js.map +1 -1
- package/dist/repositories/clients/getClient.js +7 -2
- package/dist/repositories/clients/getClient.js.map +1 -1
- package/dist/repositories/clients/getClientConfiguration.js +12 -4
- package/dist/repositories/clients/getClientConfiguration.js.map +1 -1
- package/dist/repositories/clients/getClients.js +7 -2
- package/dist/repositories/clients/getClients.js.map +1 -1
- package/dist/repositories/clients/getCustomerAttribute.js +12 -4
- package/dist/repositories/clients/getCustomerAttribute.js.map +1 -1
- package/dist/repositories/countries/getCountries.js +7 -2
- package/dist/repositories/countries/getCountries.js.map +1 -1
- package/dist/repositories/countries/getCountry.js +7 -2
- package/dist/repositories/countries/getCountry.js.map +1 -1
- package/dist/repositories/deactivations/getDeactivationReasons.js +7 -2
- package/dist/repositories/deactivations/getDeactivationReasons.js.map +1 -1
- package/dist/repositories/deactivations/getLatestDeactivationByImei.js +7 -2
- package/dist/repositories/deactivations/getLatestDeactivationByImei.js.map +1 -1
- package/dist/repositories/deviceBehaviors/getDeviceBehaviorTasks.js +7 -2
- package/dist/repositories/deviceBehaviors/getDeviceBehaviorTasks.js.map +1 -1
- package/dist/repositories/deviceBehaviors/getDeviceBehaviors.js +7 -2
- package/dist/repositories/deviceBehaviors/getDeviceBehaviors.js.map +1 -1
- package/dist/repositories/deviceBehaviors/getDeviceBehaviorsByIds.js +7 -2
- package/dist/repositories/deviceBehaviors/getDeviceBehaviorsByIds.js.map +1 -1
- package/dist/repositories/deviceBehaviors/getDevicesLastBehaviorTask.js +7 -2
- package/dist/repositories/deviceBehaviors/getDevicesLastBehaviorTask.js.map +1 -1
- package/dist/repositories/deviceBehaviors/getLatestDeviceBehaviorTasks.js +15 -7
- package/dist/repositories/deviceBehaviors/getLatestDeviceBehaviorTasks.js.map +1 -1
- package/dist/repositories/devicePairings/getDevicePairings.js +7 -2
- package/dist/repositories/devicePairings/getDevicePairings.js.map +1 -1
- package/dist/repositories/devicePairings/getDevicePairingsByClientId.js +7 -2
- package/dist/repositories/devicePairings/getDevicePairingsByClientId.js.map +1 -1
- package/dist/repositories/devicePairings/getDevicePairingsByImei.js +7 -2
- package/dist/repositories/devicePairings/getDevicePairingsByImei.js.map +1 -1
- package/dist/repositories/deviceStatus/getDeviceStatuses.js +7 -2
- package/dist/repositories/deviceStatus/getDeviceStatuses.js.map +1 -1
- package/dist/repositories/deviceStatus/getDeviceStatusesCount.js +7 -2
- package/dist/repositories/deviceStatus/getDeviceStatusesCount.js.map +1 -1
- package/dist/repositories/devices/allImeisAreActiveForClient.js +7 -2
- package/dist/repositories/devices/allImeisAreActiveForClient.js.map +1 -1
- package/dist/repositories/devices/getCanceledDevicesWithActiveSimCards.js +7 -2
- package/dist/repositories/devices/getCanceledDevicesWithActiveSimCards.js.map +1 -1
- package/dist/repositories/devices/getCarrierStatusUpdatedBefore.js +7 -2
- package/dist/repositories/devices/getCarrierStatusUpdatedBefore.js.map +1 -1
- package/dist/repositories/devices/getClientDeviceSetting.js +7 -2
- package/dist/repositories/devices/getClientDeviceSetting.js.map +1 -1
- package/dist/repositories/devices/getClientDeviceSettings.js +7 -2
- package/dist/repositories/devices/getClientDeviceSettings.js.map +1 -1
- package/dist/repositories/devices/getDevice.js +7 -2
- package/dist/repositories/devices/getDevice.js.map +1 -1
- package/dist/repositories/devices/getDeviceCustomConfig.js +7 -2
- package/dist/repositories/devices/getDeviceCustomConfig.js.map +1 -1
- package/dist/repositories/devices/getDeviceTypeByImei.js +7 -2
- package/dist/repositories/devices/getDeviceTypeByImei.js.map +1 -1
- package/dist/repositories/devices/getDeviceTypes.js +7 -2
- package/dist/repositories/devices/getDeviceTypes.js.map +1 -1
- package/dist/repositories/devices/getDeviceTypesModelsOrderedByDeviceCount.js +7 -2
- package/dist/repositories/devices/getDeviceTypesModelsOrderedByDeviceCount.js.map +1 -1
- package/dist/repositories/devices/getDeviceWithUsersInfo.js +7 -2
- package/dist/repositories/devices/getDeviceWithUsersInfo.js.map +1 -1
- package/dist/repositories/devices/getDevices.js +7 -2
- package/dist/repositories/devices/getDevices.js.map +1 -1
- package/dist/repositories/devices/getDevicesCountByStatus.js +7 -2
- package/dist/repositories/devices/getDevicesCountByStatus.js.map +1 -1
- package/dist/repositories/devices/getFilteredImeisWithStatus.js +7 -2
- package/dist/repositories/devices/getFilteredImeisWithStatus.js.map +1 -1
- package/dist/repositories/devices/getIccidStatus.js +7 -2
- package/dist/repositories/devices/getIccidStatus.js.map +1 -1
- package/dist/repositories/devices/getImeiIccidCarrier.js +7 -2
- package/dist/repositories/devices/getImeiIccidCarrier.js.map +1 -1
- package/dist/repositories/devices/getImeiIccidCarriers.js +7 -2
- package/dist/repositories/devices/getImeiIccidCarriers.js.map +1 -1
- package/dist/repositories/entityTags/searchEntityTags.js +7 -2
- package/dist/repositories/entityTags/searchEntityTags.js.map +1 -1
- package/dist/repositories/firmwares/getDeviceFirmwares.js +27 -20
- package/dist/repositories/firmwares/getDeviceFirmwares.js.map +1 -1
- package/dist/repositories/firmwares/getFirmwareAutoUpgradeBlacklist.js +7 -2
- package/dist/repositories/firmwares/getFirmwareAutoUpgradeBlacklist.js.map +1 -1
- package/dist/repositories/firmwares/getFirmwareUpgradeTasks.js +7 -2
- package/dist/repositories/firmwares/getFirmwareUpgradeTasks.js.map +1 -1
- package/dist/repositories/firmwares/getFirmwareUpgradeTasksCount.js +7 -2
- package/dist/repositories/firmwares/getFirmwareUpgradeTasksCount.js.map +1 -1
- package/dist/repositories/latestUserAppInfo/getLatestUserAppInfo.js +9 -4
- package/dist/repositories/latestUserAppInfo/getLatestUserAppInfo.js.map +1 -1
- package/dist/repositories/liveLinks/getLiveLinkData.js +13 -3
- package/dist/repositories/liveLinks/getLiveLinkData.js.map +1 -1
- package/dist/repositories/liveLinks/getLiveLinkDataCount.js +13 -3
- package/dist/repositories/liveLinks/getLiveLinkDataCount.js.map +1 -1
- package/dist/repositories/liveLinks/getLiveLinks.js +7 -2
- package/dist/repositories/liveLinks/getLiveLinks.js.map +1 -1
- package/dist/repositories/liveLinks/getLiveLinksCount.js +7 -2
- package/dist/repositories/liveLinks/getLiveLinksCount.js.map +1 -1
- package/dist/repositories/notificationRecipients/getNotificationRecipients.js +7 -2
- package/dist/repositories/notificationRecipients/getNotificationRecipients.js.map +1 -1
- package/dist/repositories/positions/getLatestPositionByImei.js +8 -2
- package/dist/repositories/positions/getLatestPositionByImei.js.map +1 -1
- package/dist/repositories/positions/getPositionsByImei.js +8 -2
- package/dist/repositories/positions/getPositionsByImei.js.map +1 -1
- package/dist/repositories/positions/getPositionsReportByClient.js +4 -0
- package/dist/repositories/positions/getPositionsReportByClient.js.map +1 -1
- package/dist/repositories/security/getAllRoles.d.ts +1 -1
- package/dist/repositories/security/getAllRoles.js +14 -4
- package/dist/repositories/security/getAllRoles.js.map +1 -1
- package/dist/repositories/security/getUserRoles.js +13 -5
- package/dist/repositories/security/getUserRoles.js.map +1 -1
- package/dist/repositories/security/getUserRolesByClientId.js +16 -8
- package/dist/repositories/security/getUserRolesByClientId.js.map +1 -1
- package/dist/repositories/security/index.d.ts +1 -1
- package/dist/repositories/security/index.js +2 -2
- package/dist/repositories/security/index.js.map +1 -1
- package/dist/repositories/security/userIsAdminOrOwner.js +14 -9
- package/dist/repositories/security/userIsAdminOrOwner.js.map +1 -1
- package/dist/repositories/security/userIsInRole.js +12 -8
- package/dist/repositories/security/userIsInRole.js.map +1 -1
- package/dist/repositories/tags/searchTags.js +7 -2
- package/dist/repositories/tags/searchTags.js.map +1 -1
- package/dist/repositories/trips/getTripById.d.ts +1 -1
- package/dist/repositories/trips/getTripById.js +12 -6
- package/dist/repositories/trips/getTripById.js.map +1 -1
- package/dist/repositories/trips/getTrips.js +8 -2
- package/dist/repositories/trips/getTrips.js.map +1 -1
- package/dist/repositories/trips/index.d.ts +1 -1
- package/dist/repositories/trips/index.js +2 -2
- package/dist/repositories/trips/index.js.map +1 -1
- package/dist/repositories/userActivations/getLastActivationDevice.js +7 -2
- package/dist/repositories/userActivations/getLastActivationDevice.js.map +1 -1
- package/dist/repositories/userActivations/getUserActivationDevices.js +7 -2
- package/dist/repositories/userActivations/getUserActivationDevices.js.map +1 -1
- package/dist/repositories/userActivations/getUserActivationDevicesByClientId.js +7 -3
- package/dist/repositories/userActivations/getUserActivationDevicesByClientId.js.map +1 -1
- package/dist/repositories/userActivations/getUserActivationMetrics.js +7 -2
- package/dist/repositories/userActivations/getUserActivationMetrics.js.map +1 -1
- package/dist/repositories/userActivations/getUserActivations.js +7 -2
- package/dist/repositories/userActivations/getUserActivations.js.map +1 -1
- package/dist/repositories/userAppIncidents/getUserAppIncidents.js +7 -2
- package/dist/repositories/userAppIncidents/getUserAppIncidents.js.map +1 -1
- package/dist/repositories/userConfigurations/getCustomUserAlertConfiguration.d.ts +2 -1
- package/dist/repositories/userConfigurations/getCustomUserAlertConfiguration.js +7 -2
- package/dist/repositories/userConfigurations/getCustomUserAlertConfiguration.js.map +1 -1
- package/dist/repositories/userConfigurations/getCustomUserAlertConfigurationCount.js +9 -4
- package/dist/repositories/userConfigurations/getCustomUserAlertConfigurationCount.js.map +1 -1
- package/dist/repositories/userConfigurations/getUserAlertConfigurations.js +7 -2
- package/dist/repositories/userConfigurations/getUserAlertConfigurations.js.map +1 -1
- package/dist/repositories/userConfigurations/getUserConfigurations.js +7 -2
- package/dist/repositories/userConfigurations/getUserConfigurations.js.map +1 -1
- package/dist/repositories/userDataDeletionRequests/getUserDataDeletionRequest.js +7 -2
- package/dist/repositories/userDataDeletionRequests/getUserDataDeletionRequest.js.map +1 -1
- package/dist/repositories/userInvitations/getUserInvitationById.js +7 -2
- package/dist/repositories/userInvitations/getUserInvitationById.js.map +1 -1
- package/dist/repositories/userInvitations/getUserInvitations.js +7 -2
- package/dist/repositories/userInvitations/getUserInvitations.js.map +1 -1
- package/dist/repositories/userRatingRequests/getUserRatingRequests.js +7 -2
- package/dist/repositories/userRatingRequests/getUserRatingRequests.js.map +1 -1
- package/dist/repositories/userRegistrationAttempts/getUserRegistrationAttempts.js +7 -2
- package/dist/repositories/userRegistrationAttempts/getUserRegistrationAttempts.js.map +1 -1
- package/dist/types/acumatica.d.ts +4 -3
- package/dist/types/aempToken.d.ts +2 -1
- package/dist/types/alertTypes.d.ts +2 -1
- package/dist/types/appFeatures.d.ts +2 -1
- package/dist/types/billing.d.ts +12 -11
- package/dist/types/blacklist.d.ts +2 -1
- package/dist/types/bleMeshConfiguration.d.ts +2 -1
- package/dist/types/boundaries.d.ts +3 -3
- package/dist/types/clients.d.ts +5 -4
- package/dist/types/clients.js.map +1 -1
- package/dist/types/common.d.ts +3 -3
- package/dist/types/countries.d.ts +3 -2
- package/dist/types/deactivations.d.ts +3 -2
- package/dist/types/deviceBehaviors.d.ts +6 -5
- package/dist/types/devicePairings.d.ts +4 -3
- package/dist/types/deviceStatus.d.ts +3 -2
- package/dist/types/devices.d.ts +17 -17
- package/dist/types/firmwares.d.ts +5 -4
- package/dist/types/firmwares.js.map +1 -1
- package/dist/types/latestUserAppInfo.d.ts +2 -1
- package/dist/types/liveLinks.d.ts +4 -4
- package/dist/types/notificationRecipients.d.ts +2 -1
- package/dist/types/position.d.ts +3 -3
- package/dist/types/security.d.ts +5 -4
- package/dist/types/tasks.d.ts +7 -7
- package/dist/types/user.d.ts +9 -9
- package/dist/types/userActivations.d.ts +6 -5
- package/dist/types/userAppIncidents.d.ts +2 -1
- package/dist/types/userConfigurations.d.ts +3 -3
- package/dist/types/userDataDeletionRequests.d.ts +2 -1
- package/dist/types/userInvitations.d.ts +3 -2
- package/dist/types/userRatingRequests.d.ts +2 -1
- package/dist/types/userRegistrationAttempts.d.ts +2 -1
- package/package.json +1 -1
|
@@ -5,7 +5,9 @@ export const allImeisAreActiveForClient = async (novaDataSource, params, logger)
|
|
|
5
5
|
logger.warn({ params }, 'DevicesRepository::allImeisAreActiveForClient missing required parameters');
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
// Force the query to run on master or slave
|
|
9
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
10
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
9
11
|
const devicesRepository = dataSource.getRepository(Device);
|
|
10
12
|
const queryBuilder = devicesRepository
|
|
11
13
|
.createQueryBuilder('device')
|
|
@@ -18,8 +20,11 @@ export const allImeisAreActiveForClient = async (novaDataSource, params, logger)
|
|
|
18
20
|
.andWhere('device.status = :status', {
|
|
19
21
|
status: DeviceStatus.Active,
|
|
20
22
|
});
|
|
23
|
+
if (queryRunner) {
|
|
24
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
25
|
+
}
|
|
21
26
|
const count = await queryBuilder.getCount();
|
|
22
27
|
return count === params.imeiList.length;
|
|
23
|
-
}, 'DevicesRepository::getDevicesImeis');
|
|
28
|
+
}, 'DevicesRepository::getDevicesImeis', dbQueryRunner);
|
|
24
29
|
};
|
|
25
30
|
//# sourceMappingURL=allImeisAreActiveForClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allImeisAreActiveForClient.js","sourceRoot":"","sources":["../../../src/repositories/devices/allImeisAreActiveForClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"allImeisAreActiveForClient.js","sourceRoot":"","sources":["../../../src/repositories/devices/allImeisAreActiveForClient.ts"],"names":[],"mappings":"AAEA,OA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const getCanceledDevicesWithActiveSimCards = async (novaDataSource, param
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getCanceledDevicesWithActiveSimCards missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const serviceProviderRepository = dataSource.getRepository(ServiceProvider);
|
|
9
11
|
const serviceProviders = await serviceProviderRepository.find();
|
|
10
12
|
const deviceRepository = dataSource.getRepository(Device);
|
|
@@ -28,6 +30,9 @@ export const getCanceledDevicesWithActiveSimCards = async (novaDataSource, param
|
|
|
28
30
|
])
|
|
29
31
|
.orderBy('device.id', 'ASC')
|
|
30
32
|
.limit(params.pagingOptions.limit);
|
|
33
|
+
if (queryRunner) {
|
|
34
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
35
|
+
}
|
|
31
36
|
const result = await queryBuilder.getRawMany();
|
|
32
37
|
return result.map(row => ({
|
|
33
38
|
imei: row.imei,
|
|
@@ -36,6 +41,6 @@ export const getCanceledDevicesWithActiveSimCards = async (novaDataSource, param
|
|
|
36
41
|
carrier: serviceProviders?.find(sp => sp.id === row.carrierId)?.name || 'Unknown Carrier',
|
|
37
42
|
deviceId: row.deviceId,
|
|
38
43
|
}));
|
|
39
|
-
}, 'DevicesRepository::getCanceledDevicesWithActiveSimCards');
|
|
44
|
+
}, 'DevicesRepository::getCanceledDevicesWithActiveSimCards', dbQueryRunner);
|
|
40
45
|
};
|
|
41
46
|
//# sourceMappingURL=getCanceledDevicesWithActiveSimCards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCanceledDevicesWithActiveSimCards.js","sourceRoot":"","sources":["../../../src/repositories/devices/getCanceledDevicesWithActiveSimCards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCanceled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,EAAE;YAC7C,WAAW,EAAE,QAAQ;SACtB,CAAC;aACD,MAAM,CAAC;YACN,qBAAqB;YACrB,uBAAuB;YACvB,6BAA6B;YAC7B,uCAAuC;YACvC,uBAAuB;SACxB,CAAC;aACD,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC;aAC3B,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAEpC,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;QAE9C,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,iBAAiB;YACzF,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC,CAAC,CAAA;IACL,CAAC,EACD,yDAAyD,EACzD,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getCarrierStatusUpdatedBefore = async (novaDataSource, params, logg
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getCarrierStatusUpdatedBefore missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const iccidStatusRepository = dataSource.getRepository(IccidStatus);
|
|
9
11
|
const queryBuilder = iccidStatusRepository
|
|
10
12
|
.createQueryBuilder('iccidStatus')
|
|
@@ -27,6 +29,9 @@ export const getCarrierStatusUpdatedBefore = async (novaDataSource, params, logg
|
|
|
27
29
|
.orderBy('iccidStatus.modifiedAt', 'ASC')
|
|
28
30
|
.addOrderBy('iccidStatus.iccid', 'ASC')
|
|
29
31
|
.limit(params.pagingOptions.limit);
|
|
32
|
+
if (queryRunner) {
|
|
33
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
34
|
+
}
|
|
30
35
|
const result = await queryBuilder.getRawMany();
|
|
31
36
|
return result.map(row => ({
|
|
32
37
|
carrier: row.carrier,
|
|
@@ -36,6 +41,6 @@ export const getCarrierStatusUpdatedBefore = async (novaDataSource, params, logg
|
|
|
36
41
|
carrierFound: row.carrierFound,
|
|
37
42
|
modifiedAt: row.modifiedAt,
|
|
38
43
|
}));
|
|
39
|
-
}, 'DevicesRepository::getCarrierStatusUpdatedBefore');
|
|
44
|
+
}, 'DevicesRepository::getCarrierStatusUpdatedBefore', dbQueryRunner);
|
|
40
45
|
};
|
|
41
46
|
//# sourceMappingURL=getCarrierStatusUpdatedBefore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCarrierStatusUpdatedBefore.js","sourceRoot":"","sources":["../../../src/repositories/devices/getCarrierStatusUpdatedBefore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCarrierStatusUpdatedBefore.js","sourceRoot":"","sources":["../../../src/repositories/devices/getCarrierStatusUpdatedBefore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAK9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,EAChD,cAA8B,EAC9B,MAA2C,EAC3C,MAAc,EACY,EAAE;IAC5B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE;QACjE,MAAM,CAAC,IAAI,CACT,EAAE,M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,MAAM;YAClB,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAChE,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,UAAU,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC,CAAC,CAAA;IACL,CAAC,EACD,kDAAkD,EAClD,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getClientDeviceSetting = async (novaDataSource, params, logger) =>
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getClientDeviceSetting missing required parameters');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const clientDeviceSettingRepository = dataSource.getRepository(ClientDeviceSetting);
|
|
9
11
|
const queryBuilder = clientDeviceSettingRepository
|
|
10
12
|
.createQueryBuilder('clientDeviceSetting')
|
|
@@ -14,8 +16,11 @@ export const getClientDeviceSetting = async (novaDataSource, params, logger) =>
|
|
|
14
16
|
.andWhere('clientDeviceSetting.clientId = :clientId', {
|
|
15
17
|
clientId: params.filters.clientId,
|
|
16
18
|
});
|
|
19
|
+
if (queryRunner) {
|
|
20
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
21
|
+
}
|
|
17
22
|
const result = await queryBuilder.getOne();
|
|
18
23
|
return result;
|
|
19
|
-
}, 'DevicesRepository::getClientDeviceSetting');
|
|
24
|
+
}, 'DevicesRepository::getClientDeviceSetting', dbQueryRunner);
|
|
20
25
|
};
|
|
21
26
|
//# sourceMappingURL=getClientDeviceSetting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClientDeviceSetting.js","sourceRoot":"","sources":["../../../src/repositories/devices/getClientDeviceSetting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getClientDeviceSetting.js","sourceRoot":"","sources":["../../../src/repositories/devices/getClientDeviceSetting.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAKpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,cAA8B,EAC9B,MAAoC,EACpC,MAAc,EACgB,EAAE;IAChC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;QACxD,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,uEAAuE,CAAC,CAAA;QAChG,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAAgC,EAAE;QAC5F,MAAM,6BAA6B,GAAG,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;QAEnF,MAAM,YAAY,GAAG,6BAA6B;aAC/C,kBAAkB,CAAC,qBAAqB,CAAC;aACzC,KAAK,CAAC,kCAAkC,EAAE;YACzC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC;aACD,QAAQ,CAAC,0CAA0C,EAAE;YACpD,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;SAClC,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,2CAA2C,EAC3C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,15 +4,20 @@ export const getClientDeviceSettings = async (novaDataSource, params, logger) =>
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getClientDeviceSettings missing required parameters');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const clientDeviceSettingRepository = dataSource.getRepository(ClientDeviceSetting);
|
|
9
11
|
const queryBuilder = clientDeviceSettingRepository
|
|
10
12
|
.createQueryBuilder('clientDeviceSetting')
|
|
11
13
|
.where('clientDeviceSetting.clientId = :clientId', {
|
|
12
14
|
clientId: params.filters.clientId,
|
|
13
15
|
});
|
|
16
|
+
if (queryRunner) {
|
|
17
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
18
|
+
}
|
|
14
19
|
const result = await queryBuilder.getMany();
|
|
15
20
|
return result;
|
|
16
|
-
}, 'DevicesRepository::getClientDeviceSettings');
|
|
21
|
+
}, 'DevicesRepository::getClientDeviceSettings', dbQueryRunner);
|
|
17
22
|
};
|
|
18
23
|
//# sourceMappingURL=getClientDeviceSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClientDeviceSettings.js","sourceRoot":"","sources":["../../../src/repositories/devices/getClientDeviceSettings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getClientDeviceSettings.js","sourceRoot":"","sources":["../../../src/repositories/devices/getClientDeviceSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAKpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,cAA8B,EAC9B,MAAqC,EACrC,MAAc,EACkB,EAAE;IAClC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,MAAM,CAAC,IAAI,CACT,EAAE,MAAM,EAAE,EACV,wEAAwE,CACzE,CAAA;QACD,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EACH,UAA0B,EAC1B,WAAyB,EACO,EAAE;QAClC,MAAM,6BAA6B,GAAG,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;QAEnF,MAAM,YAAY,GAAG,6BAA6B;aAC/C,kBAAkB,CAAC,qBAAqB,CAAC;aACzC,KAAK,CAAC,0CAA0C,EAAE;YACjD,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;SAClC,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;QAE3C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,4CAA4C,EAC5C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,9 +4,14 @@ export const getDevice = async (novaDataSource, params, logger) => {
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getDevice missing required parameters');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const devicesRepository = dataSource.getRepository(Device);
|
|
9
11
|
let queryBuilder = devicesRepository.createQueryBuilder('device');
|
|
12
|
+
if (queryRunner) {
|
|
13
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
14
|
+
}
|
|
10
15
|
if (params.filters.id) {
|
|
11
16
|
queryBuilder = queryBuilder.where('device.id = :id', {
|
|
12
17
|
id: params.filters.id,
|
|
@@ -29,6 +34,6 @@ export const getDevice = async (novaDataSource, params, logger) => {
|
|
|
29
34
|
}
|
|
30
35
|
const device = await queryBuilder.getOne();
|
|
31
36
|
return device;
|
|
32
|
-
}, 'DevicesRepository::getDevice');
|
|
37
|
+
}, 'DevicesRepository::getDevice', dbQueryRunner);
|
|
33
38
|
};
|
|
34
39
|
//# sourceMappingURL=getDevice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevice.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDevice.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevice.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAK/F,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,cAA8B,EAC9B,MAAuB,EACvB,MAAc,EACG,EAAE;IACnB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QAClD,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,0DAA0D,CAAC,CAAA;QACnF,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAAmB,EAAE;QAC/E,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAE1D,IAAI,YAAY,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QAEjE,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE;YACrB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,iBAAiB,EAAE;gBACnD,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;aACtB,CAAC,CAAA;SACH;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;YACvB,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE;gBAC1D,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC1B,CAAC,CAAA;SACH;QAED,IAAI,MAAM,CAAC,iBAAiB,CAAC,cAAc,EAAE;YAC3C,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAA;SACjF;QAED,IAAI,MAAM,CAAC,iBAAiB,CAAC,gBAAgB,EAAE;YAC7C,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAC3C,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,iCAAiC,CAClC,CAAA;YAED,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAC3C,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,2CAA2C,CAC5C,CAAA;SACF;QAED,IAAI,MAAM,CAAC,iBAAiB,CAAC,wBAAwB,EAAE;YACrD,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAC3C,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,2FAA2F,CAC5F,CAAA;SACF;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,8BAA8B,EAC9B,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,9 +4,14 @@ export const getDeviceCustomConfigs = async (novaDataSource, params, logger) =>
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getDeviceCustomConfig missing required params');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const deviceCustomConfigRepository = dataSource.getRepository(DeviceCustomConfiguration);
|
|
9
11
|
let queryBuilder = deviceCustomConfigRepository.createQueryBuilder('deviceCustomConfiguration');
|
|
12
|
+
if (queryRunner) {
|
|
13
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
14
|
+
}
|
|
10
15
|
if (params?.filters?.imei) {
|
|
11
16
|
queryBuilder = queryBuilder.orWhere(`(LOWER(deviceCustomConfiguration.imei) = LOWER(:imei) AND deviceCustomConfiguration.clientId IS NULL AND (deviceCustomConfiguration.po IS NULL OR deviceCustomConfiguration.po = ''))`, {
|
|
12
17
|
imei: params.filters.imei,
|
|
@@ -33,6 +38,6 @@ export const getDeviceCustomConfigs = async (novaDataSource, params, logger) =>
|
|
|
33
38
|
queryBuilder = queryBuilder.orderBy('deviceCustomConfiguration.id');
|
|
34
39
|
const result = await queryBuilder.getMany();
|
|
35
40
|
return result;
|
|
36
|
-
}, 'DevicesRepository::getDeviceCustomConfig');
|
|
41
|
+
}, 'DevicesRepository::getDeviceCustomConfig', dbQueryRunner);
|
|
37
42
|
};
|
|
38
43
|
//# sourceMappingURL=getDeviceCustomConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceCustomConfig.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceCustomConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDeviceCustomConfig.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceCustomConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAK1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,cAA8B,EAC9B,MAAmC,EACnC,MAAc,EACwB,EAAE;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QAAQ,CAClC,4GAA4G,EAC5G;gBACE,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY;aAC1C,CACF,CAAA;SACF;aAAM;YACL,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAA;SACvF;QAED,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAA;QAEnE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;QAE3C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,0CAA0C,EAC1C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getDeviceTypeByImei = async (novaDataSource, params, logger) => {
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getDeviceTypeByImei - missing imei parameter');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const imeiIccidCarrierRepository = dataSource.getRepository(DeviceType);
|
|
9
11
|
const queryBuilder = imeiIccidCarrierRepository
|
|
10
12
|
.createQueryBuilder('deviceType')
|
|
@@ -12,8 +14,11 @@ export const getDeviceTypeByImei = async (novaDataSource, params, logger) => {
|
|
|
12
14
|
.where(`imeiIccidCarrier.imei = :imei`, {
|
|
13
15
|
imei: params.filters.imei,
|
|
14
16
|
});
|
|
17
|
+
if (queryRunner) {
|
|
18
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
19
|
+
}
|
|
15
20
|
const result = await queryBuilder.getOne();
|
|
16
21
|
return result;
|
|
17
|
-
}, 'DevicesRepository::getDeviceTypeByImei');
|
|
22
|
+
}, 'DevicesRepository::getDeviceTypeByImei', dbQueryRunner);
|
|
18
23
|
};
|
|
19
24
|
//# sourceMappingURL=getDeviceTypeByImei.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceTypeByImei.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypeByImei.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDeviceTypeByImei.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypeByImei.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAK7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,cAA8B,EAC9B,MAAiC,EACjC,MAAc,EACO,EAAE;IACvB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,iEAAiE,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAAuB,EAAE;QACnF,MAAM,0BAA0B,GAAG,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;QAEvE,MAAM,YAAY,GAAG,0BAA0B;aAC5C,kBAAkB,CAAC,YAAY,CAAC;aAChC,SAAS,CACR,gBAAgB,EAChB,kBAAkB,EAClB,+CAA+C,CAChD;aACA,KAAK,CAAC,+BAA+B,EAAE;YACtC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,wCAAwC,EACxC,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { DeviceType, ImeiIccidCarrier } from '../../entities';
|
|
2
2
|
export const getDeviceTypes = async (novaDataSource, params) => {
|
|
3
|
-
|
|
3
|
+
// Force the query to run on master or slave
|
|
4
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
5
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
4
6
|
const deviceTypesRepository = dataSource.getRepository(DeviceType);
|
|
5
7
|
let queryBuilder = deviceTypesRepository.createQueryBuilder('deviceType');
|
|
8
|
+
if (queryRunner) {
|
|
9
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
10
|
+
}
|
|
6
11
|
if (params?.filters?.modelFamily) {
|
|
7
12
|
queryBuilder = queryBuilder.where('deviceType.modelFamily = UPPER(:modelFamily)', {
|
|
8
13
|
modelFamily: params.filters.modelFamily,
|
|
@@ -43,6 +48,6 @@ export const getDeviceTypes = async (novaDataSource, params) => {
|
|
|
43
48
|
queryBuilder = queryBuilder.orderBy('deviceType.id');
|
|
44
49
|
const result = await queryBuilder.getMany();
|
|
45
50
|
return result;
|
|
46
|
-
}, 'DevicesRepository::getDeviceTypes');
|
|
51
|
+
}, 'DevicesRepository::getDeviceTypes', dbQueryRunner);
|
|
47
52
|
};
|
|
48
53
|
//# sourceMappingURL=getDeviceTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceTypes.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDeviceTypes.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAI7D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,cAA8B,EAC9B,MAA4B,EACL,EAAE;IACzB,4CAA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B,CAAC,CAAA;aACH;YAED,IAAI,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;gBAC1B,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,yCAAyC,EAAE;oBAC9E,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;iBAC5B,CAAC,CAAA;aACH;YAED,IAAI,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE;gBAChD,YAAY,GAAG,YAAY;qBACxB,SAAS,CACR,gBAAgB,EAChB,cAAc,EACd,2CAA2C,CAC5C;qBACA,OAAO,CAAC,eAAe,CAAC,CAAA;aAC5B;SACF;QAED,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAEpD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;QAE3C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,mCAAmC,EACnC,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Device, DeviceType } from '../../entities';
|
|
2
2
|
export const getDeviceTypesModelsOrderedByDeviceCount = async (novaDataSource, params) => {
|
|
3
|
-
|
|
3
|
+
// Force the query to run on master or slave
|
|
4
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
5
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
4
6
|
const deviceTypesRepository = dataSource.getRepository(DeviceType);
|
|
5
7
|
let queryBuilder = deviceTypesRepository
|
|
6
8
|
.createQueryBuilder('dt')
|
|
@@ -12,6 +14,9 @@ export const getDeviceTypesModelsOrderedByDeviceCount = async (novaDataSource, p
|
|
|
12
14
|
'dt.protocolMatch as protocolMatch',
|
|
13
15
|
])
|
|
14
16
|
.addSelect('COUNT(d.id)', 'deviceCount');
|
|
17
|
+
if (queryRunner) {
|
|
18
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
19
|
+
}
|
|
15
20
|
if (params?.filters?.deviceStatus) {
|
|
16
21
|
queryBuilder = queryBuilder.where('d.status = :deviceStatus', {
|
|
17
22
|
deviceStatus: params.filters.deviceStatus,
|
|
@@ -23,6 +28,6 @@ export const getDeviceTypesModelsOrderedByDeviceCount = async (novaDataSource, p
|
|
|
23
28
|
...item,
|
|
24
29
|
deviceCount: parseInt(item.deviceCount, 10),
|
|
25
30
|
}));
|
|
26
|
-
}, 'DevicesRepository::getDeviceTypesModelsOrderedByDeviceCount');
|
|
31
|
+
}, 'DevicesRepository::getDeviceTypesModelsOrderedByDeviceCount', dbQueryRunner);
|
|
27
32
|
};
|
|
28
33
|
//# sourceMappingURL=getDeviceTypesModelsOrderedByDeviceCount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceTypesModelsOrderedByDeviceCount.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypesModelsOrderedByDeviceCount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDeviceTypesModelsOrderedByDeviceCount.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceTypesModelsOrderedByDeviceCount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAOnD,MAAM,CAAC,MAAM,wCAAwC,GAAG,KAAK,EAC3D,cAA8B,EAC9B,MAAsD,EACX,EAAE;IAC7C,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IACxE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EACH,UAA0B,EAC1B,WAAyB,EACkB,EAAE;QAC7C,MAAM,qBAAqB,GAAG,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;QAElE,IAAI,YAAY,GAAG,qBAAqB;aACrC,kBAAkB,CAAC,IAAI,CAAC;aACxB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,wBAAwB,CAAC;aAC/C,MAAM,CAAC;YACN,aAAa;YACb,mBAAmB;YACnB,yBAAyB;YACzB,mCAAmC;SACpC,CAAC;aACD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;QAE1C,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,IAAI,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;YACjC,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,0BAA0B,EAAE;gBAC5D,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY;aAC1C,CAAC,CAAA;SACH;QAED,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;QAE3E,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;QAE9C,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACzB,GAAG,IAAI;YACP,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;SAC5C,CAAC,CAAC,CAAA;IACL,CAAC,EACD,6DAA6D,EAC7D,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getDeviceWithUsersInfo = async (novaDataSource, params, logger) =>
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getDeviceWithUsersInfo missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const devicesRepository = dataSource.getRepository(Device);
|
|
9
11
|
const queryBuilder = devicesRepository
|
|
10
12
|
.createQueryBuilder('device')
|
|
@@ -44,6 +46,9 @@ export const getDeviceWithUsersInfo = async (novaDataSource, params, logger) =>
|
|
|
44
46
|
'securityRole.name as roleName',
|
|
45
47
|
'billing.subscriptionId as subscriptionId',
|
|
46
48
|
]);
|
|
49
|
+
if (queryRunner) {
|
|
50
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
51
|
+
}
|
|
47
52
|
const result = await queryBuilder.getRawMany();
|
|
48
53
|
return result.map(item => ({
|
|
49
54
|
...item,
|
|
@@ -55,6 +60,6 @@ export const getDeviceWithUsersInfo = async (novaDataSource, params, logger) =>
|
|
|
55
60
|
smsNotification: item.smsNotification === 1,
|
|
56
61
|
emailNotification: item.emailNotification === 1,
|
|
57
62
|
}));
|
|
58
|
-
}, 'DevicesRepository::getDeviceWithUsersInfo');
|
|
63
|
+
}, 'DevicesRepository::getDeviceWithUsersInfo', dbQueryRunner);
|
|
59
64
|
};
|
|
60
65
|
//# sourceMappingURL=getDeviceWithUsersInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceWithUsersInfo.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceWithUsersInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDeviceWithUsersInfo.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDeviceWithUsersInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAA;AAKvB,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,cAA8B,EAC9B,MAAoC,EACpC,MAAc,EACkB,EAAE;IAClC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,uEAAuE,CAAC,CAAA;QAChG,OAAO,EAAE,CAAA;KACV;IAED,4CAA4C;IAC5C,MAAM,aA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B,6BAA6B;YAC7B,6BAA6B;YAC7B,iDAAiD;YACjD,2DAA2D;YAC3D,+DAA+D;YAC/D,iDAAiD;YACjD,+BAA+B;YAC/B,0CAA0C;SAC3C,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;QAE9C,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACzB,GAAG,IAAI;YACP,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,SAAS;YACnB,UAAU,EACR,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM;gBAC7C,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACtC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE;YAC3C,eAAe,EAAE,IAAI,CAAC,eAAe,KAAK,CAAC;YAC3C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,KAAK,CAAC;SAChD,CAAC,CAAC,CAAA;IACL,CAAC,EACD,2CAA2C,EAC3C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -7,9 +7,14 @@ export const getDevices = async (novaDataSource, params, logger) => {
|
|
|
7
7
|
logger.warn({ params }, 'DevicesRepository::getDevices missing required parameters');
|
|
8
8
|
return [];
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
// Force the query to run on master or slave
|
|
11
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
12
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
11
13
|
const devicesRepository = dataSource.getRepository(Device);
|
|
12
14
|
let queryBuilder = devicesRepository.createQueryBuilder('device');
|
|
15
|
+
if (queryRunner) {
|
|
16
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
17
|
+
}
|
|
13
18
|
if (params.filters.clientId) {
|
|
14
19
|
queryBuilder = queryBuilder.where('device.clientId = :clientId', {
|
|
15
20
|
clientId: params.filters.clientId,
|
|
@@ -51,6 +56,6 @@ export const getDevices = async (novaDataSource, params, logger) => {
|
|
|
51
56
|
}
|
|
52
57
|
const devices = await queryBuilder.getMany();
|
|
53
58
|
return devices;
|
|
54
|
-
}, 'DevicesRepository::getDevices');
|
|
59
|
+
}, 'DevicesRepository::getDevices', dbQueryRunner);
|
|
55
60
|
};
|
|
56
61
|
//# sourceMappingURL=getDevices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevices.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDevices.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevices.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAK/F,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,cAA8B,EAC9B,MAAwB,EACxB,MAAc,EACK,EAAE;IACrB,IACE,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY;QAC9B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ;QAC1B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;QAClC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EACxB;QACA,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,2DAA2D,CAAC,CAAA;QACpF,OAAO,EAAE,CAAA;KACV;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAA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ACd,iCAAiC,CAClC,CAAA;YAED,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAC3C,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,2CAA2C,CAC5C,CAAA;SACF;QAED,IAAI,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,EAAE;YACtD,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAC3C,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,2FAA2F,CAC5F,CAAA;SACF;QAED,IAAI,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;YAClC,YAAY,GAAG,YAAY,CAAC,OAAO,CACjC,UAAU,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,EACxC,MAAM,EAAE,WAAW,EAAE,SAAS,IAAI,KAAK,CACxC,CAAA;SACF;QAED,IAAI,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,EAAE,aAAa,EAAE,QAAQ,IAAI,IAAI,CAAA;YACxD,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;YACjE,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC,CAAA;YAC5D,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;SAC5C;QAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;QAE5C,OAAO,OAAO,CAAA;IAChB,CAAC,EACD,+BAA+B,EAC/B,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getDevicesCountByStatus = async (novaDataSource, params, logger) =>
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getDevicesCountByStatus missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const devicesRepository = dataSource.getRepository(Device);
|
|
9
11
|
const queryBuilder = devicesRepository
|
|
10
12
|
.createQueryBuilder('device')
|
|
@@ -14,8 +16,11 @@ export const getDevicesCountByStatus = async (novaDataSource, params, logger) =>
|
|
|
14
16
|
.groupBy('device.status')
|
|
15
17
|
.select('device.status', 'status')
|
|
16
18
|
.addSelect('COUNT(device.status)', 'count');
|
|
19
|
+
if (queryRunner) {
|
|
20
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
21
|
+
}
|
|
17
22
|
const devicesCountByStatus = await queryBuilder.getRawMany();
|
|
18
23
|
return devicesCountByStatus;
|
|
19
|
-
}, 'DevicesRepository::getDevicesCountByStatus');
|
|
24
|
+
}, 'DevicesRepository::getDevicesCountByStatus', dbQueryRunner);
|
|
20
25
|
};
|
|
21
26
|
//# sourceMappingURL=getDevicesCountByStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevicesCountByStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevicesCountByStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDevicesCountByStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getDevicesCountByStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAKvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,cAA8B,EAC9B,MAAqC,EACrC,MAAc,EACmB,EAAE;IACnC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,MAAM,CAAC,IAAI,CACT,EAAE,MAAM,EAAE,EACV,wEAAwE,CACzE,CAAA;QACD,OAAO,EAAE,CAAA;KACV;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EACH,UAA0B,EAC1B,WAAyB,EACQ,EAAE;QACnC,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAE1D,MAAM,YAAY,GAAG,iBAAiB;aACnC,kBAAkB,CAAC,QAAQ,CAAC;aAC5B,KAAK,CAAC,6BAA6B,EAAE;YACpC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;SAClC,CAAC;aACD,OAAO,CAAC,eAAe,CAAC;aACxB,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC;aACjC,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAA;QAE7C,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,oBAAoB,GAAG,MAAM,YAAY,CAAC,UAAU,EAAwB,CAAA;QAElF,OAAO,oBAAoB,CAAA;IAC7B,CAAC,EACD,4CAA4C,EAC5C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,9 @@ export const getFilteredImeisWithStatus = async (novaDataSource, params, logger)
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getFilteredImeisWithStatus missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const devicesRepository = dataSource.getRepository(Device);
|
|
9
11
|
const queryBuilder = devicesRepository
|
|
10
12
|
.createQueryBuilder('device')
|
|
@@ -14,8 +16,11 @@ export const getFilteredImeisWithStatus = async (novaDataSource, params, logger)
|
|
|
14
16
|
.andWhere('status = :status', {
|
|
15
17
|
status: params.filters.status,
|
|
16
18
|
});
|
|
19
|
+
if (queryRunner) {
|
|
20
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
21
|
+
}
|
|
17
22
|
const imeiList = await queryBuilder.select('imei').getRawMany();
|
|
18
23
|
return imeiList.map(x => x.imei);
|
|
19
|
-
}, 'DevicesRepository::getFilteredImeisWithStatus');
|
|
24
|
+
}, 'DevicesRepository::getFilteredImeisWithStatus', dbQueryRunner);
|
|
20
25
|
};
|
|
21
26
|
//# sourceMappingURL=getFilteredImeisWithStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilteredImeisWithStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getFilteredImeisWithStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getFilteredImeisWithStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getFilteredImeisWithStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAKvC,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,cAA8B,EAC9B,MAAwC,EACxC,MAAc,EACK,EAAE;IACrB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;QAClE,MAAM,CAAC,IAAI,CACT,EAAE,MAAM,EAAE,EACV,2EAA2E,CAC5E,CAAA;QACD,OAAO,EAAE,CAAA;KACV;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAAqB,EAAE;QACjF,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAE1D,MAAM,YAAY,GAAG,iBAAiB;aACnC,kBAAkB,CAAC,QAAQ,CAAC;aAC5B,KAAK,CAAC,wBAAwB,EAAE;YAC/B,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;SAClC,CAAC;aACD,QAAQ,CAAC,kBAAkB,EAAE;YAC5B,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;SAC9B,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAA;QAE/D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC,EACD,+CAA+C,EAC/C,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,15 +4,20 @@ export const getIccidStatus = async (novaDataSource, params, logger) => {
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getIccidStatus missing required parameters');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const iccidStatusRepository = dataSource.getRepository(IccidStatus);
|
|
9
11
|
const queryBuilder = iccidStatusRepository
|
|
10
12
|
.createQueryBuilder('iccidStatus')
|
|
11
13
|
.where('iccidStatus.iccid = :iccid', {
|
|
12
14
|
iccid: params.filters.iccid,
|
|
13
15
|
});
|
|
16
|
+
if (queryRunner) {
|
|
17
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
18
|
+
}
|
|
14
19
|
const result = await queryBuilder.getOne();
|
|
15
20
|
return result;
|
|
16
|
-
}, 'DevicesRepository::getIccidStatus');
|
|
21
|
+
}, 'DevicesRepository::getIccidStatus', dbQueryRunner);
|
|
17
22
|
};
|
|
18
23
|
//# sourceMappingURL=getIccidStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIccidStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getIccidStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getIccidStatus.js","sourceRoot":"","sources":["../../../src/repositories/devices/getIccidStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAK5C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,cAA8B,EAC9B,MAA4B,EAC5B,MAAc,EACQ,EAAE;IACxB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,+DAA+D,CAAC,CAAA;QACxF,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAAwB,EAAE;QACpF,MAAM,qBAAqB,GAAG,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;QAEnE,MAAM,YAAY,GAAG,qBAAqB;aACvC,kBAAkB,CAAC,aAAa,CAAC;aACjC,KAAK,CAAC,4BAA4B,EAAE;YACnC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;SAC5B,CAAC,CAAA;QAEJ,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,mCAAmC,EACnC,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,9 +4,14 @@ export const getImeiIccidCarrier = async (novaDataSource, params, logger) => {
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getImeiIccidCarrier missing required parameters');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const imeiIccidCarrierRepository = dataSource.getRepository(ImeiIccidCarrier);
|
|
9
11
|
let queryBuilder = imeiIccidCarrierRepository.createQueryBuilder('imeiIccidCarrier');
|
|
12
|
+
if (queryRunner) {
|
|
13
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
14
|
+
}
|
|
10
15
|
if (params?.filters?.imei) {
|
|
11
16
|
queryBuilder = queryBuilder.where('imeiIccidCarrier.imei = :imei', {
|
|
12
17
|
imei: params.filters.imei,
|
|
@@ -19,6 +24,6 @@ export const getImeiIccidCarrier = async (novaDataSource, params, logger) => {
|
|
|
19
24
|
}
|
|
20
25
|
const result = await queryBuilder.getOne();
|
|
21
26
|
return result;
|
|
22
|
-
}, 'DevicesRepository::getImeiIccidCarrier');
|
|
27
|
+
}, 'DevicesRepository::getImeiIccidCarrier', dbQueryRunner);
|
|
23
28
|
};
|
|
24
29
|
//# sourceMappingURL=getImeiIccidCarrier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getImeiIccidCarrier.js","sourceRoot":"","sources":["../../../src/repositories/devices/getImeiIccidCarrier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getImeiIccidCarrier.js","sourceRoot":"","sources":["../../../src/repositories/devices/getImeiIccidCarrier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAKjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,cAA8B,EAC9B,MAAiC,EACjC,MAAc,EACa,EAAE;IAC7B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;QACrD,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,oEAAoE,CAAC,CAAA;QAC7F,OAAO,IAAI,CAAA;KACZ;IAED,4CAA4C;IAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAExE,OAAO,cAAc,CAAC,SAAS,CAC7B,KAAK,EAAE,UAA0B,EAAE,WAAyB,EAA6B,EAAE;QACzF,MAAM,0BAA0B,GAAG,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;QAE7E,IAAI,YAAY,GAAG,0BAA0B,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;QAEpF,IAAI,WAAW,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;SACzC;QAED,IAAI,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;YACzB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,+BAA+B,EAAE;gBACjE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC1B,CAAC,CAAA;SACH;QAED,IAAI,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;YAC1B,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,iCAAiC,EAAE;gBACtE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;aAC5B,CAAC,CAAA;SACH;QAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC,EACD,wCAAwC,EACxC,aAAa,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,15 +4,20 @@ export const getImeiIccidCarriers = async (novaDataSource, params, logger) => {
|
|
|
4
4
|
logger.warn({ params }, 'DevicesRepository::getImeiIccidCarriers missing required parameters');
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
// Force the query to run on master or slave
|
|
8
|
+
const dbQueryRunner = novaDataSource.createQueryRunnerFromParams(params);
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource, queryRunner) => {
|
|
8
10
|
const imeiIccidCarrierRepository = dataSource.getRepository(ImeiIccidCarrier);
|
|
9
11
|
const queryBuilder = imeiIccidCarrierRepository
|
|
10
12
|
.createQueryBuilder('imeiIccidCarrier')
|
|
11
13
|
.where('imeiIccidCarrier.imei IN (:...imeiList)', {
|
|
12
14
|
imeiList: params.filters.imeiList,
|
|
13
15
|
});
|
|
16
|
+
if (queryRunner) {
|
|
17
|
+
queryBuilder.setQueryRunner(queryRunner);
|
|
18
|
+
}
|
|
14
19
|
const result = await queryBuilder.getMany();
|
|
15
20
|
return result;
|
|
16
|
-
}, 'DevicesRepository::getImeiIccidCarriers');
|
|
21
|
+
}, 'DevicesRepository::getImeiIccidCarriers', dbQueryRunner);
|
|
17
22
|
};
|
|
18
23
|
//# sourceMappingURL=getImeiIccidCarriers.js.map
|