hgs-twilio-class-lib 1.1.53 → 1.1.55

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.
Files changed (480) hide show
  1. package/lib/aws/abstract/ServiceObjectStore.d.ts +9 -0
  2. package/lib/aws/abstract/ServiceObjectStore.js +10 -1
  3. package/lib/aws/abstract/ServiceOpenRequest.d.ts +7 -0
  4. package/lib/aws/abstract/ServiceOpenRequest.js +10 -1
  5. package/lib/aws/abstract/ServiceRequest.d.ts +3 -0
  6. package/lib/aws/abstract/ServiceRequest.js +7 -1
  7. package/lib/aws/abstract/ServiceResource.d.ts +20 -0
  8. package/lib/aws/abstract/ServiceResource.js +31 -1
  9. package/lib/aws/abstract/ServiceResourceFactory.d.ts +13 -0
  10. package/lib/aws/abstract/ServiceResourceFactory.js +14 -1
  11. package/lib/aws/abstract/ServiceTransaction.d.ts +6 -0
  12. package/lib/aws/abstract/ServiceTransaction.js +11 -1
  13. package/lib/aws/impl/AWSAPIConfig.d.ts +14 -0
  14. package/lib/aws/impl/AWSAPIConfig.js +38 -1
  15. package/lib/aws/impl/AWSClient.d.ts +5 -0
  16. package/lib/aws/impl/AWSClient.js +21 -1
  17. package/lib/aws/impl/AWSConnectAPIConfig.d.ts +17 -0
  18. package/lib/aws/impl/AWSConnectAPIConfig.js +38 -1
  19. package/lib/aws/impl/DynamoDB/DynamoOpenRequest.d.ts +18 -0
  20. package/lib/aws/impl/DynamoDB/DynamoOpenRequest.js +24 -1
  21. package/lib/aws/impl/DynamoDB/DynamoRequest.d.ts +16 -0
  22. package/lib/aws/impl/DynamoDB/DynamoRequest.js +21 -1
  23. package/lib/aws/impl/DynamoDB/DynamoResourse.d.ts +29 -0
  24. package/lib/aws/impl/DynamoDB/DynamoResourse.js +45 -1
  25. package/lib/aws/impl/DynamoDB/DynamoServiceFactory.d.ts +16 -0
  26. package/lib/aws/impl/DynamoDB/DynamoServiceFactory.js +63 -1
  27. package/lib/aws/impl/DynamoDB/DynamoTable.d.ts +26 -0
  28. package/lib/aws/impl/DynamoDB/DynamoTable.js +126 -1
  29. package/lib/aws/impl/DynamoDB/DynamoTransaction.d.ts +21 -0
  30. package/lib/aws/impl/DynamoDB/DynamoTransaction.js +37 -1
  31. package/lib/aws/impl/HoopServices/HoopService.d.ts +28 -0
  32. package/lib/aws/impl/HoopServices/HoopService.js +124 -1
  33. package/lib/aws/impl/HoopServices/HoopServiceFactory.d.ts +17 -0
  34. package/lib/aws/impl/HoopServices/HoopServiceFactory.js +53 -1
  35. package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.d.ts +18 -0
  36. package/lib/aws/impl/HoopServices/HoopServiceOpenRequest.js +24 -1
  37. package/lib/aws/impl/HoopServices/HoopServiceResource.d.ts +29 -0
  38. package/lib/aws/impl/HoopServices/HoopServiceResource.js +46 -1
  39. package/lib/aws/impl/HoopServices/HoopServiceTransaction.d.ts +22 -0
  40. package/lib/aws/impl/HoopServices/HoopServiceTransaction.js +37 -1
  41. package/lib/aws/interface/IDirection.d.ts +2 -0
  42. package/lib/aws/interface/IDirection.js +2 -1
  43. package/lib/aws/interface/ILink.d.ts +2 -0
  44. package/lib/aws/interface/ILink.js +2 -1
  45. package/lib/aws/interface/IServiceDBOpenRequest.d.ts +3 -0
  46. package/lib/aws/interface/IServiceDBOpenRequest.js +2 -1
  47. package/lib/aws/interface/IServiceObjectStore.d.ts +3 -0
  48. package/lib/aws/interface/IServiceObjectStore.js +2 -1
  49. package/lib/aws/interface/IServiceObjectStoreParameters.d.ts +4 -0
  50. package/lib/aws/interface/IServiceObjectStoreParameters.js +2 -1
  51. package/lib/aws/interface/IServiceRequest.d.ts +3 -0
  52. package/lib/aws/interface/IServiceRequest.js +2 -1
  53. package/lib/aws/interface/IServiceResource.d.ts +7 -0
  54. package/lib/aws/interface/IServiceResource.js +2 -1
  55. package/lib/aws/interface/IServiceTransation.d.ts +3 -0
  56. package/lib/aws/interface/IServiceTransation.js +2 -1
  57. package/lib/aws/interface/ISubResourceUri.d.ts +2 -0
  58. package/lib/aws/interface/ISubResourceUri.js +2 -1
  59. package/lib/aws/interface/ISyncItemData.d.ts +0 -0
  60. package/lib/aws/interface/ISyncItemData.js +1 -1
  61. package/lib/aws/interface/ISyncObjectStoreParameters.d.ts +0 -0
  62. package/lib/aws/interface/ISyncObjectStoreParameters.js +1 -1
  63. package/lib/aws/interface/ISyncTransactionOptions.d.ts +4 -0
  64. package/lib/aws/interface/ISyncTransactionOptions.js +2 -1
  65. package/lib/common/abstract/CommonError.d.ts +8 -0
  66. package/lib/common/abstract/CommonError.js +12 -1
  67. package/lib/common/abstract/Database.d.ts +44 -0
  68. package/lib/common/abstract/Database.js +58 -1
  69. package/lib/common/abstract/DatabaseClient.d.ts +11 -0
  70. package/lib/common/abstract/DatabaseClient.js +21 -1
  71. package/lib/common/abstract/DatabaseClientConfig.d.ts +5 -0
  72. package/lib/common/abstract/DatabaseClientConfig.js +9 -1
  73. package/lib/common/abstract/DatabaseFactory.d.ts +70 -0
  74. package/lib/common/abstract/DatabaseFactory.js +32 -1
  75. package/lib/common/abstract/DatabaseObjectStore.d.ts +29 -0
  76. package/lib/common/abstract/DatabaseObjectStore.js +13 -1
  77. package/lib/common/abstract/DatabaseOpenRequest.d.ts +24 -0
  78. package/lib/common/abstract/DatabaseOpenRequest.js +13 -1
  79. package/lib/common/abstract/DatabaseRequest.d.ts +21 -0
  80. package/lib/common/abstract/DatabaseRequest.js +14 -1
  81. package/lib/common/abstract/DatabaseTransaction.d.ts +22 -0
  82. package/lib/common/abstract/DatabaseTransaction.js +13 -1
  83. package/lib/common/abstract/Filter.d.ts +12 -0
  84. package/lib/common/abstract/Filter.js +30 -1
  85. package/lib/common/enum/ErrorTypes.d.ts +4 -0
  86. package/lib/common/enum/ErrorTypes.js +9 -1
  87. package/lib/common/enum/FilterTypes.d.ts +10 -0
  88. package/lib/common/enum/FilterTypes.js +14 -1
  89. package/lib/common/interface/IDatabaesInfo.d.ts +2 -0
  90. package/lib/common/interface/IDatabaesInfo.js +2 -1
  91. package/lib/common/interface/IDatabase.d.ts +4 -0
  92. package/lib/common/interface/IDatabase.js +2 -1
  93. package/lib/common/interface/IDatabaseClient.d.ts +5 -0
  94. package/lib/common/interface/IDatabaseClient.js +2 -1
  95. package/lib/common/interface/IDatabaseConfig.d.ts +8 -0
  96. package/lib/common/interface/IDatabaseConfig.js +10 -1
  97. package/lib/common/interface/IDatabaseDBOpenRequest.d.ts +2 -0
  98. package/lib/common/interface/IDatabaseDBOpenRequest.js +2 -1
  99. package/lib/common/interface/IDatabaseFactory.d.ts +21 -0
  100. package/lib/common/interface/IDatabaseFactory.js +2 -1
  101. package/lib/common/interface/IDatabaseObjectStore.d.ts +2 -0
  102. package/lib/common/interface/IDatabaseObjectStore.js +2 -1
  103. package/lib/common/interface/IDatabaseObjectStoreParameters.d.ts +2 -0
  104. package/lib/common/interface/IDatabaseObjectStoreParameters.js +2 -1
  105. package/lib/common/interface/IDatabaseRecord.d.ts +2 -0
  106. package/lib/common/interface/IDatabaseRecord.js +2 -1
  107. package/lib/common/interface/IDatabaseRequest.d.ts +2 -0
  108. package/lib/common/interface/IDatabaseRequest.js +2 -1
  109. package/lib/common/interface/IDatabaseTransaction.d.ts +2 -0
  110. package/lib/common/interface/IDatabaseTransaction.js +2 -1
  111. package/lib/common/interface/IDatabaseTransactionOptions.d.ts +2 -0
  112. package/lib/common/interface/IDatabaseTransactionOptions.js +2 -1
  113. package/lib/common/interface/IError.d.ts +5 -0
  114. package/lib/common/interface/IError.js +2 -1
  115. package/lib/common/interface/IErrorDetails.d.ts +6 -0
  116. package/lib/common/interface/IErrorDetails.js +2 -1
  117. package/lib/common/interface/IFilter.d.ts +25 -0
  118. package/lib/common/interface/IFilter.js +2 -1
  119. package/lib/common/type/DatabaseReadyType.d.ts +1 -0
  120. package/lib/common/type/DatabaseReadyType.js +2 -1
  121. package/lib/common/type/FilterInputType.d.ts +1 -0
  122. package/lib/common/type/FilterInputType.js +2 -1
  123. package/lib/common/type/SearchParameterType.d.ts +15 -0
  124. package/lib/common/type/SearchParameterType.js +3 -1
  125. package/lib/common/utils/dateFormat.d.ts +1 -0
  126. package/lib/common/utils/dateFormat.js +58 -1
  127. package/lib/common/utils/filter.d.ts +1 -0
  128. package/lib/common/utils/filter.js +99 -1
  129. package/lib/common/utils/newFilter.d.ts +1 -0
  130. package/lib/common/utils/newFilter.js +126 -1
  131. package/lib/common/utils/pagination.d.ts +1 -0
  132. package/lib/common/utils/pagination.js +9 -1
  133. package/lib/common/utils/search.d.ts +1 -0
  134. package/lib/common/utils/search.js +14 -1
  135. package/lib/common/utils/sort.d.ts +1 -0
  136. package/lib/common/utils/sort.js +13 -1
  137. package/lib/config/AWSConfig.d.ts +6 -0
  138. package/lib/config/AWSConfig.js +9 -1
  139. package/lib/config/DatabaseConfig.d.ts +33 -0
  140. package/lib/config/DatabaseConfig.js +36 -1
  141. package/lib/config/TwilioConfig.d.ts +4 -0
  142. package/lib/config/TwilioConfig.js +7 -1
  143. package/lib/controller/Common.d.ts +20 -0
  144. package/lib/controller/Common.js +57 -1
  145. package/lib/controller/DatabaseFactoryCollection.d.ts +6 -0
  146. package/lib/controller/DatabaseFactoryCollection.js +14 -1
  147. package/lib/controller/MainController.d.ts +6 -0
  148. package/lib/controller/MainController.js +174 -1
  149. package/lib/controller/aws/HoopBuisnessHours.d.ts +23 -0
  150. package/lib/controller/aws/HoopBuisnessHours.js +408 -1
  151. package/lib/controller/aws/HoopOperationsController.d.ts +9 -0
  152. package/lib/controller/aws/HoopOperationsController.js +86 -1
  153. package/lib/controller/aws/HoopOverrideBranchesController.d.ts +7 -0
  154. package/lib/controller/aws/HoopOverrideBranchesController.js +40 -1
  155. package/lib/controller/aws/HoopProfilesListController.d.ts +8 -0
  156. package/lib/controller/aws/HoopProfilesListController.js +61 -1
  157. package/lib/controller/aws/PlaybackScreenrecordings.d.ts +9 -0
  158. package/lib/controller/aws/PlaybackScreenrecordings.js +63 -1
  159. package/lib/controller/twilio/AgentActionsController.d.ts +54 -0
  160. package/lib/controller/twilio/AgentActionsController.js +177 -1
  161. package/lib/controller/twilio/AgentScorecardController.d.ts +53 -0
  162. package/lib/controller/twilio/AgentScorecardController.js +173 -1
  163. package/lib/controller/twilio/AuditLogController.d.ts +15 -0
  164. package/lib/controller/twilio/AuditLogController.js +137 -1
  165. package/lib/controller/twilio/CallLogsController.d.ts +12 -0
  166. package/lib/controller/twilio/CallLogsController.js +131 -1
  167. package/lib/controller/twilio/CallbackAndVoicemailController.d.ts +12 -0
  168. package/lib/controller/twilio/CallbackAndVoicemailController.js +114 -1
  169. package/lib/controller/twilio/ChannelSettingTaskInfoController.d.ts +11 -0
  170. package/lib/controller/twilio/ChannelSettingTaskInfoController.js +117 -1
  171. package/lib/controller/twilio/ChannelSettingsController.d.ts +16 -0
  172. package/lib/controller/twilio/ChannelSettingsController.js +142 -1
  173. package/lib/controller/twilio/CxConfigAssetController.d.ts +12 -0
  174. package/lib/controller/twilio/CxConfigAssetController.js +128 -1
  175. package/lib/controller/twilio/CxConfigController.d.ts +18 -0
  176. package/lib/controller/twilio/CxConfigController.js +112 -1
  177. package/lib/controller/twilio/CxConfigExternalNumbersController.d.ts +12 -0
  178. package/lib/controller/twilio/CxConfigExternalNumbersController.js +138 -1
  179. package/lib/controller/twilio/CxConfigOther.d.ts +16 -0
  180. package/lib/controller/twilio/CxConfigOther.js +128 -1
  181. package/lib/controller/twilio/CxConfigQueueMenuController.d.ts +12 -0
  182. package/lib/controller/twilio/CxConfigQueueMenuController.js +129 -1
  183. package/lib/controller/twilio/CxConfigUIconfigController.d.ts +12 -0
  184. package/lib/controller/twilio/CxConfigUIconfigController.js +132 -1
  185. package/lib/controller/twilio/GPMController.d.ts +12 -0
  186. package/lib/controller/twilio/GPMController.js +151 -1
  187. package/lib/controller/twilio/HoopBusinessHoursController.d.ts +18 -0
  188. package/lib/controller/twilio/HoopBusinessHoursController.js +285 -1
  189. package/lib/controller/twilio/HoopHolidaysController.d.ts +14 -0
  190. package/lib/controller/twilio/HoopHolidaysController.js +150 -1
  191. package/lib/controller/twilio/HoopMainController.d.ts +13 -0
  192. package/lib/controller/twilio/HoopMainController.js +297 -1
  193. package/lib/controller/twilio/HoopNotesController.d.ts +14 -0
  194. package/lib/controller/twilio/HoopNotesController.js +149 -1
  195. package/lib/controller/twilio/HoopOperationsController.d.ts +14 -0
  196. package/lib/controller/twilio/HoopOperationsController.js +138 -1
  197. package/lib/controller/twilio/HoopOverrideBranchesController.d.ts +14 -0
  198. package/lib/controller/twilio/HoopOverrideBranchesController.js +137 -1
  199. package/lib/controller/twilio/HoopPartialDaysController.d.ts +14 -0
  200. package/lib/controller/twilio/HoopPartialDaysController.js +150 -1
  201. package/lib/controller/twilio/HoopProfilesListController.d.ts +14 -0
  202. package/lib/controller/twilio/HoopProfilesListController.js +147 -1
  203. package/lib/controller/twilio/NavigationController.d.ts +13 -0
  204. package/lib/controller/twilio/NavigationController.js +170 -1
  205. package/lib/controller/twilio/QualityFormsController.d.ts +12 -0
  206. package/lib/controller/twilio/QualityFormsController.js +129 -1
  207. package/lib/controller/twilio/QuickLinkController.d.ts +11 -0
  208. package/lib/controller/twilio/QuickLinkController.js +122 -1
  209. package/lib/controller/twilio/RealTimeReportQueueDetailsController.d.ts +14 -0
  210. package/lib/controller/twilio/RealTimeReportQueueDetailsController.js +126 -1
  211. package/lib/controller/twilio/RealTimeReportsWGDetailsController.d.ts +53 -0
  212. package/lib/controller/twilio/RealTimeReportsWGDetailsController.js +160 -1
  213. package/lib/controller/twilio/TaskInfoPanelController.d.ts +15 -0
  214. package/lib/controller/twilio/TaskInfoPanelController.js +134 -1
  215. package/lib/controller/twilio/filterImpl/AgentScorecardFilter.d.ts +12 -0
  216. package/lib/controller/twilio/filterImpl/AgentScorecardFilter.js +52 -1
  217. package/lib/controller/twilio/filterImpl/AuditLogsFilter.d.ts +12 -0
  218. package/lib/controller/twilio/filterImpl/AuditLogsFilter.js +89 -1
  219. package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.d.ts +12 -0
  220. package/lib/controller/twilio/filterImpl/CXConfigPromptFilter.js +81 -1
  221. package/lib/controller/twilio/filterImpl/CallLogsFilter.d.ts +20 -0
  222. package/lib/controller/twilio/filterImpl/CallLogsFilter.js +101 -1
  223. package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.d.ts +12 -0
  224. package/lib/controller/twilio/filterImpl/CxConfigAssetFilter.js +59 -1
  225. package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.d.ts +12 -0
  226. package/lib/controller/twilio/filterImpl/CxConfigExternalNumbersFilter.js +67 -1
  227. package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.d.ts +14 -0
  228. package/lib/controller/twilio/filterImpl/CxConfigOtherFilter.js +52 -1
  229. package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.d.ts +17 -0
  230. package/lib/controller/twilio/filterImpl/CxConfigQueueMenuFilter.js +78 -1
  231. package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.d.ts +12 -0
  232. package/lib/controller/twilio/filterImpl/CxConfigUIconfigFilter.js +51 -1
  233. package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.d.ts +12 -0
  234. package/lib/controller/twilio/filterImpl/HoopHolidaysFilter.js +55 -1
  235. package/lib/controller/twilio/filterImpl/HoopNotesFilter.d.ts +12 -0
  236. package/lib/controller/twilio/filterImpl/HoopNotesFilter.js +51 -1
  237. package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.d.ts +12 -0
  238. package/lib/controller/twilio/filterImpl/HoopPartialDaysFilter.js +55 -1
  239. package/lib/controller/twilio/filterImpl/MainFilterService.d.ts +4 -0
  240. package/lib/controller/twilio/filterImpl/MainFilterService.js +108 -1
  241. package/lib/controller/twilio/filterImpl/NavigationFilter.d.ts +20 -0
  242. package/lib/controller/twilio/filterImpl/NavigationFilter.js +90 -1
  243. package/lib/controller/twilio/filterImpl/QueueDetailsFilter.d.ts +14 -0
  244. package/lib/controller/twilio/filterImpl/QueueDetailsFilter.js +53 -1
  245. package/lib/controller/twilio/filterImpl/TaskCompleteFilter.d.ts +12 -0
  246. package/lib/controller/twilio/filterImpl/TaskCompleteFilter.js +62 -1
  247. package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.d.ts +12 -0
  248. package/lib/controller/twilio/filterImpl/TaskInfoPanelFilter.js +52 -1
  249. package/lib/express/ApiResponse.d.ts +15 -0
  250. package/lib/express/ApiResponse.js +11 -1
  251. package/lib/express/RequestValidator.d.ts +50 -0
  252. package/lib/express/RequestValidator.js +77 -1
  253. package/lib/express/RequireParamsPicker.d.ts +7 -0
  254. package/lib/express/RequireParamsPicker.js +14 -1
  255. package/lib/express/ValidateRequireParameters.d.ts +3 -0
  256. package/lib/express/ValidateRequireParameters.js +39 -1
  257. package/lib/index.d.ts +39 -0
  258. package/lib/index.js +100 -1
  259. package/lib/models/BatchUpdateSkills.model.d.ts +0 -0
  260. package/lib/models/BatchUpdateSkills.model.js +11 -1
  261. package/lib/models/CannedMessage.model.d.ts +4 -0
  262. package/lib/models/CannedMessage.model.js +1 -1
  263. package/lib/models/ChannelSettingsTaskInfo.model.d.ts +87 -0
  264. package/lib/models/ChannelSettingsTaskInfo.model.js +1 -1
  265. package/lib/models/CustomerFeedback.model.d.ts +9 -0
  266. package/lib/models/CustomerFeedback.model.js +1 -1
  267. package/lib/models/Filter.model.d.ts +15 -0
  268. package/lib/models/Filter.model.js +2 -1
  269. package/lib/models/Hoop.model.d.ts +9 -0
  270. package/lib/models/Hoop.model.js +9 -1
  271. package/lib/models/Navigation.model.d.ts +28 -0
  272. package/lib/models/Navigation.model.js +8 -1
  273. package/lib/models/Roles.Model.d.ts +8 -0
  274. package/lib/models/Roles.Model.js +1 -1
  275. package/lib/models/abstract/BaseModel.d.ts +17 -0
  276. package/lib/models/abstract/BaseModel.js +40 -1
  277. package/lib/models/impl/AgentActionsLogsModel.d.ts +27 -0
  278. package/lib/models/impl/AgentActionsLogsModel.js +89 -1
  279. package/lib/models/impl/AgentActionsModel.d.ts +19 -0
  280. package/lib/models/impl/AgentActionsModel.js +60 -1
  281. package/lib/models/impl/AgentScorecardModel.d.ts +66 -0
  282. package/lib/models/impl/AgentScorecardModel.js +282 -1
  283. package/lib/models/impl/AuditLogsModel.d.ts +31 -0
  284. package/lib/models/impl/AuditLogsModel.js +146 -1
  285. package/lib/models/impl/CallLogsModel.d.ts +37 -0
  286. package/lib/models/impl/CallLogsModel.js +109 -1
  287. package/lib/models/impl/CallStatisticsModel.d.ts +16 -0
  288. package/lib/models/impl/CallStatisticsModel.js +52 -1
  289. package/lib/models/impl/CategoryDetailsModel.d.ts +17 -0
  290. package/lib/models/impl/CategoryDetailsModel.js +44 -1
  291. package/lib/models/impl/MemberModel.d.ts +42 -0
  292. package/lib/models/impl/MemberModel.js +170 -1
  293. package/lib/models/impl/ModelValidationError.d.ts +6 -0
  294. package/lib/models/impl/ModelValidationError.js +15 -1
  295. package/lib/models/impl/NavigationModel.d.ts +39 -0
  296. package/lib/models/impl/NavigationModel.js +126 -1
  297. package/lib/models/impl/PerformanceStatisticsModel.d.ts +41 -0
  298. package/lib/models/impl/PerformanceStatisticsModel.js +129 -1
  299. package/lib/models/impl/PlaybackScreenrecordings.d.ts +39 -0
  300. package/lib/models/impl/PlaybackScreenrecordings.js +133 -1
  301. package/lib/models/impl/ProfileModel.d.ts +23 -0
  302. package/lib/models/impl/ProfileModel.js +102 -1
  303. package/lib/models/impl/QualityFormsModel.d.ts +39 -0
  304. package/lib/models/impl/QualityFormsModel.js +150 -1
  305. package/lib/models/impl/QuestionDetailsModel.d.ts +39 -0
  306. package/lib/models/impl/QuestionDetailsModel.js +173 -1
  307. package/lib/models/impl/QueueDetailsModel.d.ts +63 -0
  308. package/lib/models/impl/QueueDetailsModel.js +261 -1
  309. package/lib/models/impl/QueueModel.d.ts +39 -0
  310. package/lib/models/impl/QueueModel.js +156 -1
  311. package/lib/models/impl/QuickLinkModel.d.ts +24 -0
  312. package/lib/models/impl/QuickLinkModel.js +122 -1
  313. package/lib/models/impl/StatisticsNumberDetailsModel.d.ts +18 -0
  314. package/lib/models/impl/StatisticsNumberDetailsModel.js +72 -1
  315. package/lib/models/impl/StatisticsTimeDetailsModel.d.ts +18 -0
  316. package/lib/models/impl/StatisticsTimeDetailsModel.js +72 -1
  317. package/lib/models/impl/TaskAttributesModel.d.ts +31 -0
  318. package/lib/models/impl/TaskAttributesModel.js +108 -1
  319. package/lib/models/impl/TaskChannelModel.d.ts +15 -0
  320. package/lib/models/impl/TaskChannelModel.js +69 -1
  321. package/lib/models/impl/TaskComplete.d.ts +0 -0
  322. package/lib/models/impl/TaskComplete.js +1 -1
  323. package/lib/models/impl/TaskInfoPanelModel.d.ts +16 -0
  324. package/lib/models/impl/TaskInfoPanelModel.js +69 -1
  325. package/lib/models/impl/TaskModel.d.ts +59 -0
  326. package/lib/models/impl/TaskModel.js +234 -1
  327. package/lib/models/impl/WorkGroupDetailsModel.d.ts +63 -0
  328. package/lib/models/impl/WorkGroupDetailsModel.js +281 -1
  329. package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.d.ts +33 -0
  330. package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailModel.js +140 -1
  331. package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.d.ts +8 -0
  332. package/lib/models/impl/callbackandvoicemail/CallbackAndVoicemailNamespace.js +12 -1
  333. package/lib/models/impl/callbackandvoicemail/CallbackModel.d.ts +19 -0
  334. package/lib/models/impl/callbackandvoicemail/CallbackModel.js +82 -1
  335. package/lib/models/impl/callbackandvoicemail/VoicemailModel.d.ts +25 -0
  336. package/lib/models/impl/callbackandvoicemail/VoicemailModel.js +108 -1
  337. package/lib/models/impl/channelsettings/ChannelSettingModel.d.ts +68 -0
  338. package/lib/models/impl/channelsettings/ChannelSettingModel.js +240 -1
  339. package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.d.ts +31 -0
  340. package/lib/models/impl/channelsettings/ChannelSettingTaskInfoModel.js +106 -1
  341. package/lib/models/impl/channelsettings/TaskInfoAttributeModel.d.ts +25 -0
  342. package/lib/models/impl/channelsettings/TaskInfoAttributeModel.js +80 -1
  343. package/lib/models/impl/channelsettings/TaskInfoModel.d.ts +13 -0
  344. package/lib/models/impl/channelsettings/TaskInfoModel.js +52 -1
  345. package/lib/models/impl/cxconfig/CxConfigNamespace.d.ts +16 -0
  346. package/lib/models/impl/cxconfig/CxConfigNamespace.js +20 -1
  347. package/lib/models/impl/cxconfig/CxConfigUIConfigModel.d.ts +27 -0
  348. package/lib/models/impl/cxconfig/CxConfigUIConfigModel.js +173 -1
  349. package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.d.ts +24 -0
  350. package/lib/models/impl/cxconfig/CxConfiguratorConfigModel.js +103 -1
  351. package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.d.ts +24 -0
  352. package/lib/models/impl/cxconfig/CxConfiguratorExternalNumbersModel.js +149 -1
  353. package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.d.ts +27 -0
  354. package/lib/models/impl/cxconfig/CxConfiguratorGPMAssetModel.js +179 -1
  355. package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.d.ts +40 -0
  356. package/lib/models/impl/cxconfig/CxConfiguratorGPMPromptModel.js +213 -1
  357. package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.d.ts +27 -0
  358. package/lib/models/impl/cxconfig/CxConfiguratorOtherModel.js +159 -1
  359. package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.d.ts +40 -0
  360. package/lib/models/impl/cxconfig/CxConfiguratorQueueMenuModel.js +128 -1
  361. package/lib/models/impl/hoop/HoopBusinessHoursModel.d.ts +39 -0
  362. package/lib/models/impl/hoop/HoopBusinessHoursModel.js +122 -1
  363. package/lib/models/impl/hoop/HoopDescriptionModel.d.ts +16 -0
  364. package/lib/models/impl/hoop/HoopDescriptionModel.js +64 -1
  365. package/lib/models/impl/hoop/HoopHolidaysImplModel.d.ts +25 -0
  366. package/lib/models/impl/hoop/HoopHolidaysImplModel.js +118 -1
  367. package/lib/models/impl/hoop/HoopNotesImplModel.d.ts +25 -0
  368. package/lib/models/impl/hoop/HoopNotesImplModel.js +117 -1
  369. package/lib/models/impl/hoop/HoopOperationsImplModel.d.ts +28 -0
  370. package/lib/models/impl/hoop/HoopOperationsImplModel.js +161 -1
  371. package/lib/models/impl/hoop/HoopOverrideImplModel.d.ts +22 -0
  372. package/lib/models/impl/hoop/HoopOverrideImplModel.js +143 -1
  373. package/lib/models/impl/hoop/HoopPartialDaysImplModel.d.ts +31 -0
  374. package/lib/models/impl/hoop/HoopPartialDaysImplModel.js +140 -1
  375. package/lib/models/impl/hoop/HoopProfilesListImplModel.d.ts +22 -0
  376. package/lib/models/impl/hoop/HoopProfilesListImplModel.js +104 -1
  377. package/lib/models/impl/hoop/HoopWeeklyTimingModel.d.ts +22 -0
  378. package/lib/models/impl/hoop/HoopWeeklyTimingModel.js +86 -1
  379. package/lib/models/index.d.ts +25 -0
  380. package/lib/models/index.js +53 -1
  381. package/lib/models/interface/IBaseModel.d.ts +11 -0
  382. package/lib/models/interface/IBaseModel.js +2 -1
  383. package/lib/models/types/AgentScorecard.type.d.ts +6 -0
  384. package/lib/models/types/AgentScorecard.type.js +7 -1
  385. package/lib/models/types/AuditLog.type.d.ts +13 -0
  386. package/lib/models/types/AuditLog.type.js +10 -1
  387. package/lib/models/types/CallLog.type.d.ts +16 -0
  388. package/lib/models/types/CallLog.type.js +10 -1
  389. package/lib/models/types/ChannelSetting.type.d.ts +7 -0
  390. package/lib/models/types/ChannelSetting.type.js +11 -1
  391. package/lib/models/types/CxConfig.type.d.ts +72 -0
  392. package/lib/models/types/CxConfig.type.js +43 -1
  393. package/lib/models/types/Hoop.type.d.ts +9 -0
  394. package/lib/models/types/Hoop.type.js +13 -1
  395. package/lib/models/types/Navigation.type.d.ts +11 -0
  396. package/lib/models/types/Navigation.type.js +8 -1
  397. package/lib/models/types/Profile.type.d.ts +1 -0
  398. package/lib/models/types/Profile.type.js +2 -1
  399. package/lib/models/types/QueueDetails.type.d.ts +6 -0
  400. package/lib/models/types/QueueDetails.type.js +7 -1
  401. package/lib/models/types/TaskComplete.type.d.ts +7 -0
  402. package/lib/models/types/TaskComplete.type.js +6 -1
  403. package/lib/models/types/TaskInfoPanel.type.d.ts +6 -0
  404. package/lib/models/types/TaskInfoPanel.type.js +7 -1
  405. package/lib/server.d.ts +1 -0
  406. package/lib/server.js +39 -1
  407. package/lib/twilio/abstract/ServiceObjectStore.d.ts +6 -0
  408. package/lib/twilio/abstract/ServiceObjectStore.js +10 -1
  409. package/lib/twilio/abstract/ServiceOpenRequest.d.ts +7 -0
  410. package/lib/twilio/abstract/ServiceOpenRequest.js +10 -1
  411. package/lib/twilio/abstract/ServiceRequest.d.ts +3 -0
  412. package/lib/twilio/abstract/ServiceRequest.js +7 -1
  413. package/lib/twilio/abstract/ServiceResource.d.ts +23 -0
  414. package/lib/twilio/abstract/ServiceResource.js +37 -1
  415. package/lib/twilio/abstract/ServiceResourceFactory.d.ts +15 -0
  416. package/lib/twilio/abstract/ServiceResourceFactory.js +18 -1
  417. package/lib/twilio/abstract/ServiceTransaction.d.ts +6 -0
  418. package/lib/twilio/abstract/ServiceTransaction.js +11 -1
  419. package/lib/twilio/abstract/SyncServiceItemResource.d.ts +31 -0
  420. package/lib/twilio/abstract/SyncServiceItemResource.js +60 -1
  421. package/lib/twilio/abstract/TwilioClientConfig.d.ts +0 -0
  422. package/lib/twilio/abstract/TwilioClientConfig.js +1 -1
  423. package/lib/twilio/impl/TwilioAPIKeyConfig.d.ts +14 -0
  424. package/lib/twilio/impl/TwilioAPIKeyConfig.js +31 -1
  425. package/lib/twilio/impl/TwilioAuthTokenConfig.d.ts +11 -0
  426. package/lib/twilio/impl/TwilioAuthTokenConfig.js +24 -1
  427. package/lib/twilio/impl/TwilioClient.d.ts +6 -0
  428. package/lib/twilio/impl/TwilioClient.js +21 -1
  429. package/lib/twilio/impl/message/messageService.d.ts +0 -0
  430. package/lib/twilio/impl/message/messageService.js +42 -1
  431. package/lib/twilio/impl/sync/SyncDocument.d.ts +24 -0
  432. package/lib/twilio/impl/sync/SyncDocument.js +52 -1
  433. package/lib/twilio/impl/sync/SyncDocumentTransaction.d.ts +20 -0
  434. package/lib/twilio/impl/sync/SyncDocumentTransaction.js +31 -1
  435. package/lib/twilio/impl/sync/SyncList.d.ts +24 -0
  436. package/lib/twilio/impl/sync/SyncList.js +52 -1
  437. package/lib/twilio/impl/sync/SyncListItem.d.ts +5 -0
  438. package/lib/twilio/impl/sync/SyncListItem.js +22 -1
  439. package/lib/twilio/impl/sync/SyncListTransaction.d.ts +20 -0
  440. package/lib/twilio/impl/sync/SyncListTransaction.js +31 -1
  441. package/lib/twilio/impl/sync/SyncMap.d.ts +25 -0
  442. package/lib/twilio/impl/sync/SyncMap.js +139 -1
  443. package/lib/twilio/impl/sync/SyncMapItem.d.ts +5 -0
  444. package/lib/twilio/impl/sync/SyncMapItem.js +7 -1
  445. package/lib/twilio/impl/sync/SyncMapTransaction.d.ts +22 -0
  446. package/lib/twilio/impl/sync/SyncMapTransaction.js +38 -1
  447. package/lib/twilio/impl/sync/SyncOpenRequest.d.ts +18 -0
  448. package/lib/twilio/impl/sync/SyncOpenRequest.js +24 -1
  449. package/lib/twilio/impl/sync/SyncRequest.d.ts +16 -0
  450. package/lib/twilio/impl/sync/SyncRequest.js +21 -1
  451. package/lib/twilio/impl/sync/SyncResource.d.ts +50 -0
  452. package/lib/twilio/impl/sync/SyncResource.js +97 -1
  453. package/lib/twilio/impl/sync/SyncServiceFactory.d.ts +22 -0
  454. package/lib/twilio/impl/sync/SyncServiceFactory.js +117 -1
  455. package/lib/twilio/interface/IDirection.d.ts +2 -0
  456. package/lib/twilio/interface/IDirection.js +2 -1
  457. package/lib/twilio/interface/ILink.d.ts +2 -0
  458. package/lib/twilio/interface/ILink.js +2 -1
  459. package/lib/twilio/interface/IServiceDBOpenRequest.d.ts +3 -0
  460. package/lib/twilio/interface/IServiceDBOpenRequest.js +2 -1
  461. package/lib/twilio/interface/IServiceObjectStore.d.ts +3 -0
  462. package/lib/twilio/interface/IServiceObjectStore.js +2 -1
  463. package/lib/twilio/interface/IServiceObjectStoreParameters.d.ts +4 -0
  464. package/lib/twilio/interface/IServiceObjectStoreParameters.js +2 -1
  465. package/lib/twilio/interface/IServiceRequest.d.ts +3 -0
  466. package/lib/twilio/interface/IServiceRequest.js +2 -1
  467. package/lib/twilio/interface/IServiceResource.d.ts +8 -0
  468. package/lib/twilio/interface/IServiceResource.js +2 -1
  469. package/lib/twilio/interface/IServiceTransation.d.ts +3 -0
  470. package/lib/twilio/interface/IServiceTransation.js +2 -1
  471. package/lib/twilio/interface/ISubResourceUri.d.ts +2 -0
  472. package/lib/twilio/interface/ISubResourceUri.js +2 -1
  473. package/lib/twilio/interface/ISyncItemData.d.ts +0 -0
  474. package/lib/twilio/interface/ISyncItemData.js +1 -1
  475. package/lib/twilio/interface/ISyncObjectStoreParameters.d.ts +0 -0
  476. package/lib/twilio/interface/ISyncObjectStoreParameters.js +1 -1
  477. package/lib/twilio/interface/ISyncTransactionOptions.d.ts +4 -0
  478. package/lib/twilio/interface/ISyncTransactionOptions.js +2 -1
  479. package/package.json +9 -5
  480. package/lib/models/abstract/BaseModelOld.js +0 -1
