hgs-twilio-class-lib 1.1.72 → 1.1.74
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/README.md +5 -5
- package/lib/aws/abstract/ServiceObjectStore.d.ts +9 -0
- package/lib/aws/abstract/ServiceObjectStore.js +10 -0
- package/lib/aws/abstract/ServiceOpenRequest.d.ts +7 -0
- package/lib/aws/abstract/ServiceOpenRequest.js +10 -0
- package/lib/aws/abstract/ServiceRequest.d.ts +3 -0
- package/lib/aws/abstract/ServiceRequest.js +7 -0
- package/lib/aws/abstract/ServiceResource.d.ts +20 -0
- package/lib/aws/abstract/ServiceResource.js +31 -0
- package/lib/aws/abstract/ServiceResourceFactory.d.ts +13 -0
- package/lib/aws/abstract/ServiceResourceFactory.js +14 -0
- package/lib/aws/abstract/ServiceTransaction.d.ts +6 -0
- package/lib/aws/abstract/ServiceTransaction.js +11 -0
- package/lib/aws/impl/AWSAPIConfig.d.ts +14 -0
- package/lib/aws/impl/AWSAPIConfig.js +38 -0
- package/lib/aws/impl/AWSClient.d.ts +5 -0
- package/lib/aws/impl/AWSClient.js +21 -0
- package/lib/aws/impl/AWSConnectAPIConfig.d.ts +17 -0
- package/lib/aws/impl/AWSConnectAPIConfig.js +38 -0
- package/lib/aws/impl/DynamoDB/DynamoOpenRequest.d.ts +18 -0
- package/lib/aws/impl/DynamoDB/DynamoOpenRequest.js +24 -0
- package/lib/aws/impl/DynamoDB/DynamoRequest.d.ts +16 -0
- package/lib/aws/impl/DynamoDB/DynamoRequest.js +21 -0
- package/lib/aws/impl/DynamoDB/DynamoResourse.d.ts +29 -0
- package/lib/aws/impl/DynamoDB/DynamoResourse.js +45 -0
- package/lib/aws/impl/DynamoDB/DynamoServiceFactory.d.ts +16 -0
- package/lib/aws/impl/DynamoDB/DynamoServiceFactory.js +63 -0
- package/lib/aws/impl/DynamoDB/DynamoTable.d.ts +26 -0
- package/lib/aws/impl/DynamoDB/DynamoTable.js +126 -0
- package/lib/aws/impl/DynamoDB/DynamoTransaction.d.ts +21 -0
- package/lib/aws/impl/DynamoDB/DynamoTransaction.js +37 -0
- package/lib/aws/impl/HoopServices/HoopService.d.ts +28 -0
- package/lib/aws/impl/HoopServices/HoopService.js +124 -0
- package/lib/aws/impl/HoopServices/HoopServiceFactory.d.ts +17 -0
- package/lib/aws/impl/HoopServices/HoopServiceFactory.js +53 -0
- package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.d.ts +18 -0
- package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.js +24 -0
- package/lib/aws/impl/HoopServices/HoopServiceResource.d.ts +29 -0
- package/lib/aws/impl/HoopServices/HoopServiceResource.js +46 -0
- package/lib/aws/impl/HoopServices/HoopServiceTransaction.d.ts +22 -0
- package/lib/aws/impl/HoopServices/HoopServiceTransaction.js +37 -0
- package/lib/aws/interface/IDirection.d.ts +2 -0
- package/lib/aws/interface/IDirection.js +2 -0
- package/lib/aws/interface/ILink.d.ts +2 -0
- package/lib/aws/interface/ILink.js +2 -0
- package/lib/aws/interface/IServiceDBOpenRequest.d.ts +3 -0
- package/lib/aws/interface/IServiceDBOpenRequest.js +2 -0
- package/lib/aws/interface/IServiceObjectStore.d.ts +3 -0
- package/lib/aws/interface/IServiceObjectStore.js +2 -0
- package/lib/aws/interface/IServiceObjectStoreParameters.d.ts +4 -0
- package/lib/aws/interface/IServiceObjectStoreParameters.js +2 -0
- package/lib/aws/interface/IServiceRequest.d.ts +3 -0
- package/lib/aws/interface/IServiceRequest.js +2 -0
- package/lib/aws/interface/IServiceResource.d.ts +7 -0
- package/lib/aws/interface/IServiceResource.js +2 -0
- package/lib/aws/interface/IServiceTransation.d.ts +3 -0
- package/lib/aws/interface/IServiceTransation.js +2 -0
- package/lib/aws/interface/ISubResourceUri.d.ts +2 -0
- package/lib/aws/interface/ISubResourceUri.js +2 -0
- package/lib/aws/interface/ISyncItemData.d.ts +0 -0
- package/lib/aws/interface/ISyncItemData.js +1 -0
- package/lib/aws/interface/ISyncObjectStoreParameters.d.ts +0 -0
- package/lib/aws/interface/ISyncObjectStoreParameters.js +1 -0
- package/lib/aws/interface/ISyncTransactionOptions.d.ts +4 -0
- package/lib/aws/interface/ISyncTransactionOptions.js +2 -0
- package/lib/common/abstract/CommonError.d.ts +8 -0
- package/lib/common/abstract/CommonError.js +12 -0
- package/lib/common/abstract/Database.d.ts +44 -0
- package/lib/common/abstract/Database.js +58 -0
- package/lib/common/abstract/DatabaseClient.d.ts +11 -0
- package/lib/common/abstract/DatabaseClient.js +21 -0
- package/lib/common/abstract/DatabaseClientConfig.d.ts +5 -0
- package/lib/common/abstract/DatabaseClientConfig.js +9 -0
- package/lib/common/abstract/DatabaseFactory.d.ts +70 -0
- package/lib/common/abstract/DatabaseFactory.js +32 -0
- package/lib/common/abstract/DatabaseObjectStore.d.ts +29 -0
- package/lib/common/abstract/DatabaseObjectStore.js +13 -0
- package/lib/common/abstract/DatabaseOpenRequest.d.ts +24 -0
- package/lib/common/abstract/DatabaseOpenRequest.js +13 -0
- package/lib/common/abstract/DatabaseRequest.d.ts +21 -0
- package/lib/common/abstract/DatabaseRequest.js +14 -0
- package/lib/common/abstract/DatabaseTransaction.d.ts +22 -0
- package/lib/common/abstract/DatabaseTransaction.js +13 -0
- package/lib/common/abstract/Filter.d.ts +12 -0
- package/lib/common/abstract/Filter.js +30 -0
- package/lib/common/enum/ErrorTypes.d.ts +4 -0
- package/lib/common/enum/ErrorTypes.js +9 -0
- package/lib/common/enum/FilterTypes.d.ts +10 -0
- package/lib/common/enum/FilterTypes.js +14 -0
- package/lib/common/interface/IDatabaesInfo.d.ts +2 -0
- package/lib/common/interface/IDatabaesInfo.js +2 -0
- package/lib/common/interface/IDatabase.d.ts +4 -0
- package/lib/common/interface/IDatabase.js +2 -0
- package/lib/common/interface/IDatabaseClient.d.ts +5 -0
- package/lib/common/interface/IDatabaseClient.js +2 -0
- package/lib/common/interface/IDatabaseConfig.d.ts +8 -0
- package/lib/common/interface/IDatabaseConfig.js +10 -0
- package/lib/common/interface/IDatabaseDBOpenRequest.d.ts +2 -0
- package/lib/common/interface/IDatabaseDBOpenRequest.js +2 -0
- package/lib/common/interface/IDatabaseFactory.d.ts +21 -0
- package/lib/common/interface/IDatabaseFactory.js +2 -0
- package/lib/common/interface/IDatabaseObjectStore.d.ts +2 -0
- package/lib/common/interface/IDatabaseObjectStore.js +2 -0
- package/lib/common/interface/IDatabaseObjectStoreParameters.d.ts +2 -0
- package/lib/common/interface/IDatabaseObjectStoreParameters.js +2 -0
- package/lib/common/interface/IDatabaseRecord.d.ts +2 -0
- package/lib/common/interface/IDatabaseRecord.js +2 -0
- package/lib/common/interface/IDatabaseRequest.d.ts +2 -0
- package/lib/common/interface/IDatabaseRequest.js +2 -0
- package/lib/common/interface/IDatabaseTransaction.d.ts +2 -0
- package/lib/common/interface/IDatabaseTransaction.js +2 -0
- package/lib/common/interface/IDatabaseTransactionOptions.d.ts +2 -0
- package/lib/common/interface/IDatabaseTransactionOptions.js +2 -0
- package/lib/common/interface/IError.d.ts +5 -0
- package/lib/common/interface/IError.js +2 -0
- package/lib/common/interface/IErrorDetails.d.ts +6 -0
- package/lib/common/interface/IErrorDetails.js +2 -0
- package/lib/common/interface/IFilter.d.ts +25 -0
- package/lib/common/interface/IFilter.js +2 -0
- package/lib/common/type/DatabaseReadyType.d.ts +1 -0
- package/lib/common/type/DatabaseReadyType.js +2 -0
- package/lib/common/type/FilterInputType.d.ts +1 -0
- package/lib/common/type/FilterInputType.js +2 -0
- package/lib/common/type/SearchParameterType.d.ts +15 -0
- package/lib/common/type/SearchParameterType.js +3 -0
- package/lib/common/utils/dateFormat.d.ts +1 -0
- package/lib/common/utils/dateFormat.js +58 -0
- package/lib/common/utils/filter.d.ts +1 -0
- package/lib/common/utils/filter.js +99 -0
- package/lib/common/utils/newFilter.d.ts +1 -0
- package/lib/common/utils/newFilter.js +126 -0
- package/lib/common/utils/pagination.d.ts +1 -0
- package/lib/common/utils/pagination.js +9 -0
- package/lib/common/utils/search.d.ts +1 -0
- package/lib/common/utils/search.js +14 -0
- package/lib/common/utils/sort.d.ts +1 -0
- package/lib/common/utils/sort.js +29 -0
- package/lib/config/AWSConfig.d.ts +6 -0
- package/lib/config/AWSConfig.js +9 -0
- package/lib/config/DatabaseConfig.d.ts +6 -0
- package/lib/config/DatabaseConfig.js +38 -0
- package/lib/config/TwilioConfig.d.ts +4 -0
- package/lib/config/TwilioConfig.js +7 -0
- package/lib/controller/Common.d.ts +20 -0
- package/lib/controller/Common.js +57 -0
- package/lib/controller/DatabaseFactoryCollection.d.ts +6 -0
- package/lib/controller/DatabaseFactoryCollection.js +14 -0
- package/lib/controller/MainController.d.ts +6 -0
- package/lib/controller/MainController.js +174 -0
- package/lib/controller/RealTimeDashboardController.d.ts +39 -0
- package/lib/controller/RealTimeDashboardController.js +267 -0
- package/lib/controller/aws/HoopBuisnessHours.d.ts +23 -0
- package/lib/controller/aws/HoopBuisnessHours.js +408 -0
- package/lib/controller/aws/HoopOperationsController.d.ts +9 -0
- package/lib/controller/aws/HoopOperationsController.js +86 -0
- package/lib/controller/aws/HoopOverrideBranchesController.d.ts +7 -0
- package/lib/controller/aws/HoopOverrideBranchesController.js +40 -0
- package/lib/controller/aws/HoopProfilesListController.d.ts +8 -0
- package/lib/controller/aws/HoopProfilesListController.js +61 -0
- package/lib/controller/aws/PlaybackScreenrecordings.d.ts +9 -0
- package/lib/controller/aws/PlaybackScreenrecordings.js +63 -0
- package/lib/controller/twilio/AgentActionsController.d.ts +54 -0
- package/lib/controller/twilio/AgentActionsController.js +177 -0
- package/lib/controller/twilio/AgentScorecardController.d.ts +53 -0
- package/lib/controller/twilio/AgentScorecardController.js +173 -0
- package/lib/controller/twilio/AuditLogController.d.ts +15 -0
- package/lib/controller/twilio/AuditLogController.js +137 -0
- package/lib/controller/twilio/CallLogsController.d.ts +12 -0
- package/lib/controller/twilio/CallLogsController.js +131 -0
- package/lib/controller/twilio/CallbackAndVoicemailController.d.ts +12 -0
- package/lib/controller/twilio/CallbackAndVoicemailController.js +114 -0
- package/lib/controller/twilio/ChannelSettingTaskInfoController.d.ts +11 -0
- package/lib/controller/twilio/ChannelSettingTaskInfoController.js +117 -0
- package/lib/controller/twilio/ChannelSettingsController.d.ts +16 -0
- package/lib/controller/twilio/ChannelSettingsController.js +142 -0
- package/lib/controller/twilio/CxConfigAssetController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigAssetController.js +128 -0
- package/lib/controller/twilio/CxConfigController.d.ts +18 -0
- package/lib/controller/twilio/CxConfigController.js +112 -0
- package/lib/controller/twilio/CxConfigExternalNumbersController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigExternalNumbersController.js +138 -0
- package/lib/controller/twilio/CxConfigOther.d.ts +16 -0
- package/lib/controller/twilio/CxConfigOther.js +138 -0
- package/lib/controller/twilio/CxConfigQueueMenuController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigQueueMenuController.js +129 -0
- package/lib/controller/twilio/CxConfigUIconfigController.d.ts +12 -0
- package/lib/controller/twilio/CxConfigUIconfigController.js +132 -0
- package/lib/controller/twilio/GPMController.d.ts +12 -0
- package/lib/controller/twilio/GPMController.js +151 -0
- package/lib/controller/twilio/HoopBusinessHoursController.d.ts +18 -0
- package/lib/controller/twilio/HoopBusinessHoursController.js +285 -0
- package/lib/controller/twilio/HoopHolidaysController.d.ts +14 -0
- package/lib/controller/twilio/HoopHolidaysController.js +152 -0
- package/lib/controller/twilio/HoopMainController.d.ts +13 -0
- package/lib/controller/twilio/HoopMainController.js +297 -0
- package/lib/controller/twilio/HoopNotesController.d.ts +14 -0
- package/lib/controller/twilio/HoopNotesController.js +149 -0
- package/lib/controller/twilio/HoopOperationsController.d.ts +14 -0
- package/lib/controller/twilio/HoopOperationsController.js +138 -0
- package/lib/controller/twilio/HoopOverrideBranchesController.d.ts +14 -0
- package/lib/controller/twilio/HoopOverrideBranchesController.js +137 -0
- package/lib/controller/twilio/HoopPartialDaysController.d.ts +14 -0
- package/lib/controller/twilio/HoopPartialDaysController.js +152 -0
- package/lib/controller/twilio/HoopProfilesListController.d.ts +14 -0
- package/lib/controller/twilio/HoopProfilesListController.js +147 -0
- package/lib/controller/twilio/NavigationController.d.ts +13 -0
- package/lib/controller/twilio/NavigationController.js +170 -0
- package/lib/controller/twilio/QualityFormsController.d.ts +12 -0
- package/lib/controller/twilio/QualityFormsController.js +129 -0
- package/lib/controller/twilio/QuickLinkController.d.ts +11 -0
- package/lib/controller/twilio/QuickLinkController.js +122 -0
- package/lib/controller/twilio/RealTimeReportQueueDetailsController.d.ts +14 -0
- package/lib/controller/twilio/RealTimeReportQueueDetailsController.js +126 -0
- package/lib/controller/twilio/RealTimeReportsWGDetailsController.d.ts +53 -0
- package/lib/controller/twilio/RealTimeReportsWGDetailsController.js +160 -0
- package/lib/controller/twilio/TaskInfoPanelController.d.ts +15 -0
- package/lib/controller/twilio/TaskInfoPanelController.js +134 -0
- package/lib/controller/twilio/filterImpl/AgentScorecardFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/AgentScorecardFilter.js +52 -0
- package/lib/controller/twilio/filterImpl/AuditLogsFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/AuditLogsFilter.js +89 -0
- package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.js +81 -0
- package/lib/controller/twilio/filterImpl/CallLogsFilter.d.ts +20 -0
- package/lib/controller/twilio/filterImpl/CallLogsFilter.js +101 -0
- package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.js +59 -0
- package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.js +67 -0
- package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.js +52 -0
- package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.d.ts +17 -0
- package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.js +78 -0
- package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.js +51 -0
- package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.js +58 -0
- package/lib/controller/twilio/filterImpl/HoopNotesFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/HoopNotesFilter.js +51 -0
- package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.js +58 -0
- package/lib/controller/twilio/filterImpl/MainFilterService.d.ts +4 -0
- package/lib/controller/twilio/filterImpl/MainFilterService.js +108 -0
- package/lib/controller/twilio/filterImpl/NavigationFilter.d.ts +20 -0
- package/lib/controller/twilio/filterImpl/NavigationFilter.js +90 -0
- package/lib/controller/twilio/filterImpl/QueueDetailsFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/QueueDetailsFilter.js +53 -0
- package/lib/controller/twilio/filterImpl/TaskCompleteFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/TaskCompleteFilter.js +62 -0
- package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.d.ts +12 -0
- package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.js +52 -0
- package/lib/express/ApiResponse.d.ts +15 -0
- package/lib/express/ApiResponse.js +11 -0
- package/lib/express/RequestValidator.d.ts +50 -0
- package/lib/express/RequestValidator.js +77 -0
- package/lib/express/RequireParamsPicker.d.ts +7 -0
- package/lib/express/RequireParamsPicker.js +14 -0
- package/lib/express/ValidateRequireParameters.d.ts +3 -0
- package/lib/express/ValidateRequireParameters.js +39 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.js +100 -0
- package/lib/models/BatchUpdateSkills.model.d.ts +0 -0
- package/lib/models/BatchUpdateSkills.model.js +11 -0
- package/lib/models/CannedMessage.model.d.ts +4 -0
- package/lib/models/CannedMessage.model.js +1 -0
- package/lib/models/ChannelSettingsTaskInfo.model.d.ts +87 -0
- package/lib/models/ChannelSettingsTaskInfo.model.js +1 -0
- package/lib/models/CustomerFeedback.model.d.ts +9 -0
- package/lib/models/CustomerFeedback.model.js +1 -0
- package/lib/models/Filter.model.d.ts +15 -0
- package/lib/models/Filter.model.js +2 -0
- package/lib/models/Hoop.model.d.ts +15 -0
- package/lib/models/Hoop.model.js +18 -0
- package/lib/models/Navigation.model.d.ts +28 -0
- package/lib/models/Navigation.model.js +8 -0
- package/lib/models/Roles.Model.d.ts +8 -0
- package/lib/models/Roles.Model.js +1 -0
- package/lib/models/abstract/BaseModel.d.ts +17 -0
- package/lib/models/abstract/BaseModel.js +40 -0
- package/lib/models/impl/AgentActionsLogsModel.d.ts +27 -0
- package/lib/models/impl/AgentActionsLogsModel.js +89 -0
- package/lib/models/impl/AgentActionsModel.d.ts +19 -0
- package/lib/models/impl/AgentActionsModel.js +60 -0
- package/lib/models/impl/AgentScorecardModel.d.ts +66 -0
- package/lib/models/impl/AgentScorecardModel.js +282 -0
- package/lib/models/impl/AuditLogsModel.d.ts +31 -0
- package/lib/models/impl/AuditLogsModel.js +146 -0
- package/lib/models/impl/CallLogsModel.d.ts +37 -0
- package/lib/models/impl/CallLogsModel.js +109 -0
- package/lib/models/impl/CallStatisticsModel.d.ts +16 -0
- package/lib/models/impl/CallStatisticsModel.js +52 -0
- package/lib/models/impl/CategoryDetailsModel.d.ts +17 -0
- package/lib/models/impl/CategoryDetailsModel.js +44 -0
- package/lib/models/impl/DailySummaryModel.d.ts +60 -0
- package/lib/models/impl/DailySummaryModel.js +247 -0
- package/lib/models/impl/IntervalSummaryModel.d.ts +63 -0
- package/lib/models/impl/IntervalSummaryModel.js +261 -0
- package/lib/models/impl/MemberModel.d.ts +42 -0
- package/lib/models/impl/MemberModel.js +170 -0
- package/lib/models/impl/ModelValidationError.d.ts +6 -0
- package/lib/models/impl/ModelValidationError.js +15 -0
- package/lib/models/impl/NavigationModel.d.ts +39 -0
- package/lib/models/impl/NavigationModel.js +126 -0
- package/lib/models/impl/PerformanceStatisticsModel.d.ts +41 -0
- package/lib/models/impl/PerformanceStatisticsModel.js +129 -0
- package/lib/models/impl/PlaybackScreenrecordings.d.ts +39 -0
- package/lib/models/impl/PlaybackScreenrecordings.js +133 -0
- package/lib/models/impl/ProfileModel.d.ts +23 -0
- package/lib/models/impl/ProfileModel.js +102 -0
- package/lib/models/impl/QualityFormsModel.d.ts +39 -0
- package/lib/models/impl/QualityFormsModel.js +150 -0
- package/lib/models/impl/QuestionDetailsModel.d.ts +39 -0
- package/lib/models/impl/QuestionDetailsModel.js +173 -0
- package/lib/models/impl/QueueDetailsModel.d.ts +63 -0
- package/lib/models/impl/QueueDetailsModel.js +261 -0
- package/lib/models/impl/QueueModel.d.ts +39 -0
- package/lib/models/impl/QueueModel.js +156 -0
- package/lib/models/impl/QuickLinkModel.d.ts +24 -0
- package/lib/models/impl/QuickLinkModel.js +122 -0
- package/lib/models/impl/StatisticsNumberDetailsModel.d.ts +18 -0
- package/lib/models/impl/StatisticsNumberDetailsModel.js +72 -0
- package/lib/models/impl/StatisticsTimeDetailsModel.d.ts +18 -0
- package/lib/models/impl/StatisticsTimeDetailsModel.js +72 -0
- package/lib/models/impl/TaskAttributesModel.d.ts +31 -0
- package/lib/models/impl/TaskAttributesModel.js +108 -0
- package/lib/models/impl/TaskChannelModel.d.ts +15 -0
- package/lib/models/impl/TaskChannelModel.js +69 -0
- package/lib/models/impl/TaskComplete.d.ts +0 -0
- package/lib/models/impl/TaskComplete.js +1 -0
- package/lib/models/impl/TaskInfoPanelModel.d.ts +16 -0
- package/lib/models/impl/TaskInfoPanelModel.js +69 -0
- package/lib/models/impl/TaskModel.d.ts +59 -0
- package/lib/models/impl/TaskModel.js +234 -0
- package/lib/models/impl/WorkGroupDetailsModel.d.ts +63 -0
- package/lib/models/impl/WorkGroupDetailsModel.js +281 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.d.ts +33 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.js +140 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.d.ts +8 -0
- package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.js +12 -0
- package/lib/models/impl/callbackandvoicemail/CallbackModel.d.ts +19 -0
- package/lib/models/impl/callbackandvoicemail/CallbackModel.js +82 -0
- package/lib/models/impl/callbackandvoicemail/VoicemailModel.d.ts +25 -0
- package/lib/models/impl/callbackandvoicemail/VoicemailModel.js +108 -0
- package/lib/models/impl/channelsettings/ChannelSettingModel.d.ts +68 -0
- package/lib/models/impl/channelsettings/ChannelSettingModel.js +240 -0
- package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.d.ts +31 -0
- package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.js +106 -0
- package/lib/models/impl/channelsettings/TaskInfoAttributeModel.d.ts +25 -0
- package/lib/models/impl/channelsettings/TaskInfoAttributeModel.js +80 -0
- package/lib/models/impl/channelsettings/TaskInfoModel.d.ts +13 -0
- package/lib/models/impl/channelsettings/TaskInfoModel.js +52 -0
- package/lib/models/impl/cxconfig/CxConfigNamespace.d.ts +16 -0
- package/lib/models/impl/cxconfig/CxConfigNamespace.js +20 -0
- package/lib/models/impl/cxconfig/CxConfigUIConfigModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfigUIConfigModel.js +173 -0
- package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.d.ts +24 -0
- package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.js +103 -0
- package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.d.ts +24 -0
- package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.js +149 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.js +179 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.d.ts +37 -0
- package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.js +197 -0
- package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.d.ts +27 -0
- package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.js +159 -0
- package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.d.ts +40 -0
- package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.js +128 -0
- package/lib/models/impl/hoop/HoopBusinessHoursModel.d.ts +39 -0
- package/lib/models/impl/hoop/HoopBusinessHoursModel.js +122 -0
- package/lib/models/impl/hoop/HoopDescriptionModel.d.ts +16 -0
- package/lib/models/impl/hoop/HoopDescriptionModel.js +64 -0
- package/lib/models/impl/hoop/HoopHolidaysImplModel.d.ts +25 -0
- package/lib/models/impl/hoop/HoopHolidaysImplModel.js +118 -0
- package/lib/models/impl/hoop/HoopNotesImplModel.d.ts +25 -0
- package/lib/models/impl/hoop/HoopNotesImplModel.js +117 -0
- package/lib/models/impl/hoop/HoopOperationsImplModel.d.ts +28 -0
- package/lib/models/impl/hoop/HoopOperationsImplModel.js +161 -0
- package/lib/models/impl/hoop/HoopOverrideImplModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopOverrideImplModel.js +143 -0
- package/lib/models/impl/hoop/HoopPartialDaysImplModel.d.ts +31 -0
- package/lib/models/impl/hoop/HoopPartialDaysImplModel.js +140 -0
- package/lib/models/impl/hoop/HoopProfilesListImplModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopProfilesListImplModel.js +104 -0
- package/lib/models/impl/hoop/HoopWeeklyTimingModel.d.ts +22 -0
- package/lib/models/impl/hoop/HoopWeeklyTimingModel.js +86 -0
- package/lib/models/index.d.ts +27 -0
- package/lib/models/index.js +57 -0
- package/lib/models/interface/IBaseModel.d.ts +11 -0
- package/lib/models/interface/IBaseModel.js +2 -0
- package/lib/models/types/AgentScorecard.type.d.ts +6 -0
- package/lib/models/types/AgentScorecard.type.js +7 -0
- package/lib/models/types/AuditLog.type.d.ts +13 -0
- package/lib/models/types/AuditLog.type.js +10 -0
- package/lib/models/types/CallLog.type.d.ts +16 -0
- package/lib/models/types/CallLog.type.js +10 -0
- package/lib/models/types/ChannelSetting.type.d.ts +7 -0
- package/lib/models/types/ChannelSetting.type.js +11 -0
- package/lib/models/types/CxConfig.type.d.ts +72 -0
- package/lib/models/types/CxConfig.type.js +43 -0
- package/lib/models/types/Hoop.type.d.ts +9 -0
- package/lib/models/types/Hoop.type.js +13 -0
- package/lib/models/types/Navigation.type.d.ts +11 -0
- package/lib/models/types/Navigation.type.js +8 -0
- package/lib/models/types/Profile.type.d.ts +1 -0
- package/lib/models/types/Profile.type.js +2 -0
- package/lib/models/types/QueueDetails.type.d.ts +6 -0
- package/lib/models/types/QueueDetails.type.js +7 -0
- package/lib/models/types/RealtimeSyncMapDetails.type.d.ts +6 -0
- package/lib/models/types/RealtimeSyncMapDetails.type.js +7 -0
- package/lib/models/types/TaskComplete.type.d.ts +7 -0
- package/lib/models/types/TaskComplete.type.js +6 -0
- package/lib/models/types/TaskInfoPanel.type.d.ts +6 -0
- package/lib/models/types/TaskInfoPanel.type.js +7 -0
- package/lib/server.d.ts +1 -0
- package/lib/server.js +41 -0
- package/lib/twilio/abstract/ServiceObjectStore.d.ts +6 -0
- package/lib/twilio/abstract/ServiceObjectStore.js +10 -0
- package/lib/twilio/abstract/ServiceOpenRequest.d.ts +7 -0
- package/lib/twilio/abstract/ServiceOpenRequest.js +10 -0
- package/lib/twilio/abstract/ServiceRequest.d.ts +3 -0
- package/lib/twilio/abstract/ServiceRequest.js +7 -0
- package/lib/twilio/abstract/ServiceResource.d.ts +23 -0
- package/lib/twilio/abstract/ServiceResource.js +37 -0
- package/lib/twilio/abstract/ServiceResourceFactory.d.ts +15 -0
- package/lib/twilio/abstract/ServiceResourceFactory.js +18 -0
- package/lib/twilio/abstract/ServiceTransaction.d.ts +6 -0
- package/lib/twilio/abstract/ServiceTransaction.js +11 -0
- package/lib/twilio/abstract/SyncServiceItemResource.d.ts +31 -0
- package/lib/twilio/abstract/SyncServiceItemResource.js +60 -0
- package/lib/twilio/abstract/TwilioClientConfig.d.ts +0 -0
- package/lib/twilio/abstract/TwilioClientConfig.js +1 -0
- package/lib/twilio/impl/TwilioAPIKeyConfig.d.ts +14 -0
- package/lib/twilio/impl/TwilioAPIKeyConfig.js +31 -0
- package/lib/twilio/impl/TwilioAuthTokenConfig.d.ts +11 -0
- package/lib/twilio/impl/TwilioAuthTokenConfig.js +24 -0
- package/lib/twilio/impl/TwilioClient.d.ts +6 -0
- package/lib/twilio/impl/TwilioClient.js +21 -0
- package/lib/twilio/impl/message/messageService.d.ts +0 -0
- package/lib/twilio/impl/message/messageService.js +42 -0
- package/lib/twilio/impl/sync/SyncDocument.d.ts +24 -0
- package/lib/twilio/impl/sync/SyncDocument.js +52 -0
- package/lib/twilio/impl/sync/SyncDocumentTransaction.d.ts +20 -0
- package/lib/twilio/impl/sync/SyncDocumentTransaction.js +31 -0
- package/lib/twilio/impl/sync/SyncList.d.ts +24 -0
- package/lib/twilio/impl/sync/SyncList.js +52 -0
- package/lib/twilio/impl/sync/SyncListItem.d.ts +5 -0
- package/lib/twilio/impl/sync/SyncListItem.js +22 -0
- package/lib/twilio/impl/sync/SyncListTransaction.d.ts +20 -0
- package/lib/twilio/impl/sync/SyncListTransaction.js +31 -0
- package/lib/twilio/impl/sync/SyncMap.d.ts +25 -0
- package/lib/twilio/impl/sync/SyncMap.js +81 -0
- package/lib/twilio/impl/sync/SyncMapItem.d.ts +25 -0
- package/lib/twilio/impl/sync/SyncMapItem.js +139 -0
- package/lib/twilio/impl/sync/SyncMapItemsTransaction.d.ts +22 -0
- package/lib/twilio/impl/sync/SyncMapItemsTransaction.js +38 -0
- package/lib/twilio/impl/sync/SyncMapTransaction.d.ts +22 -0
- package/lib/twilio/impl/sync/SyncMapTransaction.js +38 -0
- package/lib/twilio/impl/sync/SyncOpenRequest.d.ts +18 -0
- package/lib/twilio/impl/sync/SyncOpenRequest.js +24 -0
- package/lib/twilio/impl/sync/SyncRequest.d.ts +16 -0
- package/lib/twilio/impl/sync/SyncRequest.js +21 -0
- package/lib/twilio/impl/sync/SyncResource.d.ts +51 -0
- package/lib/twilio/impl/sync/SyncResource.js +104 -0
- package/lib/twilio/impl/sync/SyncServiceFactory.d.ts +22 -0
- package/lib/twilio/impl/sync/SyncServiceFactory.js +116 -0
- package/lib/twilio/interface/IDirection.d.ts +2 -0
- package/lib/twilio/interface/IDirection.js +2 -0
- package/lib/twilio/interface/ILink.d.ts +2 -0
- package/lib/twilio/interface/ILink.js +2 -0
- package/lib/twilio/interface/IServiceDBOpenRequest.d.ts +3 -0
- package/lib/twilio/interface/IServiceDBOpenRequest.js +2 -0
- package/lib/twilio/interface/IServiceObjectStore.d.ts +3 -0
- package/lib/twilio/interface/IServiceObjectStore.js +2 -0
- package/lib/twilio/interface/IServiceObjectStoreParameters.d.ts +4 -0
- package/lib/twilio/interface/IServiceObjectStoreParameters.js +2 -0
- package/lib/twilio/interface/IServiceRequest.d.ts +3 -0
- package/lib/twilio/interface/IServiceRequest.js +2 -0
- package/lib/twilio/interface/IServiceResource.d.ts +8 -0
- package/lib/twilio/interface/IServiceResource.js +2 -0
- package/lib/twilio/interface/IServiceTransation.d.ts +3 -0
- package/lib/twilio/interface/IServiceTransation.js +2 -0
- package/lib/twilio/interface/ISubResourceUri.d.ts +2 -0
- package/lib/twilio/interface/ISubResourceUri.js +2 -0
- package/lib/twilio/interface/ISyncItemData.d.ts +0 -0
- package/lib/twilio/interface/ISyncItemData.js +1 -0
- package/lib/twilio/interface/ISyncObjectStoreParameters.d.ts +0 -0
- package/lib/twilio/interface/ISyncObjectStoreParameters.js +1 -0
- package/lib/twilio/interface/ISyncTransactionOptions.d.ts +4 -0
- package/lib/twilio/interface/ISyncTransactionOptions.js +2 -0
- package/package.json +56 -56
|
@@ -0,0 +1,137 @@
|
|
|
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.HoopOverrideBranchesController = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
const HoopOverrideImplModel_1 = require("../../models/impl/hoop/HoopOverrideImplModel");
|
|
15
|
+
class HoopOverrideBranchesController {
|
|
16
|
+
// Constructor to initialize SyncServiceFactory
|
|
17
|
+
constructor(dbFactory) {
|
|
18
|
+
this._dbFactory = dbFactory;
|
|
19
|
+
}
|
|
20
|
+
// Method to add new data to the override branches
|
|
21
|
+
add(data) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
// Validate incoming data
|
|
25
|
+
const HoopOverride = new HoopOverrideImplModel_1.HoopOverrideBranchImplModel(data.branchId, data.profileId, data.branchStatus, data.createdAt, data.updatedAt);
|
|
26
|
+
if (HoopOverride.validationMessages.length > 0) {
|
|
27
|
+
throw HoopOverride.validationMessages; // Throw error if data validation fails
|
|
28
|
+
}
|
|
29
|
+
// Open database connection
|
|
30
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
31
|
+
const database = databaseConnection.result;
|
|
32
|
+
// Start database transaction
|
|
33
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
34
|
+
// Access object store
|
|
35
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
36
|
+
// Add data to the object store
|
|
37
|
+
let result = yield table.add(HoopOverride.serialize, data.branchId);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// Method to edit existing data in the holidays
|
|
46
|
+
edit(data) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
try {
|
|
49
|
+
// Validate incoming data
|
|
50
|
+
const HoopOverride = new HoopOverrideImplModel_1.HoopOverrideBranchImplModel(data.branchId, data.profileId, data.branchStatus, data.createdAt, data.updatedAt);
|
|
51
|
+
if (HoopOverride.validationMessages.length > 0) {
|
|
52
|
+
throw HoopOverride.validationMessages; // Throw error if data validation fails
|
|
53
|
+
}
|
|
54
|
+
// Open database connection
|
|
55
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
56
|
+
const database = databaseConnection.result;
|
|
57
|
+
// Start database transaction
|
|
58
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
59
|
+
// Access object store
|
|
60
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
61
|
+
const key = HoopOverride.branchId;
|
|
62
|
+
// Update existing data in the object store
|
|
63
|
+
let result = table.put(HoopOverride.serialize, key);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return error;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Method to get data by branchId
|
|
72
|
+
get(query) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
try {
|
|
75
|
+
console.log(query);
|
|
76
|
+
if (typeof query.branchId !== "string") {
|
|
77
|
+
throw new Error("branchId must be a string");
|
|
78
|
+
}
|
|
79
|
+
// Open database connection
|
|
80
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
81
|
+
const database = databaseConnection.result;
|
|
82
|
+
// Start database transaction
|
|
83
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
84
|
+
// Access object store
|
|
85
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
86
|
+
// Get data by branchId from the object store
|
|
87
|
+
let result = table.get(query.branchId);
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.log('error ', error);
|
|
92
|
+
return error;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// Method to get all data with query parameters
|
|
97
|
+
getAll(query) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
try {
|
|
100
|
+
// Open database connection
|
|
101
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
102
|
+
const database = databaseConnection.result;
|
|
103
|
+
// Start database transaction
|
|
104
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
105
|
+
// Access object store
|
|
106
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
107
|
+
// Retrieve all data from the object store
|
|
108
|
+
let result = yield table.getAll(query);
|
|
109
|
+
return { result, meta: query }; // Return result with meta data
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return error;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Method to delete data by branchId
|
|
117
|
+
delete(query) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
try {
|
|
120
|
+
// Open database connection
|
|
121
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
122
|
+
const database = databaseConnection.result;
|
|
123
|
+
// Start database transaction
|
|
124
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches, "readwrite");
|
|
125
|
+
// Access object store
|
|
126
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopOverrideBranches);
|
|
127
|
+
// Delete data by branchId from the object store
|
|
128
|
+
let result = table.delete(query.branchId);
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return error;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.HoopOverrideBranchesController = HoopOverrideBranchesController;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
import { HoopPartialDaysImplModel } from "../../models/impl/hoop/HoopPartialDaysImplModel";
|
|
4
|
+
export declare class HoopPartialDaysController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
constructor(dbFactory: SyncServiceFactory);
|
|
7
|
+
add(data: HoopPartialDaysImplModel): Promise<any>;
|
|
8
|
+
edit(data: HoopPartialDaysImplModel): Promise<any>;
|
|
9
|
+
get(query: {
|
|
10
|
+
holidaysId: string;
|
|
11
|
+
}): Promise<any>;
|
|
12
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
13
|
+
delete(query: Pick<HoopPartialDaysImplModel, "partialDaysId">): Promise<any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
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.HoopPartialDaysController = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
const HoopPartialDaysImplModel_1 = require("../../models/impl/hoop/HoopPartialDaysImplModel");
|
|
15
|
+
const HoopPartialDaysFilter_1 = require("./filterImpl/HoopPartialDaysFilter");
|
|
16
|
+
// Controller class to manage holidays-related data
|
|
17
|
+
class HoopPartialDaysController {
|
|
18
|
+
// Constructor to initialize SyncServiceFactory
|
|
19
|
+
constructor(dbFactory) {
|
|
20
|
+
this._dbFactory = dbFactory;
|
|
21
|
+
}
|
|
22
|
+
// Method to add new data to the holidays
|
|
23
|
+
add(data) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
try {
|
|
26
|
+
// Validate incoming data
|
|
27
|
+
const HoopPartialDays = new HoopPartialDaysImplModel_1.HoopPartialDaysImplModel(data.partialDaysId, data.profileId, data.description, data.beginTime, data.endTime, data.date, data.createdAt, data.updatedAt);
|
|
28
|
+
if (HoopPartialDays.validationMessages.length > 0) {
|
|
29
|
+
throw HoopPartialDays.validationMessages; // Throw error if data validation fails
|
|
30
|
+
}
|
|
31
|
+
// Open database connection
|
|
32
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
33
|
+
const database = databaseConnection.result;
|
|
34
|
+
// Start database transaction
|
|
35
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays, "readwrite");
|
|
36
|
+
// Access object store
|
|
37
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays);
|
|
38
|
+
// Add data to the object store
|
|
39
|
+
let result = yield table.add(HoopPartialDays.serialize, data.partialDaysId);
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// Method to edit existing data in the holidays
|
|
48
|
+
edit(data) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
try {
|
|
51
|
+
// Validate incoming data
|
|
52
|
+
const HoopPartialDays = new HoopPartialDaysImplModel_1.HoopPartialDaysImplModel(data.partialDaysId, data.profileId, data.description, data.beginTime, data.endTime, data.date, data.createdAt, data.updatedAt);
|
|
53
|
+
if (HoopPartialDays.validationMessages.length > 0) {
|
|
54
|
+
throw HoopPartialDays.validationMessages; // Throw error if data validation fails
|
|
55
|
+
}
|
|
56
|
+
// Open database connection
|
|
57
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
58
|
+
const database = databaseConnection.result;
|
|
59
|
+
// Start database transaction
|
|
60
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays, "readwrite");
|
|
61
|
+
// Access object store
|
|
62
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays);
|
|
63
|
+
const key = data.partialDaysId;
|
|
64
|
+
// Update existing data in the object store
|
|
65
|
+
let result = table.put(data, key);
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return error;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// Method to get data by holidaysId
|
|
74
|
+
get(query) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
try {
|
|
77
|
+
console.log(query);
|
|
78
|
+
if (typeof query.holidaysId !== "string") {
|
|
79
|
+
throw new Error("holidaysId must be a string");
|
|
80
|
+
}
|
|
81
|
+
// Open database connection
|
|
82
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
83
|
+
const database = databaseConnection.result;
|
|
84
|
+
// Start database transaction
|
|
85
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays, "readwrite");
|
|
86
|
+
// Access object store
|
|
87
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays);
|
|
88
|
+
// Get data by holidaysId from the object store
|
|
89
|
+
let result = table.get(query.holidaysId);
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.log('error ', error);
|
|
94
|
+
return error;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Method to get all data with query parameters
|
|
99
|
+
getAll(query) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
try {
|
|
102
|
+
// Open database connection
|
|
103
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
104
|
+
const database = databaseConnection.result;
|
|
105
|
+
// Start database transaction
|
|
106
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays, "readwrite");
|
|
107
|
+
// Access object store
|
|
108
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays);
|
|
109
|
+
// Retrieve all data from the object store
|
|
110
|
+
const allowedFields = [
|
|
111
|
+
"profileId"
|
|
112
|
+
];
|
|
113
|
+
if (query.getFilterContent) {
|
|
114
|
+
query.allowedFields = allowedFields;
|
|
115
|
+
}
|
|
116
|
+
query.category = "hoopPartialDays";
|
|
117
|
+
let result = yield table.getAll(query);
|
|
118
|
+
if (query.getFilterContent) {
|
|
119
|
+
result.filterContent = HoopPartialDaysFilter_1.HoopPartialDaysFilterService.getFilterData(result.filterOptions);
|
|
120
|
+
}
|
|
121
|
+
if ("filterOptions" in result) {
|
|
122
|
+
delete result.filterOptions;
|
|
123
|
+
}
|
|
124
|
+
return { result, meta: query };
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return error;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
// Method to delete data by holidaysId
|
|
132
|
+
delete(query) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
try {
|
|
135
|
+
// Open database connection
|
|
136
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
137
|
+
const database = databaseConnection.result;
|
|
138
|
+
// Start database transaction
|
|
139
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays, "readwrite");
|
|
140
|
+
// Access object store
|
|
141
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopPartialDays);
|
|
142
|
+
// Delete data by holidaysId from the object store
|
|
143
|
+
let result = table.delete(query.partialDaysId);
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return error;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.HoopPartialDaysController = HoopPartialDaysController;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
import { HoopProfilesListImplModel } from "../../models/impl/hoop/HoopProfilesListImplModel";
|
|
4
|
+
export declare class HoopProfilesListController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
constructor(dbFactory: SyncServiceFactory);
|
|
7
|
+
add(data: HoopProfilesListImplModel): Promise<any>;
|
|
8
|
+
edit(data: HoopProfilesListImplModel): Promise<any>;
|
|
9
|
+
get(query: {
|
|
10
|
+
profileId: string;
|
|
11
|
+
}): Promise<any>;
|
|
12
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
13
|
+
delete(query: Pick<HoopProfilesListImplModel, "profileId">): Promise<any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
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.HoopProfilesListController = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
const HoopProfilesListImplModel_1 = require("../../models/impl/hoop/HoopProfilesListImplModel");
|
|
15
|
+
class HoopProfilesListController {
|
|
16
|
+
// Constructor to initialize SyncServiceFactory
|
|
17
|
+
constructor(dbFactory) {
|
|
18
|
+
this._dbFactory = dbFactory;
|
|
19
|
+
}
|
|
20
|
+
// Method to add new data to the profiles list
|
|
21
|
+
add(data) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
// Validate incoming data
|
|
25
|
+
const HoopProfilesList = new HoopProfilesListImplModel_1.HoopProfilesListImplModel(data.profileId, data.profileName, data.timeZone, data.createdAt, data.updatedAt);
|
|
26
|
+
if (HoopProfilesList.validationMessages.length > 0) {
|
|
27
|
+
throw HoopProfilesList.validationMessages; // Throw error if data validation fails
|
|
28
|
+
}
|
|
29
|
+
// Open database connection
|
|
30
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
31
|
+
const database = databaseConnection.result;
|
|
32
|
+
// Start database transaction
|
|
33
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
34
|
+
// Access object store
|
|
35
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
36
|
+
// Add data to the object store
|
|
37
|
+
let result = yield table.add(HoopProfilesList.serialize, data.profileId);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// Method to edit existing data in the profiles list
|
|
46
|
+
edit(data) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
try {
|
|
49
|
+
// Validate incoming data
|
|
50
|
+
const HoopProfilesList = new HoopProfilesListImplModel_1.HoopProfilesListImplModel(data.profileId, data.profileName, data.timeZone, data.createdAt, data.updatedAt);
|
|
51
|
+
if (HoopProfilesList.validationMessages.length > 0) {
|
|
52
|
+
throw HoopProfilesList.validationMessages; // Throw error if data validation fails
|
|
53
|
+
}
|
|
54
|
+
// Open database connection
|
|
55
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
56
|
+
const database = databaseConnection.result;
|
|
57
|
+
// Start database transaction
|
|
58
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
59
|
+
// Access object store
|
|
60
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
61
|
+
const key = data.profileId;
|
|
62
|
+
let profileDetails = yield this.getAll({
|
|
63
|
+
itemsPerPage: 500,
|
|
64
|
+
pageNo: 1,
|
|
65
|
+
});
|
|
66
|
+
const profileInfo = profileDetails.result.items;
|
|
67
|
+
const isDuplicate = profileInfo.some((profile) => profile.profileName === data.profileName &&
|
|
68
|
+
profile.profileId !== data.profileId);
|
|
69
|
+
console.log("isDuplicate", isDuplicate);
|
|
70
|
+
if (isDuplicate) {
|
|
71
|
+
return "Profile with this name is already available in a different profile.";
|
|
72
|
+
}
|
|
73
|
+
// Update existing data in the object store
|
|
74
|
+
let result = table.put(data, key);
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
return error;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Method to get data by profileId
|
|
83
|
+
get(query) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
try {
|
|
86
|
+
console.log(query);
|
|
87
|
+
if (typeof query.profileId !== "string") {
|
|
88
|
+
throw new Error("profileId must be a string");
|
|
89
|
+
}
|
|
90
|
+
// Open database connection
|
|
91
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
92
|
+
const database = databaseConnection.result;
|
|
93
|
+
// Start database transaction
|
|
94
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
95
|
+
// Access object store
|
|
96
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
97
|
+
// Get data by profileId from the object store
|
|
98
|
+
let result = table.get(query.profileId);
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return error;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Method to get all data with query parameters
|
|
107
|
+
getAll(query) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
try {
|
|
110
|
+
// Open database connection
|
|
111
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
112
|
+
const database = databaseConnection.result;
|
|
113
|
+
// Start database transaction
|
|
114
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
115
|
+
// Access object store
|
|
116
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
117
|
+
// Retrieve all data from the object store
|
|
118
|
+
let result = yield table.getAll(query);
|
|
119
|
+
return { result, meta: query }; // Return result with meta data
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
return error;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// Method to delete data by profileId
|
|
127
|
+
delete(query) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
try {
|
|
130
|
+
// Open database connection
|
|
131
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
132
|
+
const database = databaseConnection.result;
|
|
133
|
+
// Start database transaction
|
|
134
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.hoopProfileList, "readwrite");
|
|
135
|
+
// Access object store
|
|
136
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.hoopProfileList);
|
|
137
|
+
// Delete data by profileId from the object store
|
|
138
|
+
let result = table.delete(query.profileId);
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
return error;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.HoopProfilesListController = HoopProfilesListController;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
import { NavigationModel } from "../../models/impl/NavigationModel";
|
|
4
|
+
export declare class NavigationController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
constructor(dbFactory: SyncServiceFactory);
|
|
7
|
+
add(data: NavigationModel): Promise<any>;
|
|
8
|
+
get(query: Pick<NavigationModel, "id">): Promise<any>;
|
|
9
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
10
|
+
edit(data: NavigationModel): Promise<any>;
|
|
11
|
+
delete(query: Pick<NavigationModel, "id">): Promise<any>;
|
|
12
|
+
update(query: NavigationModel[]): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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.NavigationController = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
14
|
+
const NavigationModel_1 = require("../../models/impl/NavigationModel");
|
|
15
|
+
const NavigationFilter_1 = require("./filterImpl/NavigationFilter");
|
|
16
|
+
class NavigationController {
|
|
17
|
+
constructor(dbFactory) {
|
|
18
|
+
this._dbFactory = dbFactory;
|
|
19
|
+
}
|
|
20
|
+
add(data) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
try {
|
|
23
|
+
const navaigation = new NavigationModel_1.NavigationModel(data.id, data.name, data.isEnabled, data.visible, data.appliedVersion, data.latestVersion, data.dateOflatestVersion, data.description, data.route, data.createdAt, data.updatedAt);
|
|
24
|
+
if (navaigation.validationMessages.length > 0) {
|
|
25
|
+
throw navaigation.validationMessages;
|
|
26
|
+
}
|
|
27
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
28
|
+
const database = databaseConnection.result;
|
|
29
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.navigationTable, "readwrite");
|
|
30
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.navigationTable);
|
|
31
|
+
let result = yield table.add(data, data.id);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.log('error occrred', error);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
get(query) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
console.log(query);
|
|
44
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
45
|
+
const database = databaseConnection.result;
|
|
46
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.navigationTable, "readwrite");
|
|
47
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.navigationTable);
|
|
48
|
+
let result = yield table.get(query.id);
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.log('error ', error);
|
|
53
|
+
return error;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//Get GPM Messages
|
|
58
|
+
getAll(query) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
console.log(query);
|
|
62
|
+
// changed to Specfic factory as method override is not working
|
|
63
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
64
|
+
const database = databaseConnection.result;
|
|
65
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.navigationTable, "readwrite");
|
|
66
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.navigationTable);
|
|
67
|
+
const allowedFields = [
|
|
68
|
+
"appliedVersion",
|
|
69
|
+
"latestVersion"
|
|
70
|
+
];
|
|
71
|
+
if (query.getFilterContent) {
|
|
72
|
+
query.allowedFields = allowedFields;
|
|
73
|
+
}
|
|
74
|
+
query.category = "navigation";
|
|
75
|
+
let result = yield table.getAll(query);
|
|
76
|
+
if (query.getFilterContent) {
|
|
77
|
+
result.filterContent = NavigationFilter_1.NavigationFilterService.getFilterData(result.filterOptions);
|
|
78
|
+
}
|
|
79
|
+
if ("filterOptions" in result) {
|
|
80
|
+
delete result.filterOptions;
|
|
81
|
+
}
|
|
82
|
+
return { result, meta: query };
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.log('error ', error);
|
|
86
|
+
return error;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
edit(data) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
try {
|
|
93
|
+
const navaigation = new NavigationModel_1.NavigationModel(data.id, data.name, data.isEnabled, data.visible, data.appliedVersion, data.latestVersion, data.dateOflatestVersion, data.description, data.route, data.createdAt, data.updatedAt);
|
|
94
|
+
if (navaigation.validationMessages.length > 0) {
|
|
95
|
+
throw navaigation.validationMessages;
|
|
96
|
+
}
|
|
97
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
98
|
+
const database = databaseConnection.result;
|
|
99
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.navigationTable, "readwrite");
|
|
100
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.navigationTable);
|
|
101
|
+
const key = data.id;
|
|
102
|
+
let result = yield table.put(data, key);
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.log('error ', error);
|
|
107
|
+
return error;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
delete(query) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
try {
|
|
114
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
115
|
+
const database = databaseConnection.result;
|
|
116
|
+
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.navigationTable, "readwrite");
|
|
117
|
+
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.navigationTable);
|
|
118
|
+
let result = yield table.delete(query.id);
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.log('delete record error ', error);
|
|
123
|
+
return error;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
update(query) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
try {
|
|
130
|
+
// Fetch all existing data
|
|
131
|
+
const existingData = yield this.getAll({});
|
|
132
|
+
const existingDataMap = new Map();
|
|
133
|
+
existingData.result.items.forEach((item) => {
|
|
134
|
+
existingDataMap.set(item.name, item);
|
|
135
|
+
});
|
|
136
|
+
// Loop through the query array
|
|
137
|
+
for (const data of query) {
|
|
138
|
+
const existingItem = existingDataMap.get(data.name);
|
|
139
|
+
if (existingItem) {
|
|
140
|
+
// Add missing attributes from existingItem to data
|
|
141
|
+
for (const key in existingItem) {
|
|
142
|
+
if (!(key in data)) {
|
|
143
|
+
data[key] = existingItem[key];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Update is_enabled based on enabled value in data
|
|
147
|
+
if ('enabled' in data) {
|
|
148
|
+
data['is_enabled'] = data['enabled'];
|
|
149
|
+
delete data['enabled'];
|
|
150
|
+
}
|
|
151
|
+
// Update updatedAt based on enabled current date
|
|
152
|
+
if ('updatedAt' in data) {
|
|
153
|
+
data['updatedAt'] = new Date().toISOString();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Updating the data into syncmaps
|
|
157
|
+
if (!existingItem || JSON.stringify(existingItem) !== JSON.stringify(data)) {
|
|
158
|
+
// Data doesn't match, call the edit function
|
|
159
|
+
yield this.edit(data);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return { message: "Update complete" };
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return error;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.NavigationController = NavigationController;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
3
|
+
import { QualityFormsModel } from "../../models/impl/QualityFormsModel";
|
|
4
|
+
export declare class QualityFormsController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
constructor(dbFactory: SyncServiceFactory);
|
|
7
|
+
add(data: QualityFormsModel): Promise<any>;
|
|
8
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
9
|
+
get(query: Pick<QualityFormsModel, 'formName'>): Promise<any>;
|
|
10
|
+
edit(recordingSid: string, data: QualityFormsModel): Promise<any>;
|
|
11
|
+
delete(recordingSid: string): Promise<any>;
|
|
12
|
+
}
|