hgs-twilio-class-lib 1.1.53 → 1.1.54
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/lib/aws/abstract/ServiceObjectStore.d.ts +9 -0
- package/lib/aws/abstract/ServiceObjectStore.js +10 -1
- package/lib/aws/abstract/ServiceOpenRequest.d.ts +7 -0
- package/lib/aws/abstract/ServiceOpenRequest.js +10 -1
- package/lib/aws/abstract/ServiceRequest.d.ts +3 -0
- package/lib/aws/abstract/ServiceRequest.js +7 -1
- package/lib/aws/abstract/ServiceResource.d.ts +20 -0
- package/lib/aws/abstract/ServiceResource.js +31 -1
- package/lib/aws/abstract/ServiceResourceFactory.d.ts +13 -0
- package/lib/aws/abstract/ServiceResourceFactory.js +14 -1
- package/lib/aws/abstract/ServiceTransaction.d.ts +6 -0
- package/lib/aws/abstract/ServiceTransaction.js +11 -1
- package/lib/aws/impl/AWSAPIConfig.d.ts +14 -0
- package/lib/aws/impl/AWSAPIConfig.js +38 -1
- package/lib/aws/impl/AWSClient.d.ts +5 -0
- package/lib/aws/impl/AWSClient.js +21 -1
- package/lib/aws/impl/AWSConnectAPIConfig.d.ts +17 -0
- package/lib/aws/impl/AWSConnectAPIConfig.js +38 -1
- package/lib/aws/impl/DynamoDB/DynamoOpenRequest.d.ts +18 -0
- package/lib/aws/impl/DynamoDB/DynamoOpenRequest.js +24 -1
- package/lib/aws/impl/DynamoDB/DynamoRequest.d.ts +16 -0
- package/lib/aws/impl/DynamoDB/DynamoRequest.js +21 -1
- package/lib/aws/impl/DynamoDB/DynamoResourse.d.ts +29 -0
- package/lib/aws/impl/DynamoDB/DynamoResourse.js +45 -1
- package/lib/aws/impl/DynamoDB/DynamoServiceFactory.d.ts +16 -0
- package/lib/aws/impl/DynamoDB/DynamoServiceFactory.js +63 -1
- package/lib/aws/impl/DynamoDB/DynamoTable.d.ts +26 -0
- package/lib/aws/impl/DynamoDB/DynamoTable.js +126 -1
- package/lib/aws/impl/DynamoDB/DynamoTransaction.d.ts +21 -0
- package/lib/aws/impl/DynamoDB/DynamoTransaction.js +37 -1
- package/lib/aws/impl/HoopServices/HoopService.d.ts +28 -0
- package/lib/aws/impl/HoopServices/HoopService.js +124 -1
- package/lib/aws/impl/HoopServices/HoopServiceFactory.d.ts +17 -0
- package/lib/aws/impl/HoopServices/HoopServiceFactory.js +53 -1
- package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.d.ts +18 -0
- package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.js +24 -1
- package/lib/aws/impl/HoopServices/HoopServiceResource.d.ts +29 -0
- package/lib/aws/impl/HoopServices/HoopServiceResource.js +46 -1
- package/lib/aws/impl/HoopServices/HoopServiceTransaction.d.ts +22 -0
- package/lib/aws/impl/HoopServices/HoopServiceTransaction.js +37 -1
- package/lib/aws/interface/IDirection.d.ts +2 -0
- package/lib/aws/interface/IDirection.js +2 -1
- package/lib/aws/interface/ILink.d.ts +2 -0
- package/lib/aws/interface/ILink.js +2 -1
- package/lib/aws/interface/IServiceDBOpenRequest.d.ts +3 -0
- package/lib/aws/interface/IServiceDBOpenRequest.js +2 -1
- package/lib/aws/interface/IServiceObjectStore.d.ts +3 -0
- package/lib/aws/interface/IServiceObjectStore.js +2 -1
- package/lib/aws/interface/IServiceObjectStoreParameters.d.ts +4 -0
- package/lib/aws/interface/IServiceObjectStoreParameters.js +2 -1
- package/lib/aws/interface/IServiceRequest.d.ts +3 -0
- package/lib/aws/interface/IServiceRequest.js +2 -1
- package/lib/aws/interface/IServiceResource.d.ts +7 -0
- package/lib/aws/interface/IServiceResource.js +2 -1
- package/lib/aws/interface/IServiceTransation.d.ts +3 -0
- package/lib/aws/interface/IServiceTransation.js +2 -1
- package/lib/aws/interface/ISubResourceUri.d.ts +2 -0
- package/lib/aws/interface/ISubResourceUri.js +2 -1
- package/lib/aws/interface/ISyncItemData.d.ts +0 -0
- package/lib/aws/interface/ISyncItemData.js +1 -1
- package/lib/aws/interface/ISyncObjectStoreParameters.d.ts +0 -0
- package/lib/aws/interface/ISyncObjectStoreParameters.js +1 -1
- package/lib/aws/interface/ISyncTransactionOptions.d.ts +4 -0
- package/lib/aws/interface/ISyncTransactionOptions.js +2 -1
- package/lib/common/abstract/CommonError.d.ts +8 -0
- package/lib/common/abstract/CommonError.js +12 -1
- package/lib/common/abstract/Database.d.ts +44 -0
- package/lib/common/abstract/Database.js +58 -1
- package/lib/common/abstract/DatabaseClient.d.ts +11 -0
- package/lib/common/abstract/DatabaseClient.js +21 -1
- package/lib/common/abstract/DatabaseClientConfig.d.ts +5 -0
- package/lib/common/abstract/DatabaseClientConfig.js +9 -1
- package/lib/common/abstract/DatabaseFactory.d.ts +70 -0
- package/lib/common/abstract/DatabaseFactory.js +32 -1
- package/lib/common/abstract/DatabaseObjectStore.d.ts +29 -0
- package/lib/common/abstract/DatabaseObjectStore.js +13 -1
- package/lib/common/abstract/DatabaseOpenRequest.d.ts +24 -0
- package/lib/common/abstract/DatabaseOpenRequest.js +13 -1
- package/lib/common/abstract/DatabaseRequest.d.ts +21 -0
- package/lib/common/abstract/DatabaseRequest.js +14 -1
- package/lib/common/abstract/DatabaseTransaction.d.ts +22 -0
- package/lib/common/abstract/DatabaseTransaction.js +13 -1
- package/lib/common/abstract/Filter.d.ts +12 -0
- package/lib/common/abstract/Filter.js +30 -1
- package/lib/common/enum/ErrorTypes.d.ts +4 -0
- package/lib/common/enum/ErrorTypes.js +9 -1
- package/lib/common/enum/FilterTypes.d.ts +10 -0
- package/lib/common/enum/FilterTypes.js +14 -1
- package/lib/common/interface/IDatabaesInfo.d.ts +2 -0
- package/lib/common/interface/IDatabaesInfo.js +2 -1
- package/lib/common/interface/IDatabase.d.ts +4 -0
- package/lib/common/interface/IDatabase.js +2 -1
- package/lib/common/interface/IDatabaseClient.d.ts +5 -0
- package/lib/common/interface/IDatabaseClient.js +2 -1
- package/lib/common/interface/IDatabaseConfig.d.ts +8 -0
- package/lib/common/interface/IDatabaseConfig.js +10 -1
- package/lib/common/interface/IDatabaseDBOpenRequest.d.ts +2 -0
- package/lib/common/interface/IDatabaseDBOpenRequest.js +2 -1
- package/lib/common/interface/IDatabaseFactory.d.ts +21 -0
- package/lib/common/interface/IDatabaseFactory.js +2 -1
- package/lib/common/interface/IDatabaseObjectStore.d.ts +2 -0
- package/lib/common/interface/IDatabaseObjectStore.js +2 -1
- package/lib/common/interface/IDatabaseObjectStoreParameters.d.ts +2 -0
- package/lib/common/interface/IDatabaseObjectStoreParameters.js +2 -1
- package/lib/common/interface/IDatabaseRecord.d.ts +2 -0
- package/lib/common/interface/IDatabaseRecord.js +2 -1
- package/lib/common/interface/IDatabaseRequest.d.ts +2 -0
- package/lib/common/interface/IDatabaseRequest.js +2 -1
- package/lib/common/interface/IDatabaseTransaction.d.ts +2 -0
- package/lib/common/interface/IDatabaseTransaction.js +2 -1
- package/lib/common/interface/IDatabaseTransactionOptions.d.ts +2 -0
- package/lib/common/interface/IDatabaseTransactionOptions.js +2 -1
- package/lib/common/interface/IError.d.ts +5 -0
- package/lib/common/interface/IError.js +2 -1
- package/lib/common/interface/IErrorDetails.d.ts +6 -0
- package/lib/common/interface/IErrorDetails.js +2 -1
- package/lib/common/interface/IFilter.d.ts +25 -0
- package/lib/common/interface/IFilter.js +2 -1
- package/lib/common/type/DatabaseReadyType.d.ts +1 -0
- package/lib/common/type/DatabaseReadyType.js +2 -1
- package/lib/common/type/FilterInputType.d.ts +1 -0
- package/lib/common/type/FilterInputType.js +2 -1
- package/lib/common/type/SearchParameterType.d.ts +15 -0
- package/lib/common/type/SearchParameterType.js +3 -1
- package/lib/common/utils/dateFormat.d.ts +1 -0
- package/lib/common/utils/dateFormat.js +58 -1
- package/lib/common/utils/filter.d.ts +1 -0
- package/lib/common/utils/filter.js +99 -1
- package/lib/common/utils/newFilter.d.ts +1 -0
- package/lib/common/utils/newFilter.js +126 -1
- package/lib/common/utils/pagination.d.ts +1 -0
- package/lib/common/utils/pagination.js +9 -1
- package/lib/common/utils/search.d.ts +1 -0
- package/lib/common/utils/search.js +14 -1
- package/lib/common/utils/sort.d.ts +1 -0
- package/lib/common/utils/sort.js +13 -1
- package/lib/config/AWSConfig.d.ts +6 -0
- package/lib/config/AWSConfig.js +9 -1
- package/lib/config/DatabaseConfig.d.ts +33 -0
- package/lib/config/DatabaseConfig.js +36 -1
- package/lib/config/TwilioConfig.d.ts +4 -0
- package/lib/config/TwilioConfig.js +7 -1
- package/lib/controller/Common.d.ts +20 -0
- package/lib/controller/Common.js +57 -1
- package/lib/controller/DatabaseFactoryCollection.d.ts +6 -0
- package/lib/controller/DatabaseFactoryCollection.js +14 -1
- package/lib/controller/MainController.d.ts +6 -0
- package/lib/controller/MainController.js +174 -1
- package/lib/controller/aws/HoopBuisnessHours.d.ts +23 -0
- package/lib/controller/aws/HoopBuisnessHours.js +408 -1
- package/lib/controller/aws/HoopOperationsController.d.ts +9 -0
- package/lib/controller/aws/HoopOperationsController.js +86 -1
- package/lib/controller/aws/HoopOverrideBranchesController.d.ts +7 -0
- package/lib/controller/aws/HoopOverrideBranchesController.js +40 -1
- package/lib/controller/aws/HoopProfilesListController.d.ts +8 -0
- package/lib/controller/aws/HoopProfilesListController.js +61 -1
- package/lib/controller/aws/PlaybackScreenrecordings.d.ts +9 -0
- package/lib/controller/aws/PlaybackScreenrecordings.js +63 -1
- package/lib/controller/twilio/AgentActionsController.d.ts +54 -0
- package/lib/controller/twilio/AgentActionsController.js +177 -1
- package/lib/controller/twilio/AgentScorecardController.d.ts +53 -0
- package/lib/controller/twilio/AgentScorecardController.js +173 -1
- package/lib/controller/twilio/AuditLogController.d.ts +15 -0
- package/lib/controller/twilio/AuditLogController.js +137 -1
- package/lib/controller/twilio/CallLogsController.d.ts +12 -0
- package/lib/controller/twilio/CallLogsController.js +131 -1
- package/lib/controller/twilio/CallbackAndVoicemailController.d.ts +12 -0
- package/lib/controller/twilio/CallbackAndVoicemailController.js +114 -1
- package/lib/controller/twilio/ChannelSettingTaskInfoController.d.ts +11 -0
- package/lib/controller/twilio/ChannelSettingTaskInfoController.js +117 -1
- package/lib/controller/twilio/ChannelSettingsController.d.ts +16 -0
- package/lib/controller/twilio/ChannelSettingsController.js +142 -1
- package/lib/controller/twilio/CxConfigAssetController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigAssetController.js +128 -1
- package/lib/controller/twilio/CxConfigController.d.ts +18 -0
- package/lib/controller/twilio/CxConfigController.js +112 -1
- package/lib/controller/twilio/CxConfigExternalNumbersController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigExternalNumbersController.js +138 -1
- package/lib/controller/twilio/CxConfigOther.d.ts +16 -0
- package/lib/controller/twilio/CxConfigOther.js +128 -1
- package/lib/controller/twilio/CxConfigQueueMenuController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigQueueMenuController.js +129 -1
- package/lib/controller/twilio/CxConfigUIconfigController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigUIconfigController.js +132 -1
- package/lib/controller/twilio/GPMController.d.ts +12 -0
- package/lib/controller/twilio/GPMController.js +151 -1
- package/lib/controller/twilio/HoopBusinessHoursController.d.ts +18 -0
- package/lib/controller/twilio/HoopBusinessHoursController.js +285 -1
- package/lib/controller/twilio/HoopHolidaysController.d.ts +14 -0
- package/lib/controller/twilio/HoopHolidaysController.js +150 -1
- package/lib/controller/twilio/HoopMainController.d.ts +13 -0
- package/lib/controller/twilio/HoopMainController.js +297 -1
- package/lib/controller/twilio/HoopNotesController.d.ts +14 -0
- package/lib/controller/twilio/HoopNotesController.js +149 -1
- package/lib/controller/twilio/HoopOperationsController.d.ts +14 -0
- package/lib/controller/twilio/HoopOperationsController.js +138 -1
- package/lib/controller/twilio/HoopOverrideBranchesController.d.ts +14 -0
- package/lib/controller/twilio/HoopOverrideBranchesController.js +137 -1
- package/lib/controller/twilio/HoopPartialDaysController.d.ts +14 -0
- package/lib/controller/twilio/HoopPartialDaysController.js +150 -1
- package/lib/controller/twilio/HoopProfilesListController.d.ts +14 -0
- package/lib/controller/twilio/HoopProfilesListController.js +147 -1
- package/lib/controller/twilio/NavigationController.d.ts +13 -0
- package/lib/controller/twilio/NavigationController.js +170 -1
- package/lib/controller/twilio/QualityFormsController.d.ts +12 -0
- package/lib/controller/twilio/QualityFormsController.js +129 -1
- package/lib/controller/twilio/QuickLinkController.d.ts +11 -0
- package/lib/controller/twilio/QuickLinkController.js +122 -1
- package/lib/controller/twilio/RealTimeReportQueueDetailsController.d.ts +14 -0
- package/lib/controller/twilio/RealTimeReportQueueDetailsController.js +126 -1
- package/lib/controller/twilio/RealTimeReportsWGDetailsController.d.ts +53 -0
- package/lib/controller/twilio/RealTimeReportsWGDetailsController.js +160 -1
- package/lib/controller/twilio/TaskInfoPanelController.d.ts +15 -0
- package/lib/controller/twilio/TaskInfoPanelController.js +134 -1
- package/lib/controller/twilio/filterImpl/AgentScorecardFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/AgentScorecardFilter.js +52 -1
- package/lib/controller/twilio/filterImpl/AuditLogsFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/AuditLogsFilter.js +89 -1
- package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.js +81 -1
- package/lib/controller/twilio/filterImpl/CallLogsFilter.d.ts +20 -0
- package/lib/controller/twilio/filterImpl/CallLogsFilter.js +101 -1
- package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.js +59 -1
- package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.js +67 -1
- package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.js +52 -1
- package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.d.ts +17 -0
- package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.js +78 -1
- package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.js +51 -1
- package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.js +55 -1
- package/lib/controller/twilio/filterImpl/HoopNotesFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/HoopNotesFilter.js +51 -1
- package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.js +55 -1
- package/lib/controller/twilio/filterImpl/MainFilterService.d.ts +4 -0
- package/lib/controller/twilio/filterImpl/MainFilterService.js +108 -1
- package/lib/controller/twilio/filterImpl/NavigationFilter.d.ts +20 -0
- package/lib/controller/twilio/filterImpl/NavigationFilter.js +90 -1
- package/lib/controller/twilio/filterImpl/QueueDetailsFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/QueueDetailsFilter.js +53 -1
- package/lib/controller/twilio/filterImpl/TaskCompleteFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/TaskCompleteFilter.js +62 -1
- package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.js +52 -1
- package/lib/express/ApiResponse.d.ts +15 -0
- package/lib/express/ApiResponse.js +11 -1
- package/lib/express/RequestValidator.d.ts +50 -0
- package/lib/express/RequestValidator.js +77 -1
- package/lib/express/RequireParamsPicker.d.ts +7 -0
- package/lib/express/RequireParamsPicker.js +14 -1
- package/lib/express/ValidateRequireParameters.d.ts +3 -0
- package/lib/express/ValidateRequireParameters.js +39 -1
- package/lib/index.d.ts +39 -0
- package/lib/index.js +100 -1
- package/lib/models/BatchUpdateSkills.model.d.ts +0 -0
- package/lib/models/BatchUpdateSkills.model.js +11 -1
- package/lib/models/CannedMessage.model.d.ts +4 -0
- package/lib/models/CannedMessage.model.js +1 -1
- package/lib/models/ChannelSettingsTaskInfo.model.d.ts +87 -0
- package/lib/models/ChannelSettingsTaskInfo.model.js +1 -1
- package/lib/models/CustomerFeedback.model.d.ts +9 -0
- package/lib/models/CustomerFeedback.model.js +1 -1
- package/lib/models/Filter.model.d.ts +15 -0
- package/lib/models/Filter.model.js +2 -1
- package/lib/models/Hoop.model.d.ts +9 -0
- package/lib/models/Hoop.model.js +9 -1
- package/lib/models/Navigation.model.d.ts +28 -0
- package/lib/models/Navigation.model.js +8 -1
- package/lib/models/Roles.Model.d.ts +8 -0
- package/lib/models/Roles.Model.js +1 -1
- package/lib/models/abstract/BaseModel.d.ts +17 -0
- package/lib/models/abstract/BaseModel.js +40 -1
- package/lib/models/impl/AgentActionsLogsModel.d.ts +27 -0
- package/lib/models/impl/AgentActionsLogsModel.js +89 -1
- package/lib/models/impl/AgentActionsModel.d.ts +19 -0
- package/lib/models/impl/AgentActionsModel.js +60 -1
- package/lib/models/impl/AgentScorecardModel.d.ts +66 -0
- package/lib/models/impl/AgentScorecardModel.js +282 -1
- package/lib/models/impl/AuditLogsModel.d.ts +31 -0
- package/lib/models/impl/AuditLogsModel.js +146 -1
- package/lib/models/impl/CallLogsModel.d.ts +37 -0
- package/lib/models/impl/CallLogsModel.js +109 -1
- package/lib/models/impl/CallStatisticsModel.d.ts +16 -0
- package/lib/models/impl/CallStatisticsModel.js +52 -1
- package/lib/models/impl/CategoryDetailsModel.d.ts +17 -0
- package/lib/models/impl/CategoryDetailsModel.js +44 -1
- package/lib/models/impl/MemberModel.d.ts +42 -0
- package/lib/models/impl/MemberModel.js +170 -1
- package/lib/models/impl/ModelValidationError.d.ts +6 -0
- package/lib/models/impl/ModelValidationError.js +15 -1
- package/lib/models/impl/NavigationModel.d.ts +39 -0
- package/lib/models/impl/NavigationModel.js +126 -1
- package/lib/models/impl/PerformanceStatisticsModel.d.ts +41 -0
- package/lib/models/impl/PerformanceStatisticsModel.js +129 -1
- package/lib/models/impl/PlaybackScreenrecordings.d.ts +39 -0
- package/lib/models/impl/PlaybackScreenrecordings.js +133 -1
- package/lib/models/impl/ProfileModel.d.ts +23 -0
- package/lib/models/impl/ProfileModel.js +102 -1
- package/lib/models/impl/QualityFormsModel.d.ts +39 -0
- package/lib/models/impl/QualityFormsModel.js +150 -1
- package/lib/models/impl/QuestionDetailsModel.d.ts +39 -0
- package/lib/models/impl/QuestionDetailsModel.js +173 -1
- package/lib/models/impl/QueueDetailsModel.d.ts +63 -0
- package/lib/models/impl/QueueDetailsModel.js +261 -1
- package/lib/models/impl/QueueModel.d.ts +39 -0
- package/lib/models/impl/QueueModel.js +156 -1
- package/lib/models/impl/QuickLinkModel.d.ts +24 -0
- package/lib/models/impl/QuickLinkModel.js +122 -1
- package/lib/models/impl/StatisticsNumberDetailsModel.d.ts +18 -0
- package/lib/models/impl/StatisticsNumberDetailsModel.js +72 -1
- package/lib/models/impl/StatisticsTimeDetailsModel.d.ts +18 -0
- package/lib/models/impl/StatisticsTimeDetailsModel.js +72 -1
- package/lib/models/impl/TaskAttributesModel.d.ts +31 -0
- package/lib/models/impl/TaskAttributesModel.js +108 -1
- package/lib/models/impl/TaskChannelModel.d.ts +15 -0
- package/lib/models/impl/TaskChannelModel.js +69 -1
- package/lib/models/impl/TaskComplete.d.ts +0 -0
- package/lib/models/impl/TaskComplete.js +1 -1
- package/lib/models/impl/TaskInfoPanelModel.d.ts +16 -0
- package/lib/models/impl/TaskInfoPanelModel.js +69 -1
- package/lib/models/impl/TaskModel.d.ts +59 -0
- package/lib/models/impl/TaskModel.js +234 -1
- package/lib/models/impl/WorkGroupDetailsModel.d.ts +63 -0
- package/lib/models/impl/WorkGroupDetailsModel.js +281 -1
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.d.ts +33 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.js +140 -1
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.d.ts +8 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.js +12 -1
- package/lib/models/impl/callbackandvoicemail/CallbackModel.d.ts +19 -0
- package/lib/models/impl/callbackandvoicemail/CallbackModel.js +82 -1
- package/lib/models/impl/callbackandvoicemail/VoicemailModel.d.ts +25 -0
- package/lib/models/impl/callbackandvoicemail/VoicemailModel.js +108 -1
- package/lib/models/impl/channelsettings/ChannelSettingModel.d.ts +68 -0
- package/lib/models/impl/channelsettings/ChannelSettingModel.js +240 -1
- package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.d.ts +31 -0
- package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.js +106 -1
- package/lib/models/impl/channelsettings/TaskInfoAttributeModel.d.ts +25 -0
- package/lib/models/impl/channelsettings/TaskInfoAttributeModel.js +80 -1
- package/lib/models/impl/channelsettings/TaskInfoModel.d.ts +13 -0
- package/lib/models/impl/channelsettings/TaskInfoModel.js +52 -1
- package/lib/models/impl/cxconfig/CxConfigNamespace.d.ts +16 -0
- package/lib/models/impl/cxconfig/CxConfigNamespace.js +20 -1
- package/lib/models/impl/cxconfig/CxConfigUIConfigModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfigUIConfigModel.js +180 -1
- package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.d.ts +24 -0
- package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.js +103 -1
- package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.d.ts +24 -0
- package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.js +149 -1
- package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.js +179 -1
- package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.d.ts +40 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.js +213 -1
- package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.js +159 -1
- package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.d.ts +40 -0
- package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.js +128 -1
- package/lib/models/impl/hoop/HoopBusinessHoursModel.d.ts +39 -0
- package/lib/models/impl/hoop/HoopBusinessHoursModel.js +122 -1
- package/lib/models/impl/hoop/HoopDescriptionModel.d.ts +16 -0
- package/lib/models/impl/hoop/HoopDescriptionModel.js +64 -1
- package/lib/models/impl/hoop/HoopHolidaysImplModel.d.ts +25 -0
- package/lib/models/impl/hoop/HoopHolidaysImplModel.js +118 -1
- package/lib/models/impl/hoop/HoopNotesImplModel.d.ts +25 -0
- package/lib/models/impl/hoop/HoopNotesImplModel.js +117 -1
- package/lib/models/impl/hoop/HoopOperationsImplModel.d.ts +28 -0
- package/lib/models/impl/hoop/HoopOperationsImplModel.js +161 -1
- package/lib/models/impl/hoop/HoopOverrideImplModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopOverrideImplModel.js +143 -1
- package/lib/models/impl/hoop/HoopPartialDaysImplModel.d.ts +31 -0
- package/lib/models/impl/hoop/HoopPartialDaysImplModel.js +140 -1
- package/lib/models/impl/hoop/HoopProfilesListImplModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopProfilesListImplModel.js +104 -1
- package/lib/models/impl/hoop/HoopWeeklyTimingModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopWeeklyTimingModel.js +86 -1
- package/lib/models/index.d.ts +25 -0
- package/lib/models/index.js +53 -1
- package/lib/models/interface/IBaseModel.d.ts +11 -0
- package/lib/models/interface/IBaseModel.js +2 -1
- package/lib/models/types/AgentScorecard.type.d.ts +6 -0
- package/lib/models/types/AgentScorecard.type.js +7 -1
- package/lib/models/types/AuditLog.type.d.ts +13 -0
- package/lib/models/types/AuditLog.type.js +10 -1
- package/lib/models/types/CallLog.type.d.ts +16 -0
- package/lib/models/types/CallLog.type.js +10 -1
- package/lib/models/types/ChannelSetting.type.d.ts +7 -0
- package/lib/models/types/ChannelSetting.type.js +11 -1
- package/lib/models/types/CxConfig.type.d.ts +72 -0
- package/lib/models/types/CxConfig.type.js +43 -1
- package/lib/models/types/Hoop.type.d.ts +9 -0
- package/lib/models/types/Hoop.type.js +13 -1
- package/lib/models/types/Navigation.type.d.ts +11 -0
- package/lib/models/types/Navigation.type.js +8 -1
- package/lib/models/types/Profile.type.d.ts +1 -0
- package/lib/models/types/Profile.type.js +2 -1
- package/lib/models/types/QueueDetails.type.d.ts +6 -0
- package/lib/models/types/QueueDetails.type.js +7 -1
- package/lib/models/types/TaskComplete.type.d.ts +7 -0
- package/lib/models/types/TaskComplete.type.js +6 -1
- package/lib/models/types/TaskInfoPanel.type.d.ts +6 -0
- package/lib/models/types/TaskInfoPanel.type.js +7 -1
- package/lib/server.d.ts +1 -0
- package/lib/server.js +39 -1
- package/lib/twilio/abstract/ServiceObjectStore.d.ts +6 -0
- package/lib/twilio/abstract/ServiceObjectStore.js +10 -1
- package/lib/twilio/abstract/ServiceOpenRequest.d.ts +7 -0
- package/lib/twilio/abstract/ServiceOpenRequest.js +10 -1
- package/lib/twilio/abstract/ServiceRequest.d.ts +3 -0
- package/lib/twilio/abstract/ServiceRequest.js +7 -1
- package/lib/twilio/abstract/ServiceResource.d.ts +23 -0
- package/lib/twilio/abstract/ServiceResource.js +37 -1
- package/lib/twilio/abstract/ServiceResourceFactory.d.ts +15 -0
- package/lib/twilio/abstract/ServiceResourceFactory.js +18 -1
- package/lib/twilio/abstract/ServiceTransaction.d.ts +6 -0
- package/lib/twilio/abstract/ServiceTransaction.js +11 -1
- package/lib/twilio/abstract/SyncServiceItemResource.d.ts +31 -0
- package/lib/twilio/abstract/SyncServiceItemResource.js +60 -1
- package/lib/twilio/abstract/TwilioClientConfig.d.ts +0 -0
- package/lib/twilio/abstract/TwilioClientConfig.js +1 -1
- package/lib/twilio/impl/TwilioAPIKeyConfig.d.ts +14 -0
- package/lib/twilio/impl/TwilioAPIKeyConfig.js +31 -1
- package/lib/twilio/impl/TwilioAuthTokenConfig.d.ts +11 -0
- package/lib/twilio/impl/TwilioAuthTokenConfig.js +24 -1
- package/lib/twilio/impl/TwilioClient.d.ts +6 -0
- package/lib/twilio/impl/TwilioClient.js +21 -1
- package/lib/twilio/impl/message/messageService.d.ts +0 -0
- package/lib/twilio/impl/message/messageService.js +42 -1
- package/lib/twilio/impl/sync/SyncDocument.d.ts +24 -0
- package/lib/twilio/impl/sync/SyncDocument.js +52 -1
- package/lib/twilio/impl/sync/SyncDocumentTransaction.d.ts +20 -0
- package/lib/twilio/impl/sync/SyncDocumentTransaction.js +31 -1
- package/lib/twilio/impl/sync/SyncList.d.ts +24 -0
- package/lib/twilio/impl/sync/SyncList.js +52 -1
- package/lib/twilio/impl/sync/SyncListItem.d.ts +5 -0
- package/lib/twilio/impl/sync/SyncListItem.js +22 -1
- package/lib/twilio/impl/sync/SyncListTransaction.d.ts +20 -0
- package/lib/twilio/impl/sync/SyncListTransaction.js +31 -1
- package/lib/twilio/impl/sync/SyncMap.d.ts +25 -0
- package/lib/twilio/impl/sync/SyncMap.js +139 -1
- package/lib/twilio/impl/sync/SyncMapItem.d.ts +5 -0
- package/lib/twilio/impl/sync/SyncMapItem.js +7 -1
- package/lib/twilio/impl/sync/SyncMapTransaction.d.ts +22 -0
- package/lib/twilio/impl/sync/SyncMapTransaction.js +38 -1
- package/lib/twilio/impl/sync/SyncOpenRequest.d.ts +18 -0
- package/lib/twilio/impl/sync/SyncOpenRequest.js +24 -1
- package/lib/twilio/impl/sync/SyncRequest.d.ts +16 -0
- package/lib/twilio/impl/sync/SyncRequest.js +21 -1
- package/lib/twilio/impl/sync/SyncResource.d.ts +50 -0
- package/lib/twilio/impl/sync/SyncResource.js +97 -1
- package/lib/twilio/impl/sync/SyncServiceFactory.d.ts +22 -0
- package/lib/twilio/impl/sync/SyncServiceFactory.js +117 -1
- package/lib/twilio/interface/IDirection.d.ts +2 -0
- package/lib/twilio/interface/IDirection.js +2 -1
- package/lib/twilio/interface/ILink.d.ts +2 -0
- package/lib/twilio/interface/ILink.js +2 -1
- package/lib/twilio/interface/IServiceDBOpenRequest.d.ts +3 -0
- package/lib/twilio/interface/IServiceDBOpenRequest.js +2 -1
- package/lib/twilio/interface/IServiceObjectStore.d.ts +3 -0
- package/lib/twilio/interface/IServiceObjectStore.js +2 -1
- package/lib/twilio/interface/IServiceObjectStoreParameters.d.ts +4 -0
- package/lib/twilio/interface/IServiceObjectStoreParameters.js +2 -1
- package/lib/twilio/interface/IServiceRequest.d.ts +3 -0
- package/lib/twilio/interface/IServiceRequest.js +2 -1
- package/lib/twilio/interface/IServiceResource.d.ts +8 -0
- package/lib/twilio/interface/IServiceResource.js +2 -1
- package/lib/twilio/interface/IServiceTransation.d.ts +3 -0
- package/lib/twilio/interface/IServiceTransation.js +2 -1
- package/lib/twilio/interface/ISubResourceUri.d.ts +2 -0
- package/lib/twilio/interface/ISubResourceUri.js +2 -1
- package/lib/twilio/interface/ISyncItemData.d.ts +0 -0
- package/lib/twilio/interface/ISyncItemData.js +1 -1
- package/lib/twilio/interface/ISyncObjectStoreParameters.d.ts +0 -0
- package/lib/twilio/interface/ISyncObjectStoreParameters.js +1 -1
- package/lib/twilio/interface/ISyncTransactionOptions.d.ts +4 -0
- package/lib/twilio/interface/ISyncTransactionOptions.js +2 -1
- package/package.json +9 -5
- package/lib/models/abstract/BaseModelOld.js +0 -1
|
@@ -1 +1,408 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.HoopBusinessHoursControllerAConnect = void 0;
|
|
16
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
17
|
+
const HoopProfilesListController_1 = require("./HoopProfilesListController");
|
|
18
|
+
const HoopOverrideBranchesController_1 = require("./HoopOverrideBranchesController");
|
|
19
|
+
const HoopOperationsController_1 = require("./HoopOperationsController");
|
|
20
|
+
const HoopBusinessHoursModel_1 = require("../../models/impl/hoop/HoopBusinessHoursModel");
|
|
21
|
+
const HoopDescriptionModel_1 = require("../../models/impl/hoop/HoopDescriptionModel");
|
|
22
|
+
const HoopWeeklyTimingModel_1 = require("../../models/impl/hoop/HoopWeeklyTimingModel");
|
|
23
|
+
const Hoop_type_1 = require("../../models/types/Hoop.type");
|
|
24
|
+
class HoopBusinessHoursControllerAConnect {
|
|
25
|
+
constructor(dbFactory) {
|
|
26
|
+
this._dbFactory = dbFactory;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Method to get business hours based on the profile ID.
|
|
30
|
+
* @param query - Object containing the profileName and instanceId
|
|
31
|
+
* @returns - Business hours status
|
|
32
|
+
*/
|
|
33
|
+
getBusinessHours(query) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
// Initialize HoopBusinessHoursModel
|
|
37
|
+
const scheduleInfo = new HoopBusinessHoursModel_1.HoopBusinessHoursModel(true, // isOpen
|
|
38
|
+
false, // isHoliday
|
|
39
|
+
false, // isPartialDay
|
|
40
|
+
true, // isRegularDay
|
|
41
|
+
new HoopDescriptionModel_1.HoopDescriptionModel("", "", ""), // Description
|
|
42
|
+
{}, // Override branches
|
|
43
|
+
[], // Weekly timing
|
|
44
|
+
"", // Weekly timing string
|
|
45
|
+
new Date(Date.now()), // reopen timing string
|
|
46
|
+
"EST" // Time zone
|
|
47
|
+
);
|
|
48
|
+
// Initialize necessary controllers for fetching data
|
|
49
|
+
const profilesListController = new HoopProfilesListController_1.HoopProfilesListControllerAConnect(this._dbFactory);
|
|
50
|
+
const profileInfo = yield profilesListController.get({
|
|
51
|
+
instanceId: query.instanceId,
|
|
52
|
+
});
|
|
53
|
+
const profile = profileInfo.find((p) => p.profileName === query.profileName);
|
|
54
|
+
if (!profile) {
|
|
55
|
+
throw new Error(`Profile with name '${query.profileName}' not found.`);
|
|
56
|
+
}
|
|
57
|
+
const operationsController = new HoopOperationsController_1.HoopOperationsControllerAConnect(this._dbFactory);
|
|
58
|
+
const operationHours = yield operationsController.getAll({
|
|
59
|
+
instanceId: query.instanceId,
|
|
60
|
+
hoursOfOperationId: profile.profileId,
|
|
61
|
+
itemsPerPage: 0,
|
|
62
|
+
pageNo: 0,
|
|
63
|
+
});
|
|
64
|
+
const overridesController = new HoopOverrideBranchesController_1.HoopOverrideBranchesControllerAConnect(this._dbFactory);
|
|
65
|
+
const overrides = yield overridesController.getAll({
|
|
66
|
+
instanceId: query.instanceId,
|
|
67
|
+
hoursOfOperationId: profile.profileId,
|
|
68
|
+
itemsPerPage: 0,
|
|
69
|
+
pageNo: 0,
|
|
70
|
+
});
|
|
71
|
+
const timeZone = operationHours.length > 0 ? operationHours[0].timeZone : "EST";
|
|
72
|
+
const currentDay = new Date()
|
|
73
|
+
.toLocaleString("en-US", { timeZone: timeZone, weekday: "long" })
|
|
74
|
+
.toUpperCase();
|
|
75
|
+
const currentDate = moment_timezone_1.default.tz(scheduleInfo.timeZone).format("YYYY-MM-DD");
|
|
76
|
+
const weeklyTimings = operationHours.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const weeklyTiming = new HoopWeeklyTimingModel_1.HoopWeeklyTimingModel(item.day, item.day, yield this.formatTime(item.beginTime), yield this.formatTime(item.endTime), item.day);
|
|
78
|
+
// Validate weeklyTiming
|
|
79
|
+
if (weeklyTiming.validationMessages.length > 0) {
|
|
80
|
+
throw weeklyTiming.validationMessages; // Throw error if data validation fails
|
|
81
|
+
}
|
|
82
|
+
// Serialize weeklyTiming
|
|
83
|
+
return weeklyTiming.serialize;
|
|
84
|
+
}));
|
|
85
|
+
const resolvedWeeklyTimings = yield Promise.all(weeklyTimings);
|
|
86
|
+
const groupedTimings = yield this.groupWeeklyTimings(resolvedWeeklyTimings);
|
|
87
|
+
scheduleInfo.weeklyTiming = groupedTimings;
|
|
88
|
+
yield this.evaluateTodayBusinessHours(currentDay, operationHours, scheduleInfo, currentDate);
|
|
89
|
+
const HoursOfOperationOverrideList = overrides.result.HoursOfOperationOverrideList;
|
|
90
|
+
// Check overrides for current
|
|
91
|
+
for (const overridesItem of HoursOfOperationOverrideList) {
|
|
92
|
+
if ((0, moment_timezone_1.default)(currentDate).isBetween(overridesItem.EffectiveFrom, overridesItem.EffectiveTill, null, "[]")) {
|
|
93
|
+
scheduleInfo.isOpen = false;
|
|
94
|
+
scheduleInfo.isRegularDay = false;
|
|
95
|
+
const HoopDescription = new HoopDescriptionModel_1.HoopDescriptionModel(overridesItem.Name, "00:00:00", "00:00:00");
|
|
96
|
+
if (HoopDescription.validationMessages.length > 0) {
|
|
97
|
+
throw HoopDescription.validationMessages; // Throw error if data validation fails
|
|
98
|
+
}
|
|
99
|
+
scheduleInfo.description =
|
|
100
|
+
HoopDescription.serialize;
|
|
101
|
+
if (overridesItem.Config.length > 0) {
|
|
102
|
+
overridesItem["LastModifiedTime"] =
|
|
103
|
+
overrides.result.LastModifiedTime;
|
|
104
|
+
const OverrideOperationHours = yield operationsController.mapOperations(overridesItem.Config, scheduleInfo.timeZone, overridesItem);
|
|
105
|
+
yield this.evaluateTodayBusinessHours(currentDay, OverrideOperationHours, scheduleInfo, currentDate);
|
|
106
|
+
scheduleInfo.isRegularDay = false;
|
|
107
|
+
}
|
|
108
|
+
scheduleInfo.description.hoopDesc = overridesItem.Name;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (scheduleInfo.validationMessages.length > 0) {
|
|
112
|
+
throw scheduleInfo.validationMessages;
|
|
113
|
+
}
|
|
114
|
+
scheduleInfo.weeklyTimingString = yield this.generateBusinessHoursString(scheduleInfo.weeklyTiming, scheduleInfo.timeZone);
|
|
115
|
+
if (scheduleInfo.isOpen === false) {
|
|
116
|
+
const reOpenTiming = yield this.findNextReopeningDate(moment_timezone_1.default.tz(scheduleInfo.timeZone), scheduleInfo.timeZone, resolvedWeeklyTimings, HoursOfOperationOverrideList);
|
|
117
|
+
scheduleInfo.reopenTiming = reOpenTiming.toDate();
|
|
118
|
+
}
|
|
119
|
+
const businessHours = scheduleInfo.serialize;
|
|
120
|
+
return businessHours;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
// Log and return the error if an exception occurs
|
|
124
|
+
return error;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
formatTime(time) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
return time.toISOString().slice(11, 19); // Extracts the time portion (HH:MM:SS)
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
evaluateTodayBusinessHours(currentDay, operationHours, scheduleInfo, currentDate) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
const todayEntries = operationHours.filter((hour) => hour.day === currentDay);
|
|
136
|
+
if (todayEntries.length > 0) {
|
|
137
|
+
scheduleInfo.timeZone = todayEntries[0].timeZone;
|
|
138
|
+
let isWithinWorkingHours = false;
|
|
139
|
+
var isBeforeBeginTime = true;
|
|
140
|
+
for (const entry of todayEntries) {
|
|
141
|
+
const beginTime = moment_timezone_1.default.utc(entry.beginTime.toISOString()).format();
|
|
142
|
+
const endTime = moment_timezone_1.default.utc(entry.endTime.toISOString()).format();
|
|
143
|
+
const currentTime = (0, moment_timezone_1.default)().tz(entry.timeZone).format();
|
|
144
|
+
var isBeforeBeginTime = currentTime < beginTime ? true : currentTime > beginTime;
|
|
145
|
+
const isCurrentTimeWithinRange = currentTime >= beginTime && currentTime <= endTime;
|
|
146
|
+
isWithinWorkingHours = isWithinWorkingHours || isCurrentTimeWithinRange;
|
|
147
|
+
const description = new HoopDescriptionModel_1.HoopDescriptionModel(isCurrentTimeWithinRange
|
|
148
|
+
? "Normal Business Hours"
|
|
149
|
+
: "Out of Business Hours", yield this.formatTime(entry.beginTime), yield this.formatTime(entry.endTime));
|
|
150
|
+
if (description.validationMessages.length > 0)
|
|
151
|
+
throw description.validationMessages;
|
|
152
|
+
scheduleInfo.description =
|
|
153
|
+
description.serialize;
|
|
154
|
+
if (isCurrentTimeWithinRange)
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
scheduleInfo.isOpen = isWithinWorkingHours;
|
|
158
|
+
scheduleInfo.isRegularDay = true;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
scheduleInfo.isOpen = false;
|
|
162
|
+
scheduleInfo.isRegularDay = false;
|
|
163
|
+
const description = new HoopDescriptionModel_1.HoopDescriptionModel("Out of Business Hours", "00:00:00", "00:00:00");
|
|
164
|
+
if (description.validationMessages.length > 0)
|
|
165
|
+
throw description.validationMessages;
|
|
166
|
+
scheduleInfo.description = description.serialize;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
groupWeeklyTimings(weeklyTiming) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
const dayOrder = Object.keys(Hoop_type_1.AvailableDay)
|
|
173
|
+
.filter((key) => isNaN(Number(key))) // Filter out numeric keys (if any)
|
|
174
|
+
.map((key) => key.toUpperCase());
|
|
175
|
+
// Sort the input by day order and startTime
|
|
176
|
+
const sortedTiming = [...weeklyTiming].sort((a, b) => {
|
|
177
|
+
const dayComparison = dayOrder.indexOf(a.startDay.toUpperCase()) -
|
|
178
|
+
dayOrder.indexOf(b.startDay.toUpperCase());
|
|
179
|
+
if (dayComparison === 0) {
|
|
180
|
+
// If startDay is the same, sort by startTime
|
|
181
|
+
return a.startTime.localeCompare(b.startTime);
|
|
182
|
+
}
|
|
183
|
+
return dayComparison;
|
|
184
|
+
});
|
|
185
|
+
return sortedTiming.reduce((result, current) => {
|
|
186
|
+
const lastGroup = result[result.length - 1];
|
|
187
|
+
// If there is a last group and it matches the current timing
|
|
188
|
+
if (lastGroup &&
|
|
189
|
+
lastGroup.startTime === current.startTime &&
|
|
190
|
+
lastGroup.endTime === current.endTime &&
|
|
191
|
+
dayOrder.indexOf(current.startDay) ===
|
|
192
|
+
dayOrder.indexOf(lastGroup.endDay) + 1) {
|
|
193
|
+
// Extend the last group's endDay and description
|
|
194
|
+
lastGroup.endDay = current.endDay;
|
|
195
|
+
lastGroup.description = `${lastGroup.startDay}-${lastGroup.endDay}`;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// Start a new group
|
|
199
|
+
const HoopWeeklyTiming = new HoopWeeklyTimingModel_1.HoopWeeklyTimingModel(current.startDay, current.endDay, current.startTime, current.endTime, current.startDay);
|
|
200
|
+
if (HoopWeeklyTiming.validationMessages.length > 0) {
|
|
201
|
+
throw HoopWeeklyTiming.validationMessages;
|
|
202
|
+
}
|
|
203
|
+
result.push(HoopWeeklyTiming.serialize);
|
|
204
|
+
}
|
|
205
|
+
return result;
|
|
206
|
+
}, []);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
generateBusinessHoursString(weeklyTimings, timeZone) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
const formatTime = (time) => {
|
|
212
|
+
let [hours, minutes] = time.split(":");
|
|
213
|
+
let period = parseInt(hours) >= 12 ? "PM" : "AM";
|
|
214
|
+
if (parseInt(hours) > 12) {
|
|
215
|
+
hours = (parseInt(hours) - 12).toString().padStart(2, "0");
|
|
216
|
+
}
|
|
217
|
+
else if (parseInt(hours) === 0) {
|
|
218
|
+
hours = "12";
|
|
219
|
+
}
|
|
220
|
+
return `${hours}:${minutes} ${period}`;
|
|
221
|
+
};
|
|
222
|
+
return weeklyTimings
|
|
223
|
+
.map((item) => {
|
|
224
|
+
if (item.startDay === item.endDay) {
|
|
225
|
+
return `${item.startDay} from ${formatTime(item.startTime)} to ${formatTime(item.endTime)} ${timeZone}`;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
return `${item.startDay} through ${item.endDay} from ${formatTime(item.startTime)} to ${formatTime(item.endTime)} ${timeZone}`;
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
.join(", ");
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
findNextReopeningDate(currentDate, timeZone, weeklySchedule, holidayOverrides) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
// Check if the weekly schedule is empty
|
|
237
|
+
if (!weeklySchedule || weeklySchedule.length === 0) {
|
|
238
|
+
throw new Error("Weekly schedule is empty. Cannot determine the next reopening date.");
|
|
239
|
+
}
|
|
240
|
+
let dayOffset = 0;
|
|
241
|
+
let potentialReopeningDate = currentDate;
|
|
242
|
+
let overrideReopeningDate = "";
|
|
243
|
+
const currentDayName = currentDate.format("dddd").toUpperCase();
|
|
244
|
+
let targetDayName = potentialReopeningDate.format("dddd").toUpperCase();
|
|
245
|
+
while (true) {
|
|
246
|
+
const matchingWeeklySchedule = weeklySchedule.find((item) => item.startDay === targetDayName);
|
|
247
|
+
if (matchingWeeklySchedule) {
|
|
248
|
+
const holidayCheckResult = yield this.checkHolidayOverride(potentialReopeningDate, holidayOverrides, timeZone);
|
|
249
|
+
if (holidayCheckResult) {
|
|
250
|
+
if (holidayCheckResult.nextOpeningDay &&
|
|
251
|
+
holidayCheckResult.hasReopeningTime === true) {
|
|
252
|
+
overrideReopeningDate = holidayCheckResult.nextOpeningDay;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
else if (holidayCheckResult.nextOpeningDay &&
|
|
256
|
+
holidayCheckResult.hasReopeningTime === false) {
|
|
257
|
+
potentialReopeningDate = holidayCheckResult.nextOpeningDay;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
potentialReopeningDate = moment_timezone_1.default
|
|
261
|
+
.tz(potentialReopeningDate, timeZone)
|
|
262
|
+
.add(1, "days");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
const fetchCurrentDays = weeklySchedule.filter((item) => item.startDay ===
|
|
267
|
+
potentialReopeningDate.format("dddd").toUpperCase());
|
|
268
|
+
const checkTimingForToday = yield this.checkTimingsForToday(potentialReopeningDate, fetchCurrentDays, timeZone);
|
|
269
|
+
if (checkTimingForToday) {
|
|
270
|
+
overrideReopeningDate = checkTimingForToday;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
potentialReopeningDate = moment_timezone_1.default
|
|
275
|
+
.tz(potentialReopeningDate, timeZone)
|
|
276
|
+
.add(1, "days");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
potentialReopeningDate = moment_timezone_1.default
|
|
282
|
+
.tz(currentDate, timeZone)
|
|
283
|
+
.add(dayOffset, "days");
|
|
284
|
+
targetDayName = potentialReopeningDate.format("dddd").toUpperCase(); // Update day in uppercase
|
|
285
|
+
const holidayCheckResult = yield this.checkHolidayOverride(potentialReopeningDate, holidayOverrides, timeZone);
|
|
286
|
+
if (holidayCheckResult) {
|
|
287
|
+
if (holidayCheckResult.nextOpeningDay &&
|
|
288
|
+
holidayCheckResult.hasReopeningTime === true) {
|
|
289
|
+
overrideReopeningDate = holidayCheckResult.nextOpeningDay;
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
else if (holidayCheckResult.nextOpeningDay &&
|
|
293
|
+
holidayCheckResult.hasReopeningTime === false) {
|
|
294
|
+
const weeklyScheduleMatch = weeklySchedule.find((item) => item.startDay === targetDayName);
|
|
295
|
+
potentialReopeningDate = holidayCheckResult.nextOpeningDay;
|
|
296
|
+
dayOffset += 1;
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
dayOffset += 1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
dayOffset += 1;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (!overrideReopeningDate) {
|
|
308
|
+
const matchedSchedule = weeklySchedule.find((i) => i.startDay === potentialReopeningDate.format("dddd").toUpperCase());
|
|
309
|
+
const reopeningDateTime = moment_timezone_1.default.tz(`${potentialReopeningDate.format("YYYY-MM-DD")}T${matchedSchedule.startTime}`, timeZone);
|
|
310
|
+
overrideReopeningDate = reopeningDateTime;
|
|
311
|
+
}
|
|
312
|
+
return overrideReopeningDate;
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
checkHolidayOverride(potentialDate, holidayOverrides, timeZone) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
const potentialDayName = potentialDate.format("dddd").toUpperCase();
|
|
318
|
+
const potentialDateString = potentialDate.format("YYYY-MM-DD");
|
|
319
|
+
for (const overrideKey in holidayOverrides) {
|
|
320
|
+
const overrideStart = holidayOverrides[overrideKey].EffectiveFrom;
|
|
321
|
+
const overrideEnd = holidayOverrides[overrideKey].EffectiveTill;
|
|
322
|
+
if (potentialDateString >= overrideStart &&
|
|
323
|
+
potentialDateString <= overrideEnd) {
|
|
324
|
+
if (holidayOverrides[overrideKey].Config.length > 0) {
|
|
325
|
+
const filteredOverrides = holidayOverrides[overrideKey].Config.filter((item) => item.Day === potentialDayName);
|
|
326
|
+
let nextOpeningDay = "";
|
|
327
|
+
try {
|
|
328
|
+
const openingTime = yield this.determineOpeningTime(potentialDate, filteredOverrides, timeZone);
|
|
329
|
+
nextOpeningDay = openingTime ? openingTime : "";
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
console.error("Error in determineOpeningTime:", error);
|
|
333
|
+
return undefined; // Return undefined if determineOpeningTime fails
|
|
334
|
+
}
|
|
335
|
+
return { nextOpeningDay, hasReopeningTime: true };
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
const nextAvailableDate = moment_timezone_1.default
|
|
339
|
+
.tz(overrideEnd, timeZone)
|
|
340
|
+
.add(1, "days");
|
|
341
|
+
return { nextOpeningDay: nextAvailableDate, hasReopeningTime: false };
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
determineOpeningTime(reopeningDate, dailySchedule, timeZone) {
|
|
348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
+
try {
|
|
350
|
+
// Sort the daily schedule by StartTime
|
|
351
|
+
const sortedSchedule = [...dailySchedule].sort((a, b) => {
|
|
352
|
+
const aTimeInMinutes = a.StartTime.Hours * 60 + a.StartTime.Minutes;
|
|
353
|
+
const bTimeInMinutes = b.StartTime.Hours * 60 + b.StartTime.Minutes;
|
|
354
|
+
return aTimeInMinutes - bTimeInMinutes;
|
|
355
|
+
});
|
|
356
|
+
if (sortedSchedule.length === 0) {
|
|
357
|
+
throw Error;
|
|
358
|
+
}
|
|
359
|
+
let potentialOpeningTimes = [];
|
|
360
|
+
sortedSchedule.forEach((scheduleItem) => {
|
|
361
|
+
const currentDateString = moment_timezone_1.default.tz(timeZone).format("YYYY-MM-DD");
|
|
362
|
+
const startTime = (0, moment_timezone_1.default)(reopeningDate).set({
|
|
363
|
+
hour: scheduleItem.StartTime.Hours,
|
|
364
|
+
minute: scheduleItem.StartTime.Minutes,
|
|
365
|
+
second: 0,
|
|
366
|
+
});
|
|
367
|
+
const endTime = (0, moment_timezone_1.default)(reopeningDate).set({
|
|
368
|
+
hour: scheduleItem.EndTime.Hours,
|
|
369
|
+
minute: scheduleItem.EndTime.Minutes,
|
|
370
|
+
second: 0,
|
|
371
|
+
});
|
|
372
|
+
if (currentDateString !== startTime.format("YYYY-MM-DD")) {
|
|
373
|
+
potentialOpeningTimes.push(startTime);
|
|
374
|
+
}
|
|
375
|
+
if (reopeningDate.isBefore(startTime) &&
|
|
376
|
+
reopeningDate.isBefore(endTime)) {
|
|
377
|
+
potentialOpeningTimes.push(startTime);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
return potentialOpeningTimes[0];
|
|
381
|
+
}
|
|
382
|
+
catch (error) {
|
|
383
|
+
console.error("Error in determineOpeningTime:", error);
|
|
384
|
+
throw error; // Rethrow the error to be handled in checkHolidayOverride
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
checkTimingsForToday(reopeningDate, fetchCurrentDays, timeZone) {
|
|
389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
390
|
+
const sortedSchedule = fetchCurrentDays.sort((a, b) => a.startTime.localeCompare(b.startTime));
|
|
391
|
+
let potentialOpeningTimes = [];
|
|
392
|
+
sortedSchedule.forEach((item) => {
|
|
393
|
+
const currentDateString = moment_timezone_1.default.tz(timeZone).format("YYYY-MM-DD");
|
|
394
|
+
const startTime = moment_timezone_1.default.tz(`${reopeningDate.format("YYYY-MM-DD")} ${item.startTime}`, "YYYY-MM-DD HH:mm:ss", timeZone);
|
|
395
|
+
const endTime = moment_timezone_1.default.tz(`${reopeningDate.format("YYYY-MM-DD")} ${item.endTime}`, "YYYY-MM-DD HH:mm:ss", timeZone);
|
|
396
|
+
if (currentDateString !== startTime.format("YYYY-MM-DD")) {
|
|
397
|
+
potentialOpeningTimes.push(startTime);
|
|
398
|
+
}
|
|
399
|
+
if (reopeningDate.isBefore(startTime) &&
|
|
400
|
+
reopeningDate.isBefore(endTime)) {
|
|
401
|
+
potentialOpeningTimes.push(startTime);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
return potentialOpeningTimes[0];
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
exports.HoopBusinessHoursControllerAConnect = HoopBusinessHoursControllerAConnect;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HoopServiceFactory } from "../../aws/impl/HoopServices/HoopServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
export declare class HoopOperationsControllerAConnect {
|
|
4
|
+
private _dbFactory;
|
|
5
|
+
constructor(dbFactory: HoopServiceFactory);
|
|
6
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
7
|
+
private dateTimeConversion;
|
|
8
|
+
mapOperations(config: any[], timezone: string, request: any): Promise<any[]>;
|
|
9
|
+
}
|
|
@@ -1 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.HoopOperationsControllerAConnect = void 0;
|
|
16
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
17
|
+
const uuid_1 = require("uuid");
|
|
18
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
19
|
+
// import { operationsModel } from "../../models/Hoop.model";
|
|
20
|
+
const HoopOperationsImplModel_1 = require("../../models/impl/hoop/HoopOperationsImplModel");
|
|
21
|
+
class HoopOperationsControllerAConnect {
|
|
22
|
+
// Constructor to initialize HoopServiceFactory
|
|
23
|
+
constructor(dbFactory) {
|
|
24
|
+
this._dbFactory = dbFactory;
|
|
25
|
+
}
|
|
26
|
+
// Method to get all data with query parameters
|
|
27
|
+
getAll(query) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
// Open database connection
|
|
31
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
32
|
+
const database = databaseConnection.result;
|
|
33
|
+
// Start database transaction
|
|
34
|
+
const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
35
|
+
// Access object store
|
|
36
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
37
|
+
// Retrieve all data from the object store
|
|
38
|
+
const request = yield table.customGetHoop(query);
|
|
39
|
+
const config = request.Config;
|
|
40
|
+
const timeZone = request.TimeZone || "EST";
|
|
41
|
+
// const hoursOfOperationId = request.HoursOfOperationId
|
|
42
|
+
const result = yield this.mapOperations(config, timeZone, request);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return error;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
dateTimeConversion(timeString, timeZone) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const currentDate = (0, moment_timezone_1.default)().tz(timeZone).format('YYYY-MM-DD'); // Current date in the desired timezone
|
|
53
|
+
const date = new Date(Date.parse(`${currentDate}T${timeString}:00Z`));
|
|
54
|
+
return date;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
mapOperations(config, timezone, request) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
try {
|
|
60
|
+
return Promise.all(config.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const { Day, StartTime, EndTime } = item;
|
|
62
|
+
const formattedStartTimeMinutes = String(StartTime.Minutes).padStart(2, '0');
|
|
63
|
+
const formattedEndTimeMinutes = String(EndTime.Minutes).padStart(2, '0');
|
|
64
|
+
const formattedStartTimeHours = String(StartTime.Hours).padStart(2, '0');
|
|
65
|
+
const formattedEndTimeHours = String(EndTime.Hours).padStart(2, '0');
|
|
66
|
+
const startTime = `${formattedStartTimeHours}:${formattedStartTimeMinutes}`;
|
|
67
|
+
const endTime = `${formattedEndTimeHours}:${formattedEndTimeMinutes}`;
|
|
68
|
+
const startDateTime = yield this.dateTimeConversion(startTime, timezone);
|
|
69
|
+
const endDateTime = yield this.dateTimeConversion(endTime, timezone);
|
|
70
|
+
const uuid = (0, uuid_1.v4)();
|
|
71
|
+
const operation = new HoopOperationsImplModel_1.HoopOperationsImplModel(uuid, request.HoursOfOperationId, Day, startDateTime, endDateTime, new Date(request.LastModifiedTime), new Date(request.LastModifiedTime));
|
|
72
|
+
if (operation.validationMessages.length > 0) {
|
|
73
|
+
throw operation.validationMessages;
|
|
74
|
+
}
|
|
75
|
+
const operationData = operation.serialize;
|
|
76
|
+
operationData['timeZone'] = request.TimeZone || timezone;
|
|
77
|
+
return operationData;
|
|
78
|
+
})));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return error;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.HoopOperationsControllerAConnect = HoopOperationsControllerAConnect;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HoopServiceFactory } from "../../aws/impl/HoopServices/HoopServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
export declare class HoopOverrideBranchesControllerAConnect {
|
|
4
|
+
private _dbFactory;
|
|
5
|
+
constructor(dbFactory: HoopServiceFactory);
|
|
6
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
7
|
+
}
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HoopOverrideBranchesControllerAConnect = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
class HoopOverrideBranchesControllerAConnect {
|
|
15
|
+
// Constructor to initialize HoopServiceFactory
|
|
16
|
+
constructor(dbFactory) {
|
|
17
|
+
this._dbFactory = dbFactory;
|
|
18
|
+
}
|
|
19
|
+
// Method to get all data with query parameters
|
|
20
|
+
getAll(query) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
try {
|
|
23
|
+
// Open database connection
|
|
24
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
25
|
+
const database = databaseConnection.result;
|
|
26
|
+
// Start database transaction
|
|
27
|
+
const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
28
|
+
// Access object store
|
|
29
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
30
|
+
// Retrieve all data from the object store
|
|
31
|
+
let result = yield table.customGetOverrides(query);
|
|
32
|
+
return { result }; // Return result with meta data
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return error;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.HoopOverrideBranchesControllerAConnect = HoopOverrideBranchesControllerAConnect;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HoopServiceFactory } from "../../aws/impl/HoopServices/HoopServiceFactory";
|
|
2
|
+
export declare class HoopProfilesListControllerAConnect {
|
|
3
|
+
private _dbFactory;
|
|
4
|
+
constructor(dbFactory: HoopServiceFactory);
|
|
5
|
+
get(query: {
|
|
6
|
+
instanceId: string;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
}
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HoopProfilesListControllerAConnect = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
const HoopProfilesListImplModel_1 = require("../../models/impl/hoop/HoopProfilesListImplModel");
|
|
15
|
+
class HoopProfilesListControllerAConnect {
|
|
16
|
+
// Constructor to initialize HoopServiceFactory
|
|
17
|
+
constructor(dbFactory) {
|
|
18
|
+
this._dbFactory = dbFactory;
|
|
19
|
+
}
|
|
20
|
+
// Method to get data by profileId
|
|
21
|
+
get(query) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
if (typeof query.instanceId !== "string") {
|
|
25
|
+
throw new Error("instanceId must be a string");
|
|
26
|
+
}
|
|
27
|
+
// Open database connection
|
|
28
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
29
|
+
const database = databaseConnection.result;
|
|
30
|
+
// Start database transaction
|
|
31
|
+
const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
32
|
+
// Access object store
|
|
33
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
34
|
+
// Get data by profileId from the object store
|
|
35
|
+
let result = yield table.asyncGet(query.instanceId);
|
|
36
|
+
// Use a Promise to handle the `IDBRequest`
|
|
37
|
+
// const k = Array(result)
|
|
38
|
+
const profiles = result.map((item) => {
|
|
39
|
+
// Construct the profile model instance
|
|
40
|
+
const profile = new HoopProfilesListImplModel_1.HoopProfilesListImplModel(item.Id, // profileId
|
|
41
|
+
item.Name, // profileName
|
|
42
|
+
'EST', // timeZone (adjust if dynamic)
|
|
43
|
+
new Date(item.LastModifiedTime), // createdAt
|
|
44
|
+
new Date(item.LastModifiedTime) // updatedAt
|
|
45
|
+
);
|
|
46
|
+
if (profile.validationMessages.length > 0) {
|
|
47
|
+
throw profile.validationMessages;
|
|
48
|
+
}
|
|
49
|
+
const result = profile.serialize;
|
|
50
|
+
// Return the output format
|
|
51
|
+
return result;
|
|
52
|
+
});
|
|
53
|
+
return profiles;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return error;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.HoopProfilesListControllerAConnect = HoopProfilesListControllerAConnect;
|