@@ -1 +1,142 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChannelSettingsController=void 0;const e=require("tslib"),t=require("../../config/DatabaseConfig"),i=require("../../models/impl/channelsettings/ChannelSettingModel");exports.ChannelSettingsController=class{constructor(e){this._dbFactory=e}getDatabaseConnection(){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result}))}getTransaction(){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this.getDatabaseConnection()).transaction(t.databaseConfig.tables.channelSettingsTable,"readwrite")}))}validateChannelSetting(t){return e.__awaiter(this,void 0,void 0,(function*(){const e=t.validationMessages;if(e.length>0)throw e}))}getMap(){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable),i=yield e.getMap(),n=JSON.parse(JSON.stringify(i));return n.etag=n.revision,n}catch(e){throw console.error("Error retrieving channel setting sync map:",e),e}}))}add(n){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new i.ChannelSettingModel(n.id,n.name,n.channelType,n.queueSid,n.autoAnswer,n.autoComplete,n.autoCallTranscript,n.autoCallRecording,n.autoCallScreenRecording,n.alert,n.waitMusic,n.createdBy,n.createdDate,n.updatedDate,n.waitMusicFile,n.alertAudioFile,n.autoAnswerTime,n.useAlertExistingAudio,n.autoCompleteTime,n.useWaitExistingAudio);if(e.validationMessages.length>0)throw e.validationMessages;const a=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable);return yield a.add(e.serialize,e.id)}catch(e){throw console.error("Error adding channel setting:",e),e}}))}get(i){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable);return yield e.get(i.id)}catch(e){throw console.error("Error retrieving channel setting:",e),e}}))}getAll(i){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable);let n=yield e.getAll(i);return n.items&&n.items.length&&(n.items=n.items.map((e=>Object.assign({},e)))),i.getFilterContent&&(i.allowedFields=["name","channelType","queueSid"],n.filterContent=n.filter((e=>i.allowedFields.every((t=>t in e))))),{result:n,meta:i}}catch(e){throw console.error("Error retrieving all channel settings:",e),e}}))}edit(n){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new i.ChannelSettingModel(n.id,n.name,n.channelType,n.queueSid,n.autoAnswer,n.autoComplete,n.autoCallTranscript,n.autoCallRecording,n.autoCallScreenRecording,n.alert,n.waitMusic,n.createdBy,n.createdDate,n.updatedDate,n.waitMusicFile,n.alertAudioFile,n.autoAnswerTime,n.useAlertExistingAudio,n.autoCompleteTime,n.useWaitExistingAudio);yield this.validateChannelSetting(e);const a=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable);return yield a.put(e.serialize,e.id)}catch(e){throw console.error("Error editing channel setting:",e),e}}))}delete(i){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction()).objectStore(t.databaseConfig.tables.channelSettingsTable);return yield e.delete(i.id)}catch(e){throw console.error("Error deleting channel setting:",e),e}}))}};
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.ChannelSettingsController = void 0;
13
+ const DatabaseConfig_1 = require("../../config/DatabaseConfig");
14
+ const ChannelSettingModel_1 = require("../../models/impl/channelsettings/ChannelSettingModel");
15
+ class ChannelSettingsController {
16
+ constructor(dbFactory) {
17
+ this._dbFactory = dbFactory;
18
+ }
19
+ getDatabaseConnection() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
22
+ return databaseConnection.result;
23
+ });
24
+ }
25
+ getTransaction() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const database = yield this.getDatabaseConnection();
28
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable, "readwrite");
29
+ return dbTransaction;
30
+ });
31
+ }
32
+ validateChannelSetting(channelSetting) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const validationMessages = channelSetting.validationMessages;
35
+ if (validationMessages.length > 0) {
36
+ throw validationMessages;
37
+ }
38
+ });
39
+ }
40
+ getMap() {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ try {
43
+ const dbTransaction = yield this.getTransaction();
44
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
45
+ const result = yield table.getMap();
46
+ const result2 = JSON.parse(JSON.stringify(result));
47
+ result2.etag = result2.revision;
48
+ return result2;
49
+ }
50
+ catch (error) {
51
+ console.error("Error retrieving channel setting sync map:", error);
52
+ throw error;
53
+ }
54
+ });
55
+ }
56
+ add(data) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ try {
59
+ const channelSetting = new ChannelSettingModel_1.ChannelSettingModel(data.id, data.name, data.channelType, data.queueSid, data.autoAnswer, data.autoComplete, data.autoCallTranscript, data.autoCallRecording, data.autoCallScreenRecording, data.alert, data.waitMusic, data.createdBy, data.createdDate, data.updatedDate, data.waitMusicFile, data.alertAudioFile, data.autoAnswerTime, data.useAlertExistingAudio, data.autoCompleteTime, data.useWaitExistingAudio);
60
+ if (channelSetting.validationMessages.length > 0) {
61
+ throw channelSetting.validationMessages;
62
+ }
63
+ const dbTransaction = yield this.getTransaction();
64
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
65
+ const result = yield table.add(channelSetting.serialize, channelSetting.id);
66
+ return result;
67
+ }
68
+ catch (error) {
69
+ console.error("Error adding channel setting:", error);
70
+ throw error;
71
+ }
72
+ });
73
+ }
74
+ get(query) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ try {
77
+ const dbTransaction = yield this.getTransaction();
78
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
79
+ const result = yield table.get(query.id);
80
+ return result;
81
+ }
82
+ catch (error) {
83
+ console.error("Error retrieving channel setting:", error);
84
+ throw error;
85
+ }
86
+ });
87
+ }
88
+ getAll(query) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ try {
91
+ const dbTransaction = yield this.getTransaction();
92
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
93
+ let result = yield table.getAll(query);
94
+ if (result.items && result.items.length) {
95
+ result.items = result.items.map((item) => {
96
+ return Object.assign({}, item);
97
+ });
98
+ }
99
+ if (query.getFilterContent) {
100
+ query.allowedFields = ["name", "channelType", "queueSid"]; // Example allowed fields
101
+ result.filterContent = result.filter((item) => query.allowedFields.every((field) => field in item));
102
+ }
103
+ return { result, meta: query };
104
+ }
105
+ catch (error) {
106
+ console.error("Error retrieving all channel settings:", error);
107
+ throw error;
108
+ }
109
+ });
110
+ }
111
+ edit(data) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ try {
114
+ const channelSetting = new ChannelSettingModel_1.ChannelSettingModel(data.id, data.name, data.channelType, data.queueSid, data.autoAnswer, data.autoComplete, data.autoCallTranscript, data.autoCallRecording, data.autoCallScreenRecording, data.alert, data.waitMusic, data.createdBy, data.createdDate, data.updatedDate, data.waitMusicFile, data.alertAudioFile, data.autoAnswerTime, data.useAlertExistingAudio, data.autoCompleteTime, data.useWaitExistingAudio);
115
+ yield this.validateChannelSetting(channelSetting);
116
+ const dbTransaction = yield this.getTransaction();
117
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
118
+ const result = yield table.put(channelSetting.serialize, channelSetting.id);
119
+ return result;
120
+ }
121
+ catch (error) {
122
+ console.error("Error editing channel setting:", error);
123
+ throw error;
124
+ }
125
+ });
126
+ }
127
+ delete(query) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ try {
130
+ const dbTransaction = yield this.getTransaction();
131
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.channelSettingsTable);
132
+ const result = yield table.delete(query.id);
133
+ return result;
134
+ }
135
+ catch (error) {
136
+ console.error("Error deleting channel setting:", error);
137
+ throw error;
138
+ }
139
+ });
140
+ }
141
+ }
142
+ exports.ChannelSettingsController = ChannelSettingsController;
@@ -0,0 +1,12 @@
1
+ import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
2
+ import { SearchParameterType } from "../../common/type/SearchParameterType";
3
+ import { CxConfiguratorGPMAssetModel } from "../../models/impl/cxconfig/CxConfiguratorGPMAssetModel";
4
+ export declare class CxConfigAssetController {
5
+ private _dbFactory;
6
+ constructor(dbFactory: SyncServiceFactory);
7
+ add(data: CxConfiguratorGPMAssetModel): Promise<any>;
8
+ get(query: Pick<CxConfiguratorGPMAssetModel, "id">): Promise<any>;
9
+ getAll(query: SearchParameterType): Promise<any>;
10
+ edit(data: CxConfiguratorGPMAssetModel): Promise<any>;
11
+ delete(query: Pick<CxConfiguratorGPMAssetModel, "id">): Promise<any>;
12
+ }
@@ -1 +1,128 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.CxConfigAssetController=void 0;const e=require("tslib"),t=require("../../config/DatabaseConfig"),a=require("../../models/impl/cxconfig/CxConfiguratorGPMAssetModel"),o=require("./filterImpl/CxConfigAssetFilter");exports.CxConfigAssetController=class{constructor(e){this._dbFactory=e}add(o){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new a.CxConfiguratorGPMAssetModel(o.id,o.name,o.value,o.type,o.description,o.createdAt,o.updatedAt);if(e.validationMessages.length>0)throw e.validationMessages;const s=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let i=s.transaction(t.databaseConfig.tables.cxConfigAssetTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigAssetTable);return yield i.add(e.serialize,e.id)}catch(e){throw console.log("error occrred",e),e}}))}get(a){return e.__awaiter(this,void 0,void 0,(function*(){try{console.log(a);const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let o=e.transaction(t.databaseConfig.tables.cxConfigAssetTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigAssetTable);return yield o.get(a.id)}catch(e){return console.log("error ",e),e}}))}getAll(a){return e.__awaiter(this,void 0,void 0,(function*(){try{console.log(a);const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let s=e.transaction(t.databaseConfig.tables.cxConfigAssetTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigAssetTable);const i=["type"];a.getFilterContent&&(a.allowedFields=i),a.category="CXConfig-Asset";let r=yield s.getAll(a);return a.getFilterContent&&(r.filterContent=o.CXConfigAssetFilterService.getFilterData(r.filterOptions)),"filterOptions"in r&&delete r.filterOptions,{result:r,meta:a}}catch(e){return console.log("error ",e),e}}))}edit(o){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new a.CxConfiguratorGPMAssetModel(o.id,o.name,o.value,o.type,o.description,o.createdAt,o.updatedAt);if(e.validationMessages.length>0)throw e.validationMessages;const s=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let i=s.transaction(t.databaseConfig.tables.cxConfigAssetTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigAssetTable);const r=e.id;return yield i.put(e.serialize,r)}catch(e){return console.log("error ",e),e}}))}delete(a){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let o=e.transaction(t.databaseConfig.tables.cxConfigAssetTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigAssetTable);return yield o.delete(a.id)}catch(e){return console.log("delete record error ",e),e}}))}};
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.CxConfigAssetController = void 0;
13
+ const DatabaseConfig_1 = require("../../config/DatabaseConfig");
14
+ const CxConfiguratorGPMAssetModel_1 = require("../../models/impl/cxconfig/CxConfiguratorGPMAssetModel");
15
+ const CxConfigAssetFilter_1 = require("./filterImpl/CxConfigAssetFilter");
16
+ class CxConfigAssetController {
17
+ constructor(dbFactory) {
18
+ this._dbFactory = dbFactory;
19
+ }
20
+ add(data) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ try {
23
+ const gpmasset = new CxConfiguratorGPMAssetModel_1.CxConfiguratorGPMAssetModel(data.id, data.name, data.value, data.type, data.description, data.createdAt, data.updatedAt);
24
+ if (gpmasset.validationMessages.length > 0) {
25
+ throw gpmasset.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.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable, "readwrite");
30
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable);
31
+ let result = yield table.add(gpmasset.serialize, gpmasset.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.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable, "readwrite");
47
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable);
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.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable, "readwrite");
66
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable);
67
+ const allowedFields = [
68
+ "type"
69
+ ];
70
+ if (query.getFilterContent) {
71
+ query.allowedFields = allowedFields;
72
+ }
73
+ query.category = "CXConfig-Asset";
74
+ let result = yield table.getAll(query);
75
+ if (query.getFilterContent) {
76
+ result.filterContent = CxConfigAssetFilter_1.CXConfigAssetFilterService.getFilterData(result.filterOptions);
77
+ }
78
+ if ("filterOptions" in result) {
79
+ delete result.filterOptions;
80
+ }
81
+ return { result, meta: query };
82
+ }
83
+ catch (error) {
84
+ console.log("error ", error);
85
+ return error;
86
+ }
87
+ });
88
+ }
89
+ edit(data) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ try {
92
+ const gpmasset = new CxConfiguratorGPMAssetModel_1.CxConfiguratorGPMAssetModel(data.id, data.name, data.value, data.type, data.description, data.createdAt, data.updatedAt);
93
+ if (gpmasset.validationMessages.length > 0) {
94
+ throw gpmasset.validationMessages;
95
+ }
96
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
97
+ const database = databaseConnection.result;
98
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable, "readwrite");
99
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable);
100
+ const key = gpmasset.id;
101
+ let result = yield table.put(gpmasset.serialize, key);
102
+ return result;
103
+ }
104
+ catch (error) {
105
+ console.log("error ", error);
106
+ return error;
107
+ }
108
+ });
109
+ }
110
+ delete(query) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ try {
113
+ // const DataValidation = new CxConfiguratorGPMPrompt(query)
114
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
115
+ const database = databaseConnection.result;
116
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable, "readwrite");
117
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigAssetTable);
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
+ }
128
+ exports.CxConfigAssetController = CxConfigAssetController;
@@ -0,0 +1,18 @@
1
+ import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
2
+ import { CxConfiguratorConfigModel } from "../../models/impl/cxconfig/CxConfiguratorConfigModel";
3
+ import { SearchParameterType } from "../../common/type/SearchParameterType";
4
+ export declare class CxConfigController {
5
+ private _dbFactory;
6
+ constructor(dbFactory: SyncServiceFactory);
7
+ private getDatabaseConnection;
8
+ private getTransaction;
9
+ add(data: CxConfiguratorConfigModel): Promise<any>;
10
+ get(query: {
11
+ id: string;
12
+ }): Promise<any>;
13
+ getAll(query: SearchParameterType): Promise<any>;
14
+ edit(data: CxConfiguratorConfigModel): Promise<any>;
15
+ delete(query: {
16
+ id: string;
17
+ }): Promise<any>;
18
+ }
@@ -1 +1,112 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.CxConfigController=void 0;const e=require("tslib"),t=require("../../config/DatabaseConfig"),o=require("../../models/impl/cxconfig/CxConfiguratorConfigModel");exports.CxConfigController=class{constructor(e){this._dbFactory=e}getDatabaseConnection(){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result}))}getTransaction(t){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this.getDatabaseConnection()).transaction(t,"readwrite")}))}add(r){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new o.CxConfiguratorConfigModel(r.id,r.name,r.value,r.description,r.createdAt,r.updatedAt);if(e.validationMessages.length>0)throw e.validationMessages;const a=(yield this.getTransaction(t.databaseConfig.tables.cxConfigTable)).objectStore(t.databaseConfig.tables.cxConfigTable);return yield a.add(e.serialize,e.id)}catch(e){throw console.error("Error occurred during add operation:",e),e}}))}get(o){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction(t.databaseConfig.tables.cxConfigTable)).objectStore(t.databaseConfig.tables.cxConfigTable);return yield e.get(o.id)}catch(e){return console.error("Error occurred during get operation:",e),e}}))}getAll(o){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction(t.databaseConfig.tables.cxConfigTable)).objectStore(t.databaseConfig.tables.cxConfigTable);return{result:yield e.getAll(o),meta:o}}catch(e){return console.error("Error occurred during getAll operation:",e),e}}))}edit(r){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=new o.CxConfiguratorConfigModel(r.id,r.name,r.value,r.description,r.createdAt,r.updatedAt);if(e.validationMessages.length>0)throw e.validationMessages;const a=(yield this.getTransaction(t.databaseConfig.tables.cxConfigTable)).objectStore(t.databaseConfig.tables.cxConfigTable),i=e.id;return yield a.put(e.serialize,i)}catch(e){return console.error("Error occurred during edit operation:",e),e}}))}delete(o){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this.getTransaction(t.databaseConfig.tables.cxConfigTable)).objectStore(t.databaseConfig.tables.cxConfigTable);return yield e.delete(o.id)}catch(e){return console.error("Error occurred during delete operation:",e),e}}))}};
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.CxConfigController = void 0;
13
+ const DatabaseConfig_1 = require("../../config/DatabaseConfig");
14
+ const CxConfiguratorConfigModel_1 = require("../../models/impl/cxconfig/CxConfiguratorConfigModel");
15
+ class CxConfigController {
16
+ constructor(dbFactory) {
17
+ this._dbFactory = dbFactory;
18
+ }
19
+ getDatabaseConnection() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
22
+ return databaseConnection.result;
23
+ });
24
+ }
25
+ getTransaction(tableName) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const database = yield this.getDatabaseConnection();
28
+ const dbTransaction = database.transaction(tableName, "readwrite");
29
+ return dbTransaction;
30
+ });
31
+ }
32
+ add(data) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ try {
35
+ const cxConfig = new CxConfiguratorConfigModel_1.CxConfiguratorConfigModel(data.id, data.name, data.value, data.description, data.createdAt, data.updatedAt);
36
+ if (cxConfig.validationMessages.length > 0) {
37
+ throw cxConfig.validationMessages;
38
+ }
39
+ const dbTransaction = yield this.getTransaction(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
40
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
41
+ const result = yield table.add(cxConfig.serialize, cxConfig.id);
42
+ return result;
43
+ }
44
+ catch (error) {
45
+ console.error("Error occurred during add operation:", error);
46
+ throw error;
47
+ }
48
+ });
49
+ }
50
+ get(query) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ try {
53
+ const dbTransaction = yield this.getTransaction(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
54
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
55
+ const result = yield table.get(query.id);
56
+ return result;
57
+ }
58
+ catch (error) {
59
+ console.error("Error occurred during get operation:", error);
60
+ return error;
61
+ }
62
+ });
63
+ }
64
+ getAll(query) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ try {
67
+ const dbTransaction = yield this.getTransaction(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
68
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
69
+ const result = yield table.getAll(query);
70
+ return { result, meta: query };
71
+ }
72
+ catch (error) {
73
+ console.error("Error occurred during getAll operation:", error);
74
+ return error;
75
+ }
76
+ });
77
+ }
78
+ edit(data) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ try {
81
+ const cxConfig = new CxConfiguratorConfigModel_1.CxConfiguratorConfigModel(data.id, data.name, data.value, data.description, data.createdAt, data.updatedAt);
82
+ if (cxConfig.validationMessages.length > 0) {
83
+ throw cxConfig.validationMessages;
84
+ }
85
+ const dbTransaction = yield this.getTransaction(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
86
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
87
+ const key = cxConfig.id;
88
+ const result = yield table.put(cxConfig.serialize, key);
89
+ return result;
90
+ }
91
+ catch (error) {
92
+ console.error("Error occurred during edit operation:", error);
93
+ return error;
94
+ }
95
+ });
96
+ }
97
+ delete(query) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ try {
100
+ const dbTransaction = yield this.getTransaction(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
101
+ const table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigTable);
102
+ const result = yield table.delete(query.id);
103
+ return result;
104
+ }
105
+ catch (error) {
106
+ console.error("Error occurred during delete operation:", error);
107
+ return error;
108
+ }
109
+ });
110
+ }
111
+ }
112
+ exports.CxConfigController = CxConfigController;
@@ -0,0 +1,12 @@
1
+ import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
2
+ import { SearchParameterType } from "../../common/type/SearchParameterType";
3
+ import { CxConfiguratorExternalNumbersModel } from "../../models/impl/cxconfig/CxConfiguratorExternalNumbersModel";
4
+ export declare class CxConfigExternalNumbersController {
5
+ private _dbFactory;
6
+ constructor(dbFactory: SyncServiceFactory);
7
+ add(data: CxConfiguratorExternalNumbersModel): Promise<any>;
8
+ get(query: Pick<CxConfiguratorExternalNumbersModel, "id">): Promise<any>;
9
+ getAll(query: SearchParameterType): Promise<any>;
10
+ edit(data: CxConfiguratorExternalNumbersModel): Promise<any>;
11
+ delete(query: Pick<CxConfiguratorExternalNumbersModel, "id">): Promise<any>;
12
+ }
@@ -1 +1,138 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.CxConfigExternalNumbersController=void 0;const e=require("tslib"),t=require("../../config/DatabaseConfig"),a=require("../../models/impl/cxconfig/CxConfiguratorExternalNumbersModel"),r=require("./filterImpl/CxConfigExternalNumbersFilter");exports.CxConfigExternalNumbersController=class{constructor(e){this._dbFactory=e}add(r){return e.__awaiter(this,void 0,void 0,(function*(){try{const{id:e,name:n,phonenumber:o,type:i,createdAt:s,updatedAt:l}=r,d=new a.CxConfiguratorExternalNumbersModel(e,n,o,i,s,l);if(d.validationMessages.length>0)throw d.validationMessages;const b=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let c=b.transaction(t.databaseConfig.tables.cxConfigExternalNumbersTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigExternalNumbersTable);return yield c.add(d.serialize,d.id)}catch(e){throw console.log("error occurred",e),e}}))}get(a){return e.__awaiter(this,void 0,void 0,(function*(){try{console.log(a);const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let r=e.transaction(t.databaseConfig.tables.cxConfigExternalNumbersTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigExternalNumbersTable);return yield r.get(a.id)}catch(e){return console.log("error ",e),e}}))}getAll(a){return e.__awaiter(this,void 0,void 0,(function*(){try{console.log(a);const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let n=e.transaction(t.databaseConfig.tables.cxConfigExternalNumbersTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigExternalNumbersTable);const o=["phonenumber","type"];a.getFilterContent&&(a.allowedFields=o),a.category="CXConfig-ExternalNumbers";let i=yield n.getAll(a);return a.getFilterContent&&(i.filterContent=r.CXConfigExternalNumbersFilterService.getFilterData(i.filterOptions)),a.getPromptForIVR&&(i.items=i.items.reduce(((e,t)=>{const{name:a,phonenumber:r,updatedAt:n,type:o,id:i,createdAt:s}=t;return e[a]={phonenumber:r,type:o,id:i,createdAt:s,updatedAt:n},e}),{})),"filterOptions"in i&&delete i.filterOptions,{result:i,meta:a}}catch(e){return console.log("error ",e),e}}))}edit(r){return e.__awaiter(this,void 0,void 0,(function*(){try{const{id:e,name:n,phonenumber:o,type:i,createdAt:s,updatedAt:l}=r,d=new a.CxConfiguratorExternalNumbersModel(e,n,o,i,s,l);if(d.validationMessages.length>0)throw d.validationMessages;const b=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let c=b.transaction(t.databaseConfig.tables.cxConfigExternalNumbersTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigExternalNumbersTable);const u=d.id;return yield c.put(d.serialize,u)}catch(e){return console.log("error ",e),e}}))}delete(a){return e.__awaiter(this,void 0,void 0,(function*(){try{const e=(yield this._dbFactory.asyncOpen(t.databaseConfig.databaseName,t.databaseConfig.version)).result;let r=e.transaction(t.databaseConfig.tables.cxConfigExternalNumbersTable,"readwrite").objectStore(t.databaseConfig.tables.cxConfigExternalNumbersTable);return yield r.delete(a.id)}catch(e){return console.log("delete record error ",e),e}}))}};
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.CxConfigExternalNumbersController = void 0;
13
+ const DatabaseConfig_1 = require("../../config/DatabaseConfig");
14
+ const CxConfiguratorExternalNumbersModel_1 = require("../../models/impl/cxconfig/CxConfiguratorExternalNumbersModel");
15
+ const CxConfigExternalNumbersFilter_1 = require("./filterImpl/CxConfigExternalNumbersFilter");
16
+ class CxConfigExternalNumbersController {
17
+ constructor(dbFactory) {
18
+ this._dbFactory = dbFactory;
19
+ }
20
+ // Accepts an object and initializes the model with its properties
21
+ add(data) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ const { id, name, phonenumber, type, createdAt, updatedAt } = data;
25
+ // Initialize the model with individual attributes
26
+ const externalNumber = new CxConfiguratorExternalNumbersModel_1.CxConfiguratorExternalNumbersModel(id, name, phonenumber, type, createdAt, updatedAt);
27
+ if (externalNumber.validationMessages.length > 0) {
28
+ throw externalNumber.validationMessages;
29
+ }
30
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
31
+ const database = databaseConnection.result;
32
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable, "readwrite");
33
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable);
34
+ let result = yield table.add(externalNumber.serialize, externalNumber.id);
35
+ return result;
36
+ }
37
+ catch (error) {
38
+ console.log('error occurred', error);
39
+ throw error;
40
+ }
41
+ });
42
+ }
43
+ get(query) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ try {
46
+ console.log(query);
47
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
48
+ const database = databaseConnection.result;
49
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable, "readwrite");
50
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable);
51
+ let result = yield table.get(query.id);
52
+ return result;
53
+ }
54
+ catch (error) {
55
+ console.log('error ', error);
56
+ return error;
57
+ }
58
+ });
59
+ }
60
+ getAll(query) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ try {
63
+ console.log(query);
64
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
65
+ const database = databaseConnection.result;
66
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable, "readwrite");
67
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable);
68
+ const allowedFields = ["phonenumber", "type"];
69
+ if (query.getFilterContent) {
70
+ query.allowedFields = allowedFields;
71
+ }
72
+ query.category = "CXConfig-ExternalNumbers";
73
+ let result = yield table.getAll(query);
74
+ if (query.getFilterContent) {
75
+ result.filterContent = CxConfigExternalNumbersFilter_1.CXConfigExternalNumbersFilterService.getFilterData(result.filterOptions);
76
+ }
77
+ if (query.getPromptForIVR) {
78
+ result.items = transformArrayToJson(result.items);
79
+ }
80
+ if ("filterOptions" in result) {
81
+ delete result.filterOptions;
82
+ }
83
+ return { result, meta: query };
84
+ }
85
+ catch (error) {
86
+ console.log('error ', error);
87
+ return error;
88
+ }
89
+ });
90
+ }
91
+ edit(data) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ try {
94
+ const { id, name, phonenumber, type, createdAt, updatedAt } = data;
95
+ // Initialize the model with individual attributes
96
+ const externalNumber = new CxConfiguratorExternalNumbersModel_1.CxConfiguratorExternalNumbersModel(id, name, phonenumber, type, createdAt, updatedAt);
97
+ if (externalNumber.validationMessages.length > 0) {
98
+ throw externalNumber.validationMessages;
99
+ }
100
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
101
+ const database = databaseConnection.result;
102
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable, "readwrite");
103
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable);
104
+ const key = externalNumber.id;
105
+ let result = yield table.put(externalNumber.serialize, key);
106
+ return result;
107
+ }
108
+ catch (error) {
109
+ console.log('error ', error);
110
+ return error;
111
+ }
112
+ });
113
+ }
114
+ delete(query) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ try {
117
+ const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
118
+ const database = databaseConnection.result;
119
+ const dbTransaction = database.transaction(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable, "readwrite");
120
+ let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.cxConfigExternalNumbersTable);
121
+ let result = yield table.delete(query.id);
122
+ return result;
123
+ }
124
+ catch (error) {
125
+ console.log('delete record error ', error);
126
+ return error;
127
+ }
128
+ });
129
+ }
130
+ }
131
+ exports.CxConfigExternalNumbersController = CxConfigExternalNumbersController;
132
+ function transformArrayToJson(inputArray) {
133
+ return inputArray.reduce((acc, item) => {
134
+ const { name, phonenumber, updatedAt, type, id, createdAt } = item;
135
+ acc[name] = { phonenumber, type, id, createdAt, updatedAt };
136
+ return acc;
137
+ }, {});
138
+ }
@@ -0,0 +1,16 @@
1
+ import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
2
+ import { SearchParameterType } from "../../common/type/SearchParameterType";
3
+ import { CxConfiguratorOtherModel } from "../../models/impl/cxconfig/CxConfiguratorOtherModel";
4
+ export declare class CxConfigOtherController {
5
+ private _dbFactory;
6
+ constructor(dbFactory: SyncServiceFactory);
7
+ add(data: CxConfiguratorOtherModel): Promise<any>;
8
+ get(query: Pick<CxConfiguratorOtherModel, "id">): Promise<any>;
9
+ getAll(query: SearchParameterType): Promise<any>;
10
+ edit(data: CxConfiguratorOtherModel): Promise<any>;
11
+ delete(query: Pick<CxConfiguratorOtherModel, "id">): Promise<IDBRequest<undefined> | {
12
+ statusCode: number;
13
+ message: string;
14
+ details?: string | undefined;
15
+ }>;
16
+ }