o2g-node-sdk 1.0.0
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 +10 -0
- package/dist/ErrorInfo.d.ts +87 -0
- package/dist/host.d.ts +17 -0
- package/dist/o2g-analytics.d.ts +66 -0
- package/dist/o2g-cc-agent.d.ts +247 -0
- package/dist/o2g-cc-mngt.d.ts +32 -0
- package/dist/o2g-cc-pilot.d.ts +42 -0
- package/dist/o2g-comlog.d.ts +173 -0
- package/dist/o2g-directory.d.ts +88 -0
- package/dist/o2g-eventSummary.d.ts +33 -0
- package/dist/o2g-maint.d.ts +48 -0
- package/dist/o2g-messaging.d.ts +115 -0
- package/dist/o2g-node-sdk.d.ts +159 -0
- package/dist/o2g-node-sdk.js +2 -0
- package/dist/o2g-node-sdk.js.map +1 -0
- package/dist/o2g-pbx-mngt.d.ts +146 -0
- package/dist/o2g-phone-set-prog.d.ts +29 -0
- package/dist/o2g-routing.d.ts +267 -0
- package/dist/o2g-rsi.d.ts +160 -0
- package/dist/o2g-telephony.d.ts +795 -0
- package/dist/o2g-user-mngt.d.ts +42 -0
- package/dist/o2g-users.d.ts +85 -0
- package/dist/subscription.d.ts +258 -0
- package/dist/types/analytics/call-type.d.ts +24 -0
- package/dist/types/analytics/charging-file.d.ts +27 -0
- package/dist/types/analytics/charging-result.d.ts +43 -0
- package/dist/types/analytics/charging.d.ts +105 -0
- package/dist/types/analytics/incident.d.ts +46 -0
- package/dist/types/analytics/tel-facility.d.ts +44 -0
- package/dist/types/analytics/time-range.d.ts +22 -0
- package/dist/types/cc-agent/cc-agent-events.d.ts +54 -0
- package/dist/types/cc-agent/cc-agent-types.d.ts +71 -0
- package/dist/types/cc-agent/intrusion-mode.d.ts +24 -0
- package/dist/types/cc-agent/operator-dyn-state.d.ts +56 -0
- package/dist/types/cc-agent/operator-main-state.d.ts +21 -0
- package/dist/types/cc-agent/operator-type.d.ts +16 -0
- package/dist/types/cc-mngt/calendar/abstract-calendar.d.ts +7 -0
- package/dist/types/cc-mngt/calendar/calendar.d.ts +19 -0
- package/dist/types/cc-mngt/calendar/day-of-week.d.ts +33 -0
- package/dist/types/cc-mngt/calendar/exception-calendar.d.ts +26 -0
- package/dist/types/cc-mngt/calendar/normal-calendar.d.ts +27 -0
- package/dist/types/cc-mngt/calendar/transition.d.ts +49 -0
- package/dist/types/cc-mngt/cc-mngt-types.d.ts +0 -0
- package/dist/types/cc-mngt/pilot-rule-set.d.ts +27 -0
- package/dist/types/cc-mngt/pilot-rule.d.ts +14 -0
- package/dist/types/cc-mngt/pilot.d.ts +56 -0
- package/dist/types/cc-pilot/cc-pilot-events.d.ts +111 -0
- package/dist/types/comlog/com-record.d.ts +51 -0
- package/dist/types/comlog/comlog-events.d.ts +74 -0
- package/dist/types/comlog/comlog-types.d.ts +131 -0
- package/dist/types/comlog/option.d.ts +23 -0
- package/dist/types/comlog/page.d.ts +33 -0
- package/dist/types/comlog/query-filter.d.ts +44 -0
- package/dist/types/comlog/query-result.d.ts +27 -0
- package/dist/types/comlog/reason.d.ts +61 -0
- package/dist/types/comlog/role.d.ts +17 -0
- package/dist/types/common/common-types.d.ts +78 -0
- package/dist/types/directory/criteria.d.ts +90 -0
- package/dist/types/directory/directory-types.d.ts +44 -0
- package/dist/types/directory/filter-item.d.ts +21 -0
- package/dist/types/directory/operation-filter.d.ts +21 -0
- package/dist/types/events/events.d.ts +54 -0
- package/dist/types/eventsummary/event-summary-counter.d.ts +44 -0
- package/dist/types/eventsummary/event-summary-events.d.ts +15 -0
- package/dist/types/maint/maint-events.d.ts +51 -0
- package/dist/types/maint/maint-types.d.ts +162 -0
- package/dist/types/messaging/messaging-types.d.ts +120 -0
- package/dist/types/pbxmngt/attribute-filter.d.ts +30 -0
- package/dist/types/pbxmngt/attribute-type.d.ts +34 -0
- package/dist/types/pbxmngt/filter.d.ts +46 -0
- package/dist/types/pbxmngt/model.d.ts +63 -0
- package/dist/types/pbxmngt/pbx-attr-map.d.ts +91 -0
- package/dist/types/pbxmngt/pbx-attribute.d.ts +87 -0
- package/dist/types/pbxmngt/pbx-object.d.ts +45 -0
- package/dist/types/pbxmngt/pbxmngt-events.d.ts +59 -0
- package/dist/types/pbxmngt/pbxmngt-types.d.ts +14 -0
- package/dist/types/phoneset/device-key.d.ts +27 -0
- package/dist/types/phoneset/phoneset-types.d.ts +17 -0
- package/dist/types/phoneset/pin-control.d.ts +21 -0
- package/dist/types/phoneset/pin.d.ts +50 -0
- package/dist/types/phoneset/programmable-key.d.ts +23 -0
- package/dist/types/phoneset/softkey.d.ts +17 -0
- package/dist/types/routing/destination.d.ts +19 -0
- package/dist/types/routing/forward.d.ts +51 -0
- package/dist/types/routing/overflow.d.ts +42 -0
- package/dist/types/routing/routing-capability.d.ts +31 -0
- package/dist/types/routing/routing-events.d.ts +15 -0
- package/dist/types/routing/routing-state.d.ts +67 -0
- package/dist/types/routing/routing-types.d.ts +10 -0
- package/dist/types/rsi/add-digit-coll-criteria.d.ts +16 -0
- package/dist/types/rsi/collection-cause.d.ts +21 -0
- package/dist/types/rsi/routing-caller-type.d.ts +17 -0
- package/dist/types/rsi/routing-reason.d.ts +25 -0
- package/dist/types/rsi/rsi-events.d.ts +76 -0
- package/dist/types/rsi/rsi-types.d.ts +49 -0
- package/dist/types/rsi/tones.d.ts +25 -0
- package/dist/types/telephony/RecordingAction.d.ts +6 -0
- package/dist/types/telephony/acr-skill.d.ts +29 -0
- package/dist/types/telephony/telephony-events.d.ts +292 -0
- package/dist/types/telephony/telephony-types.d.ts +587 -0
- package/dist/types/users/users-events.d.ts +33 -0
- package/dist/types/users/users-types.d.ts +129 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o2g-node-sdk.js","mappings":"wGAsBA,kBAWI,WAAAA,CAAYC,EAAkBC,EAAgBC,EAA0B,MACpEC,KAAKC,UAAYJ,EACjBG,KAAKE,QAAUJ,EACfE,KAAKG,UAAYJ,CACrB,CAKA,Y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lE,EAC/C,EAnDJ,oBAM2B,EAAA67B,sBAAwB,qBAMxB,EAAAC,qBAAuB,oBAMvB,EAAAC,sBAAwB,oB,GC5C/CC,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBpkC,IAAjBqkC,EACH,OAAOA,EAAaljC,QAGrB,IAAID,EAAS+iC,EAAyBG,GAAY,CAGjDjjC,QAAS,CAAC,GAOX,OAHAmjC,EAAoBF,GAAUG,KAAKrjC,EAAOC,QAASD,EAAQA,EAAOC,QAASgjC,GAGpEjjC,EAAOC,OACf,CCnB0BgjC,CAAoB,M","sources":["webpack://o2g-node-sdk/./src/types/phoneset/device-key.ts","webpack://o2g-node-sdk/./src/internal/service-factory.ts","webpack://o2g-node-sdk/./src/internal/rest/users-rest.ts","webpack://o2g-node-sdk/./src/internal/rest/analytics-rest.ts","webpack://o2g-node-sdk/./src/types/comlog/reason.ts","webpack://o2g-node-sdk/./src/types/analytics/charging.ts","webpack://o2g-node-sdk/./src/types/analytics/time-range.ts","webpack://o2g-node-sdk/./src/internal/rest/o2g-rest.ts","webpack://o2g-node-sdk/./src/internal/rest/authentication-rest.ts","webpack://o2g-node-sdk/./src/types/cc-agent/intrusion-mode.ts","webpack://o2g-node-sdk/external node-commonjs \"os\"","webpack://o2g-node-sdk/./src/types/pbxmngt/pbx-attribute.ts","webpack://o2g-node-sdk/./src/o2g-analytics.ts","webpack://o2g-node-sdk/./src/types/directory/criteria.ts","webpack://o2g-node-sdk/./src/types/analytics/incident.ts","webpack://o2g-node-sdk/./src/internal/rest/ccMngt-rest.ts","webpack://o2g-node-sdk/external commonjs \"reflect-metadata\"","webpack://o2g-node-sdk/./src/types/pbxmngt/attribute-type.ts","webpack://o2g-node-sdk/external commonjs \"fetch-cookie\"","webpack://o2g-node-sdk/./src/types/routing/destination.ts","webpack://o2g-node-sdk/./src/types/routing/routing-capability.ts","webpack://o2g-node-sdk/external node-commonjs \"fs/promises\"","webpack://o2g-node-sdk/./src/types/telephony/RecordingAction.ts","webpack://o2g-node-sdk/./src/o2g-pbx-mngt.ts","webpack://o2g-node-sdk/./src/internal/rest/ccPilot-rest.ts","webpack://o2g-node-sdk/./src/o2g-user-mngt.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/pilot-rule.ts","webpack://o2g-node-sdk/./src/types/comlog/query-filter.ts","webpack://o2g-node-sdk/./src/o2g-routing.ts","webpack://o2g-node-sdk/./src/types/pbxmngt/attribute-filter.ts","webpack://o2g-node-sdk/./src/types/pbxmngt/pbx-object.ts","webpack://o2g-node-sdk/./src/internal/events/event-packages.ts","webpack://o2g-node-sdk/./src/internal/service-end-point.ts","webpack://o2g-node-sdk/./src/internal/util/assert.ts","webpack://o2g-node-sdk/./src/types/pbxmngt/pbx-attr-map.ts","webpack://o2g-node-sdk/./src/internal/o2g-application.ts","webpack://o2g-node-sdk/./src/internal/util/http-response.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/calendar/abstract-calendar.ts","webpack://o2g-node-sdk/./src/o2g-directory.ts","webpack://o2g-node-sdk/./src/types/cc-agent/operator-type.ts","webpack://o2g-node-sdk/external commonjs \"uuid\"","webpack://o2g-node-sdk/./src/o2g-users.ts","webpack://o2g-node-sdk/./src/internal/util/http-client.ts","webpack://o2g-node-sdk/./src/internal/types/routing/forward-route.ts","webpack://o2g-node-sdk/./src/internal/events/chunk-eventing.ts","webpack://o2g-node-sdk/./src/types/telephony/acr-skill.ts","webpack://o2g-node-sdk/./src/internal/rest/rsi-rest.ts","webpack://o2g-node-sdk/external node-commonjs \"events\"","webpack://o2g-node-sdk/./src/o2g-cc-mngt.ts","webpack://o2g-node-sdk/./src/internal/rest/ccAgent-rest.ts","webpack://o2g-node-sdk/./src/internal/rest/messaging-rest.ts","webpack://o2g-node-sdk/./src/internal/util/http-content.ts","webpack://o2g-node-sdk/./src/o2g-telephony.ts","webpack://o2g-node-sdk/./src/internal/rest/sessions-rest.ts","webpack://o2g-node-sdk/./src/internal/access-mode.ts","webpack://o2g-node-sdk/./src/types/routing/overflow.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/calendar/transition.ts","webpack://o2g-node-sdk/./src/o2g-rsi.ts","webpack://o2g-node-sdk/./src/o2g-comlog.ts","webpack://o2g-node-sdk/./src/internal/types/routing/o2g-destination.ts","webpack://o2g-node-sdk/./src/internal/rest/comlog-rest.ts","webpack://o2g-node-sdk/external commonjs \"inversify\"","webpack://o2g-node-sdk/./src/types/phoneset/programmable-key.ts","webpack://o2g-node-sdk/./src/o2g-node-sdk.ts","webpack://o2g-node-sdk/./src/o2g-cc-agent.ts","webpack://o2g-node-sdk/./src/types/cc-agent/operator-main-state.ts","webpack://o2g-node-sdk/./src/types/routing/routing-state.ts","webpack://o2g-node-sdk/./src/types/pbxmngt/model.ts","webpack://o2g-node-sdk/./src/internal/util/file-utils.ts","webpack://o2g-node-sdk/./src/types/analytics/charging-result.ts","webpack://o2g-node-sdk/./src/internal/rest/pbx-mngt-rest.ts","webpack://o2g-node-sdk/./src/internal/util/injection-container.ts","webpack://o2g-node-sdk/./src/o2g-maint.ts","webpack://o2g-node-sdk/./src/o2g-messaging.ts","webpack://o2g-node-sdk/./src/internal/rest/directory-rest.ts","webpack://o2g-node-sdk/./src/internal/session.ts","webpack://o2g-node-sdk/./src/types/maint/maint-types.ts","webpack://o2g-node-sdk/./src/types/comlog/role.ts","webpack://o2g-node-sdk/./src/internal/rest/maint-rest.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/pilot.ts","webpack://o2g-node-sdk/./src/internal/rest/subscriptions-rest.ts","webpack://o2g-node-sdk/./src/types/analytics/tel-facility.ts","webpack://o2g-node-sdk/./src/types/directory/operation-filter.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/calendar/exception-calendar.ts","webpack://o2g-node-sdk/./src/internal/util/util-uri.ts","webpack://o2g-node-sdk/external node-commonjs \"path\"","webpack://o2g-node-sdk/./src/internal/rest/rest-service.ts","webpack://o2g-node-sdk/external commonjs \"tough-cookie\"","webpack://o2g-node-sdk/./src/internal/util/logger.ts","webpack://o2g-node-sdk/./src/types/directory/filter-item.ts","webpack://o2g-node-sdk/./src/internal/rest/eventSummary-rest.ts","webpack://o2g-node-sdk/./src/o2g-eventSummary.ts","webpack://o2g-node-sdk/./src/types/routing/forward.ts","webpack://o2g-node-sdk/./src/internal/types/routing/overflow-route.ts","webpack://o2g-node-sdk/./src/internal/rest/routing-rest.ts","webpack://o2g-node-sdk/./src/subscription.ts","webpack://o2g-node-sdk/./src/types/analytics/call-type.ts","webpack://o2g-node-sdk/./src/types/phoneset/pin-control.ts","webpack://o2g-node-sdk/./src/internal/rest/user-mngt-rest.ts","webpack://o2g-node-sdk/./src/internal/types/cc-mngt/o2gccmntg-types.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/calendar/normal-calendar.ts","webpack://o2g-node-sdk/./src/internal/events/event-dispatcher.ts","webpack://o2g-node-sdk/./src/internal/rest/phone-set-prog-rest.ts","webpack://o2g-node-sdk/./src/types/phoneset/pin.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/pilot-rule-set.ts","webpack://o2g-node-sdk/./src/types/comlog/option.ts","webpack://o2g-node-sdk/./src/types/cc-mngt/calendar/day-of-week.ts","webpack://o2g-node-sdk/./src/types/phoneset/softkey.ts","webpack://o2g-node-sdk/./src/o2g-phone-set-prog.ts","webpack://o2g-node-sdk/./src/types/comlog/query-result.ts","webpack://o2g-node-sdk/./src/types/comlog/page.ts","webpack://o2g-node-sdk/./src/types/analytics/charging-file.ts","webpack://o2g-node-sdk/./src/types/comlog/com-record.ts","webpack://o2g-node-sdk/./src/internal/rest/telephony-rest.ts","webpack://o2g-node-sdk/./src/types/pbxmngt/filter.ts","webpack://o2g-node-sdk/./src/o2g-cc-pilot.ts","webpack://o2g-node-sdk/webpack/bootstrap","webpack://o2g-node-sdk/webpack/startup"],"sourcesContent":["/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * DeviceKey class represents the base class for key on an OmniPCX Enterprise device.\r\n */\r\nexport class DeviceKey {\r\n protected _position: number;\r\n protected _number: string;\r\n protected _mnemonic: string | null;\r\n\r\n /**\r\n * Constructs a new DeviceKey with the specified position, number, and optional mnemonic.\r\n * @param position The key position on the device.\r\n * @param number The phone number associated with this key.\r\n * @param mnemonic The mnemonic associated with this key (optional).\r\n */\r\n constructor(position: number, number: string, mnemonic: string | null = null) {\r\n this._position = position;\r\n this._number = number;\r\n this._mnemonic = mnemonic;\r\n }\r\n\r\n /**\r\n * Returns the key position.\r\n */\r\n public get position(): number {\r\n return this._position;\r\n }\r\n\r\n /**\r\n * Returns the key-associated number.\r\n */\r\n public get number(): string {\r\n return this._number;\r\n }\r\n\r\n /**\r\n * Returns the key mnemonic, or null if not set.\r\n */\r\n public get mnemonic(): string | null {\r\n return this._mnemonic;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport O2GRest from \"./rest/o2g-rest\";\r\nimport AuthenticationRest from \"./rest/authentication-rest\";\r\nimport SessionsRest from \"./rest/sessions-rest\";\r\nimport RoutingRest from \"./rest/routing-rest\";\r\nimport EventSummaryRest from \"./rest/eventSummary-rest\";\r\nimport CallCenterAgentRest from \"./rest/ccAgent-rest\";\r\nimport CallCenterPilotRest from \"./rest/ccPilot-rest\";\r\nimport UsersRest from \"./rest/users-rest\";\r\nimport TelephonyRest from \"./rest/telephony-rest\";\r\nimport DirectoryRest from \"./rest/directory-rest\";\r\nimport SubscriptionsRest from \"./rest/subscriptions-rest\";\r\nimport CommunicationLogRest from \"./rest/comlog-rest\";\r\nimport AnalyticsRest from \"./rest/analytics-rest\";\r\nimport MaintenanceRest from \"./rest/maint-rest\";\r\nimport RsiRest from \"./rest/rsi-rest\";\r\nimport PbxManagementRest from \"./rest/pbx-mngt-rest\";\r\nimport UtilUri from \"./util/util-uri\";\r\nimport { AccessMode } from \"./access-mode\";\r\nimport PhoneSetProgrammingRest from \"./rest/phone-set-prog-rest\";\r\nimport MessagingRest from \"./rest/messaging-rest\";\r\nimport { RestService } from \"./rest/rest-service\";\r\nimport { RoxeRestApiDescriptor, ServerInfo, SessionInfo, Version } from \"./types/common/o2gcommon-types\";\r\nimport UserManagementRest from \"./rest/user-mngt-rest\";\r\nimport CallCenterManagementRest from \"./rest/ccMngt-rest\";\r\nimport { Logger } from \"./util/logger\";\r\n\r\nclass O2GService {\r\n private _value: string;\r\n\r\n static _map: Map<string, O2GService> = new Map<string, O2GService>();\r\n\r\n static registerService(service: O2GService): O2GService {\r\n this._map.set(service._value, service);\r\n return service;\r\n }\r\n\r\n constructor(name: string) {\r\n this._value = name;\r\n }\r\n\r\n static get(name: string): O2GService {\r\n\r\n var lower = name.toLowerCase();\r\n\r\n if (this._map.has(lower)) {\r\n return this._map.get(lower)!;\r\n }\r\n else {\r\n return new O2GService(lower);\r\n }\r\n }\r\n\r\n static O2G = O2GService.registerService(new O2GService(\"O2G\"));\r\n static Authentication = O2GService.registerService(new O2GService(\"authenticate\"));\r\n static Sessions = O2GService.registerService(new O2GService(\"sessions\"));\r\n static Subscriptions = O2GService.registerService(new O2GService(\"subscriptions\")); \r\n static EventSummary = O2GService.registerService(new O2GService(\"eventsummary\")); \r\n static Telephony = O2GService.registerService(new O2GService(\"telephony\")); \r\n static Users = O2GService.registerService(new O2GService(\"users\")); \r\n static UserManagement = O2GService.registerService(new O2GService(\"usermanagement\")); \r\n static Routing = O2GService.registerService(new O2GService(\"routing\")); \r\n static Messaging = O2GService.registerService(new O2GService(\"voicemail\"));\r\n static Maintenance = O2GService.registerService(new O2GService(\"maintenance\"));\r\n static Directory = O2GService.registerService(new O2GService(\"directory\")); \r\n static PbxManagement = O2GService.registerService(new O2GService(\"pbxmanagement\")); \r\n static CommunicationLog = O2GService.registerService(new O2GService(\"comlog\")); \r\n static PhoneSetProgramming = O2GService.registerService(new O2GService(\"phonesetprogramming\"));\r\n static CallCenterPilot = O2GService.registerService(new O2GService(\"acdpilotmonitoring\"));\r\n static CallCenterAgent = O2GService.registerService(new O2GService(\"acdagent\"));\r\n static CallCenterRsi = O2GService.registerService(new O2GService(\"acdrsi\"));\r\n static CallCenterManagement = O2GService.registerService(new O2GService(\"acdmanagement\"));\r\n static Analytics = O2GService.registerService(new O2GService(\"analytics\"));\r\n}\r\n\r\n\r\n\r\nexport default class {\r\n\r\n private _apiVersion: string;\r\n \r\n private _logger = Logger.create(\"ServiceFactory\");\r\n private _services: Map<O2GService, any> = new Map<O2GService, any>();\r\n private _servicesUri: Map<O2GService, string> = new Map<O2GService, string>();\r\n\r\n\t_accessMode: AccessMode = AccessMode.Private;\r\n ApiVersion: string | null = null;\r\n\r\n\r\n constructor(version: string) {\r\n this._apiVersion = version;\r\n\t}\r\n\r\n private throwUnableToConnect(host: Host): never | void {\r\n if ((host.privateAddress != null) && (host.publicAddress != null)) {\r\n throw new Error(`[${host.privateAddress}, ${host.publicAddress}]`);\r\n }\r\n else if (host.privateAddress != null) {\r\n throw new Error(`[${host.privateAddress}]`);\r\n }\r\n else {\r\n throw new Error(`[${host.publicAddress}]`);\r\n }\r\n }\r\n\r\n setO2GServiceUri(address: string): void {\r\n\t\t\r\n\t\tif (this._servicesUri.has(O2GService.O2G)) {\r\n\t\t\tthis._servicesUri.delete(O2GService.O2G);\r\n\t\t\tthis._services.delete(O2GService.O2G);\r\n\t\t}\r\n\t\tthis._servicesUri.set(O2GService.O2G, \"https://\" + address + \"/api/rest\");\r\n\t}\r\n\r\n getOrCreate(serviceName: O2GService, restService: typeof RestService) {\r\n if (!this._servicesUri.has(serviceName)) {\r\n return undefined;\r\n }\r\n\t\t\r\n let service = this._services.get(serviceName);\r\n\t\tif (!service) {\r\n\t\t\tservice = new restService(this._servicesUri.get(serviceName)!);\r\n\t\t\tthis._services.set(serviceName, service);\r\n\t\t}\r\n\t\t\t\r\n\t\treturn service;\r\n }\r\n\r\n getSubscriptionService() {\r\n return this.getOrCreate(O2GService.Subscriptions, SubscriptionsRest);\r\n }\r\n\r\n getO2GService() {\r\n return this.getOrCreate(O2GService.O2G, O2GRest);\r\n }\r\n\r\n getAuthenticationService() {\r\n return this.getOrCreate(O2GService.Authentication, AuthenticationRest);\r\n }\r\n\r\n getSessionsService() {\r\n return this.getOrCreate(O2GService.Sessions, SessionsRest);\r\n }\r\n\r\n getEventSummaryService() {\r\n return this.getOrCreate(O2GService.EventSummary, EventSummaryRest);\r\n }\r\n\r\n getRoutingService() {\r\n return this.getOrCreate(O2GService.Routing, RoutingRest);\r\n }\r\n\r\n getUsersService() {\r\n return this.getOrCreate(O2GService.Users, UsersRest);\r\n }\r\n\r\n getUserManagementService() {\r\n return this.getOrCreate(O2GService.UserManagement, UserManagementRest);\r\n }\r\n\r\n getTelephonyService() {\r\n return this.getOrCreate(O2GService.Telephony, TelephonyRest);\r\n }\r\n\r\n getDirectoryService() {\r\n return this.getOrCreate(O2GService.Directory, DirectoryRest);\r\n }\r\n\r\n getCommunicationLogService() {\r\n return this.getOrCreate(O2GService.CommunicationLog, CommunicationLogRest);\r\n }\r\n\r\n getAnalyticsService() {\r\n return this.getOrCreate(O2GService.Analytics, AnalyticsRest);\r\n }\r\n\r\n getCallCenterAgentService() {\r\n return this.getOrCreate(O2GService.CallCenterAgent, CallCenterAgentRest);\r\n }\r\n\r\n getCallCenterPilotService() {\r\n return this.getOrCreate(O2GService.CallCenterPilot, CallCenterPilotRest);\r\n }\r\n\r\n getCallCenterManagementService() {\r\n return this.getOrCreate(O2GService.CallCenterManagement, CallCenterManagementRest);\r\n }\r\n\r\n getMaintenanceService() {\r\n return this.getOrCreate(O2GService.Maintenance, MaintenanceRest);\r\n }\r\n\r\n getRsiService() {\r\n return this.getOrCreate(O2GService.CallCenterRsi, RsiRest);\r\n }\r\n\r\n getPbxManagementService() {\r\n return this.getOrCreate(O2GService.PbxManagement, PbxManagementRest);\r\n }\r\n\r\n getPhoneSetProgrammingService() {\r\n return this.getOrCreate(O2GService.PhoneSetProgramming, PhoneSetProgrammingRest);\r\n }\r\n\r\n getMessagingService() {\r\n return this.getOrCreate(O2GService.Messaging, MessagingRest);\r\n }\r\n\r\n // Bootstrap on the specified address\r\n // Try to get the O2G info\r\n bootstrapAddress(address: string) {\r\n\r\n // Init the O2G service address\r\n this.setO2GServiceUri(address);\r\n\r\n // Try to get the information\r\n return new Promise((resolve, reject) => {\r\n\r\n this.getO2GService().get()\r\n .then((apiDescriptor: O2GService) => resolve(apiDescriptor))\r\n .catch(() => {\r\n this._logger.error(\"Unable to bootstrap on {addr}\", address);\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n getVersion(descriptor: RoxeRestApiDescriptor): Version {\r\n\r\n if (this._apiVersion) {\r\n let version = descriptor.versions.find(version => version.id === this._apiVersion);\r\n if (version) {\r\n return version;\r\n }\r\n\r\n throw new Error(`API version [${this._apiVersion}] is not supported.`);\r\n }\r\n else {\r\n const version = descriptor.versions.find(version => version.status == \"CURRENT\");\r\n if (version) {\r\n this._apiVersion = version.id;\r\n return version;\r\n }\r\n else {\r\n throw new Error(\"Unable to retrieve current API version.\");\r\n }\r\n }\r\n }\r\n\r\n async bootstrap(host: Host): Promise<ServerInfo> {\r\n\r\n let apiDescriptor: RoxeRestApiDescriptor | null = null;\r\n\r\n if (host.privateAddress) {\r\n \r\n try {\r\n this.setO2GServiceUri(host.privateAddress);\r\n\r\n apiDescriptor = await this.getO2GService().get();\r\n this._accessMode = AccessMode.Private;\r\n }\r\n catch (e) {\r\n this._logger.debug(\"Unable to bootstrap on {0}\", host.privateAddress);\r\n \r\n if (host.publicAddress == null) {\r\n this.throwUnableToConnect(host);\r\n }\r\n }\r\n }\r\n\r\n if (apiDescriptor == null) {\r\n try {\r\n this.setO2GServiceUri(host.publicAddress);\r\n\r\n apiDescriptor = await this.getO2GService().get();\r\n this._accessMode = AccessMode.Public;\r\n }\r\n catch (e) {\r\n this._logger.debug(\"Unable to bootstrap on {0}\", host.publicAddress);\r\n this.throwUnableToConnect(host);\r\n }\r\n }\r\n\r\n const version: Version | null = this.getVersion(apiDescriptor!);\r\n\r\n if (this._accessMode == AccessMode.Private) {\r\n this._servicesUri.set(O2GService.Authentication, UtilUri.ensureHttps(version!.internalUrl));\r\n }\r\n else {\r\n this._servicesUri.set(O2GService.Authentication, UtilUri.ensureHttps(version!.publicUrl));\r\n }\r\n\r\n return apiDescriptor!.serverInfo;\r\n }\r\n\r\n\r\n setSessionUris(privateUri: string, publicUri: string) {\r\n\r\n if (this._accessMode === AccessMode.Private) {\r\n this._servicesUri.set(O2GService.Sessions, UtilUri.ensureHttps(privateUri));\r\n }\r\n else {\r\n this._servicesUri.set(O2GService.Sessions, UtilUri.ensureHttps(publicUri));\r\n }\r\n }\r\n\r\n setServices(sessionInfo: SessionInfo) {\r\n \r\n let baseUrl: string;\r\n\r\n // get the right URL\r\n if (this._accessMode == AccessMode.Private) {\r\n baseUrl = sessionInfo.privateBaseUrl;\r\n }\r\n else {\r\n baseUrl = sessionInfo.publicBaseUrl;\r\n }\r\n\r\n sessionInfo.services.forEach(service => {\r\n\r\n var serviceName = O2GService.get(service.serviceName);\r\n if (service.relativeUrl.startsWith(\"/telephony\")) {\r\n // Only one telephony service\r\n serviceName = O2GService.Telephony;\r\n }\r\n\r\n if (!this._servicesUri.has(serviceName)) {\r\n if (service.relativeUrl.startsWith(\"/telephony\")) {\r\n this._logger.debug(\"Register service: Telephony\");\r\n\r\n this._servicesUri.set(serviceName, baseUrl + \"/telephony\");\r\n }\r\n else {\r\n this._logger.debug(\"Register service: {service}\", service.serviceName);\r\n this._servicesUri.set(serviceName, baseUrl + service.relativeUrl);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport HttpContent from '../util/http-content';\r\nimport { Preferences, SupportedLanguages, User } from '../../types/users/users-types';\r\n\r\ntype LoginsResponse = {\r\n loginNames: string[];\r\n}\r\n\r\nexport default class UsersRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getByLoginName(loginName: string | null = null): Promise<User | null> {\r\n\r\n let uriGet = this._uri;\r\n if (loginName) {\r\n uriGet = UtilUri.appendPath(uriGet, loginName);\r\n }\r\n\r\n const _user = this.getResult<User>(await RestService._httpClient.get(uriGet));\r\n \r\n if (!_user) return null;\r\n return {\r\n ..._user,\r\n nodeId: Number(_user.nodeId)\r\n }\r\n }\r\n\r\n public async getLogins(nodeIds: number[] | null, onlyACD: boolean, onlyWithExtLogin: boolean): Promise<string[] | null> {\r\n\r\n let uriGet = this._uri.replace(\"/users\", \"/logins\");\r\n if (nodeIds) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeIds\", nodeIds.join(';'));\r\n }\r\n\r\n if (onlyACD) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"onlyACD\");\r\n }\r\n\r\n if (onlyWithExtLogin) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"onlyWithExtLogin\");\r\n }\r\n\r\n const logins = this.getResult<LoginsResponse>(await RestService._httpClient.get(uriGet));\r\n if (logins && Array.isArray(logins.loginNames)) {\r\n return logins.loginNames;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getByCompanyPhone(companyPhone: string): Promise<User | null> {\r\n\r\n const _user = this.getResult<User>(await RestService._httpClient.get(UtilUri.appendQuery(this._uri, \"companyPhone\", companyPhone)));\r\n \r\n if (!_user) return null;\r\n return {\r\n ..._user,\r\n nodeId: Number(_user.nodeId)\r\n }\r\n }\r\n\r\n public async getPreferences(loginName: string): Promise<Preferences | null> {\r\n return this.getResult<Preferences>(await RestService._httpClient.get(UtilUri.appendPath(this._uri, loginName, \"preferences\")));\r\n\t}\r\n\r\n async getSupportedLanguages(loginName: string): Promise<SupportedLanguages | null> {\r\n return this.getResult<SupportedLanguages>(await RestService._httpClient.get(UtilUri.appendPath(this._uri, loginName, \"preferences/supportedLanguages\")));\r\n\t}\r\n\r\n async changePassword(loginName: string, oldPassword: string, newPassword: string): Promise<boolean> {\r\n\r\n let json = JSON.stringify({\r\n oldPassword: oldPassword,\r\n newPassword: newPassword\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.put(UtilUri.appendPath(this._uri, loginName, \"password\"), new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport {Incident} from '../../types/analytics/incident';\r\nimport {ChargingFile} from '../../types/analytics/charging-file';\r\nimport {ChargingResult} from '../../types/analytics/charging-result';\r\nimport {TimeRange} from '../../types/analytics/time-range';\r\nimport { O2GChargingResult, O2GIncident } from '../types/analytics/o2ganalytics-types';\r\nimport { O2GChargingFile } from '../types/analytics/o2ganalytics-types';\r\n\r\ntype O2GChargingFileResult = {\r\n files: O2GChargingFile[];\r\n}\r\n\r\ntype O2GIncidents = {\r\n incidents: O2GIncident[];\r\n}\r\n\r\nexport default class AnalyticsRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n padTo2Digits(num: number) {\r\n return num.toString().padStart(2, '0');\r\n }\r\n \r\n _formatDateFilter(date: Date) {\r\n return [\r\n date.getFullYear(),\r\n (date.getMonth() + 1).toString().padStart(2, '0'),\r\n date.getDate().toString().padStart(2, '0')\r\n ].join('');\r\n }\r\n\r\n\r\n public async getIncidents(nodeId: number, last: number): Promise<Array<Incident> | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"incidents\");\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeId\", AssertUtil.positive(nodeId, \"nodeId\").toString());\r\n\r\n if (last > 0) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"last\", last.toString());\r\n }\r\n\r\n let o2gIncidentsResult = this.getResult<O2GIncidents>(await RestService._httpClient.get(uriGet));\r\n if (o2gIncidentsResult) {\r\n\r\n let o2gIncident: O2GIncident[] = o2gIncidentsResult.incidents;\r\n if (o2gIncident) {\r\n\r\n return o2gIncident.map((inc: O2GIncident) => Incident.build(inc));\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public async getChargingFiles(nodeId: number, filter: TimeRange | null): Promise<Array<ChargingFile> | null> {\r\n\r\n var uriGet = UtilUri.appendPath(this._uri, \"charging\", \"files\");\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeId\", AssertUtil.positive(nodeId, \"nodeId\").toString());\r\n\r\n if (filter) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"fromDate\", this._formatDateFilter(filter.from));\r\n uriGet = UtilUri.appendQuery(uriGet, \"toDate\", this._formatDateFilter(filter.to));\r\n }\r\n\r\n let o2gChargingFilesResult = this.getResult<O2GChargingFileResult>(await RestService._httpClient.get(uriGet));\r\n if (o2gChargingFilesResult) {\r\n\r\n let o2gChargingFiles: O2GChargingFile[] = o2gChargingFilesResult.files;\r\n if (o2gChargingFiles) {\r\n\r\n return o2gChargingFiles.map((cf: O2GChargingFile) => ChargingFile.build(cf));\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public async getChargingsFromFilter(nodeId: number, filter: TimeRange | null, topResults: number | null, all: boolean): Promise<ChargingResult | null> {\r\n\r\n var uriGet = UtilUri.appendPath(this._uri, \"charging\");\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeId\", AssertUtil.positive(nodeId, \"nodeId\").toString());\r\n\r\n if (filter) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"fromDate\", this._formatDateFilter(filter.from));\r\n uriGet = UtilUri.appendQuery(uriGet, \"toDate\", this._formatDateFilter(filter.to));\r\n }\r\n\r\n if (topResults) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"top\", topResults.toString());\r\n }\r\n\r\n if (all) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"all\", \"true\");\r\n }\r\n\r\n const o2gChargingResult = this.getResult<O2GChargingResult>(await RestService._httpClient.get(uriGet));\r\n if (o2gChargingResult) {\r\n\r\n return ChargingResult.build(o2gChargingResult, filter);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getChargingsFromFiles(nodeId: number, files: Array<ChargingFile>, topResults: number | null, all: boolean): Promise<ChargingResult | null> {\r\n\r\n var uriGet = UtilUri.appendPath(this._uri, \"charging\");\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeId\", AssertUtil.positive(nodeId, \"nodeId\").toString());\r\n uriGet = UtilUri.appendQuery(uriGet, \"files\", AssertUtil.notNull(files, \"files\").map((file: ChargingFile) => file.name).join(','));\r\n\r\n if (topResults) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"top\", topResults.toString());\r\n }\r\n\r\n if (all) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"all\", \"true\");\r\n }\r\n\r\n const o2gChargingResult = this.getResult<O2GChargingResult>(await RestService._httpClient.get(uriGet));\r\n if (o2gChargingResult) {\r\n\r\n return ChargingResult.build(o2gChargingResult);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted = '', free of charge = '', to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\") = '', to deal in the Software \r\n* without restriction = '', including without limitation the rights to use = '', copy = '', modify = '', merge = '', \r\n* publish = '', distribute = '', sublicense = '', and/or sell copies of the Software = '', and to permit persons \r\n* to whom the Software is furnished to do so = '', subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\" = '', WITHOUT WARRANTY OF ANY KIND = '', EXPRESS OR IMPLIED = '', INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY = '', FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM = '', \r\n* DAMAGES OR OTHER LIABILITY = '', WHETHER IN AN ACTION OF CONTRACT = '', TORT OR OTHERWISE = '', ARISING FROM = '', \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * Reason enum defines the why reason the communication has been released, established or rerouted.\r\n */\r\nexport enum Reason {\r\n \r\n /**\r\n * The call was abandonned because there was no Available trunk.\r\n */\r\n ALL_TRUNK_BUSY = 'ALL_TRUNK_BUSY',\r\n \r\n /**\r\n * The call was refused because the dialed number is not valid.\r\n */\r\n INVALID_NUMBER = 'INVALID_NUMBER',\r\n \r\n /**\r\n * The call was canceled by the caller.\r\n */\r\n ABANDONED = 'ABANDONED',\r\n \r\n /**\r\n * The call failed because the called party is busy.\r\n */\r\n BUSY = 'BUSY',\r\n \r\n /**\r\n * The call was set to be a conference.\r\n */\r\n CONFERENCED = 'CONFERENCED',\r\n \r\n /**\r\n * he call was picked up.\r\n */\r\n PICKUP = 'PICKUP',\r\n \r\n /**\r\n * The call was forwarded to another destination.\r\n */\r\n FORWARDED = 'FORWARDED',\r\n \r\n /**\r\n * The call was redirected to another destination.\r\n */\r\n REDIRECTED = 'REDIRECTED',\r\n \r\n /**\r\n * The call was released since redirection to another destination fails.\r\n */\r\n RELEASED_ON_REDIRECT = 'RELEASED_ON_REDIRECT',\r\n \r\n /**\r\n * The call was transferred.\r\n */\r\n TRANSFERRED = 'TRANSFERRED',\r\n \r\n /**\r\n * The call was released since transfer to another destination fails.\r\n */\r\n RELEASED_ON_TRANSFER = 'RELEASED_ON_TRANSFER',\r\n \r\n /**\r\n * The call ended on voicemail.\r\n */\r\n VOICEMAIL = 'VOICEMAIL',\r\n \r\n /**\r\n * The call normally ended.\r\n */\r\n NORMAL = 'NORMAL',\r\n \r\n /**\r\n * The reason is unknown.\r\n */\r\n UNKNOWN = 'UNKNOWN'\r\n }","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GCharging } from \"../../internal/types/analytics/o2ganalytics-types\";\r\nimport { CallType } from \"./call-type\";\r\nimport { TelFacility } from \"./tel-facility\";\r\n\r\n/**\r\n * Charging represents a charging information.\r\n */\r\nexport class Charging {\r\n\r\n private _caller!: string;\r\n private _name!: string;\r\n private _called!: string;\r\n private _initialDialedNumber!: string;\r\n private _callNumber!: number;\r\n private _chargingUnits!: number;\r\n private _cost!: number;\r\n private _startDate!: Date;\r\n private _duration!: number;\r\n private _callType!: CallType;\r\n private _effectiveCallDuration!: number;\r\n private _actingExtensionNumberNode!: number;\r\n private _internalFacilities!: TelFacility[];\r\n private _externalFacilities!: TelFacility[];\r\n \r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n }\r\n\r\n /**\r\n * Returns the caller phone number.\r\n */\r\n public get caller(): string {\r\n\t\treturn this._caller;\r\n\t}\r\n\r\n /**\r\n * Returns the caller name.\r\n */\t\r\n public get name(): string {\r\n\t\treturn this._name;\r\n\t}\r\n\r\n /**\r\n * Returns the called phone number.\r\n */\t\r\n\tpublic get called(): string {\r\n\t\treturn this._called;\r\n\t}\r\n\r\n /**\r\n * Returns the initial dialed number.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get initialDialedNumber(): string {\r\n\t\treturn this._initialDialedNumber;\r\n\t}\r\n\r\n /**\r\n * Returns the number of charged calls.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get callNumber(): number {\r\n\t\treturn this._callNumber;\r\n\t}\r\n\r\n /**\r\n * Returns the number of charged units.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get chargingUnits(): number {\r\n\t\treturn this._chargingUnits;\r\n\t}\r\n\r\n /**\r\n * Returns the call charging cost.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get cost(): number {\r\n\t\treturn this._cost;\r\n\t}\r\n\r\n /**\r\n * Returns the call start date.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get startDate(): Date {\r\n\t\treturn this._startDate;\r\n\t}\r\n\r\n /**\r\n * Returns the call duration.\r\n */\t\r\n\tpublic get duration(): number {\r\n\t\treturn this._duration;\r\n\t}\r\n\r\n /**\r\n * Returns the call type.\r\n * <p>\r\n * This information is provided only if the query has been done with the 'all' option.\r\n * @see {@link Analytics.getChargings}.\r\n */\t\r\n\tpublic get callType(): CallType {\r\n\t\treturn this._callType;\r\n\t}\r\n\r\n /**\r\n * Returns the effective call duration.\r\n */\t\r\n\tpublic get effectiveCallDuration(): number {\r\n\t\treturn this._effectiveCallDuration;\r\n\t}\r\n\r\n /**\r\n * Returns the acting extension node number.\r\n */\t\r\n\tpublic get actingExtensionNumberNode(): number {\r\n\t\treturn this._actingExtensionNumberNode;\r\n\t}\r\n\r\n /**\r\n * Return the internal facilities.\r\n */\t\r\n\tpublic get internalFacilities(): TelFacility[] {\r\n\t\treturn this._internalFacilities;\r\n\t}\r\n\r\n /**\r\n * Return the external facilities.\r\n */\t\r\n\tpublic get externalFacilities(): TelFacility[] {\r\n\t\treturn this._externalFacilities;\r\n\t}\r\n\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gCharging: O2GCharging): Charging {\r\n\r\n let result = new Charging();\r\n\r\n result._caller = o2gCharging.caller;\r\n result._name = o2gCharging.name;\r\n result._called = o2gCharging.called;\r\n result._initialDialedNumber = o2gCharging.initialDialledNumber;\r\n result._callNumber = o2gCharging.callNumber;\r\n result._chargingUnits = o2gCharging.chargingUnits;\r\n result._cost = o2gCharging.cost;\r\n\r\n result._startDate = this._makeDate(o2gCharging.startDate);\r\n \r\n result._duration = o2gCharging.duration;\r\n\r\n if (CallType.isCallType(o2gCharging.callType)) {\r\n result._callType = o2gCharging.callType as CallType;\r\n } else {\r\n result._callType = CallType.Unspecified;\r\n }\r\n\r\n result._effectiveCallDuration = o2gCharging.effectiveCallDuration;\r\n result._actingExtensionNumberNode = o2gCharging.actingExtensionNumberNode;\r\n\r\n \r\n if (o2gCharging.internalFacilities) {\r\n result._internalFacilities = o2gCharging.internalFacilities.facilities\r\n .map((f: string) => TelFacility[f as keyof typeof TelFacility])\r\n .filter(fac => fac !== undefined);\r\n }\r\n\r\n if (o2gCharging.externalFacilities) {\r\n result._externalFacilities = o2gCharging.externalFacilities.facilities\r\n .map((f: string) => TelFacility[f as keyof typeof TelFacility])\r\n .filter(fac => fac !== undefined);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private static _makeDate(date: string): Date {\r\n\r\n let items = date.split(' ');\r\n return new Date(items[0].substring(0, 4) + '-' + items[0].substring(4, 6) + '-' + items[0].substring(6, 8) + 'T' + items[1]);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * TimeRange represents an interval between two dates. It is used to filter analytics requests.\r\n * @see {@link Analytics.getChargingsFromFilter} and {@link Analytics.getChargingFiles}\r\n */\r\nexport class TimeRange {\r\n\r\n private _from: Date;\r\n private _to: Date;\r\n\r\n /**\r\n * Construct a new TimeRange, with the specified \"from\" date and \"to\" date.\r\n * @param from the begining of the range\r\n * @param to the end of the range\r\n */\r\n constructor(from: Date, to: Date) {\r\n this._from = from;\r\n this._to = to;\r\n }\r\n\r\n /**\r\n * Returns the \"from\" date.\r\n */\r\n public get from() {\r\n return this._from;\r\n }\r\n\r\n /**\r\n * Returns the \"to\" date.\r\n */\r\n public get to() {\r\n return this._to;\r\n }\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport { RoxeRestApiDescriptor } from '../types/common/o2gcommon-types';\r\n\r\nexport default class O2GRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async get(): Promise<RoxeRestApiDescriptor> {\r\n\r\n var httpResponse = await RestService._httpClient.get(this._uri);\r\n\r\n if (httpResponse.isSuccessStatusCode()) {\r\n return httpResponse.fromJson<RoxeRestApiDescriptor>();\r\n }\r\n else {\r\n throw new Error(\"Unable to get O2G service\");\r\n }\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport { O2GAuthenticateResult } from '../types/common/o2gcommon-types';\r\n\r\nexport default class AuthenticationRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async authenticate(login: string, password: string): Promise<O2GAuthenticateResult | null> {\r\n\r\n const basicAuth = Buffer.from(login + \":\" + password).toString(\"base64\");\r\n\r\n let additionalHeaders: Record<string, string> = {};\r\n additionalHeaders[\"Authorization\"] = `Basic ${basicAuth}`;\r\n\r\n return this.getResult<O2GAuthenticateResult>(await RestService._httpClient.get(this._uri, \"json\", additionalHeaders));\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * IntrusionMode represents the possible intrusion mode.\r\n * <p>\r\n * A supervisor can intrude in an established CCD call. The intrusion depends on the IntrusionMode.\r\n * @see {@link CallCenterAgent.requestIntrusion}\r\n */\r\n export enum IntrusionMode {\r\n\r\n /**\r\n * The supervisor can talk to both the agent and the remote customer.\r\n */\r\n NORMAL = \"NORMAL\",\r\n\r\n /**\r\n * The supervisor can only talk to the agent but listen to the remote customer.\r\n */\r\n RESTRICTED = \"RESTRICTED\",\r\n \r\n /**\r\n * The supervisor only listens to the conversation between agent and customer.\r\n */\r\n DISCRETE = \"DISCRETE\",\r\n\r\n /**\r\n * The supervisor stops the intrusion\r\n */\r\n STOP = \"STOP\"\r\n}\r\n","module.exports = require(\"os\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {PbxAttributeMap} from \"./pbx-attr-map\";\r\nimport { O2GPbxAttribute } from \"../../internal/types/pbxmngt/o2gpbxmngt-types\";\r\n\r\n/**\r\n * PbxAttribute class represents an attribute in a {@link PbxObject} object. A PbxAttribute\r\n * can be of the following type:\r\n * <p><b><u>Integer</u></b>: An Integer value is equivalent to an int value.\r\n * <p><b><u>Boolean</u></b>: An Boolean value is equivalent to an boolean value.\r\n * <p><b><u>Enumerated</u></b>: An enumerated value can have a limited set of possible\r\n * values. PbxAttribute treats enumerated value as string value.\r\n * <p><b><u>OctetString, ByteString</u></b>: An OctetString or a ByteString are equivalent to a string value.\r\n * <p><b><u>Sequence</u></b>: A Sequence is a structured data whose attribute member have\r\n * a specific name and type: For exemple\r\n * @example\r\n * ```typescript\r\n * Skill := Sequence {\r\n * Skill_Nb := Integer,\r\n * Skill_Level := Integer,\r\n * Skill_Activate := Boolean\r\n * }\r\n * ```\r\n * \r\n * <p><b><u>Set</u></b>: A Set value is a list of attributes of the same type. It can be\r\n * a list of simple value like:\r\n * \r\n * @example\r\n * ```typescript\r\n * SimpleSet := Set {\r\n * Item := OctetString\r\n * }\r\n * ```\r\n * \r\n * or a list of sequences:\r\n * \r\n * @example\r\n * ```typescript\r\n * SkillSet := Set {\r\n * Item := Sequence {\r\n * Skill_Nb := Integer,\r\n * Skill_Level := Integer,\r\n * Skill_Activate := Boolean\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport class PbxAttribute {\r\n private _name: string;\r\n private _values: string[] = [];\r\n private _attributeMaps: PbxAttributeMap[] | null = null;\r\n private _sequenceMap: PbxAttributeMap | null = null;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor(name: string) {\r\n this._name = name;\r\n }\r\n\r\n /**\r\n * Returns this attribute's name.\r\n */\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(attr: O2GPbxAttribute): PbxAttribute {\r\n const attribute = new PbxAttribute(attr.name);\r\n attribute._values = attr.value ?? [];\r\n\r\n if (attr.complexValue) {\r\n attribute._attributeMaps = attr.complexValue.map(PbxAttributeMap.build);\r\n }\r\n\r\n return attribute;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static addSequenceAttribute(pbxAttribute: PbxAttribute, name: string, attr: O2GPbxAttribute): void {\r\n if (!pbxAttribute._sequenceMap) {\r\n pbxAttribute._sequenceMap = new PbxAttributeMap();\r\n }\r\n\r\n const attribute = new PbxAttribute(name);\r\n attribute._values = attr.value ?? [];\r\n\r\n pbxAttribute._sequenceMap.add(attribute);\r\n }\r\n\r\n public static createSetOfStrings(attrName: string, values: string[]): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._values = values;\r\n return attribute;\r\n }\r\n\r\n public static createString(attrName: string, value: string): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._values = [value];\r\n return attribute;\r\n }\r\n\r\n public static createBoolean(attrName: string, value: boolean): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._values = [value ? \"true\" : \"false\"];\r\n return attribute;\r\n }\r\n\r\n public static createInteger(attrName: string, value: number): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._values = [value.toString()];\r\n return attribute;\r\n }\r\n\r\n public static createSequence(attrName: string, sequence: PbxAttributeMap): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._sequenceMap = sequence;\r\n return attribute;\r\n }\r\n\r\n public static createSequenceSet(attrName: string, setOfSequences: PbxAttributeMap[]): PbxAttribute {\r\n const attribute = new PbxAttribute(attrName);\r\n attribute._attributeMaps = setOfSequences;\r\n return attribute;\r\n }\r\n\r\n public getAt(index: number): PbxAttributeMap {\r\n if (!this._attributeMaps || !Array.isArray(this._attributeMaps)) {\r\n throw new Error(\"InvalidObject: Attribute is not a Set\");\r\n }\r\n\r\n return this._attributeMaps![index];\r\n }\r\n\r\n\r\n public asAttributeMap(): PbxAttributeMap | null {\r\n if (!this._sequenceMap) {\r\n throw new Error(\"InvalidObject: Attribute is not a sequence\");\r\n }\r\n\r\n return this._sequenceMap;\r\n }\r\n\r\n public asListOfMaps(): PbxAttributeMap[] | null {\r\n if (!this._attributeMaps) {\r\n throw new Error(\"InvalidObject: Attribute is not a sequence set\");\r\n }\r\n\r\n return this._attributeMaps;\r\n }\r\n\r\n private _assertUnique(values: string[]): string {\r\n if (Array.isArray(values) && values.length === 1) {\r\n return values[0];\r\n }\r\n\r\n throw new Error(\"Value is not a list with a unique element\");\r\n }\r\n\r\n public asBoolean(): boolean {\r\n const value = this._assertUnique(this._values);\r\n\r\n if (value === \"true\") return true;\r\n if (value === \"false\") return false;\r\n\r\n throw new Error(`Value \"${value}\" is not a boolean`); \r\n }\r\n\r\n public setBoolean(value: boolean): void {\r\n this._values = [value ? \"true\" : \"false\"];\r\n this._sequenceMap = null;\r\n this._attributeMaps = null;\r\n }\r\n\r\n public asInteger(): number {\r\n const value = this._assertUnique(this._values);\r\n const num = parseInt(value, 10);\r\n\r\n if (isNaN(num)) {\r\n throw new Error(`InvalidObject: Value \"${value}\" is not a valid integer`);\r\n }\r\n\r\n return num;\r\n }\r\n\r\n public setInteger(value: number): void {\r\n this._values = [value.toString()];\r\n this._sequenceMap = null;\r\n this._attributeMaps = null;\r\n }\r\n\r\n public asString(): string {\r\n return this._assertUnique(this._values);\r\n }\r\n\r\n public setString(value: string): void {\r\n this._values = [value];\r\n this._sequenceMap = null;\r\n this._attributeMaps = null;\r\n }\r\n\r\n public asEnum(): string {\r\n return this.asString();\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static from(attr: PbxAttribute): O2GPbxAttribute[] {\r\n const listAttr: O2GPbxAttribute[] = [];\r\n\r\n if (attr._sequenceMap) {\r\n for (const name of attr._sequenceMap.names) {\r\n const nestedAttr = attr._sequenceMap.getAttribute(name);\r\n if (nestedAttr) {\r\n listAttr.push({\r\n name: `${attr.name}.${name}`,\r\n value: nestedAttr._values,\r\n });\r\n }\r\n }\r\n } else if (attr._attributeMaps) {\r\n listAttr.push({\r\n name: attr.name,\r\n value: attr._values,\r\n complexValue: attr._attributeMaps.map(attrMap =>\r\n PbxAttributeMap.from(attrMap, attr.name)\r\n )\r\n });\r\n } else {\r\n listAttr.push({\r\n name: attr.name,\r\n value: attr._values\r\n });\r\n }\r\n\r\n return listAttr;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport AnalyticsRest from \"./internal/rest/analytics-rest\";\r\nimport {Incident} from \"./types/analytics/incident\";\r\nimport {ChargingFile} from \"./types/analytics/charging-file\";\r\nimport {ChargingResult} from \"./types/analytics/charging-result\";\r\nimport {TimeRange} from \"./types/analytics/time-range\";\r\n\r\n/**\r\n * The Analytics service allows to retrieve OmniPCX entreprise charging information and incidents. \r\n * <p>Using this service requires having a <b>ANALYTICS</b> license. This service requires an administrative login.\r\n * <p>\r\n * O2G uses SSH to get the information from an OmniPCX Enterprise node. So\r\n * <b>SSH must be enabled</b> on the OmniPCX Enterprise node to use this\r\n * service.\r\n */\r\nexport class Analytics {\r\n private _analyticsRest: AnalyticsRest\r\n\r\n /**\r\n * \r\n * @internal \r\n */\r\n constructor(analyticsRest: AnalyticsRest) {\r\n this._analyticsRest = analyticsRest;\r\n\t}\r\n\r\n /**\r\n * Returns a list of incidents from the specified OmniPCX Enterprise node.\r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param last the number of incidents to retrieve\r\n */\r\n async getIncidents(nodeId: number, last: number = 0): Promise<Array<Incident> | null> {\r\n return await this._analyticsRest.getIncidents(nodeId, last);\r\n }\r\n\r\n /**\r\n * Get the list of charging file from the specified node, using the time range filter.\r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param filter time range filter\r\n * @see {@link getChargingsFromFiles}\r\n */\r\n async getChargingFiles(nodeId: number, filter: TimeRange | null = null): Promise<Array<ChargingFile> | null> {\r\n return await this._analyticsRest.getChargingFiles(nodeId, filter);\r\n }\r\n\r\n /**\r\n * Query the charging information for the specified node, using the specified options.\r\n * <p>\r\n * If 'all' is set to 'true', all the tickets are returned, including the zero cost ticket, and with the called party; If 'all' is\r\n * set to 'false', the total of charging info is returned for each user, the call number giving the number of calls with non null charging cost.\r\n * <p>\r\n * The request processes charging files on the OmniPCX Enterprise. The processing is limited to a maximum of 100 files for performance reason. If\r\n * the range filter is too large and the number of file to process is greater than 100, the method fails and returns 'null'. In this case, a smaller\r\n * range must be specified.\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param filter a time range filter\r\n * @param topResults allows to return only the 'top N' tickets\r\n * @param all 'true' to include tickets with a 0 cost\r\n */\r\n async getChargingsFromFilter(nodeId: number, filter: TimeRange | null = null, topResults: number | null = null, all: boolean = false): Promise<ChargingResult | null> {\r\n return await this._analyticsRest.getChargingsFromFilter(nodeId, filter, topResults, all);\r\n }\r\n\r\n /**\r\n * Query the charging information for the specified node, using the specified charging files. The charging files can be retrieved with {@link getChargingFiles}.\r\n * <p>\r\n * If 'all' is set to 'true', all the tickets are returned, including the zero cost ticket, and with the called party; If 'all' is\r\n * set to 'false', the total of charging info is returned for each user, the call number giving the number of calls with non null charging cost.\r\n * <p>\r\n * The request processes charging files on the OmniPCX Enterprise. The processing is limited to a maximum of 100 files for performance reason. If\r\n * the range filter is too large and the number of file to process is greater than 100, the method fails and returns 'null'. In this case, a smaller\r\n * range must be specified.\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param files the list of file to process\r\n * @param topResults allows to return only the 'top N' tickets\r\n * @param all 'true' to include tickets with a 0 cost\r\n */\r\n async getChargingsFromFiles(nodeId: number, files: Array<ChargingFile>, topResults: number | null = null, all: boolean = false): Promise<ChargingResult | null> {\r\n return await this._analyticsRest.getChargingsFromFiles(nodeId, files, topResults, all);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { FilterItem } from \"./filter-item\";\r\nimport { OperationFilter } from \"./operation-filter\";\r\n\r\n/**\r\n * Criteria allows to specifiy a filter to apply on a directory search.\r\n * <p>\r\n * A simple criteria is a tuple of the form: [Attribute, Operation, Value]. For example : [LAST_NAME, BEGINS_WITH, \"fr\"].\r\n * <br>A Criteria can also be the logical OR or AND combination of the set of other Criteria's.\r\n * <p>\r\n * The acceptable values for the Attributes are:<br>\r\n * <table>\r\n * <caption>Attributes values</caption>\r\n * <thead>\r\n * <tr><th>Value</th><th>Description</th></tr>\r\n * </thead>\r\n * <tr><td>LAST_NAME</td><td>The last name.</td></tr>\r\n * <tr><td>FIRST_NAME</td><td>The first name.</td></tr>\r\n * <tr><td>LOGIN_NAME</td><td>The login name.</td></tr>\r\n * <tr><td>PHONE_NUMBER</td><td>The phone number.</td></tr>\r\n * </table>\r\n * <p>\r\n * The acceptable values for the Operands are<br>\r\n * <table>\r\n * <caption>Operands values</caption>\r\n * <thead>\r\n * <tr><th>Value</th><th>Description</th></tr>\r\n * </thead>\r\n * <tr><td>BEGINS_WITH</td><td>The attribute must begin with the given value.</td></tr>\r\n * <tr><td>ENDS_WITH</td><td>The attribute must end with the given value.</td></tr>\r\n * <tr><td>CONTAINS</td><td>The attribute must contain with the given value.</td></tr>\r\n * <tr><td>EQUAL_IGNORE_CASE</td><td>The attribute is equal to the given value (case insensitive comparison).</td></tr>\r\n * </table>\r\n * <p><b><u>exemples</u></b>:\r\n * @example\r\n * ```typescript\r\n * // Search users whom last name begins with 'b'\r\n * let criteria = Criteria.create(\r\n * FilterItem.LASTNAME, \r\n * OperationFilter.BEGINS_WITH, \r\n * 'b');\r\n * \r\n * // Search users whom last name begins with 'b' and first name contains 'ja'\r\n * let criteria = Criteria.and(\r\n * Criteria.create(\r\n * FilterItem.LASTNAME,\r\n * OperationFilter.BEGINS_WITH,\r\n * 'b'\r\n * ),\r\n * Criteria.create(\r\n * FilterItem.FIRSTNAME,\r\n * OperationFilter.CONTAINS,\r\n * 'ja'\r\n * )\r\n * );\r\n * ```\r\n *\r\n */\r\n export class Criteria {\r\n\r\n private field!: string;\r\n private operation!: string;\r\n private operand: any\r\n\r\n private static _makeField(attr: FilterItem): string {\r\n if (attr == FilterItem.LAST_NAME) return \"lastName\";\r\n else if (attr == FilterItem.FIRST_NAME) return \"firstName\";\r\n else if (attr == FilterItem.PHONE_NUMBER) return \"id.phoneNumber\";\r\n else return \"id.loginName\";\r\n }\r\n\r\n private static _makeOperation(operation: OperationFilter): string {\r\n if (operation == OperationFilter.BEGINS_WITH) return \"BEGIN_WITH\";\r\n else if (operation == OperationFilter.EQUAL_IGNORE_CASE) return \"EQUAL_IGNORE_CASE\";\r\n else if (operation == OperationFilter.CONTAINS) return \"CONTAIN\";\r\n else return \"END_WITH\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n\r\n }\r\n\r\n\r\n\t/**\r\n\t * Create a new search Criteria with the specified attribute filter, operation\r\n\t * filter and value.\r\n\t * \r\n\t * @param field the attribute filter\r\n\t * @param operation the operation\r\n\t * @param operand the value associated to this critera\r\n\t */\r\n public static create(field: FilterItem, operation: OperationFilter, value: string): Criteria {\r\n\r\n var criteria = new Criteria();\r\n criteria.field = Criteria._makeField(field);\r\n criteria.operation = Criteria._makeOperation(operation);\r\n criteria.operand = value;\r\n\r\n return criteria;\r\n }\r\n\r\n\r\n\t/**\r\n\t * Create a search Criteria that is the OR combination of the given\r\n\t * list of Criterias.\r\n\t * \r\n\t * @param criterias a list of Criteria objects.\r\n\t */\r\n public static or(): Criteria {\r\n\r\n var criteria = new Criteria();\r\n criteria.operation = \"OR\";\r\n criteria.operand = Array.from(arguments);\r\n\r\n return criteria;\r\n }\r\n\r\n\t/**\r\n\t * Create a search Criteria that is the AND combination of the given\r\n\t * list of Criterias.\r\n\t * \r\n\t * @param criterias a list of Criteria objects.\r\n\t */\r\n public static and(): Criteria {\r\n\r\n var criteria = new Criteria();\r\n criteria.operation = \"AND\";\r\n criteria.operand = Array.from(arguments);;\r\n\r\n return criteria;\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GIncident } from \"../../internal/types/analytics/o2ganalytics-types\";\r\n\r\nexport class Incident {\r\n private _id!: number;\r\n private _severity!: number;\r\n private _description!: string;\r\n private _nbOccurs!: number;\r\n private _node!: number;\r\n private _main!: boolean;\r\n private _rack!: string;\r\n private _board!: string;\r\n private _equipment!: string;\r\n private _termination!: string;\r\n private _date!: Date;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {}\r\n\r\n /** Returns the incident identifier. */\r\n public get id(): number {\r\n return this._id;\r\n }\r\n\r\n /** Returns the date the incident has been raised. */\r\n public get date(): Date {\r\n return this._date;\r\n }\r\n\r\n /** Returns the incident severity. */\r\n public get severity(): number {\r\n return this._severity;\r\n }\r\n\r\n /** Returns the textual description of this incident. */\r\n public get description(): string {\r\n return this._description;\r\n }\r\n\r\n /** Returns the number of occurrences of this incident. */\r\n public get nbOccurs(): number {\r\n return this._nbOccurs;\r\n }\r\n\r\n /** Returns the OmniPCX Enterprise node on which this incident has been raised. */\r\n public get node(): number {\r\n return this._node;\r\n }\r\n\r\n /** Returns whether this incident has been raised on the main call server. */\r\n public get main(): boolean {\r\n return this._main;\r\n }\r\n\r\n /** Returns the rack related to this incident. */\r\n public get rack(): string {\r\n return this._rack;\r\n }\r\n\r\n /** Returns the board related to this incident. */\r\n public get board(): string {\r\n return this._board;\r\n }\r\n\r\n /** Returns the equipment related to this incident. */\r\n public get equipment(): string {\r\n return this._equipment;\r\n }\r\n\r\n /** Returns the termination related to this incident. */\r\n public get termination(): string {\r\n return this._termination;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gIncident: O2GIncident): Incident {\r\n const result = new Incident();\r\n\r\n result._id = parseInt(o2gIncident.value);\r\n result._severity = o2gIncident.severity;\r\n result._description = o2gIncident.type;\r\n result._nbOccurs = o2gIncident.nbOccurs;\r\n result._node = parseInt(o2gIncident.node);\r\n result._main = o2gIncident.main;\r\n result._rack = o2gIncident.rack;\r\n result._board = o2gIncident.board;\r\n result._equipment = o2gIncident.equipment;\r\n result._termination = o2gIncident.termination;\r\n result._date = this._makeDate(o2gIncident.date, o2gIncident.hour);\r\n\r\n return result;\r\n }\r\n\r\n private static _makeIsoDate(date: string): string {\r\n const [day, month, yearSuffix] = date.trim().split('/');\r\n const year = (2000 + parseInt(yearSuffix)).toString();\r\n return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;\r\n }\r\n\r\n private static _makeDate(date: string, hour: string): Date {\r\n return new Date(`${this._makeIsoDate(date)}T${hour.trim()}`);\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { Calendar } from '../../types/cc-mngt/calendar/calendar';\r\nimport { DayOfWeek } from '../../types/cc-mngt/calendar/day-of-week';\r\nimport { ExceptionCalendar } from '../../types/cc-mngt/calendar/exception-calendar';\r\nimport { NormalCalendar } from '../../types/cc-mngt/calendar/normal-calendar';\r\nimport { Transition } from '../../types/cc-mngt/calendar/transition';\r\nimport { Pilot } from '../../types/cc-mngt/pilot';\r\nimport { PilotRule } from '../../types/cc-mngt/pilot-rule';\r\nimport { PilotRuleSet } from '../../types/cc-mngt/pilot-rule-set';\r\nimport { O2GCalendar, toCalendar, O2GExceptionCalendar, toExceptionCalendar, formatCalendarDate, toPilotTransition, O2GNormalCalendar, toNormalCalendar, O2GDayOfWeek, O2GPilot } from '../types/cc-mngt/o2gccmntg-types';\r\nimport {AssertUtil} from '../util/assert';\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from '../util/util-uri';\r\nimport {RestService} from './rest-service'\r\n\r\n\r\ntype PilotList = {\r\n pilotList: O2GPilot[];\r\n}\r\n\r\nclass PrivatePilotRuleSet extends PilotRuleSet {\r\n public constructor(rules: Map<number, PilotRule>) {\r\n super(rules);\r\n }\r\n}\r\n\r\nclass PrivatePilot extends Pilot {\r\n public constructor(data: {\r\n number: string,\r\n name: string,\r\n state: Pilot.ServiceState,\r\n detailedState: Pilot.Status,\r\n waitingTime: number,\r\n saturation: boolean,\r\n rules: PilotRuleSet,\r\n possibleTransfer: boolean,\r\n supervisedTransfer: boolean\r\n }) {\r\n super(data);\r\n }\r\n}\r\n\r\n\r\nexport default class CallCenterManagementRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getPilots(nodeId: number): Promise<Pilot[] | null> {\r\n\r\n const uriGet = UtilUri.appendPath(this._uri, AssertUtil.positive(nodeId, \"nodeId\").toString(), \"pilots\");\r\n\r\n const o2gPilotList = this.getResult<PilotList>(await RestService._httpClient.get(uriGet));\r\n if (o2gPilotList && Array.isArray(o2gPilotList.pilotList)) {\r\n \r\n return o2gPilotList.pilotList.map((o2gPilot) => {\r\n\r\n // Create the PilotRuleSet\r\n const rules: Map<number, PilotRule> = new Map<number, PilotRule>();\r\n if (o2gPilot.rules && o2gPilot.rules.ruleList) {\r\n o2gPilot.rules.ruleList.forEach((r) => {\r\n const pilotRule: PilotRule = PilotRule.build({\r\n number: parseInt(r.ruleNumber, 10), \r\n name: r.name, \r\n active: r.active\r\n });\r\n\r\n rules.set(pilotRule.number, pilotRule);\r\n });\r\n }\r\n\r\n const pilot: Pilot = new PrivatePilot({\r\n ...o2gPilot,\r\n rules: new PrivatePilotRuleSet(rules)\r\n });\r\n\r\n return pilot;\r\n });\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getPilot(nodeId: number, pilotNumber: string): Promise<Pilot | null> {\r\n const uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"));\r\n\r\n return this.getResult<Pilot>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n public async getCalendar(nodeId: number, pilotNumber: string): Promise<Calendar | null> {\r\n const uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar\"\r\n );\r\n\r\n const calendar = this.getResult<O2GCalendar>(await RestService._httpClient.get(uriGet));\r\n if (calendar) {\r\n return toCalendar(calendar);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getExceptionCalendar(nodeId: number, pilotNumber: string): Promise<ExceptionCalendar | null> {\r\n const uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n );\r\n\r\n const calendar = this.getResult<O2GExceptionCalendar>(await RestService._httpClient.get(uriGet));\r\n if (calendar) {\r\n return toExceptionCalendar(calendar);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async addExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, transition: Transition): Promise<boolean> {\r\n \r\n const uriPost = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n formatCalendarDate(AssertUtil.notNull(dateTransition, \"dateTransition\"))\r\n );\r\n\r\n const json = JSON.stringify(toPilotTransition(transition));\r\n\r\n const httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, transitionIndex: number): Promise<boolean> {\r\n \r\n const uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n formatCalendarDate(AssertUtil.notNull(dateTransition, \"dateTransition\")),\r\n \"transitions\",\r\n (AssertUtil.positive(transitionIndex, \"transitionIndex\")+1).toString()\r\n );\r\n\r\n const httpResponse = await RestService._httpClient.put(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async setExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, transitionIndex: number, transition: Transition): Promise<boolean> {\r\n \r\n const uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n formatCalendarDate(AssertUtil.notNull(dateTransition, \"dateTransition\")),\r\n \"transitions\",\r\n (AssertUtil.positive(transitionIndex, \"transitionIndex\")+1).toString()\r\n );\r\n\r\n const json = JSON.stringify(toPilotTransition(transition));\r\n const httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getNormalCalendar(nodeId: number, pilotNumber: string): Promise<NormalCalendar | null> {\r\n const uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/normal\",\r\n );\r\n\r\n const calendar = this.getResult<O2GNormalCalendar>(await RestService._httpClient.get(uriGet));\r\n if (calendar) {\r\n return toNormalCalendar(calendar);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async addNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, transition: Transition): Promise<boolean> {\r\n \r\n const uriPost = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n O2GDayOfWeek[day.toLowerCase() as keyof typeof O2GDayOfWeek]\r\n );\r\n\r\n const json = JSON.stringify(toPilotTransition(transition));\r\n\r\n const httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, transitionIndex: number): Promise<boolean> {\r\n \r\n const uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n O2GDayOfWeek[day.toLowerCase() as keyof typeof O2GDayOfWeek],\r\n \"transitions\",\r\n (AssertUtil.positive(transitionIndex, \"transitionIndex\")+1).toString()\r\n );\r\n\r\n const httpResponse = await RestService._httpClient.put(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async setNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, transitionIndex: number, transition: Transition): Promise<boolean> {\r\n \r\n const uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"calendar/exception\",\r\n O2GDayOfWeek[day.toLowerCase() as keyof typeof O2GDayOfWeek],\r\n \"transitions\",\r\n (AssertUtil.positive(transitionIndex, \"transitionIndex\")+1).toString()\r\n );\r\n\r\n const json = JSON.stringify(toPilotTransition(transition));\r\n const httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async openPilot(nodeId: number, pilotNumber: string): Promise<boolean> {\r\n \r\n const uriPost = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"open\"\r\n );\r\n\r\n const httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async closePilot(nodeId: number, pilotNumber: string): Promise<boolean> {\r\n \r\n const uriPost = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"pilots\",\r\n AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"),\r\n \"close\"\r\n );\r\n\r\n const httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","module.exports = require(\"reflect-metadata\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * AttributeType represents the possible type of an attribute.\r\n * @see {@link Model}\r\n */\r\nexport enum AttributeType {\r\n\r\n /**\r\n * An enumerated type.\r\n */\r\n Enumerated = \"Enumerated\",\r\n\r\n /**\r\n * An octet string type.\r\n */\r\n OctetString = \"OctetString\",\r\n\r\n /**\r\n * A sequence of other attributes.\r\n */\r\n Sequence = \"Sequence\",\r\n\r\n /**\r\n * An integer type.\r\n */\r\n Integer = \"Integer\",\r\n\r\n /**\r\n * A boolean type.\r\n */\r\n Boolean = \"Boolean\",\r\n\r\n /**\r\n * A set of other attributes.\r\n */\r\n Set = \"Set\",\r\n\r\n /**\r\n * A byte string type.\r\n */\r\n ByteString = \"ByteString\"\r\n}\r\n","module.exports = require(\"fetch-cookie\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * Destination represents a forward or an overflow destination.\r\n * @see {@link Forward}\r\n * @see {@link Overflow}\r\n */\r\nexport enum Destination {\r\n\r\n /**\r\n * The destination is the user voice mail.\r\n */\r\n VOICEMAIL = \"VOICEMAIL\",\r\n\r\n /**\r\n * The destination is another phone number. This destination can be used only to configure a forward.\r\n */\r\n NUMBER = \"NUMBER\", \r\n\r\n /**\r\n * None destination.\r\n */\r\n NONE = \"NONE\"\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GRoutingCapabilities } from \"../../internal/types/routing/o2grouting-types\";\r\n\r\n/**\r\n * RoutingCapabilities represents the routing capability of a user.\r\n */\r\nexport class RoutingCapabilities {\r\n private _presentationRoute!: boolean;\r\n private _forwardRoute!: boolean;\r\n private _overflowRoute!: boolean;\r\n private _dnd!: boolean;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n }\r\n\r\n public get canManageRemoteExtension(): boolean {\r\n return this._presentationRoute;\r\n }\r\n\r\n /**\r\n * Returns whether this user can manage forward.\r\n */\r\n public get canManageForward(): boolean {\r\n return this._forwardRoute;\r\n }\r\n\r\n /**\r\n * Returns whether this user can manage overflow.\r\n */\r\n public get canManageOverflow(): boolean {\r\n return this._overflowRoute;\r\n }\r\n\r\n /**\r\n * Returns whether this user can manage do not disturb.\r\n */\r\n public get canManageDnd(): boolean {\r\n return this._dnd;\r\n }\r\n \r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(capabilities: O2GRoutingCapabilities): RoutingCapabilities {\r\n\r\n let result = new RoutingCapabilities();\r\n result._presentationRoute = capabilities.presentationRoute;\r\n result._forwardRoute = capabilities.forwardRoute;\r\n result._overflowRoute = capabilities.overflowRoute;\r\n result._dnd = capabilities.dnd;\r\n\r\n return result;\r\n }\r\n\r\n}","module.exports = require(\"fs/promises\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport enum RecordingAction {\r\n\r\n START = \"Start\",\r\n STOP = \"Stop\", \r\n PAUSE = \"Pause\",\r\n RESUME = \"Resume\"\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n\r\nimport PbxManagementRest from \"./internal/rest/pbx-mngt-rest\";\r\nimport {Model} from \"./types/pbxmngt/model\";\r\nimport {PbxAttribute} from \"./types/pbxmngt/pbx-attribute\";\r\nimport {PbxObject} from \"./types/pbxmngt/pbx-object\";\r\nimport { Pbx } from \"./types/pbxmngt/pbxmngt-types\";\r\nimport { Filter } from \"./types/pbxmngt/filter\";\r\nimport EventEmitter from \"events\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * PbxManagement service allows an administrator to manage an OmniPcx\r\n * Enterprise, that is to create/modify/delete any object or sub-object in the\r\n * OmniPcx Enterprise object model. Using this service requires having a\r\n * <b>MANAGEMENT</b> license.\r\n * <p>\r\n * <b>WARNING:</b> Using this service requires to have a good knowledge of the\r\n * OmniPCX Enterprise object model.\r\n * <p>\r\n * The service uses two kinds of resource: the object model resource and the\r\n * object instance resource.\r\n * <p><b><u>The object model</u></b>: The object model can be retrieved for the whole Pbx\r\n * or for a particular object. It provides the detail of object attributes:\r\n * whether the attribute is mandatory/optional in the object creation, what\r\n * range of value is authorized, what are the possible enumeration value.\r\n * <p><b><u>The object instance</u></b>: It is used to create, modify, retrieve or remove\r\n * any instances of any object, giving the reference of this object. For the\r\n * creation or the modification of an object, the body must be compliant with\r\n * the object model.\r\n * <p>\r\n * The list of sub-objects which are returned by a get instance of an object\r\n * corresponds to the relative path of the first instanciable objects in the\r\n * hierarchy in order to be able by recursion to build the path to access to any\r\n * object and sub-object.\r\n * <p>\r\n * When access to an object which is a sub-object, the full path must be given :\r\n * {object1Name}/{object1Id}/{object2Name}/{object2Id}/..../{objectxName}/{objectxId}.\r\n */\r\n export class PbxManagement extends EventEmitter {\r\n\r\n /**\r\n * Occurs when a PBX object instance is created. \r\n * Only Object Subscriber is concerned by this event.\r\n * @event\r\n */\r\n public static readonly ON_PBX_OBJECT_INSTANCE_CREATED = \"OnPbxObjectInstanceCreated\";\r\n\r\n /**\r\n * Occurs when a PBX object instance is deleted. \r\n * Only Object Subscriber is concerned by this event.\r\n * @event\r\n */\r\n public static readonly ON_PBX_OBJECT_INSTANCE_DELETED = \"OnPbxObjectInstanceDeleted\";\r\n\r\n /**\r\n * Occurs when a PBX object instance is modified. \r\n * Only Object Subscriber is concerned by this event.\r\n * @event\r\n */\r\n public static readonly ON_PBX_OBJECT_INSTANCE_MODIFIED = \"OnPbxObjectInstanceModified\"; \r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _pbxMngtRest: PbxManagementRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, PbxManagement.ON_PBX_OBJECT_INSTANCE_CREATED);\r\n eventRegistry.register(this, PbxManagement.ON_PBX_OBJECT_INSTANCE_MODIFIED);\r\n eventRegistry.register(this, PbxManagement.ON_PBX_OBJECT_INSTANCE_DELETED);\r\n }\r\n\r\n /**\r\n * Gets the list of OmniPCX Enterprise nodes connected on this O2G server.\r\n */\r\n public async getPbxs(): Promise<number[] | null> {\r\n return this._pbxMngtRest.getPbxs();\r\n }\r\n \r\n /**\r\n * Gets the OmniPCX Enterprise specified by its node id.\r\n * \r\n * @param nodeId the PCX Enterprise node id\r\n */\r\n public async getPbx(nodeId: number): Promise<Pbx | null> {\r\n return this._pbxMngtRest.getPbx(nodeId);\r\n }\r\n \r\n /**\r\n * Get the description of the data model for the specified object on the\r\n * specified OmniPCX Enterprise node.\r\n * <p>\r\n * If 'objectName' is 'null', the global object model of the OmniPCX Enterprise node is returned.\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectName the object name\r\n */\r\n public async getObjectModel(nodeId: number, objectName: string | null = null): Promise<Model | null> {\r\n return this._pbxMngtRest.getObjectModel(nodeId, objectName);\r\n }\r\n \r\n /**\r\n * Gets the node(root) object.\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n */\r\n public async getNodeObject(nodeId: number): Promise<PbxObject | null> {\r\n return this._pbxMngtRest.getNodeObject(nodeId);\r\n }\r\n \r\n /**\r\n * Gets the object specified by its instance definition and its instance id.\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectInstanceDefinition the object instance definition\r\n * @param objectId the object instance id\r\n * @param attributes the optional attributes to retrieve. It can be a string with a comma separated attribute name, or an array of PbxAtribute objects.\r\n */\r\n public async getObject(nodeId: number, objectInstanceDefinition: string, objectId: string, attributes: string|PbxAttribute[] | null = null): Promise<PbxObject | null> {\r\n return this._pbxMngtRest.getObject(nodeId, objectInstanceDefinition, objectId, attributes);\r\n }\r\n\r\n /**\r\n * Queries the list of object instances that match the specified filter.\r\n * A filter can be built using the {@link Filter} class, or it can be a string object.\r\n * @example\r\n * ```typescript\r\n * // Using a Filter object\r\n * let filter = o2g.types.pbxmngt.Filter.create(\r\n * \"StationType\", \r\n * o2g.types.pbxmngt.AttributeFilter.Equals, \r\n * \"ANALOG\");\r\n * let objectInstances = await o2g.pbxManagement.getObjectInstances(5, \"Subscriber\", filter);\r\n * \r\n * // Using a string as a filter\r\n * objectInstances = await o2g.pbxManagement.getObjectInstances(5, \"Subscriber\", \"StationType==ANALOG\");\r\n * \r\n * ```\r\n * \r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectInstanceDefinition the object instance definition\r\n * @param filter a filter to query the instances ({@link Filter} object or string)\r\n */\r\n public async getObjectInstances(nodeId: number, objectInstanceDefinition: string, filter: string|Filter|null = null): Promise<string[] | null> {\r\n return this._pbxMngtRest.getObjectInstances(nodeId, objectInstanceDefinition, filter);\r\n }\r\n \r\n /**\r\n * Changes one or several attribute values of the specified object.\r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectInstanceDefinition the object instance definition\r\n * @param objectId the object instance id\r\n * @param attributes the array of attributes to change\r\n */\r\n public async setObject(nodeId: number, objectInstanceDefinition: string, objectId: string, attributes: PbxAttribute[]): Promise<boolean> {\r\n return this._pbxMngtRest.setObject(nodeId, objectInstanceDefinition, objectId, attributes);\r\n }\r\n\r\n /**\r\n * Deletes the specified instance of object.\r\n * <p>\r\n * The \"<i>FORCED_DELETE</i>\" action is not available for all object. \r\n * Check the availability in the {@link Model} model corresponding to this object.\r\n * This option can be used, for exemple, to delete a {@code Subscriber} having voice mails in his mail box.\r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectInstanceDefinition the object instance definition\r\n * @param objectId the object instance id\r\n * @param forceDelete Use the \"<i>FORCED_DELETE</i>\" action to delete the object.\r\n */\r\n public async deleteObject(nodeId: number, objectInstanceDefinition: string, objectId: string, forceDelete = false): Promise<boolean> {\r\n return this._pbxMngtRest.deleteObject(nodeId, objectInstanceDefinition, objectId, forceDelete);\r\n }\r\n\r\n /**\r\n * Creates a new object with the specified collection of attributes\r\n * @param nodeId the OmniPCX Enterprise node id\r\n * @param objectInstanceDefinition the object instance definition\r\n * @param attributes the array of attributes to set at this object creation.\r\n */\r\n public async createObject(nodeId: number, objectInstanceDefinition: string, attributes: PbxAttribute[]): Promise<boolean> {\r\n return this._pbxMngtRest.createObject(nodeId, objectInstanceDefinition, attributes);\r\n } \r\n\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from '../util/util-uri';\r\nimport {AssertUtil} from '../util/assert';\r\n\r\nexport default class CallCenterPilotRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async monitorStart(pilotNumber: string): Promise<boolean> { \r\n \r\n const uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"));\r\n \r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async monitorStop(pilotNumber: string): Promise<boolean> { \r\n const uriDelete = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(pilotNumber, \"pilotNumber\"));\r\n \r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport UserManagementRest from \"./internal/rest/user-mngt-rest\";\r\nimport { User } from \"./types/users/users-types\";\r\n\r\n\r\n/**\r\n * The User Management service allows an administrator to create/delete/get the O2G users.\r\n */\r\nexport class UserManagement {\r\n\r\n private readonly _userManagementRest: UserManagementRest;\r\n\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(userManagementRest: UserManagementRest) {\r\n this._userManagementRest = userManagementRest;\r\n }\r\n\r\n /**\r\n * Retrieves a list of users login from the connected OXEs.\r\n * <p>\r\n * if 'nodeIds' is 'null', retrieves the login of users from all the\r\n * connected OmniPCX Enterprise nodes. \r\n * \r\n * @param nodeIds Specify a list of OXE nodes Id in which the query is done.\r\n * This parameter is only valid for an administrator session.\r\n */\r\n\tpublic async getLogins(nodeIds: number[] | null = null): Promise<string[] | null> {\r\n\t\treturn await this._userManagementRest.getLogins(nodeIds);\r\n\t}\r\n\r\n /**\r\n * Retrieves the information on a user from one of its device.\r\n * \r\n * @param deviceNumber the user device\r\n */\r\n\tpublic async getByDeviceNumber(deviceNumber: string): Promise<string | null> {\r\n\t\treturn await this._userManagementRest.getByDeviceNumber(deviceNumber);\r\n\t}\r\n\r\n /**\r\n * Create O2G users on demand.\r\n * @param nodeId the OXE node number\r\n * @param deviceNumbers collection of device phone numbers corresponding to the users to be created. If deviceNumbers is null or empty, all the users of the specified node are created.\r\n */\r\n public async createUsers(nodeId: number, deviceNumbers: string[] | null): Promise<boolean> {\r\n return await this._userManagementRest.createUsers(nodeId, deviceNumbers);\r\n }\r\n\t\r\n /**\r\n * Retrieves the information on a user from its login.\r\n * \r\n * @param loginName the user login name\r\n */\r\n public async getByLoginName(loginName: string): Promise<User | null> {\r\n return await this._userManagementRest.getByLoginName(loginName);\r\n }\r\n\r\n public async deleteUser(loginName: string): Promise<boolean> {\r\n return await this._userManagementRest.deleteUser(loginName);\r\n }\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport class PilotRule {\r\n // Private fields\r\n private _number: number;\r\n private _name: string;\r\n private _active: boolean;\r\n\r\n private constructor(number: number, name: string, active: boolean) {\r\n this._number = number;\r\n this._name = name;\r\n this._active = active;\r\n }\r\n\r\n // Getters\r\n public get number(): number {\r\n return this._number;\r\n }\r\n\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n public get active(): boolean {\r\n return this._active;\r\n }\r\n\r\n public static build(obj: { number: number, name: string, active: boolean }): PilotRule {\r\n return new PilotRule(obj.number, obj.name, obj.active);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { Role } from \"./role\";\r\nimport { Option } from \"./option\";\r\n\r\n\r\n/**\r\n * QueryFilter class represents a communication log query filter. It is used to filter records in a\r\n * {@link CommunicationLog.getComRecords} query.\r\n */\r\nexport class QueryFilter {\r\n\r\n /**\r\n * The start date from which the query searches for matching the\r\n * records. When used, the query returns the records not older than this date.\r\n * When omitted the query searches for matching records starting from the\r\n * oldest.\r\n */\r\n public after?: Date;\r\n\r\n /**\r\n * The end date from which the query stop searching the records. When\r\n * used the query returns the records older than this date. When omitted the\r\n * query searches for matching records until the newest.\r\n */\r\n public before?: Date;\r\n\r\n /**\r\n * The search options.\r\n */\r\n public options?: Option;\r\n\r\n /**\r\n * The call reference used in this query filter. When used, the query\r\n * will retrieve only the com record related to this call reference.\r\n */\r\n public callRef!: string;\r\n \r\n /**\r\n * The remote party. When used, filters on the records in which the user\r\n * is engaged with this remote party.\r\n */\r\n public remotePartyId!: string;\r\n \r\n /**\r\n * The user's role in the communication. Allows to filter on the user's\r\n * role in the communication.\r\n */\r\n public role?: Role;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport RoutingRest from \"./internal/rest/routing-rest\";\r\nimport {Forward, ForwardCondition } from \"./types/routing/forward\";\r\nimport {Overflow, OverflowCondition } from \"./types/routing/overflow\";\r\nimport { RoutingCapabilities } from \"./types/routing/routing-capability\";\r\nimport {RoutingState} from \"./types/routing/routing-state\";\r\nimport { DndState } from \"./types/routing/routing-types\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * The Routing service allows a user to manage forward, overflow, DoNotDisturb\r\n * and activation of his remote extension device (if any). Using this service\r\n * requires having a <b>TELEPHONY_ADVANCED</b> license.\r\n * <h2>Forward:</h2>A forward can be activated on the voice mail or on any\r\n * number as far as this number is authorized by the OmniPCX Enterprise\r\n * numbering policy. Use one of the methods:\r\n * {@link forwardOnNumber} or {@link forwardOnVoiceMail} to activate a forward. <br>\r\n * A {@link ForwardCondition} can be associated to the forward:\r\n * <table>\r\n * <caption>Forward conditions</caption>\r\n * <tr>\r\n * <td>IMMEDIATE\r\n * <td>\r\n * <td>Incoming calls are immediately forwarded on the target.</td>\r\n * <tr>\r\n * <tr>\r\n * <td>BUSY\r\n * <td>\r\n * <td>Incoming calls are forwarded on the target if the user is busy.</td>\r\n * <tr>\r\n * <tr>\r\n * <td>NO_ANSWER\r\n * <td>\r\n * <td>Incoming calls are forwarded on the target if the user does not answer\r\n * the call</td>\r\n * <tr>\r\n * <tr>\r\n * <td>BUSY_NO_ANSWER\r\n * <td>\r\n * <td>One of the two last conditions</td>\r\n * <tr>\r\n * </table>\r\n * <h2>Overflow:</h2>An overflow can be activated on the voice mail (if any).\r\n * Use method:\r\n * {@link overflowOnVoiceMail} to activate an overflow. <br>\r\n * A {@link OverflowCondition Condition} can be associated to the overflow:\r\n * <table>\r\n * <caption>Overflow conditions</caption>\r\n * <tr>\r\n * <td>BUSY\r\n * <td>\r\n * <td>Incoming calls are redirected on the target if the user is busy.</td>\r\n * <tr>\r\n * <tr>\r\n * <td>NO_ANSWER\r\n * <td>\r\n * <td>Incoming calls are redirected on the target if the user does not answer\r\n * the call</td>\r\n * <tr>\r\n * <tr>\r\n * <td>BUSY_NO_ANSWER\r\n * <td>\r\n * <td>One of the two last conditions</td>\r\n * <tr>\r\n * </table>\r\n * <h2>Do Not Disturb:</h2> When the Do Not Disturb (DND) is activated, the user\r\n * does not receive any call. The DND is activated using method\r\n * {@link activateDnd}.\r\n * <h2>Remote extension activation:</h2> When a remote extension is not\r\n * activated, it does not ring on incoming call. Use the method\r\n * {@link setRemoteExtensionActivation} to activate the remote extension. <br>\r\n * <h2>Eventing:</h2> For each routing modification, a\r\n * {@link ON_ROUTING_STATE_CHANGED} event is raised.\r\n */\r\nexport class Routing extends EventEmitter {\r\n\r\n\t/**\r\n\t * Raised for each routing modification.\r\n\t * @event\r\n\t */\r\n public static readonly ON_ROUTING_STATE_CHANGED = \"OnRoutingStateChanged\";\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _routingRest: RoutingRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, Routing.ON_ROUTING_STATE_CHANGED);\r\n }\r\n\r\n /**\r\n * Activate the Do Not Disturb for the specified user.\r\n * <p>\r\n * This method does nothing and return 'true' if the Do Not Disturb is\r\n * already activated.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async activateDnd(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.activateDnd(loginName);\r\n\t}\r\n\r\n /**\r\n * Cancel the Do Not Disturb for the specified user.\r\n * <p>\r\n * This method does nothing and return 'true' if the Do Not Disturb was\r\n * not activated.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async cancelDnd(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.cancelDnd(loginName);\r\n\t}\r\n\r\n /**\r\n * Get the Do Not Disturb state of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getDndState(loginName: string | null = null): Promise<DndState | null> {\r\n\t\treturn await this._routingRest.getDndState(loginName);\r\n\t}\r\n\r\n /**\r\n * Allows to know what the specified user is allowed to do.\r\n * <p>\r\n * If the session has been opened for a user, the 'logiName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getCapabilities(loginName: string | null = null): Promise<RoutingCapabilities | null> {\r\n\t\treturn await this._routingRest.getCapabilities(loginName);\r\n\t}\r\n\r\n /**\r\n * Activate the remote extension device for the specified user.\r\n * <p>\r\n * When the remote extension is activated, it rings on incoming call on the user\r\n * company phone. \r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async activateRemoteExtension(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.setRemoteExtensionActivation(true, loginName);\r\n\t}\r\n\r\n /**\r\n * Deactivate the remote extension device for the specified user.\r\n * <p>\r\n * When it is deactivated, it never rings, but it can be used to\r\n * place an outgoing call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async deactivateRemoteExtension(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.setRemoteExtensionActivation(false, loginName);\r\n\t}\r\n\r\n /**\r\n * Get the forward state of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getForward(loginName: string | null = null): Promise<Forward | null> {\r\n\t\treturn await this._routingRest.getForward(loginName);\r\n\t}\r\n\r\n /**\r\n * Cancel the forward for the specified user.\r\n * <p>\r\n * This method does nothing and return 'true' if there is no forward\r\n * activated.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async cancelForward(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.cancelForward(loginName);\r\n\t}\r\n\r\n /**\r\n * Set a forward on voice mail with the specified condition, for the specified\r\n * user.\r\n * <p>\r\n * This method will fail and return 'false' if the user does not have a voice mail. \r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param condition the forward condition\r\n * @param loginName the user login name\r\n */\r\n\tpublic async forwardOnVoiceMail(condition: ForwardCondition, loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.forwardOnVoiceMail(condition, loginName);\r\n\t}\r\n\r\n /**\r\n * Set a forward on the specified number, with the specified condition, for the\r\n * specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param number the phone number on which the forward is activated\r\n * @param condition the forward condition\r\n * @param loginName the user login name\r\n */\r\n\t public async forwardOnNumber(number: string, condition: ForwardCondition, loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.forwardOnNumber(number, condition, loginName);\r\n\t}\r\n\r\n /**\r\n * Cancel the overflow for the specified user.\r\n * <p>\r\n * This method does nothing and return 'true' if there is no overflow activated.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async cancelOverflow(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.cancelOverflow(loginName);\r\n\t}\r\n\r\n /**\r\n * Get the overflow state for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getOverflow(loginName: string | null = null): Promise<Overflow | null> {\r\n\t\treturn await this._routingRest.getOverflow(loginName);\r\n\t}\r\n\r\n /**\r\n * Activate an overflow on voice mail with the specified condition, for the\r\n * specified user.\r\n * <p>\r\n * This method will fail and return 'false' if the user does not have a voice mail. \r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param condition the overflow condition\r\n * @param loginName the user login name\r\n */\r\n\t public async overflowOnVoiceMail(condition: OverflowCondition, loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.overflowOnVoiceMail(condition, loginName);\r\n\t}\r\n\r\n /**\r\n * Get the routing state of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getRoutingState(loginName: string | null = null): Promise<RoutingState | null> {\r\n\t\treturn await this._routingRest.getRoutingState(loginName);\r\n\t}\r\n\r\n /**\r\n * Asks a snapshot event on the specified user.\r\n * <p>\r\n * The event OnRoutingStateChanged will contain the DynamicState\r\n * (forward/overflow/dnd state). If a second request is asked since the previous\r\n * one is still in progress, it has no effect.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async requestSnapshot(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._routingRest.requestSnapshot(loginName);\r\n\t}\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * AttributeFilter represents the possible operation to apply to an attribute to build a filter.\r\n * @see {@link PbxManagement.getObjectInstances}\r\n */\r\nexport enum AttributeFilter {\r\n \r\n /**\r\n * The attribute is equal to the value.\r\n */\r\n Equals = 0,\r\n\r\n /**\r\n * The attribute starts with the value.\r\n */\r\n StartsWith = 1,\r\n\r\n /**\r\n * The attributes ends with the value.\r\n */\r\n EndsWith = 2,\r\n\r\n /**\r\n * The attribute is not equals to the value.\r\n */\r\n NotEquals = 3,\r\n\r\n /**\r\n * The attribute is greather than or equals to the value.\r\n */\r\n GreatherThanOrEquals = 4,\r\n\r\n /**\r\n * The attribute is Less than or equals to the value.\r\n */\r\n LessThanOrEquals = 5\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {PbxAttribute} from \"./pbx-attribute\";\r\nimport { O2GPbxObject } from \"../../internal/types/pbxmngt/o2gpbxmngt-types\";\r\n\r\n/**\r\n * PbxObject represents an object of the OmniPCX Enterprise object model.\r\n * <p>\r\n * A PbxObject object is referenced by it's object instance definition,\r\n * a hierarchical path from the root object, and a unique instance id.<br>\r\n * For exemple:\r\n * <ul>\r\n * <li>\"Subscriber\" : A Subscriber object.</li>\r\n * <li>\"Application_Configuration/1/ACD2/1/ACD2_Operator/1/ACD2_Operator_data\" :\r\n * A CCD operator data object.</li>\r\n * </ul>\r\n */\r\nexport class PbxObject {\r\n private _objectName!: string;\r\n private _id!: string;\r\n private _objectNames!: string[];\r\n private _attributes!: Map<string, PbxAttribute>;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n // Initialized via the static build method\r\n }\r\n\r\n /**\r\n * Returns the collection of sub-object names.\r\n */\r\n public get objectNames(): string[] {\r\n return this._objectNames;\r\n }\r\n\r\n /**\r\n * Returns this object's name.\r\n */\r\n public get name(): string {\r\n return this._objectName;\r\n }\r\n\r\n /**\r\n * Returns this object's instance ID.\r\n */\r\n public get id(): string {\r\n return this._id;\r\n }\r\n\r\n /**\r\n * Returns the attribute with the specified name.\r\n * @param attrName The attribute name.\r\n */\r\n public getAttribute(attrName: string): PbxAttribute | undefined {\r\n return this._attributes.get(attrName);\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2GPbxObject: O2GPbxObject): PbxObject {\r\n const mapAttributes = new Map<string, PbxAttribute>();\r\n\r\n if (o2GPbxObject.attributes) {\r\n for (const attr of o2GPbxObject.attributes) {\r\n const names = attr.name.split('.');\r\n\r\n if (names.length === 1) {\r\n mapAttributes.set(attr.name, PbxAttribute.build(attr));\r\n } else {\r\n if (!mapAttributes.has(names[0])) {\r\n mapAttributes.set(names[0], new PbxAttribute(names[0]));\r\n }\r\n\r\n const parentAttr = mapAttributes.get(names[0]);\r\n if (parentAttr) {\r\n PbxAttribute.addSequenceAttribute(parentAttr, names[1], attr);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const result = new PbxObject();\r\n result._id = o2GPbxObject.objectId;\r\n result._objectName = o2GPbxObject.objectName;\r\n result._objectNames = o2GPbxObject.objectNames;\r\n result._attributes = mapAttributes;\r\n\r\n return result;\r\n }\r\n}\r\n","\r\n/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport enum EventPackage {\r\n\r\n Telephony = \"telephony\",\r\n EventSummary = \"eventSummary\",\r\n CommunicationLog = \"unifiedComLog\",\r\n User = \"user\",\r\n Users = \"userManagement\",\r\n Routing = \"routingManagement\",\r\n Agent = \"agent\",\r\n Pilot = \"pilot\",\r\n Rsi = \"rsi\",\r\n System = \"system\",\r\n PbxManagement = \"pbxManagement\"\r\n};\r\n","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {Logger} from './util/logger'\r\nimport {AssertUtil} from './util/assert'\r\nimport Session from './session'\r\nimport ServiceFactory from './service-factory'\r\nimport { O2GAuthenticateResult, ServerInfo, SessionInfo } from './types/common/o2gcommon-types'\r\n\r\n\r\nexport default class ServiceEndPoint {\r\n\r\n\tprivate _serviceFactory: ServiceFactory;\r\n\tprivate _serverInfo: ServerInfo;\r\n\r\n\tprivate _logger = Logger.create(\"ServiceEndPoint\");\r\n\r\n\tconstructor(serviceFactory: ServiceFactory, serverInfo: ServerInfo) {\r\n\t\tthis._serviceFactory = serviceFactory;\r\n\t\tthis._serverInfo = serverInfo;\r\n\t}\r\n\r\n\tpublic async openSession(login: string, password: string, applicationName: string): Promise<Session> {\r\n\t\tAssertUtil.notNullOrEmpty(login, \"login\");\r\n\t\tAssertUtil.notNullOrEmpty(password, \"password\");\r\n\t\tAssertUtil.notNullOrEmpty(applicationName, \"applicationName\");\r\n\r\n\t\tthis._logger.debug(`OpenSession -> Authenticate user ${login}`);\r\n\r\n\t\tlet authenticationService = this._serviceFactory.getAuthenticationService();\r\n\t\tlet authenticationResult: O2GAuthenticateResult = await authenticationService.authenticate(login, password);\r\n\r\n\t\tthis._logger.info(\"Authentication done.\");\r\n\r\n\t\tthis._serviceFactory.setSessionUris(authenticationResult.internalUrl, authenticationResult.publicUrl);\r\n\r\n\t\tthis._logger.debug(\"OpenSession -> OpenSession {application}\", applicationName);\r\n\t\t\r\n\t\tlet sessionsService = this._serviceFactory.getSessionsService();\r\n\t\tlet sessionInfo: SessionInfo = await sessionsService.open(applicationName);\r\n\t\tif (sessionInfo) {\r\n\t\t\tthis._logger.debug(\"Session opened: TimeToLive = {timeToLive}\", sessionInfo.timeToLive);\r\n\t\t\tthis._serviceFactory.setServices(sessionInfo);\t\r\n\t\t\treturn new Session(this._serviceFactory, sessionInfo, login);\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tawait sessionsService.close();\r\n\t\t\tthrow new Error(\"Unable to open session\");\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\nexport class AssertUtil {\r\n\r\n static notNullOrEmpty(str: string | null | undefined, name: string): string {\r\n if (str == null || str.trim().length === 0) {\r\n throw new Error(`InvalidArgument: ${name} must not be null or empty`);\r\n }\r\n return str as string;\r\n }\r\n \r\n static notNull<T>(obj: T | null | undefined, name: string): T {\r\n if (obj == null) {\r\n throw new Error(`InvalidArgument: ${name} must not be null`);\r\n }\r\n return obj as T;\r\n }\r\n\r\n static positive(value: number, name: string): number {\r\n if (value < 0) {\r\n throw new Error(`InvalidArgument: ${name} must be positive`);\r\n }\r\n return value;\r\n }\r\n\r\n static positiveStrict(value: number, name: string): number {\r\n if (value <= 0) {\r\n throw new Error(`InvalidArgument: ${name} must be strict positive`);\r\n }\r\n return value;\r\n }\r\n}\r\n","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GPbxAttribute, O2GPbxComplexAttribute } from \"../../internal/types/pbxmngt/o2gpbxmngt-types\";\r\nimport {PbxAttribute} from \"./pbx-attribute\";\r\n\r\n/**\r\n * PbxAttributeMap represents a sequence of named attributes.\r\n */\r\nexport class PbxAttributeMap {\r\n\r\n private _attributes: Map<string, PbxAttribute>;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n this._attributes = new Map<string, PbxAttribute>();\r\n }\r\n\r\n /**\r\n * Returns the names of the attributes in this sequence.\r\n */\r\n public get names(): string[] {\r\n return Array.from(this._attributes.keys());\r\n }\r\n\r\n /**\r\n * Returns the Attribute with the specified name.\r\n * @example\r\n * ```typescript\r\n * let skillSequence = ...\r\n * let attr = skillSequence.getAttribute(\"Skill_nb\");\r\n * ```\r\n * \r\n * @param name The attribute name\r\n */\r\n public getAttribute(name: string): PbxAttribute | undefined {\r\n return this._attributes.get(name);\r\n }\r\n\r\n /**\r\n * Adds the specified attribute to this sequence. It's possible to chain the\r\n * add operations to create a complete sequence.\r\n * \r\n * @example\r\n * ```typescript\r\n * let attr = PbxAttributeMap.create()\r\n * .add(PbxAttribute.createBoolean(\"Elem1\", true))\r\n * .add(PbxAttribute.createInteger(\"Elem2\", 23));\r\n * ```\r\n * \r\n * @param value the attribute to add to this sequence\r\n * @return the sequence object.\r\n */\r\n public add(value: PbxAttribute): PbxAttributeMap {\r\n this._attributes.set(value.name, value);\r\n return this;\r\n }\r\n\r\n /**\r\n * Create a new empty PbxAttributeMap. Use this method to create a new sequence\r\n * of attribute. For example:\r\n * \r\n * @example\r\n * ```typescript\r\n * Sequence {\r\n * Param1 := Integer,\r\n * Param2 := Boolean\r\n * }\r\n * ```\r\n * Can be created with the following operations\r\n * ```typescript\r\n * let sequence = PbxAttributeMap.create()\r\n * .add(PbxAttribute.createInteger(\"Param1\", 1))\r\n * .add(PbxAttribute.createBoolean(\"Param2\", true));\r\n * ```\r\n */\r\n public static create(): PbxAttributeMap {\r\n return new PbxAttributeMap();\r\n }\r\n\r\n /**\r\n * Create a new PbxAttributeMap with the specified attributes.\r\n * Use this method to create a new sequence of attributes. For example:\r\n * \r\n * @example\r\n * ```typescript\r\n * Sequence {\r\n * Param1 := Integer,\r\n * Param2 := Boolean\r\n * }\r\n * ```\r\n * Can be created with the following:\r\n * ```typescript\r\n * let sequence = PbxAttributeMap.createWith([\r\n * PbxAttribute.createInteger(\"Param1\", 1),\r\n * PbxAttribute.createBoolean(\"Param2\", true)\r\n * ]);\r\n * ```\r\n * \r\n * @param attributes the array of attributes\r\n */\r\n public static createWith(attributes: PbxAttribute[]): PbxAttributeMap {\r\n const map = new PbxAttributeMap();\r\n attributes.forEach(attr => map._attributes.set(attr.name, attr));\r\n return map;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gPbxComplexAttribute: O2GPbxComplexAttribute): PbxAttributeMap {\r\n const mapAttributes = new PbxAttributeMap();\r\n\r\n if (o2gPbxComplexAttribute.attributes) {\r\n o2gPbxComplexAttribute.attributes.forEach(attr => {\r\n mapAttributes._attributes.set(attr.name, PbxAttribute.build(attr));\r\n });\r\n }\r\n\r\n return mapAttributes;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static from(attributeMaps: PbxAttributeMap, attrName: string): O2GPbxComplexAttribute {\r\n const o2gPbxAttributes: O2GPbxAttribute[] = [];\r\n attributeMaps.names.forEach(name => {\r\n const attr = attributeMaps.getAttribute(name);\r\n if (attr) {\r\n o2gPbxAttributes.push(...PbxAttribute.from(attr));\r\n }\r\n });\r\n\r\n return {\r\n name: attrName,\r\n attributes: o2gPbxAttributes\r\n };\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport ServiceFactory from './service-factory'\r\nimport ServiceEndPoint from './service-end-point';\r\nimport { ServerInfo } from './types/common/o2gcommon-types';\r\nimport Session from './session';\r\nimport {Subscription} from \"../subscription\";\r\nimport EventEmitter from 'events';\r\nimport { Routing } from '../o2g-routing';\r\nimport { Messaging } from '../o2g-messaging';\r\nimport { EventSink, IEventSink } from './events/event-dispatcher';\r\nimport { container, TYPES } from './util/injection-container';\r\nimport { EventSummary } from '../o2g-eventSummary';\r\nimport { Telephony } from '../o2g-telephony';\r\nimport { Users } from '../o2g-users';\r\nimport { Directory } from '../o2g-directory';\r\nimport { CommunicationLog } from '../o2g-comlog';\r\nimport { Analytics } from '../o2g-analytics';\r\nimport { CallCenterAgent } from '../o2g-cc-agent';\r\nimport { CallCenterPilot } from '../o2g-cc-pilot';\r\nimport { Maintenance } from '../o2g-maint';\r\nimport { Rsi } from '../o2g-rsi';\r\nimport { PbxManagement } from '../o2g-pbx-mngt';\r\nimport { PhoneSetProgramming } from '../o2g-phone-set-prog';\r\nimport { UserManagement } from '../o2g-user-mngt';\r\nimport { CallCenterManagement } from '../o2g-cc-mngt';\r\nimport { Logger } from './util/logger';\r\n\r\n\r\n/**\r\n * Class Application represents an O2G application.\r\n */\r\n export default class Application extends EventEmitter {\r\n\tprivate _applicationName: string;\r\n\tprivate _host: Host;\r\n\tprivate _apiVersion: string;\r\n\tprivate _serviceFactory!: ServiceFactory;\r\n\tprivate _serverInfo!: ServerInfo;\r\n\tprivate _session!: Session;\r\n\r\n public static readonly O2G_ONCHANNEL_INFORMATION = \"OnChannelInformation\";\r\n\r\n private static _logger = Logger.create(\"Application\");\r\n\r\n\tconstructor(applicationName: string, host: Host, apiVersion: string) {\r\n\t\tsuper();\r\n\t\tthis._applicationName = applicationName;\r\n\t\tthis._host = host;\r\n this._apiVersion = apiVersion;\r\n\t}\r\n\r\n\tasync connect(): Promise<ServiceEndPoint> {\r\n\t\tconst { privateAddress, publicAddress } = this._host;\r\n\r\n \tif (!privateAddress && !publicAddress) {\r\n \tthrow new Error(\"Either privateAddress or publicAddress must be provided.\");\r\n \t}\r\n\r\n\t\tthis._serviceFactory = new ServiceFactory(this._apiVersion);\r\n\t\tthis._serverInfo = await this._serviceFactory.bootstrap(this._host);\r\n\r\n\t\treturn new ServiceEndPoint(this._serviceFactory, this._serverInfo);\r\n\t}\r\n\r\n\tgetRoutingService(): Routing {\r\n\t\treturn this._session.getRoutingService();\r\n\t}\r\n\r\n\tgetEventSummaryService(): EventSummary {\r\n\t\treturn this._session.getEventSummaryService();\r\n\t}\r\n\r\n\tgetTelephonyService(): Telephony {\r\n\t\treturn this._session.getTelephonyService();\r\n\t}\r\n\r\n\tgetUsersService(): Users {\r\n\t\treturn this._session.getUsersService();\r\n\t}\r\n\r\n getUserManagementService(): UserManagement {\r\n\t\treturn this._session.getUserManagementService();\r\n }\r\n\r\n\tgetDirectoryService(): Directory {\r\n\t\treturn this._session.getDirectoryService();\r\n\t}\r\n\r\n\tgetCommunicationLogService(): CommunicationLog {\r\n\t\treturn this._session.getCommunicationLogService();\r\n\t}\r\n\r\n\tgetAnalyticsService(): Analytics {\r\n\t\treturn this._session.getAnalyticsService();\r\n\t}\r\n\r\n\tgetCallCenterAgentService(): CallCenterAgent {\r\n\t\treturn this._session.getCallCenterAgentService();\r\n\t}\r\n\r\n\tgetCallCenterPilotService(): CallCenterPilot {\r\n\t\treturn this._session.getCallCenterPilotService();\r\n\t}\r\n\r\n\tgetCallCenterManagementService(): CallCenterManagement {\r\n\t\treturn this._session.getCallCenterManagementService();\r\n\t}\r\n\r\n\tgetMaintenanceService(): Maintenance {\r\n\t\treturn this._session.getMaintenanceService();\r\n\t}\r\n\r\n\tgetRsiService(): Rsi {\r\n\t\treturn this._session.getRsiService();\r\n\t}\r\n\r\n\tgetPbxManagementService(): PbxManagement {\r\n\t\treturn this._session.getPbxManagementService();\r\n\t}\r\n\r\n\tgetPhoneSetProgrammingService(): PhoneSetProgramming {\r\n\t\treturn this._session.getPhoneSetProgrammingService();\r\n\t}\r\n\r\n\tgetMessagingService(): Messaging {\r\n\t\treturn this._session.getMessagingService();\r\n\t}\r\n\r\n\tasync login(login: string, password: string): Promise<void> {\r\n\r\n\t\tlet serviceEndPoint: ServiceEndPoint = await this.connect();\r\n\r\n\t\tconst session = await serviceEndPoint.openSession(login, password, this._applicationName);\r\n\t\tif (session) {\r\n\t\t\tthis._session = session;\r\n\r\n\t\t\t// register for event\r\n\t\t\tconst eventRegistry: IEventSink = container.get<EventSink>(TYPES.EventSink);\r\n\t\t\teventRegistry.register(this, Application.O2G_ONCHANNEL_INFORMATION);\r\n\t\t}\r\n\t\telse {\r\n \tthrow new Error('Login failed: session could not be opened.');\r\n \t}\r\n\t}\r\n\r\n\tasync subscribe(subscription: Subscription): Promise<void> {\r\n\t\tawait this._session.listenEvents(subscription);\r\n\t}\r\n\r\n\tasync close(): Promise<void> {\r\n\t\tif (this._session) {\r\n\t\t\tawait this._session.close();\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport default class HttpResponse {\r\n private readonly _code: number;\r\n private readonly _response: any;\r\n private readonly _headers: Headers | null;\r\n\r\n constructor(code: number, headers: Headers | null, response: any = null) {\r\n this._code = code;\r\n this._headers = headers;\r\n this._response = response;\r\n }\r\n\r\n get response(): any {\r\n return this._response;\r\n }\r\n\r\n get code(): number {\r\n return this._code;\r\n }\r\n\r\n get headers(): Headers | null {\r\n return this._headers;\r\n }\r\n\r\n isSuccessStatusCode(): boolean {\r\n return this._code >= 200 && this._code < 300;\r\n }\r\n\r\n fromJson<T>(): T {\r\n if (typeof this._response === 'string') {\r\n return JSON.parse(this._response) as T;\r\n }\r\n \r\n // If _response is already an object, return it as is\r\n return this._response as T;\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { Transition } from \"./transition\";\r\n\r\nexport abstract class AbstractCalendar<T> {\r\n protected transitions: Map<T, Transition[]>;\r\n\r\n constructor(transitions: Map<T, Transition[]>) {\r\n this.transitions = transitions;\r\n }\r\n\r\n protected _getTransitions(element: T): Transition[] | undefined {\r\n return this.transitions.get(element);\r\n }\r\n\r\n protected _getItemAt(element: T, index: number): Transition | undefined {\r\n const transitions = this._getTransitions(element);\r\n return transitions ? transitions[index] : undefined;\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport DirectoryRest from \"./internal/rest/directory-rest\";\r\nimport {Criteria} from \"./types/directory/criteria\";\r\nimport { SearchResult } from \"./types/directory/directory-types\";\r\n\r\n/**\r\n * The DirectoryService is used to search contacts in the OmniPCX\r\n * Enterprise phone book. Using this service requires having a\r\n * <b>TELEPHONY_ADVANCED</b> license.\r\n * <p>\r\n * A directory search is a set of 2 or more sequential operations:\r\n * <ol>\r\n * <li>The first operation initiate the search with a set of criteria</li>\r\n * <li>The second and next operations retrieve results</li>\r\n * </ol>\r\n * <p>\r\n * Note: For each session (user or administrator), only 5 concurrent searches\r\n * are authorized. An unused search context is freed after 1 minute.\r\n * \r\n * <p>\r\n * @example\r\n * ```typescript\r\n *\t\r\n * await o2g.directory.search(myCriteria);\r\n * while (!finished) {\r\n *\t\t\r\n * let result = await o2g.directory.getResults();\r\n * if (result.getResultCode() == SearchResult.ResultCode.NOK) {\r\n * // Wait the results\r\n * }\r\n * else if ((result.getResultCode() == SearchResult.ResultCode.FINISH) ||\r\n * (result.getResultCode() == SearchResult.ResultCode.TIMEOUT)) {\r\n * // Exit the loop\r\n * finished = true;\r\n * }\r\n * else {\r\n * // Process results\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport class Directory {\r\n\r\n\tprivate _directoryRest: DirectoryRest;\r\n\r\n\t/**\r\n\t * @internal\r\n\t */\r\n constructor(directoryRest: DirectoryRest) {\r\n\t\tthis._directoryRest = directoryRest;\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates a search for the specified user with the specified filter. The\r\n\t * search will be limited to the specified number of results.\r\n\t * <p>\r\n\t * If the session has been opened for a user, the 'loginName' parameter is\r\n\t * ignored, but it is mandatory if the session has been opened by an\r\n\t * administrator.\r\n\t * \r\n\t * @param filter the search filter\r\n\t * @param limit maximum number of results. The range of supported values is[1 .. 100]\r\n\t * @param loginName the user login name\r\n\t */\r\n\tpublic async search(filter: Criteria, limit: number | null = null, loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._directoryRest.search(filter, limit, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Cancel a search query for the specified user.\r\n\t * <p>\r\n\t * If the session has been opened for a user, the 'loginName' parameter is\r\n\t * ignored, but it is mandatory if the session has been opened by an\r\n\t * administrator.\r\n\t * \r\n\t * @param loginName the user login name\r\n\t */\r\n\t public async cancel(loginName: string | null = null): Promise<boolean> {\r\n\t\treturn await this._directoryRest.cancel(loginName);\r\n }\r\n\r\n\t/**\r\n\t * Gets the next available results for the current search.\r\n\t * 'getResults' is generally called in a loop and for each iteration\r\n\t * <ul>\r\n\t * <li>if the status result code is 'NOK', the search is in progress but no result is\r\n\t * available : it is recommended to wait before the next iteration (500ms for\r\n\t * example)</li>\r\n\t * <li>if the status result code is 'OK', results are available and can be processed</li>\r\n\t * <li>if the status result code is 'FINISH' or 'TIMEOUT', search is ended, exit from the\r\n\t * loop</li>\r\n\t * </ul>\r\n\t * <p>\r\n\t * If the session has been opened for a user, the 'loginName' parameter is\r\n\t * ignored, but it is mandatory if the session has been opened by an\r\n\t * administrator.\r\n\t * \r\n\t * @param loginName the user login name\r\n\t */\r\n\tpublic async getResults(loginName: string | null = null): Promise<SearchResult | null> {\r\n\t\treturn await this._directoryRest.getResults(loginName);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * OperatorType represents the CCD operator, either Agent or Supervisor.\r\n */\r\nexport enum OperatorType {\r\n\r\n /**\r\n * CCD Agent.\r\n */\r\n AGENT = \"AGENT\",\r\n\r\n /**\r\n * CCD Supervisor.\r\n */\r\n SUPERVISOR = \"SUPERVISOR\"\r\n}\r\n\r\n\r\nexport namespace OperatorType {\r\n export function isOperatorType(value: string): value is OperatorType {\r\n return Object.values(OperatorType).includes(value as OperatorType);\r\n }\r\n}","module.exports = require(\"uuid\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport UsersRest from \"./internal/rest/users-rest\";\r\nimport { Preferences, SupportedLanguages, User } from \"./types/users/users-types\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\nimport { OnUserCreated, OnUserInfoChanged } from \"./types/users/users-events\";\r\n\r\n// adapter function for event\r\nfunction nodeIdAdapter<T extends { eventName: string; user: { nodeId: number }}>(raw: any): T {\r\n return {\r\n ...raw, // keep all existing fields as-is\r\n user: {\r\n ...raw.user,\r\n nodeId: Number(raw.user.nodeId)\r\n }\r\n } as T;\r\n}\r\n\r\n/**\r\n * The User service allows:\r\n * <ul>\r\n * <li>an administrator to retrieve the list of O2G users.\r\n * <li>a user to get information on another user account.\r\n * <li>a user to change its password or some parameter like supported language.\r\n * </ul>\r\n */\r\nexport class Users extends EventEmitter {\r\n\r\n\t/**\r\n\t * Raised on creation of an user.\r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_USER_CREATED = \"OnUserCreated\";\r\n\r\n\t/**\r\n\t * Raised when user is deleted.\r\n\t * @event\r\n\t */\r\n public static readonly ON_USER_DELETED = \"OnUserDeleted\";\r\n\r\n\t/**\r\n\t * Raised on any change on the user's data.\r\n\t * @event\r\n\t */\r\n public static readonly ON_USER_INFO_CHANGED = \"OnUserInfoChanged\";\r\n\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _usersRest: UsersRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, Users.ON_USER_CREATED, nodeIdAdapter<OnUserCreated>);\r\n eventRegistry.register(this, Users.ON_USER_INFO_CHANGED, nodeIdAdapter<OnUserInfoChanged>);\r\n eventRegistry.register(this, Users.ON_USER_DELETED);\r\n }\r\n\r\n /**\r\n * Retrieves a list of users login from the connected OXEs.\r\n * <p>\r\n * if 'nodeIds' is 'null', retrieves the login of users from all the\r\n * connected OmniPCX Enterprise nodes. This method is generally used by an\r\n * administrator. if it is used by a user, 'nodeIds' must be set to\r\n * 'null' and 'onlyACD' to 'false'. In this case only the user login\r\n * is retrieved.\r\n * \r\n * @param nodeIds Specify a list of OXE nodes Id in which the query is done.\r\n * This parameter is only valid for an administrator session.\r\n * @param onlyACD Allows to select only the ACD operators (agents or\r\n * supervisors) during the query. This parameter is only valid\r\n * for an administrator session.\r\n * @param onlyWithExtLogin Allow to select only the user with an external login during the query. This parameter is only valid\r\n * for an administrator session.\r\n */\r\n\t public async getLogins(nodeIds: number[] | null = null, onlyACD: boolean = false, onlyWithExtLogin: boolean = false): Promise<string[] | null> {\r\n\t\treturn await this._usersRest.getLogins(nodeIds, onlyACD, onlyWithExtLogin);\r\n\t}\r\n\r\n /**\r\n * Retrieves the information on a user from its login.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getByLoginName(loginName: string): Promise<User | null> {\r\n\t\treturn await this._usersRest.getByLoginName(loginName);\r\n\t}\r\n\r\n /**\r\n * Retrieves the information on a user from its company extension umber.\r\n * \r\n * @param companyPhone the user extension number\r\n */\r\n\t public async getByCompanyPhone(companyPhone: string): Promise<User | null> {\r\n\t\treturn await this._usersRest.getByCompanyPhone(companyPhone);\r\n\t}\r\n\r\n /**\r\n * Returns the specified user supported languages.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getSupportedLanguages(loginName: string): Promise<SupportedLanguages | null> {\r\n\t\treturn await this._usersRest.getSupportedLanguages(loginName);\r\n\t}\r\n\t\r\n /**\r\n * Returns the preference of the specified user.\r\n * \r\n * @param loginName the user login name\r\n */\r\n\t public async getPreferences(loginName: string): Promise<Preferences | null> {\r\n\t\treturn await this._usersRest.getPreferences(loginName);\r\n\t}\r\n\r\n /**\r\n * Changes the specified user password.\r\n * \r\n * @param loginName the user login name\r\n * @param oldPassword the old password\r\n * @param newPassword the new password\r\n */\r\n\t public async changePassword(loginName: string, oldPassword: string, newPassword: string): Promise<boolean> {\r\n\t\treturn await this._usersRest.changePassword(loginName, oldPassword, newPassword);\r\n\t}\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport HttpResponse from \"./http-response\";\r\nimport HttpContent from \"./http-content\";\r\nimport fetchCookie from 'fetch-cookie';\r\nimport { CookieJar } from 'tough-cookie';\r\n\r\nconst cookieJar = new CookieJar();\r\n\r\n// Import node-fetch only if fetch is not available globally\r\nlet fetchFunction: typeof fetch;\r\n\r\n// Node >= 18, use global fetch with cookie support\r\nfetchFunction = fetchCookie(fetch, cookieJar);\r\n\r\nenum HttpMethod {\r\n GET = \"GET\",\r\n POST = \"POST\",\r\n PUT = \"PUT\",\r\n DELETE = \"DELETE\"\r\n}\r\n\r\nexport default class HttpClient {\r\n\r\n public static DUMP_COOKIES: boolean = false;\r\n\r\n async printCookies(url: string) {\r\n const cookies = await cookieJar.getCookies(url);\r\n console.log(\"Cookies for\", url);\r\n cookies.forEach(cookie => {\r\n console.log(`- ${cookie.key}=${cookie.value}`);\r\n });\r\n }\r\n\r\n async sendRequest(\r\n method: HttpMethod, \r\n uri: string, \r\n content: HttpContent | null = null, \r\n responseType: \"json\" | \"text\" | \"arrayBuffer\" | null = null,\r\n additionalHeaders: Record<string, string> = {}): Promise<HttpResponse> {\r\n\r\n const headers: Record<string, string> = {\r\n ...additionalHeaders\r\n };\r\n\r\n const fetchOptions: RequestInit = {\r\n method,\r\n headers,\r\n credentials: \"include\", // similar to xhr.withCredentials = true\r\n };\r\n\r\n if (content) {\r\n headers[\"Content-Type\"] = content.type;\r\n fetchOptions.body = content.content;\r\n } \r\n else if (method === HttpMethod.POST) {\r\n headers[\"Content-Type\"] = \"application/json\";\r\n }\r\n\r\n try {\r\n\r\n if (HttpClient.DUMP_COOKIES) {\r\n await this.printCookies(uri);\r\n }\r\n \r\n // Wait for fetchFunction to resolve if dynamic import is used\r\n const fetchResolved = fetchFunction;\r\n\r\n const response = await fetchResolved(uri, fetchOptions);\r\n\r\n let data: any;\r\n switch (responseType) {\r\n case \"json\":\r\n data = await response.json();\r\n break;\r\n case \"text\":\r\n data = await response.text();\r\n break;\r\n case \"arrayBuffer\":\r\n data = await response.arrayBuffer();\r\n break;\r\n default:\r\n data = await response.text();\r\n }\r\n\r\n return new HttpResponse(response.status, response.headers, data);\r\n } \r\n catch (error: any) {\r\n return Promise.reject(new HttpResponse(0, null, error.message || error));\r\n }\r\n }\r\n\r\n get(\r\n uri: string, \r\n responseType: \"json\" | \"text\" | \"arrayBuffer\" | null = null,\r\n additionalHeaders: Record<string, string> = {}\r\n ): Promise<HttpResponse> {\r\n\r\n return this.sendRequest(HttpMethod.GET, uri, null, responseType, additionalHeaders);\r\n }\r\n\r\n delete(\r\n uri: string,\r\n additionalHeaders: Record<string, string> = {}\r\n ): Promise<HttpResponse> {\r\n\r\n return this.sendRequest(HttpMethod.DELETE, uri, null, null, additionalHeaders);\r\n }\r\n\r\n post(\r\n uri: string, \r\n content: HttpContent | null = null, \r\n responseType: \"json\" | \"text\" | \"arrayBuffer\" | null = null,\r\n additionalHeaders: Record<string, string> = {}\r\n ): Promise<HttpResponse> {\r\n return this.sendRequest(HttpMethod.POST, uri, content, responseType, additionalHeaders);\r\n }\r\n\r\n put(\r\n uri: string, \r\n content: HttpContent | null = null,\r\n additionalHeaders: Record<string, string> = {}\r\n ): Promise<HttpResponse> {\r\n\r\n return this.sendRequest(HttpMethod.PUT, uri, content, null, additionalHeaders);\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { ForwardCondition } from \"../../../types/routing/forward\";\r\nimport {O2GDestination} from \"./o2g-destination\";\r\n\r\nexport class ForwardRoute {\r\n forwardType!: string;\r\n destinations!: O2GDestination[];\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static createForwardOnVoiceMail(condition : ForwardCondition): ForwardRoute {\r\n\r\n let result: ForwardRoute = new ForwardRoute();\r\n result.destinations = [\r\n O2GDestination.createVoiceMailDestination()\r\n ];\r\n\r\n if (condition !== ForwardCondition.IMMEDIATE) {\r\n result.forwardType = condition.toString();\r\n }\r\n return result;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static createForwardOnNumber(number: string, condition: ForwardCondition): any {\r\n\r\n let result: ForwardRoute = new ForwardRoute();\r\n result.destinations = [\r\n O2GDestination.createNumberDestination(number)\r\n ];\r\n\r\n if (condition !== ForwardCondition.IMMEDIATE) {\r\n result.forwardType = condition.toString();\r\n }\r\n return result;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { EventDispatcher } from \"./event-dispatcher\";\r\n\r\n\r\nexport default class ChunkEventing {\r\n private _uri: string;\r\n private _abortController: AbortController | null = null;\r\n private _eventDispatcher: EventDispatcher;\r\n private _isRunning = false;\r\n private _reconnectScheduled = false;\r\n\r\n constructor(uri: string, eventDispatcher: EventDispatcher) {\r\n this._uri = uri;\r\n this._eventDispatcher = eventDispatcher;\r\n }\r\n\r\n public async start(): Promise<void> {\r\n if (this._isRunning || this._reconnectScheduled) {\r\n console.warn('ChunkEventing: Already running or reconnect scheduled.');\r\n return;\r\n }\r\n\r\n this._isRunning = true;\r\n this._abortController = new AbortController();\r\n const signal = this._abortController.signal;\r\n\r\n const fetchOptions: RequestInit = {\r\n method: 'POST',\r\n headers: { 'Accept': '*/*' },\r\n signal,\r\n };\r\n\r\n try {\r\n const response = await fetch(this._uri, fetchOptions);\r\n\r\n if (!response.ok) {\r\n console.error(`ChunkEventing: HTTP error ${response.status} - ${response.statusText}`);\r\n const errorBody = await response.text();\r\n console.error('ChunkEventing: Response body:', errorBody);\r\n return this.scheduleReconnect();\r\n }\r\n\r\n if (!response.body) {\r\n console.error('ChunkEventing: Response body is null.');\r\n return this.scheduleReconnect();\r\n }\r\n\r\n const decoder = new TextDecoder('utf-8');\r\n const reader = response.body.getReader();\r\n let buffer = '';\r\n\r\n while (true) {\r\n const { done, value } = await reader.read();\r\n buffer += decoder.decode(value, { stream: true });\r\n\r\n let newlineIndex;\r\n while ((newlineIndex = buffer.indexOf('\\n')) !== -1) {\r\n const line = buffer.slice(0, newlineIndex).trim();\r\n buffer = buffer.slice(newlineIndex + 1);\r\n\r\n if (line) {\r\n try {\r\n const event = JSON.parse(line);\r\n this._eventDispatcher.dispatch(event);\r\n } catch (e) {\r\n console.error('ChunkEventing: Failed to parse line:', line, e);\r\n }\r\n }\r\n }\r\n\r\n if (done) {\r\n if (buffer.length > 0) {\r\n try {\r\n const finalEvent = JSON.parse(buffer);\r\n this._eventDispatcher.dispatch(finalEvent);\r\n console.log('ChunkEventing: Final event dispatched:', finalEvent);\r\n } catch (e) {\r\n console.error('ChunkEventing: Failed to parse final buffer:', e);\r\n }\r\n }\r\n console.log('ChunkEventing: Stream ended.');\r\n break;\r\n }\r\n }\r\n\r\n } catch (error: any) {\r\n if (error.name === 'AbortError') {\r\n console.log('ChunkEventing: Fetch aborted.');\r\n } else {\r\n console.error('ChunkEventing: Fetch error:', error);\r\n return this.scheduleReconnect();\r\n }\r\n } finally {\r\n this._abortController = null;\r\n this._isRunning = false;\r\n }\r\n }\r\n\r\n public stop(): void {\r\n if (this._abortController) {\r\n this._abortController.abort();\r\n console.log('ChunkEventing: Streaming stopped.');\r\n }\r\n this._reconnectScheduled = false;\r\n }\r\n\r\n private scheduleReconnect(initial = false): void {\r\n if (this._reconnectScheduled) return;\r\n this._reconnectScheduled = true;\r\n\r\n const delay = initial ? 0 : 1000;\r\n\r\n console.log(`ChunkEventing: Reconnecting in ${delay / 1000}s...`);\r\n\r\n setTimeout(() => {\r\n this._reconnectScheduled = false;\r\n this.start().catch(err => {\r\n console.error('ChunkEventing: Reconnection failed:', err);\r\n // Retry again after 1s on next failure\r\n this.scheduleReconnect(false);\r\n });\r\n }, delay);\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * AcrSkill represents a skill associated to a call. When the \"Advanced Call Routing\" call distribution strategy is configured, \r\n * the CCD agent are selected according to their {@link AgentSkill}. \r\n * The selected agent skills must match the skill required by the call.\r\n */\r\nexport class AcrSkill {\r\n \r\n private skillNumber: number;\r\n private acrStatus: boolean;\r\n private expertEvalLevel: number;\r\n \r\n /**\r\n * Construct a new AcrSkill with the specified parameters.\r\n * @param number the skill number\r\n * @param level the expected skill level\r\n * @param mandatory whether this skill is a mandatory skill.\r\n */\r\n constructor(number: number, level: number, mandatory: boolean) {\r\n this.skillNumber = number;\r\n this.expertEvalLevel = level;\r\n this.acrStatus = mandatory;\r\n }\r\n\r\n /**\r\n * Returns the skill number\r\n */\r\n public get number(): number {\r\n return this.skillNumber;\r\n }\r\n\r\n /**\r\n * Returns whether this skill is a mandatory skill.\r\n */\r\n public get mandatory(): boolean {\r\n return this.acrStatus;\r\n }\r\n\r\n /**\r\n * Returns the skill level.\r\n */\r\n public get evalLevel(): number {\r\n return this.expertEvalLevel;\r\n }\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from '../util/util-uri';\r\nimport {AssertUtil} from '../util/assert';\r\nimport HttpContent from '../util/http-content';\r\nimport { Tones } from '../../types/rsi/tones';\r\nimport {AdditionalDigitCollectionCriteria} from '../../types/rsi/add-digit-coll-criteria';\r\nimport { RsiPoint, RouteSession } from '../../types/rsi/rsi-types';\r\n\r\n\r\ntype RsiPointList = {\r\n rsiPoints: RsiPoint[];\r\n}\r\n\r\ntype RouteSessionList = {\r\n routeSessions: RouteSession[];\r\n}\r\n\r\nexport default class RsiRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getRsiPoints(): Promise<RsiPoint[] | null> {\r\n const rsiPoints = this.getResult<RsiPointList>(await RestService._httpClient.get(this._uri));\r\n \r\n if (rsiPoints && Array.isArray(rsiPoints.rsiPoints)) {\r\n return rsiPoints.rsiPoints;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async enableRsiPoint(rsiNumber: string): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"enable\");\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async disableRsiPoint(rsiNumber: string): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"disable\");\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async startCollectDigits(rsiNumber: string, callRef: string, numChars: number, flushChar: string | null, timeout: number | null, additionalCriteria: AdditionalDigitCollectionCriteria | null) {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"collectDigits\");\r\n\r\n let req: any = new Object();\r\n req.callRef = AssertUtil.notNullOrEmpty(callRef, \"callRef\");\r\n req.numChars = numChars;\r\n if (flushChar) {\r\n req.flushChar = flushChar;\r\n }\r\n if (timeout) {\r\n req.timeout = timeout;\r\n }\r\n if (additionalCriteria) {\r\n req.additionalCriteria = additionalCriteria;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return null;\r\n }\r\n\r\n public async stopCollectDigits(rsiNumber: string, collCrid: string): Promise<boolean> {\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \r\n \"collectDigits\",\r\n AssertUtil.notNullOrEmpty(collCrid, \"collCrid\"));\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async playTone(rsiNumber: string, callRef: string, tone: Tones, duration: number): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"playTone\");\r\n\r\n let json = JSON.stringify({\r\n \"callRef\": AssertUtil.notNullOrEmpty(callRef, \"callRef\"),\r\n \"tone\": tone,\r\n \"duration\": duration\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async cancelTone(rsiNumber: string, callRef: string): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"stopTone\");\r\n\r\n let json = JSON.stringify({\r\n \"callRef\": AssertUtil.notNullOrEmpty(callRef, \"callRef\"),\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async playVoiceGuide(rsiNumber: string, callRef: string, guideNumber: number, duration: number | null = null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"playVoiceGuide\");\r\n\r\n let req: any = new Object();\r\n req.callRef = AssertUtil.notNullOrEmpty(callRef, \"callRef\");\r\n req.guideNumber = guideNumber;\r\n if (duration) {\r\n req.duration = duration;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async routeEnd(rsiNumber: string, routeCrid: string): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"routeEnd\");\r\n\r\n let json = JSON.stringify({\r\n \"routeCrid\": routeCrid\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async routeSelect(rsiNumber: string, routeCrid: string, selectedRoute: string, callingLine: string | null, associatedData: string | null, routeToVoiceMail: boolean | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"routeSelect\");\r\n\r\n let req: any = new Object();\r\n req.routeCrid = AssertUtil.notNullOrEmpty(routeCrid, \"routeCrid\");\r\n req.selectedRoute = AssertUtil.notNullOrEmpty(selectedRoute, \"selectedRoute\");\r\n if (callingLine) {\r\n req.callingLine = callingLine;\r\n }\r\n if (associatedData) {\r\n req.associatedData = associatedData;\r\n }\r\n if (routeToVoiceMail) {\r\n req.routeToVoiceMail = routeToVoiceMail;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getRouteSessions(rsiNumber: string): Promise<RouteSession[] | null> {\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \"routeSessions\");\r\n\r\n const routeSessions = this.getResult<RouteSessionList>(await RestService._httpClient.get(uriGet));\r\n\r\n if (routeSessions && Array.isArray(routeSessions.routeSessions)) {\r\n return routeSessions.routeSessions;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getRouteSession(rsiNumber: string, routeCrid: string): Promise<RouteSession | null> {\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(rsiNumber, \"rsiNumber\"), \r\n \"routeSessions\",\r\n AssertUtil.notNullOrEmpty(routeCrid, \"routeCrid\")\r\n );\r\n\r\n return this.getResult<RouteSession>(await RestService._httpClient.get(uriGet));\r\n }\r\n}","module.exports = require(\"events\");","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport CallCenterManagementRest from \"./internal/rest/ccMngt-rest\";\r\nimport { Calendar } from \"./types/cc-mngt/calendar/calendar\";\r\nimport { DayOfWeek } from \"./types/cc-mngt/calendar/day-of-week\";\r\nimport { ExceptionCalendar } from \"./types/cc-mngt/calendar/exception-calendar\";\r\nimport { NormalCalendar } from \"./types/cc-mngt/calendar/normal-calendar\";\r\nimport { Transition } from \"./types/cc-mngt/calendar/transition\";\r\nimport { Pilot } from \"./types/cc-mngt/pilot\";\r\n\r\n/**\r\n * This service allows an administrator session to manage CCD pilot objects.\r\n * service requires having a <b>CONTACTCENTER_SRV</b> license.\r\n */\r\nexport class CallCenterManagement {\r\n\r\n private readonly _ccManagementRest: CallCenterManagementRest;\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(ccManagementRest: CallCenterManagementRest) {\r\n this._ccManagementRest = ccManagementRest;\r\n }\r\n\r\n public async getPilots(nodeId: number): Promise<Pilot[] | null> {\r\n return this._ccManagementRest.getPilots(nodeId);\r\n }\r\n\r\n public async getPilot(nodeId: number, pilotNumber: string): Promise<Pilot | null> {\r\n return this._ccManagementRest.getPilot(nodeId, pilotNumber);\r\n }\r\n\r\n public async getCalendar(nodeId: number, pilotNumber: string): Promise<Calendar | null> {\r\n return this._ccManagementRest.getCalendar(nodeId, pilotNumber);\r\n }\r\n\r\n public async getExceptionCalendar(nodeId: number, pilotNumber: string): Promise<ExceptionCalendar | null> {\r\n return this._ccManagementRest.getExceptionCalendar(nodeId, pilotNumber);\r\n }\r\n\r\n public async addExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, transition: Transition): Promise<boolean> {\r\n return this._ccManagementRest.addExceptionTransition(nodeId, pilotNumber, dateTransition, transition);\r\n }\r\n\r\n public async deleteExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, index: number): Promise<boolean> {\r\n return this._ccManagementRest.deleteExceptionTransition(nodeId, pilotNumber, dateTransition, index);\r\n }\r\n\r\n public async setExceptionTransition(nodeId: number, pilotNumber: string, dateTransition: Date, index: number, transition: Transition): Promise<boolean> {\r\n return this._ccManagementRest.deleteExceptionTransition(nodeId, pilotNumber, dateTransition, index);\r\n }\r\n\r\n public async getNormalCalendar(nodeId: number, pilotNumber: string): Promise<NormalCalendar | null> {\r\n return this._ccManagementRest.getNormalCalendar(nodeId, pilotNumber);\r\n }\r\n\r\n public async addNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, transition: Transition): Promise<boolean> {\r\n return this._ccManagementRest.addNormalTransition(nodeId, pilotNumber, day, transition);\r\n }\r\n\r\n public async deleteNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, index: number): Promise<boolean> {\r\n return this._ccManagementRest.deleteNormalTransition(nodeId, pilotNumber, day, index);\r\n }\r\n\r\n public async setNormalTransition(nodeId: number, pilotNumber: string, day: DayOfWeek, index: number, transition: Transition): Promise<boolean> {\r\n return this._ccManagementRest.setNormalTransition(nodeId, pilotNumber, day, index, transition);\r\n }\r\n\r\n public async openPilot(nodeId: number, pilotNumber: string): Promise<boolean> {\r\n return this._ccManagementRest.openPilot(nodeId, pilotNumber);\r\n }\r\n\r\n public async closePilot(nodeId: number, pilotNumber: string): Promise<boolean> {\r\n return this._ccManagementRest.closePilot(nodeId, pilotNumber);\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from '../util/util-uri';\r\nimport {AssertUtil} from '../util/assert';\r\nimport HttpContent from '../util/http-content';\r\nimport { IntrusionMode } from '../../types/cc-agent/intrusion-mode';\r\nimport {OperatorType} from '../../types/cc-agent/operator-type'\r\nimport { AgentGroups, AgentSkill, OperatorConfig, OperatorState, WithdrawReason } from '../../types/cc-agent/cc-agent-types';\r\n\r\ntype O2GAgentConfig = {\r\n type: string;\r\n proacd: string;\r\n processingGroups: AgentGroups;\r\n skills: {\r\n skills: AgentSkill[];\r\n };\r\n selfAssign: boolean;\r\n headset: boolean;\r\n help: boolean;\r\n multiline: boolean;\r\n}\r\n\r\ntype O2GWithdrawReasons = {\r\n reasons: WithdrawReason[];\r\n}\r\n\r\nexport default class CallCenterAgentRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getConfiguration(loginName: string | null): Promise<OperatorConfig | null> { \r\n let uriGet = UtilUri.appendPath(this._uri, \"config\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const o2gAgentConfig = this.getResult<O2GAgentConfig>(await RestService._httpClient.get(uriGet));\r\n if (o2gAgentConfig) {\r\n\r\n let mapSkills = new Map<number, AgentSkill>();\r\n if (o2gAgentConfig.skills.skills) {\r\n\r\n o2gAgentConfig.skills.skills.forEach(s => mapSkills.set(s.number, s));\r\n }\r\n\r\n return {\r\n \"type\": OperatorType.isOperatorType(o2gAgentConfig.type) ? o2gAgentConfig.type : OperatorType.AGENT,\r\n \"proacd\": o2gAgentConfig.proacd,\r\n \"groups\": o2gAgentConfig.processingGroups,\r\n \"selfAssign\": o2gAgentConfig.selfAssign,\r\n \"skills\": mapSkills,\r\n \"headset\": o2gAgentConfig.headset,\r\n \"help\": o2gAgentConfig.help,\r\n \"multiline\": o2gAgentConfig.multiline\r\n };\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getState(loginName: string | null): Promise<OperatorState | null> { \r\n let uriGet = UtilUri.appendPath(this._uri, \"state\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<OperatorState>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n public async logon(proAcdNumber: string, pgNumber: string | null, headset: boolean, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"logon\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.proAcdDeviceNumber = AssertUtil.notNullOrEmpty(proAcdNumber, \"proAcdNumber\");\r\n if (pgNumber) {\r\n req.pgGroupNumber = pgNumber;\r\n }\r\n if (headset) {\r\n req.headset = true;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async logoff(loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"logoff\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async enter(pgNumber: string, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"enter\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req = {\r\n \"pgGroupNumber\": AssertUtil.notNullOrEmpty(pgNumber, \"pgNumber\")\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async exit(loginName: string | null): Promise<boolean> {\r\n // First get the operator state to get the processing group\r\n const state = await this.getState(loginName);\r\n if (state && state.pgNumber) {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"exit\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n \r\n let json = JSON.stringify({\r\n \"pgGroupNumber\": state.pgNumber\r\n });\r\n \r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n\r\n private async _doAgentAction(action: string, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, action);\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async setWrapup(loginName: string | null): Promise<boolean> {\r\n return this._doAgentAction(\"wrapUp\", loginName);\r\n }\r\n\r\n public async setReady(loginName: string | null): Promise<boolean> {\r\n return await this._doAgentAction(\"ready\", loginName);\r\n }\r\n\r\n public async setPause(loginName: string | null): Promise<boolean> {\r\n return await this._doAgentAction(\"pause\", loginName);\r\n }\r\n\r\n public async requestPermanentListening(agentNumber: string, loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"permanentListening\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req = {\r\n \"agentNumber\": AssertUtil.notNullOrEmpty(agentNumber, \"agentNumber\")\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async cancelPermanentListening(loginName: string | null = null): Promise<boolean> {\r\n let uriDelete = UtilUri.appendPath(this._uri, \"permanentListening\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n public async requestIntrusion(agentNumber: string, intrusionMode: IntrusionMode, loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"intrusion\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req = {\r\n \"agentNumber\": AssertUtil.notNullOrEmpty(agentNumber, \"agentNumber\"),\r\n \"mode\": intrusionMode\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async changeIntrusionMode(newIntrusionMode: IntrusionMode, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPut = UtilUri.appendPath(this._uri, \"intrusion\");\r\n if (loginName) {\r\n uriPut = UtilUri.appendQuery(uriPut, \"loginName\", loginName);\r\n }\r\n\r\n let req = {\r\n \"mode\": newIntrusionMode\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async requestSupervisorHelp(loginName: string | null): Promise<boolean> {\r\n return await this._doAgentAction(\"supervisorHelp\", loginName);\r\n }\r\n\r\n private async _doCancelSupervisorHelpRequest(otherNumber: string, loginName: string | null): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(this._uri, \"supervisorHelp\");\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"other\", otherNumber);\r\n \r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async rejectAgentHelpRequest(agentNumber: string, loginName: string | null): Promise<boolean> {\r\n return this._doCancelSupervisorHelpRequest(AssertUtil.notNullOrEmpty(agentNumber, \"agentNumber\"), loginName)\r\n }\r\n\r\n public async cancelSupervisorHelpRequest(supervisorNumber: string, loginName: string | null): Promise<boolean> {\r\n return this._doCancelSupervisorHelpRequest(AssertUtil.notNullOrEmpty(supervisorNumber, \"supervisorNumber\"), loginName)\r\n }\r\n\r\n public async requestSnapshot(loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"state/snapshot\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async activateSkills(skillNumbers: number[], loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"config/skills/activate\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n \"skills\": skillNumbers\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deactivateSkills(skillNumbers: number[], loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"config/skills/deactivate\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n \"skills\": skillNumbers\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getWithdrawReasons(pgNumber: string, loginName: string | null): Promise<WithdrawReason[] | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"withdrawReasons\");\r\n uriGet = UtilUri.appendQuery(uriGet, \"pgNumber\", AssertUtil.notNullOrEmpty(pgNumber, \"pgNumber\"));\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const o2gWithdrawReasons = this.getResult<O2GWithdrawReasons>(await RestService._httpClient.get(uriGet));\r\n if (o2gWithdrawReasons && Array.isArray(o2gWithdrawReasons.reasons)) {\r\n return o2gWithdrawReasons.reasons;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async setWithdraw(reason: WithdrawReason, loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"withdraw\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n \"reasonIndex\": AssertUtil.notNull(reason, \"reason\").index\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport HttpContent from '../util/http-content';\r\nimport { MailBox, MailBoxInfo, VoiceMessage } from '../../types/messaging/messaging-types';\r\nimport { Logger } from '../util/logger';\r\n\r\ntype MailBoxes = {\r\n mailboxes: MailBox[];\r\n}\r\n\r\ntype VoicemailsList = {\r\n voicemails: VoiceMessage[];\r\n}\r\n\r\n\r\nexport default class MessagingRest extends RestService {\r\n\r\n private _logger = Logger.create(\"MessagingRest\");\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getMailboxes(loginName: string | null): Promise<MailBox[] | null> {\r\n \r\n this._logger.info(`getMailboxes loginName=${loginName}`);\r\n\r\n let uriGet = this._uri;\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const mailboxes = this.getResult<MailBoxes>(await RestService._httpClient.get(uriGet))\r\n if (mailboxes && Array.isArray(mailboxes.mailboxes)) {\r\n return mailboxes.mailboxes;\r\n }\r\n else {\r\n this._logger.error(`Error in getResult`);\r\n return null;\r\n }\r\n }\r\n\r\n public async getMailboxInfo(mailboxId: string, password: string | null, loginName: string | null): Promise<MailBoxInfo | null> {\r\n\r\n this._logger.info(`getMailboxInfo mailboxId=${mailboxId}, loginName=${loginName}`);\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"));\r\n if (loginName != null) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n if (password) {\r\n var json = JSON.stringify({\r\n \"password\": password\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return this.getResult<MailBoxInfo>(httpResponse);\r\n }\r\n else {\r\n uriPost = UtilUri.appendQuery(uriPost, \"withUserPwd\");\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return this.getResult<MailBoxInfo>(httpResponse);\r\n }\r\n }\r\n\r\n public async getVoiceMessages(mailboxId: string, newOnly: boolean, offset: number | null, limit: number | null, loginName: string | null): Promise<VoiceMessage[] | null> {\r\n \r\n this._logger.info(`getVoiceMessages mailboxId=${mailboxId}, loginName=${loginName}`);\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"), \"voicemails\");\r\n if (loginName != null) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n if (newOnly) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"newOnly\", \"true\");\r\n }\r\n if (offset) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"offset\", offset.toString());\r\n }\r\n if (limit) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"limit\", limit.toString());\r\n }\r\n \r\n const voicemails = this.getResult<VoicemailsList>(await RestService._httpClient.get(uriGet))\r\n if (voicemails && Array.isArray(voicemails.voicemails)) {\r\n let vms = voicemails.voicemails;\r\n vms.forEach(vm => vm.date = new Date(vm.date));\r\n\r\n return vms;\r\n }\r\n else {\r\n this._logger.error(`Error in getVoiceMessages`);\r\n return null;\r\n }\r\n }\r\n\r\n public async downloadVoiceMessage(mailboxId: string, voicemailId: string, wavPath: string | null, loginName: string | null): Promise<string | null> {\r\n \r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"), \r\n \"voicemails\",\r\n AssertUtil.notNullOrEmpty(voicemailId, \"voicemailId\"));\r\n\r\n if (loginName != null) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n \r\n // Get the file as an array buffer\r\n let httpResponse = await RestService._httpClient.get(uriGet, \"arrayBuffer\");\r\n return await this.downloadFile(httpResponse, wavPath, \"wav\");\r\n }\r\n\r\n public async acknowledgeVoiceMessage(mailboxId: string, voicemailId: string, loginName: string | null): Promise<boolean> {\r\n \r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"), \r\n \"voicemails\",\r\n AssertUtil.notNullOrEmpty(voicemailId, \"voicemailId\"));\r\n\r\n if (loginName != null) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n \r\n let additionalHeaders: Record<string, string> = {};\r\n additionalHeaders[\"Range\"] = \"bytes=0-1\";\r\n\r\n // Get the file as an array buffer\r\n let httpResponse = await RestService._httpClient.get(uriGet, \"arrayBuffer\", additionalHeaders);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n\r\n public async deleteVoiceMessages(mailboxId: string, msgIds: string[], loginName: string | null = null): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"), \r\n \"voicemails\");\r\n\r\n if (loginName != null) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n if (msgIds) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"msgIds\", msgIds.join(';'));\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async deleteVoiceMessage(mailboxId: string, voicemailId: string, loginName: string | null = null): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(mailboxId, \"mailboxId\"), \r\n \"voicemails\",\r\n AssertUtil.notNullOrEmpty(voicemailId, \"voicemailId\"));\r\n\r\n if (loginName != null) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n \r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n\r\nexport default class HttpContent {\r\n private readonly _content: any;\r\n private readonly _type: string;\r\n\r\n constructor(content: any, type: string = 'application/json') {\r\n this._content = content;\r\n this._type = type;\r\n }\r\n\r\n get type(): string {\r\n return this._type;\r\n }\r\n\r\n get content(): any {\r\n return this._content;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport TelephonyRest from \"./internal/rest/telephony-rest\";\r\nimport {AcrSkill} from \"./types/telephony/acr-skill\";\r\nimport { RecordingAction } from \"./types/telephony/RecordingAction\";\r\nimport { HuntingGroups, Call, Leg, TelephonicState, Participant, DeviceState, HuntingGroupStatus, Callback, MiniMessage } from \"./types/telephony/telephony-types\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n\r\n/**\r\n * The TelephonyService allows a user to initiate a call and to activate\r\n * any kind of OmniPCX Enterprise telephony services.\r\n * <p>\r\n * Using this service requires having a <b>TELEPHONY_ADVANCED</b> license,\r\n * except for the 3 basic services\r\n * {@link basicMakeCall}, {@link basicAnswerCall} and {@link basicDropMe} that are available without any\r\n * license.\r\n * \r\n */\r\n export class Telephony extends EventEmitter {\r\n\r\n\t/**\r\n\t * Occurs in response to a snapshot request.\r\n\t * @event\r\n\t */\r\n public static readonly ON_TELEPHONY_STATE = \"OnTelephonyState\";\r\n\r\n\t/**\r\n\t * Occurs when a new call is created.\r\n\t * @event\r\n\t */\r\n public static readonly ON_CALL_CREATED = \"OnCallCreated\";\r\n\r\n\t/**\r\n\t * Occurs when an existing call is modified.\r\n\t * @event\r\n\t */\r\n public static readonly ON_CALL_MODIFIED = \"OnCallModified\";\r\n\r\n\t/**\r\n\t * Occurs when a call has been removed.\r\n\t * @event\r\n\t */\r\n public static readonly ON_CALL_REMOVED = \"OnCallRemoved\";\r\n\r\n\t/**\r\n\t * Occurs when a user's state has been modified.\r\n\t * @event\r\n\t */\r\n public static readonly ON_USER_STATE_MODIFIED = \"OnUserStateModified\";\r\n\r\n\t/**\r\n\t * Occurs when a device's state has been modified.\r\n\t * @event\r\n\t */\r\n public static readonly ON_DEVICE_STATE_MODIFIED = \"OnDeviceStateModified\";\r\n\r\n\t/**\r\n\t * Occurs when a user's dynamic state change.\r\n\t * @event\r\n\t */\r\n public static readonly ON_DYNAMIC_STATE_CHANGED = \"OnDynamicStateChanged\";\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _telephonyRest: TelephonyRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, Telephony.ON_TELEPHONY_STATE);\r\n eventRegistry.register(this, Telephony.ON_CALL_CREATED);\r\n eventRegistry.register(this, Telephony.ON_CALL_MODIFIED);\r\n eventRegistry.register(this, Telephony.ON_CALL_REMOVED);\r\n eventRegistry.register(this, Telephony.ON_USER_STATE_MODIFIED);\r\n eventRegistry.register(this, Telephony.ON_DEVICE_STATE_MODIFIED);\r\n eventRegistry.register(this, Telephony.ON_DYNAMIC_STATE_CHANGED);\r\n }\r\n\r\n /**\r\n * Initiates a call from the specified device to the specified called number.\r\n * <p>\r\n * If the session is opened by a user, the device phone number must be one of\r\n * the user.\r\n * <p>\r\n * If the automatic answer on make call 'autoAnswer' parameter is set to\r\n * 'false' the deviceId is called before launching the make call to\r\n * callee, else callee is called immediately\r\n * \r\n * @param deviceId the device phone number for which the call is made\r\n * @param callee the called number\r\n * @param autoAnswer automatic answer on make call.\r\n */\r\n\tpublic async basicMakeCall(deviceId: string, callee: string, autoAnswer = true): Promise<boolean> {\r\n\t\treturn await this._telephonyRest.basicMakeCall(deviceId, callee, autoAnswer);\r\n\t}\r\n\t\r\n /**\r\n * Answers to an incoming ringing call on the specified device.\r\n * <p>\r\n * If the session is opened by a user, the device phone number must be one of\r\n * the user.\r\n * \r\n * @param deviceId the device phone number\r\n */\r\n\tpublic async basicAnswerCall(deviceId: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.basicAnswerCall(deviceId);\r\n\t}\r\n\r\n /**\r\n * Exits from the call for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>\r\n * if the call is a single call, it is released; if it is a conference, the call\r\n * carries on without the user.\r\n * \r\n * @param loginName the login name for whom the drop is done\r\n */\r\n\tpublic async basicDropMe(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.basicDropMe(loginName);\r\n\t}\r\n\r\n /**\r\n * Retrieves the calls in progress for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getCalls(loginName: string | null = null): Promise<Call[] | null> { \r\n\t\treturn await this._telephonyRest.getCalls(loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the call specified by the call reference for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param loginName the login name\r\n */\r\n\t public async getCall(callRef: string, loginName: string | null = null): Promise<Call | null> { \r\n\t\treturn await this._telephonyRest.getCall(callRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Initiates a call from the specified device to the specified called number for\r\n * the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>\r\n * If the automatic answer on make call 'autoAnswer' parameter is set to\r\n * 'false' the deviceId is called before launching the make call to\r\n * callee, else callee is called immediately\r\n * \r\n * @param deviceId the device phone number for which the call is made\r\n * @param callee the called number\r\n * @param autoAnswer automatic answer on make call.\r\n * @param loginName the login name\r\n */\r\n\t public async makeCall(deviceId: string, callee: string, autoAnswer: boolean = true, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.makeCall(deviceId, callee, autoAnswer, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates a new call to another user (the callee), using the specified deviceId and options.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * Use the makeCallEx service to initiated a call from one of the devices of the logged user. \r\n\t * First, the call server initiates a call on the user 'deviceId'. Then when the call is answered the call server starts the call to the 'callee'.\r\n\t * an {@link ON_CALL_CREATED} is raised.\r\n\t * <p>\r\n\t * If <c>inhibitProgressTone</c> is <see langword=\"true\"/>, progress tone is inhibited on an outbound call.\r\n\t * <p>\r\n\t * The callingNumber is used on an outbound call to to present another calling number on the public network call in order to hide the real calling extension number.\r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n * @param callee \t\t\tthe called number\r\n * @param autoAnswer \t\t\tautomatic answer on make call\r\n\t * @param inhibitProgressTone \tallows to inhibit the progress tone on the current external call\r\n\t * @param associatedData \t\tcorrelator data to add to the call\r\n\t * @param callingNumber \t\tcalling number to present to the public network\r\n * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makeCallEx(deviceId: string, callee: string, autoAnswer: boolean = true, inhibitProgressTone = false, associatedData: string | null = null, callingNumber: string | null = null, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.makeCallEx(deviceId, callee, autoAnswer, inhibitProgressTone, associatedData, callingNumber, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates a new private call to another user (the callee), using a pin code and an optional secret code.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * The private call is a service which allows a user to specify that the external call made is personal and not professional.The charging for this\r\n\t * type of call can then be given specific processing.\r\n\t * <p>\r\n\t * Use the 'makePrivateCall' service to initiated a private call from one of the devices of the logged user. First, the call server initiates a \r\n\t * call on the user 'deviceId'. Then when the call is answered the call server starts the call to the 'callee'.\r\n\t * an {@link ON_CALL_CREATED} is raised.\r\n\t * <p>\r\n\t * The private call requires the user enters a PIN code (Personal Identification Number). \r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n * @param callee \t\t\tthe called number\r\n\t * @param pin \t\t\t\t\tthe PIN code to identify the caller\r\n\t * @param secretCode \t\t\tthe optional secret code used to confirm the PIN code\r\n * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makePrivateCall(deviceId: string, callee: string, pin: string, secretCode: string | null = null, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.makePrivateCall(deviceId, callee, pin, secretCode, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates a new business call to another user (the callee), using the specified business code.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * Use the 'makeBusinessCall' service to initiated a business call from one of the devices of the logged user. First, the call server initiates a \r\n\t * call on the user 'deviceId'. Then when the call is answered the call server starts the call to the 'callee'.\r\n\t * an {@link ON_CALL_CREATED} is raised.\r\n\t * <p>\r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n * @param callee \t\t\tthe called number\r\n\t * @param businessCode \t\t\tthe cost center on which the call will be charged\r\n\t * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makeBusinessCall(deviceId: string, callee: string, businessCode: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.makeBusinessCall(deviceId, callee, businessCode, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates a call from a CCD agent to a supervisor.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * Use the 'makeSupervisorCall' service to initiated to initiated a call from an agent to a supervisor. First, the call server initiates a \r\n\t * call on the agent 'deviceId'. Then, when the call is answered the call server calls the supervisor.\r\n\t * an {@link ON_CALL_CREATED} is raised.\r\n\t * <p>\r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n * @param autoAnswer \t\t\tautomatic answer on make call\r\n\t * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makeSupervisorCall(deviceId: string, autoAnswer: boolean = true, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.makeSupervisorCall(deviceId, autoAnswer, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates an enquiry call from a CCD agent to a pilot or a RSI point.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * Use the 'makePilotOrRSISupervisedTransferCall' service to initiated an enquiry call to a CCD pilot or an RSI point from a CCD operator. \r\n\t * <p>\r\n\t * The CCD pilot or the RSI point performs a call distribution to select an agent that will be alerted by this call. The 'callProfile' is mandatory\r\n\t * in case of \"Advanced Call Routing\" call distribution strategy.\r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n\t * @param pilot \t\t\t\tcalled CCD pilot or RSI point number\r\n\t * @param associatedData \t\tcorrelator data to add to the call\r\n\t * @param callProfile \t\t\tThe call profile associated to this call\r\n\t * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makePilotOrRSISupervisedTransferCall(deviceId: string, pilot: string, associatedData: string | null = null, callProfile: AcrSkill[] | null = null, loginName: string | null = null): Promise<boolean | null> { \r\n\t\treturn await this._telephonyRest.makePilotOrRSISupervisedTransferCall(deviceId, pilot, associatedData, callProfile, loginName);\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates an local call to a CCD pilot or a RSI point.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n\t * <p>\r\n\t * Use the 'makePilotOrRSICall' service to initiated a local call to a CCD pilot or an RSI point. \r\n\t * <p>\r\n\t * The CCD pilot or the RSI point performs a call distribution to select an agent that will be alerted by this call. The 'callProfile' is mandatory\r\n\t * in case of \"Advanced Call Routing\" call distribution strategy.\r\n\t * \r\n * @param deviceId \t\t\tthe device phone number for which the call is made\r\n\t * @param pilot \t\t\t\tcalled CCD pilot or RSI point number.\r\n * @param autoAnswer \t\t\tautomatic answer on make call\r\n\t * @param associatedData \t\tcorrelator data to add to the call\r\n\t * @param callProfile \t\t\tThe call profile associated to this call\r\n\t * @param loginName \t\t\tthe login name\r\n\t */\r\n\tpublic async makePilotOrRSICall(deviceId: string, pilot: string, autoAnswer: boolean = true, associatedData: string | null = null, callProfile: AcrSkill[] | null = null, loginName: string | null = null): Promise<boolean | null> { \r\n\t\treturn null;\r\n\t}\r\n\t\r\n /**\r\n * Puts an active call on hold and retrieve a call that has been previously put\r\n * in hold.\r\n * <p>\r\n * If the session is opened by a user, the device phone number must be one of\r\n * the user.\r\n * \r\n * @param callRef the call reference of the call on hold\r\n * @param deviceId the device phone number for which the operation is done\r\n */\r\n\t public async alternate(callRef: string, deviceId: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.alternate(callRef, deviceId);\r\n\t}\r\n\r\n /**\r\n * Answers to an incoming ringing call specified by it reference.\r\n * <p>\r\n * If the session is opened by a user, the device phone number must be one of\r\n * the user.\r\n * <p>\r\n * Answering a call will fail if the call state is not correct. The state can be\r\n * checked by listening to the telephony events, and more specifically by\r\n * checking the capabilities of the involved leg. (answer capability on the\r\n * leg).\r\n * \r\n * @param callRef the call reference of the call on hold\r\n * @param deviceId the device phone number for which the operation is done\r\n */\r\n\t public async answer(callRef: string, deviceId: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.answer(callRef, deviceId);\r\n\t}\r\n\t\r\n /**\r\n * Associates data to a previously established call.\r\n * <p>\r\n * If the session is opened by a user, the device phone number must be one of\r\n * the user.\r\n * \r\n * @param callRef the call reference of the call on hold\r\n * @param deviceId the device phone number for which the operation is done\r\n * @param associatedData the associated data\r\n */\r\n\tpublic async attachData(callRef: string, deviceId: string, associatedData: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.attachData(callRef, deviceId, associatedData);\r\n\t}\r\n\r\n /**\r\n * Transfers the active call to another user, without keeping control on this\r\n * call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the reference of the active call\r\n * @param transferTo the phone number to which the call is transfered\r\n * @param anonymous anonymous transfer if this parameter is 'true', the\r\n * call will be transfered as anonymous\r\n * @param loginName the login name\r\n */\r\n\t public async blindTransfer(callRef: string, transferTo: string, anonymous: boolean = false, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.blindTransfer(callRef, transferTo, anonymous, loginName);\r\n\t}\r\n\r\n /**\r\n * Requests a callback on the call specified by the call reference for the\r\n * specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param loginName the login name\r\n */\r\n\t public async callback(callRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.callback(callRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the legs involved by the call specified by the call reference for the\r\n * specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param loginName the login name\r\n */\r\n\t public async getDeviceLegs(callRef: string, loginName: string | null = null): Promise<Leg[] | null> { \r\n\t\treturn await this._telephonyRest.getDeviceLegs(callRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the leg specified by its id, involved by the call specified by the\r\n * call reference for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param legId the leg identifier\r\n * @param loginName the login name\r\n */\r\n\t public async getDeviceLeg(callRef: string, legId: string, loginName: string | null = null): Promise<Leg | null> { \r\n\t\treturn await this._telephonyRest.getDeviceLeg(callRef, legId, loginName);\r\n\t}\r\n\r\n /**\r\n * Exits from the call specified by its reference for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>\r\n * if the call is a single call, it is released; if it is a conference, the call\r\n * carries on without the user.\r\n * \r\n * @param callRef the call reference\r\n * @param loginName the login name for whom the drop is done\r\n */\r\n\t public async dropme(callRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.dropme(callRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Puts on hold the call specified by its reference, on the specified device,\r\n * for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param deviceId the device phone number from which the call put on hold\r\n * @param loginName the login name\r\n */\r\n\t public async hold(callRef: string, deviceId: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.hold(callRef, deviceId, loginName);\r\n\t}\r\n\r\n /**\r\n * Makes a 3-party conference with a specified active call and a specified held\r\n * call for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the active call reference\r\n * @param heldCallRef the held call reference\r\n * @param loginName the login name\r\n */\r\n\t public async merge(callRef: string, heldCallRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.merge(callRef, heldCallRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Redirects an outgoing ringing call specified by its reference to the voice\r\n * mail of the called user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the ringing call reference\r\n * @param loginName the login name\r\n */\r\n\t public async overflowToVoiceMail(callRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.overflowToVoiceMail(callRef, loginName);\r\n\t}\r\n\t\r\n /**\r\n * Gets the telephonic state and capabilities for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getState(loginName: string | null = null): Promise<TelephonicState | null> { \r\n\t\treturn await this._telephonyRest.getState(loginName);\r\n\t}\r\n\t\r\n /**\r\n * Parks the specified active call to a target device. If the device is not\r\n * provided, the call will be parked on the current device.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the active call reference\r\n * @param parkTo the target device\r\n * @param loginName the login name\r\n */\r\n\t public async park(callRef: string, parkTo: string | null = null, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.park(callRef, parkTo, loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the list of participants in the specified call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param loginName the login name\r\n */\r\n\t public async getParticipants(callRef: string, loginName: string | null = null): Promise<Participant[] | null> { \r\n\t\treturn await this._telephonyRest.getParticipants(callRef, loginName);\r\n\t}\r\n\t\r\n /**\r\n * Returns the specified participant in the specified call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param participantId the participant identifier\r\n * @param loginName the login name\r\n */\r\n\t public async getParticipant(callRef: string, participantId: string, loginName: string | null = null): Promise<Participant | null> { \r\n\t\treturn await this._telephonyRest.getParticipant(callRef, participantId, loginName);\r\n\t}\r\n\r\n /**\r\n * Drops the specified participant from the specified call for the specified\r\n * user.\r\n * <p>\r\n * If the call is a single call, it is released; if it is a conference, the call\r\n * carries on without the participant.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the call reference\r\n * @param participantId the participant identifier\r\n * @param loginName the login name\r\n */\r\n\t public async dropParticipant(callRef: string, participantId: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.dropParticipant(callRef, participantId, loginName);\r\n\t}\r\n\r\n /**\r\n * Releases the current call (active or ringing) to retrieve a previously put in\r\n * hold call (cancel a consultation call).\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the held call reference\r\n * @param deviceId the device phone number for which the operation is done\r\n * @param enquiryCallRef the reference of the enquiry call to cancel\r\n * @param loginName the login name\r\n */\r\n\t public async reconnect(callRef: string, deviceId: string, enquiryCallRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.reconnect(callRef, deviceId, enquiryCallRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Starts, stops, pauses or resumes the recording of a the specified call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the reference of the recorded call\r\n * @param action the recording action\r\n * @param loginName the login name\r\n */\r\n\t public async doRecordAction(callRef: string, action: RecordingAction, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.doRecordAction(callRef, action, loginName);\r\n\t}\r\n\r\n /**\r\n * Redirects an incoming ringing call to another user or number, instead of\r\n * responding to it. If 'redirectTo' is equal to 'VOICEMAIL',\r\n * redirect the incoming ringing call to the user voice mail.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the incoming ringing call reference\r\n * @param redirectTo Phone number of the redirection, or \"VOICEMAIL\"\r\n * @param anonymous anonymous redirection if this parameter is 'true',\r\n * the call will be redirected as anonymous\r\n * @param loginName the login name\r\n */\r\n\t public async redirect(callRef: string, redirectTo: string, anonymous: boolean = false, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.redirect(callRef, redirectTo, anonymous, loginName);\r\n\t}\r\n\r\n /**\r\n * Retrieves a call that has been previously put in hold.\r\n * <p>\r\n * This method with return {@code false} if it is invoked from a session opened\r\n * by an administrator.\r\n * \r\n * @param callRef the held call reference\r\n * @param deviceId the device phone number for which the operation is done\r\n */\r\n\t public async retrieve(callRef: string, deviceId: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.retrieve(callRef, deviceId, loginName);\r\n\t}\r\n\r\n /**\r\n * Sends DTMF codes on the specified active call.\r\n * \r\n * @param callRef the active call reference\r\n * @param deviceId the device phone number for which the operation is done\r\n * @param number the DTMF codes to send\r\n */\r\n\t public async sendDtmf(callRef: string, deviceId: string, number: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.sendDtmf(callRef, deviceId, number);\r\n\t}\r\n\r\n /**\r\n * Sends the account info for the specified call, on the specified device.\r\n * <p>\r\n * This operation is used by a CCD agent to send the transaction code at the end\r\n * of the call. The string value MUST complain with the transaction code\r\n * accepted by OXE (that is numerical value only)\r\n * \r\n * @param callRef the call reference\r\n * @param deviceId the device phone number for which the operation is done\r\n * @param accountInfo the transaction code\r\n */\r\n\t public async sendAccountInfo(callRef: string, deviceId: string, accountInfo: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.sendAccountInfo(callRef, deviceId, accountInfo);\r\n\t}\r\n\r\n /**\r\n * Transfers a specified active call to a specified held call for the specified\r\n * user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callRef the active call reference\r\n * @param heldCallRef the held call reference\r\n * @param loginName the login name\r\n */\r\n\t public async transfer(callRef: string, heldCallRef: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.transfer(callRef, heldCallRef, loginName);\r\n\t}\r\n\r\n /**\r\n * Logs the specified user on a specified desk sharing set.\r\n * <p>\r\n * The user must be configured as a Desk sharing user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param dssDeviceNumber the desk sharing set phone number\r\n * @param loginName the login name\r\n * @see {@link deskSharingLogOff}\r\n */\r\n\t public async deskSharingLogOn(dssDeviceNumber: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.deskSharingLogOn(dssDeviceNumber, loginName);\r\n\t}\r\n\r\n /**\r\n * Logs off the specified user from the desk sharing set.\r\n * <p>\r\n * The user must be configured as a Desk sharing user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n * @see {@link deskSharingLogOn}\r\n */\r\n\t public async deskSharingLogOff(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.deskSharingLogOff(loginName);\r\n\t}\r\n\r\n /**\r\n * Gets states of all devices of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getDevicesState(loginName: string | null = null): Promise<DeviceState[] | null> { \r\n\t\treturn await this._telephonyRest.getDevicesState(loginName);\r\n\t}\r\n\r\n /**\r\n * Gets state of the specified device of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param deviceId the device phone number for which the operation is done\r\n * @param loginName the login name\r\n */\r\n\t public async getDeviceState(deviceId: string, loginName: string | null = null): Promise<DeviceState | null> { \r\n\t\treturn await this._telephonyRest.getDeviceState(deviceId, loginName);\r\n\t}\r\n\r\n /**\r\n * Picks up the specified incoming call for another user.\r\n * \r\n * @param deviceId the device phone number for which the operation is\r\n * done\r\n * @param otherCallRef reference of the call to pickup (on the remote user)\r\n * @param otherPhoneNumber the phone number on which the call is ringing\r\n * @param autoAnswer 'true' to automatically answer the call after\r\n * the pickup.\r\n */\r\n\t public async pickUp(deviceId: string, otherCallRef: string, otherPhoneNumber: string, autoAnswer: boolean = false): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.pickUp(deviceId, otherCallRef, otherPhoneNumber, autoAnswer);\r\n\t}\r\n\r\n /**\r\n * Performs an intrusion in the active call of a called user.\r\n * <p>\r\n * No parameter is required to invoke the intrusion: it only depends on the\r\n * current capability intrusion of the current device. It is based on the fact\r\n * that the current device must be in releasing state while calling a user which\r\n * is in busy call with another user, the current device has the intrusion\r\n * capability and the 2 users engaged in the call have the capability to allow\r\n * intrusion.\r\n * </p>\r\n * \r\n * @param deviceId the device from where the unpark request is requested.\r\n * @since O2G 2.4\r\n */\r\n\t public async intrusion(deviceId: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.intrusion(deviceId);\r\n\t}\r\n\r\n /**\r\n * UnParks a call from a target device.\r\n * \r\n * @param heldCallRef Reference of the held call.\r\n * @param deviceId the device from where the unpark request is requested.\r\n */\r\n\t public async unPark(deviceId: string, heldCallRef: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.unPark(deviceId, heldCallRef);\r\n\t}\r\n\r\n /**\r\n * Retrieves the specified user hunting group status.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getHuntingGroupStatus(loginName: string | null = null): Promise<HuntingGroupStatus | null> { \r\n\t\treturn await this._telephonyRest.getHuntingGroupStatus(loginName);\r\n\t}\r\n\r\n /**\r\n * Logs on the specified user in his current hunting group.\r\n * <p>\r\n * The user must be configured as member of a hunting group.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async huntingGroupLogOn(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.huntingGroupLogOn(loginName);\r\n\t}\r\n\r\n /**\r\n * Logs off the specified user from his current hunting group.\r\n * <p>\r\n * The user must be configured as member of a hunting group.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async huntingGroupLogOff(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.huntingGroupLogOff(loginName);\r\n\t}\r\n\r\n /**\r\n * Sets the specified user as member of an existing hunting group.\r\n * <p>\r\n * The request will fail if the hunting group does not exist. If the user\r\n * already belongs to the group, nothing is done and 'true' is returned.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param hgNumber the hunting group number\r\n * @param loginName the login name\r\n */\r\n\t public async addHuntingGroupMember(hgNumber: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.addHuntingGroupMember(hgNumber, loginName);\r\n\t}\r\n\r\n /**\r\n * Removes the specified user from an existing hunting group.\r\n * <p>\r\n * The request will fail if the hunting group does not exist. If the user does\r\n * not belong to the group, nothing is done and 'true' is returned.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param hgNumber the hunting group number\r\n * @param loginName the login name\r\n */\r\n\t public async deleteHuntingGroupMember(hgNumber: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.deleteHuntingGroupMember(hgNumber, loginName);\r\n\t}\r\n\r\n /**\r\n * Gets the list of hunting groups existing on the OXE node the specified user\r\n * belongs to.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async queryHuntingGroups(loginName: string | null = null): Promise<HuntingGroups | null> { \r\n\t\treturn await this._telephonyRest.queryHuntingGroups(loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the list of callback requests for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getCallbacks(loginName: string | null = null): Promise<Callback[] | null> { \r\n\t\treturn await this._telephonyRest.getCallbacks(loginName);\r\n\t}\r\n\r\n /**\r\n * Deletes all callback requests for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async deleteCallbacks(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.deleteCallbacks(loginName);\r\n\t}\r\n\r\n /**\r\n * Deletes the specified callback requests for the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callbackId the callback identifier\r\n * @param loginName the login name\r\n */\r\n\t public async deleteCallback(callbackId: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.deleteCallback(callbackId, loginName);\r\n\t}\r\n\r\n /**\r\n * Returns the current new message for the specified user.\r\n * <p>\r\n * As soon as a message is read, it is erased from OXE and cannot be read again.\r\n * The messages are retrieved in Last In First Out mode.\r\n * <p>\r\n * This method with return 'false' if all the messages have been\r\n * retrieved.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async getMiniMessage(loginName: string | null = null): Promise<MiniMessage | null> { \r\n\t\treturn await this._telephonyRest.getMiniMessage(loginName);\r\n\t}\r\n\r\n /**\r\n * Sends the specified mini message to the specified recipient.\r\n * \r\n * @param recipient the recipient of the mini message phone number\r\n * @param message the mini message text\r\n * <p>\r\n * If the session has been opened for a user, the\r\n * 'loginName' parameter is ignored, but it is mandatory\r\n * if the session has been opened by an administrator.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async sendMiniMessage(recipient: string, message: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.sendMiniMessage(recipient, message, loginName);\r\n\t}\r\n\r\n /**\r\n * Requests for call back from an idle device of the specified user.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param callee phone number of the called party for which a call back is\r\n * requested.\r\n * @param loginName the login name\r\n */\r\n\t public async requestCallback(callee: string, loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.requestCallback(callee, loginName);\r\n\t}\r\n\t\r\n /**\r\n * Asks a snapshot event on the specified user.\r\n * <p>\r\n * The event OnTelephonyState will contain the TelephonicState (calls[] and\r\n * deviceCapabilities[]). If a second request is asked since the previous one is\r\n * still in progress, it has no effect.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored.\r\n * \r\n * @param loginName the login name\r\n */\r\n\t public async requestSnapshot(loginName: string | null = null): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.requestSnapshot(loginName);\r\n\t}\r\n\r\n /**\r\n * This action acts as a \"flip/flop\" and has the same effect than pressing the key:\r\n * <ul>\r\n * <li>it activates or deactivates the microphone if the device has an outgoing or established call\r\n * <li>it activates or deactivates the interphony if the device is idle\r\n * <li>it has no effect if the device is ringing on incoming call\r\n * <ul><p>\r\n * This operation is done in blind mode: no state event is provided on the push but when the device returns to idle after a call, the microphone comes back in the active state.\r\n * \r\n * @param deviceId the device from where the unpark request is requested.\r\n */\r\n\t public async toggleInterphony(deviceId: string): Promise<boolean> { \r\n\t\treturn await this._telephonyRest.toggleInterphony(deviceId);\r\n\t}\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from \"../util/util-uri\";\r\nimport { SessionInfo } from '../types/common/o2gcommon-types';\r\n\r\nexport default class SessionsRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async open(applicationName: string): Promise<SessionInfo | null> {\r\n\r\n var params = { \"applicationName\" : applicationName }\r\n var httpContent = new HttpContent(JSON.stringify(params));\r\n\r\n return this.getResult(await RestService._httpClient.post(this._uri, httpContent));\r\n }\r\n\r\n public async close(): Promise<boolean> {\r\n var httpResponse = await RestService._httpClient.delete(this._uri);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async keepAlive(): Promise<boolean> {\r\n var httpResponse = await RestService._httpClient.post(UtilUri.appendPath(this._uri, \"keepalive\"));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport enum AccessMode {\r\n\r\n Public = 0,\r\n Private = 1\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport OverflowRoute from \"../../internal/types/routing/overflow-route\";\r\nimport { Destination } from \"./destination\";\r\n\r\n/**\r\n * OverflowCondition represents the possible condition a user can associate to an overflow.\r\n */\r\n export enum OverflowCondition {\r\n /**\r\n * Incoming calls are forwarded on the target if the user is busy.\r\n */\r\n BUSY = \"BUSY\",\r\n\r\n /**\r\n * Incoming calls are forwarded on the target if the user does not answer the call.\r\n */\r\n NO_ANSWER = \"NO_ANSWER\",\r\n\r\n /**\r\n * Incoming calls are forwarded on the target if the user is busy or if the user does not answer the call.\r\n */\r\n BUSY_OR_NO_ANSWER = \"BUSY_OR_NO_ANSWER\" \r\n}\r\n\r\n\r\n/**\r\n * Overflow represents an overflow the user has activated.\r\n */\r\n export class Overflow {\r\n private _destination!: Destination;\r\n private _condition: OverflowCondition | null = null;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {}\r\n\r\n /**\r\n * Returns this overflow destination.\r\n */\r\n public get destination(): Destination {\r\n return this._destination;\r\n }\r\n\r\n /**\r\n * Returns this overflow associated condition.\r\n */\r\n public get condition(): OverflowCondition | null {\r\n return this._condition;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(overflowRoute: OverflowRoute | null = null): Overflow {\r\n const result = new Overflow();\r\n\r\n if (overflowRoute) {\r\n if (overflowRoute.destinations.length === 1) {\r\n result._destination = Destination[overflowRoute.destinations[0].type as keyof typeof Destination];\r\n } else {\r\n result._destination = Destination.NONE;\r\n }\r\n\r\n result._condition = OverflowCondition[overflowRoute.overflowType as keyof typeof OverflowCondition];\r\n } else {\r\n result._condition = null;\r\n result._destination = Destination.NONE;\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n\r\n/**\r\n * Represents the possible operating modes of a CCD pilot.\r\n */\r\nexport enum PilotOperatingMode {\r\n /**\r\n * The pilot operates in normal (opened) mode.\r\n */\r\n NORMAL = 'NORMAL',\r\n\r\n /**\r\n * The pilot operates in closed mode.\r\n */\r\n CLOSED = 'CLOSED',\r\n\r\n /**\r\n * The pilot operates in forward mode.\r\n */\r\n FORWARD = 'FORWARD'\r\n}\r\n\r\n\r\n\r\n/**\r\n * Represents a transition in a CCD pilot calendar.\r\n */\r\nexport interface Transition {\r\n /**\r\n * The pilot rule number associated with this transition.\r\n */\r\n ruleNumber: number;\r\n\r\n /**\r\n * The mode in which the pilot is operating during this transition.\r\n */\r\n mode: PilotOperatingMode;\r\n\r\n /**\r\n * The start time of this transition during the day.\r\n */\r\n time: Transition.Time;\r\n}\r\n\r\nexport namespace Transition {\r\n /**\r\n * Represents the starting time of a transition in a pilot calendar.\r\n * Time is in 24-hour format.\r\n */\r\n export class Time {\r\n\r\n constructor(private _hour: number, private _minute: number) {}\r\n\r\n public get hour(): number {\r\n return this._hour;\r\n }\r\n\r\n public get minute(): number {\r\n return this._minute;\r\n }\r\n\r\n public toString(): string {\r\n const pad = (n: number) => n.toString().padStart(2, \"0\");\r\n return `${pad(this._hour)}:${pad(this._minute)}`; \r\n }\r\n\r\n static parse(value: string): Time {\r\n if (!value) throw new Error(`Invalid time format: null`);\r\n\r\n const [hourStr, minuteStr] = value.split(\":\");\r\n const hour = parseInt(hourStr, 10);\r\n const minute = parseInt(minuteStr, 10);\r\n\r\n if (\r\n isNaN(hour) || isNaN(minute) ||\r\n hour < 0 || hour > 23 ||\r\n minute < 0 || minute > 59\r\n ) {\r\n throw new Error(`Invalid time format: ${value}`);\r\n }\r\n\r\n return new Time(hour, minute);\r\n }\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport RsiRest from \"./internal/rest/rsi-rest\";\r\nimport {AdditionalDigitCollectionCriteria} from \"./types/rsi/add-digit-coll-criteria\";\r\nimport { RouteSession, RsiPoint } from \"./types/rsi/rsi-types\";\r\nimport { Tones } from \"./types/rsi/tones\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * RsiService provides access to th RSI (Routing Service Intelligence)\r\n * points features:\r\n * <ul>\r\n * <li>Makes route selection.</li>\r\n * <li>Makes digits collection.</li>\r\n * <li>Plays voice guides or tones.</li>\r\n * <li>Plays announcements (prompts and/or digits).</li>\r\n * </ul>\r\n * <p>\r\n * To be able to receive the RouteRequest from the OmniPCX Enterprise, the first\r\n * action is subscribe to rsi events and the second action is to enable the RSI\r\n * point.\r\n * <p>\r\n * Using this service requires having a <b>CONTACTCENTER_RSI</b> license.\r\n */\r\n export class Rsi extends EventEmitter {\r\n\r\n /**\r\n * Occurs when a data collection has ended.\r\n * @event\r\n */\r\n public static readonly ON_DIGIT_COLLECTED = \"OnDigitCollected\";\r\n\r\n /**\r\n * Raised from a RSI point when a tone generation is started.\r\n * @event\r\n */\r\n public static readonly ON_TONE_GENERATED_START = \"OnToneGeneratedStart\";\r\n\r\n /**\r\n * Raised from a RSI point when a tone generation is stopped.\r\n * @event\r\n */\r\n public static readonly ON_TONE_GENERATED_STOP = \"OnToneGeneratedStop\";\r\n\r\n /**\r\n * Raised from a Routing point to close a route session (routing crid is no longer valid).\r\n * @event\r\n */\r\n public static readonly ON_ROUTE_END = \"OnRouteEnd\";\r\n\r\n /**\r\n * Raised from a Routing point to request a route.\r\n * @event\r\n */\r\n public static readonly ON_ROUTE_REQUEST = \"OnRouteRequest\";\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _rsiRest: RsiRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, Rsi.ON_DIGIT_COLLECTED);\r\n eventRegistry.register(this, Rsi.ON_TONE_GENERATED_START);\r\n eventRegistry.register(this, Rsi.ON_TONE_GENERATED_STOP);\r\n eventRegistry.register(this, Rsi.ON_ROUTE_END);\r\n eventRegistry.register(this, Rsi.ON_ROUTE_REQUEST);\r\n }\r\n\r\n\r\n /**\r\n * Gets the configured Rsi points.\r\n */\r\n public async getRsiPoints(): Promise<RsiPoint[] | null> {\r\n return this._rsiRest.getRsiPoints();\r\n }\r\n\r\n /**\r\n * Enables the specified rsi point.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n */\r\n public async enableRsiPoint(rsiNumber: string): Promise<boolean> {\r\n return this._rsiRest.enableRsiPoint(rsiNumber);\r\n }\r\n\r\n /**\r\n * Disables the specified rsi point.\r\n * \r\n * @param rsiNumber the rsi point extension number.\r\n */\r\n public async disableRsiPoint(rsiNumber: string): Promise<boolean> {\r\n return this._rsiRest.disableRsiPoint(rsiNumber);\r\n }\r\n\r\n /**\r\n * Starts a digits collection for the specified rsi, on the specified call.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param callRef the call reference\r\n * @param numChars the optionnal number of digits to collect. The\r\n * digit collection is stopped when this number is\r\n * reached\r\n * @param flushChar the optional character used to stop the digit\r\n * collection when pressed.\r\n * @param timeout optional timeout in second. Stop the digit\r\n * collection after this time elapses.\r\n * @param additionalCriteria extension criteria used to collect digits\r\n * @see {@link ON_DIGIT_COLLECTED} event\r\n * @see {@link stopCollectDigits}\r\n */\r\n public async startCollectDigits(rsiNumber: string, callRef: string, numChars: number, flushChar: string | null = null, timeout: number | null = null, additionalCriteria: AdditionalDigitCollectionCriteria | null = null): Promise<boolean | null> {\r\n return this._rsiRest.startCollectDigits(rsiNumber, callRef, numChars, flushChar, timeout, additionalCriteria);\r\n }\r\n\r\n /**\r\n * Stops the specified digits collection.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param callCrid the digit collection identifier\r\n * @see {@link startCollectDigits}.\r\n */\r\n public async stopCollectDigits(rsiNumber: string, collCrid: string): Promise<boolean> {\r\n return this._rsiRest.stopCollectDigits(rsiNumber, collCrid);\r\n }\r\n\r\n /**\r\n * Plays the specified tone on the specified call.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param callRef the call reference\r\n * @param tone the tone to play\r\n * @param duration the duration the tone is played (in second)\r\n * @see {@link ON_TONE_GENERATED_START} event.\r\n * @see {@link cancelTone}.\r\n */\r\n public async playTone(rsiNumber: string, callRef: string, tone: Tones, duration: number): Promise<boolean> {\r\n return this._rsiRest.playTone(rsiNumber, callRef, tone, duration);\r\n }\r\n\r\n /**\r\n * Cancels playing a tone on the specified call.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param callRef the call reference\r\n * @see {@link ON_TONE_GENERATED_STOP} event.\r\n * @see {@link playTone}\r\n */\r\n public async cancelTone(rsiNumber: string, callRef: string): Promise<boolean> {\r\n return this._rsiRest.cancelTone(rsiNumber, callRef);\r\n }\r\n\r\n /**\r\n * Plays the specified voice guide on the specified call.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param callRef the call reference\r\n * @param guideNumber the voice guide number as defined in the OmniPcx\r\n * Enterprise\r\n * @param duration an optional duration for the voice guide in second.\r\n * @see {@link ON_TONE_GENERATED_START}\r\n */\r\n public async playVoiceGuide(rsiNumber: string, callRef: string, guideNumber: number, duration: number | null = null): Promise<boolean> {\r\n return this._rsiRest.playVoiceGuide(rsiNumber, callRef, guideNumber, duration);\r\n }\r\n\r\n /**\r\n * Ends a route session.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param routeCrid the routing session unique identifier\r\n * @see {@link ON_ROUTE_REQUEST} event.\r\n */\r\n public async routeEnd(rsiNumber: string, routeCrid: string): Promise<boolean> {\r\n return this._rsiRest.routeEnd(rsiNumber, routeCrid);\r\n }\r\n\r\n /**\r\n * Selects a route for the specified route session. \r\n * @param rsiNumber the rsi point extension number\r\n * @param routeCrid the routing session unique identifier\r\n * @param selectedRoute the selected route number\r\n * @param callingLine an optional calling line value that will be presented\r\n * to the selected route\r\n * @param associatedData the optional associated data to attach to the call\r\n * @param routeToVoiceMail 'true' if the selected route is the voice mail; 'false' otherwise\r\n * @see {@link ON_ROUTE_REQUEST} event.\r\n */\r\n public async routeSelect(rsiNumber: string, routeCrid: string, selectedRoute: string, callingLine: string | null = null, associatedData: string | null = null, routeToVoiceMail: boolean | null = null): Promise<boolean> {\r\n return this._rsiRest.routeSelect(rsiNumber, routeCrid, selectedRoute, callingLine, associatedData, routeToVoiceMail);\r\n }\r\n\r\n /**\r\n * Gets the list of existing route sessions for the specified rsi point.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n */\r\n public async getRouteSessions(rsiNumber: string): Promise<RouteSession[] | null> {\r\n return this._rsiRest.getRouteSessions(rsiNumber);\r\n }\r\n\r\n /**\r\n * Return the specified route session.\r\n * \r\n * @param rsiNumber the rsi point extension number\r\n * @param routeCrid the routing session unique identifier\r\n */\r\n public async getRouteSession(rsiNumber: string, routeCrid: string): Promise<RouteSession | null> {\r\n return this._rsiRest.getRouteSession(rsiNumber, routeCrid);\r\n }\r\n \r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport CommunicationLogRest from \"./internal/rest/comlog-rest\";\r\nimport {ComRecord} from \"./types/comlog/com-record\";\r\nimport {Page} from \"./types/comlog/page\";\r\nimport {QueryFilter} from \"./types/comlog/query-filter\";\r\nimport {QueryResult} from \"./types/comlog/query-result\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * The CommunicationLog service allows a user to retrieve his last communication history records and to manage them. Using this service requires\r\n * having a <b>TELEPHONY_ADVANCED</b> license.\r\n */\r\nexport class CommunicationLog extends EventEmitter {\r\n\r\n /**\r\n * Occurs when a new comlog entry has been created.\r\n * @event\r\n */\r\n public static readonly ON_COM_RECORD_CREATED = \"OnComRecordCreated\";\r\n\r\n /**\r\n * Occurs when one or more records have been modified.\r\n * @event\r\n */\r\n public static readonly ON_COM_RECORD_MODIFIED = \"OnComRecordModified\";\r\n\r\n /**\r\n * Occurs when one or more call log records have been deleted.\r\n * @see {@link deleteComRecords}, {@link deleteComRecord}, {@link deleteComRecordsById}.\r\n * @event\r\n */\r\n public static readonly ON_COM_RECORDS_DELETED = \"OnComRecordsDeleted\";\r\n\r\n /**\r\n * Occurs when one or more unanswered comlog records have been acknowledged.\r\n * @see {@link acknowledgeComRecords}, {@link acknowledgeComRecord}\r\n * @event\r\n */\r\n public static readonly ON_COM_RECORDS_ACK = \"OnComRecordsAck\";\r\n\r\n /**\r\n * Occurs when one or more unanswered comlog records have been unacknowledged.\r\n * @see {@link unacknowledgeComRecords}, {@link unacknowledgeComRecord}\r\n * @event\r\n */\r\n public static readonly ON_COM_RECORDS_UNACK = \"OnComRecordsUnAck\";\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _comLogRest: CommunicationLogRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, CommunicationLog.ON_COM_RECORD_CREATED);\r\n eventRegistry.register(this, CommunicationLog.ON_COM_RECORD_MODIFIED);\r\n eventRegistry.register(this, CommunicationLog.ON_COM_RECORDS_DELETED);\r\n eventRegistry.register(this, CommunicationLog.ON_COM_RECORDS_ACK);\r\n eventRegistry.register(this, CommunicationLog.ON_COM_RECORDS_UNACK);\r\n }\r\n\r\n /**\r\n * Gets the com records corresponding to the specified filter, using the\r\n * specified page, with a possible optimization.\r\n * <p>\r\n * If 'optimized' is used and set to 'true' the query returns the\r\n * full identity of a participant only the first time it occurs, when the same\r\n * participant appears in several records. When omitted this query returns the\r\n * records with no optimization.\r\n * <p>\r\n * 'page' parameter allows to query the communication log by page. The\r\n * {@link QueryResult} result contains the same parameters and the total number\r\n * of records retrieved by the query.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param filter the filter describing the query criterias\r\n * @param page the page description\r\n * @param optimized 'true' to activate optimization.\r\n * @param loginName the user login name\r\n */\r\n public async getComRecords(filter: QueryFilter | null = null, page: Page | null = null, optimized: boolean = false, loginName: string | null = null): Promise<QueryResult | null> {\r\n return await this._comLogRest.getComRecords(filter, page, optimized, loginName);\r\n }\r\n\r\n /**\r\n * Gets the specified com record.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordId the com record identifier\r\n * @param loginName the user login name\r\n */\r\n public async getComRecord(recordId: string, loginName: string | null = null): Promise<ComRecord | null> {\r\n return await this._comLogRest.getComRecord(recordId, loginName);\r\n }\r\n\r\n /**\r\n * Deletes the specified com record.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordId the com record identifier\r\n * @param loginName the user login name\r\n */\r\n public async deleteComRecord(recordId: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.deleteComRecord(recordId, loginName);\r\n }\r\n\r\n /**\r\n * Deletes the specified list of com records.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_DELETED} event is raised containing the list of the com records that have been deleted.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordIds the list of com records\r\n * @param loginName the user login name\r\n */\r\n public async deleteComRecordsById(recordIds: string[], loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.deleteComRecordsById(recordIds, loginName);\r\n }\r\n\r\n\r\n /**\r\n * Deletes the com records corresponding to the given filter.\r\n * <p>\r\n * When used, the 'filter' parameter defines the search criteria for the delete operation.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_DELETED} event is raised\r\n * containing the list of the com records that have been deleted.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param filter the filter describing the query criterias\r\n * @param loginName the user login name\r\n */\r\n public async deleteComRecords(filter: QueryFilter | null = null, loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.deleteComRecords(filter, loginName);\r\n }\r\n\r\n /**\r\n * Acknowledge the specified list of com records.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_ACK} event is raised containing the list of the com records that have been acknowledged.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName\" parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordIds the list of com records\r\n * @param loginName the user login name\r\n */\r\n public async acknowledgeComRecords(recordIds: string[], loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.acknowledgeComRecords(recordIds, loginName);\r\n }\r\n\r\n /**\r\n * Acknowledge the specified com record.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_ACK} event is raised containing the list of the com records that have been acknowledged.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordId the com record identifier\r\n * @param loginName the user login name\r\n */\r\n public async acknowledgeComRecord(recordId: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.acknowledgeComRecord(recordId, loginName);\r\n }\r\n\r\n\r\n /**\r\n * Unacknowledge the specified list of com records.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_UNACK} event is raised containing the list of the com records that have been acknowledged.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName\" parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordIds the list of com records\r\n * @param loginName the user login name\r\n */\r\n public async unacknowledgeComRecords(recordIds: string[], loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.unacknowledgeComRecords(recordIds, loginName);\r\n }\r\n\r\n /**\r\n * Unacknowledge the specified com record.\r\n * <p>\r\n * An {@link ON_COM_RECORDS_UNACK} event is raised containing the list of the com records that have been acknowledged.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param recordId the com record identifier\r\n * @param loginName the user login name\r\n */\r\n public async unacknowledgeComRecord(recordId: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._comLogRest.unacknowledgeComRecord(recordId, loginName);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n\r\nexport class O2GDestination {\r\n\r\n type!: string;\r\n number!: string;\r\n selected: boolean = false;\r\n \r\n public static createMobileDestination(active: boolean): O2GDestination {\r\n\r\n let result = new O2GDestination();\r\n result.type = \"MOBILE\";\r\n result.selected = active;\r\n return result;\r\n }\r\n\r\n\r\n public static createNumberDestination(number: string): O2GDestination {\r\n\r\n let result = new O2GDestination();\r\n result.type = \"NUMBER\";\r\n result.number = number;\r\n return result;\r\n }\r\n\r\n public static createVoiceMailDestination(): O2GDestination {\r\n\r\n let result = new O2GDestination();\r\n result.type = \"VOICEMAIL\";\r\n return result;\r\n }\r\n\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport { Option } from '../../types/comlog/option';\r\nimport {QueryResult} from '../../types/comlog/query-result';\r\nimport {ComRecord} from '../../types/comlog/com-record';\r\nimport {Page} from '../../types/comlog/page';\r\nimport {QueryFilter} from '../../types/comlog/query-filter';\r\nimport { Role } from '../../types/comlog/role';\r\nimport { O2GComHistoryRecord, O2GComHistoryRecords } from '../types/comlog/o2gcomlog-types';\r\n\r\n\r\nexport default class CommunicationLogRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getComRecords(filter: QueryFilter | null, page: Page | null, optimized: boolean, loginName: string | null): Promise<QueryResult | null> {\r\n\r\n var uriGet = this._uri;\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n if (filter) {\r\n if (filter.after) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"afterDate\", filter.after.toString());\r\n }\r\n if (filter.before) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"beforeDate\", filter.before.toString());\r\n }\r\n\r\n if (filter.options) {\r\n if (filter.options & Option.UNACKNOWLEDGED) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"unacknowledged\", \"true\");\r\n }\r\n\r\n if (filter.options & Option.UNANSWERED) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"unanswered\", \"true\");\r\n }\r\n }\r\n\r\n if (filter.role) {\r\n if (filter.role === Role.CALLEE) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"role\", \"CALLEE\");\r\n }\r\n else if (filter.role == Role.CALLER) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"role\", \"CALLER\");\r\n }\r\n }\r\n\r\n if (filter.callRef) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"comRef\", filter.callRef);\r\n }\r\n\r\n if (filter.remotePartyId) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"remotePartyId\", filter.remotePartyId);\r\n }\r\n }\r\n\r\n if (page) {\r\n if (AssertUtil.positive(page.offset, \"page.offset\") > 0) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"offset\", page.offset.toString());\r\n }\r\n\r\n if (AssertUtil.positive(page.limit, \"page.limit\") > 0) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"limit\", page.limit.toString());\r\n }\r\n }\r\n\r\n if (optimized) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"optimized\", \"true\");\r\n }\r\n\r\n\r\n const o2gComRecords = this.getResult<O2GComHistoryRecords>(await RestService._httpClient.get(uriGet));\r\n if (o2gComRecords) {\r\n\r\n return QueryResult.build(o2gComRecords);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getComRecord(recordId: string, loginName: string | null): Promise<ComRecord | null> {\r\n \r\n var uriGet = UtilUri.appendPath(this._uri, recordId);\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const o2gComRecord = this.getResult<O2GComHistoryRecord>(await RestService._httpClient.get(uriGet));\r\n if (o2gComRecord) {\r\n return ComRecord.build(o2gComRecord);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async deleteComRecord(recordId: string, loginName: string | null): Promise<boolean> {\r\n var uriDelete = UtilUri.appendPath(this._uri, recordId);\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteComRecords(filter: QueryFilter | null, loginName: string | null): Promise<boolean> {\r\n var uriDelete = this._uri;\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n if (filter) {\r\n if (filter.after) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"afterDate\", filter.after.toString());\r\n }\r\n if (filter.before) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"beforeDate\", filter.before.toString());\r\n }\r\n\r\n if (filter.options) {\r\n if (filter.options & Option.UNACKNOWLEDGED) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"unacknowledged\", \"true\");\r\n }\r\n\r\n if (filter.options & Option.UNANSWERED) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"unanswered\", \"true\");\r\n }\r\n }\r\n\r\n if (filter.role) {\r\n if (filter.role == Role.CALLEE) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"role\", \"CALLEE\");\r\n }\r\n else if (filter.role == Role.CALLER) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"role\", \"CALLER\");\r\n }\r\n }\r\n\r\n if (filter.callRef) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"comRef\", filter.callRef);\r\n }\r\n\r\n if (filter.remotePartyId) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"remotePartyId\", filter.remotePartyId);\r\n }\r\n }\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteComRecordsById(recordIds: string[], loginName: string | null): Promise<boolean> {\r\n\r\n var uriDelete = UtilUri.appendQuery(this._uri, \"recordIdList\", recordIds.join(','));\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n private async _ackOrUnAckComRecords(ack: string, recordIds: string[], loginName: string | null): Promise<boolean> {\r\n\r\n var uriPut = UtilUri.appendQuery(this._uri, \"acknowledge\", ack);\r\n if (loginName) {\r\n uriPut = UtilUri.appendQuery(uriPut, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.recordIds = recordIds;\r\n\r\n var json = JSON.stringify(req);\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async acknowledgeComRecords(recordIds: string[], loginName: string | null): Promise<boolean> {\r\n return this._ackOrUnAckComRecords(\"true\", recordIds, loginName);\r\n }\r\n\r\n public async acknowledgeComRecord(recordId: string, loginName: string | null): Promise<boolean> {\r\n return this._ackOrUnAckComRecords(\"true\", [recordId], loginName);\r\n }\r\n\r\n public async unacknowledgeComRecords(recordIds: string[], loginName: string | null): Promise<boolean> {\r\n return this._ackOrUnAckComRecords(\"false\", recordIds, loginName);\r\n }\r\n\r\n public async unacknowledgeComRecord(recordId: string, loginName: string | null): Promise<boolean> {\r\n return this._ackOrUnAckComRecords(\"false\", [recordId], loginName);\r\n }\r\n}","module.exports = require(\"inversify\");","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {DeviceKey} from \"./device-key\";\r\n\r\n/**\r\n * ProgrammableKey class represents a programmable key on an OmniPCX Enterprise device.\r\n */\r\nexport class ProgrammableKey extends DeviceKey {\r\n\r\n private _locked: boolean;\r\n\r\n /**\r\n * Construct a new ProgrammableKey with the specified parameters.\r\n * @param position the key position\r\n * @param number the associated number\r\n * @param mnemonic the key mnemonic\r\n * @param locked 'true' if the key is locked, 'false' otherwise\r\n */\r\n constructor(position: number, number: string, mnemonic: string | null = null, locked: boolean = false) {\r\n super(position, number, mnemonic);\r\n\r\n this._locked = locked;\r\n }\r\n\r\n /**\r\n * Return whether this key is locked.\r\n */\r\n public get locked(): boolean {\r\n return this._locked;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(pkey: any): ProgrammableKey {\r\n return new ProgrammableKey(pkey.position, pkey.number, pkey.mnemonic, pkey.locked);\r\n }\r\n}","/**\r\n * Copyright 2025 ALE International\r\n *\r\n * Licensed under the MIT License. You may obtain a copy of the License at:\r\n * https://opensource.org/licenses/MIT\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify, merge,\r\n * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\r\n * to whom the Software is furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all copies or\r\n * substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING\r\n * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport Application from \"./internal/o2g-application\";\r\nimport { Routing } from \"./o2g-routing\";\r\nimport { EventSummary } from \"./o2g-eventSummary\";\r\nimport { Directory } from \"./o2g-directory\";\r\nimport { Users } from \"./o2g-users\";\r\nimport { Telephony } from \"./o2g-telephony\";\r\nimport { CommunicationLog } from \"./o2g-comlog\";\r\nimport { Analytics } from \"./o2g-analytics\";\r\nimport { CallCenterAgent } from \"./o2g-cc-agent\";\r\nimport { CallCenterPilot } from \"./o2g-cc-pilot\";\r\nimport { Maintenance } from \"./o2g-maint\";\r\nimport { PbxManagement } from \"./o2g-pbx-mngt\";\r\nimport { PhoneSetProgramming } from \"./o2g-phone-set-prog\";\r\nimport { Messaging } from \"./o2g-messaging\";\r\nimport { containerInit } from \"./internal/util/injection-container\";\r\nimport { Subscription } from \"./subscription\";\r\nimport { TimeRange } from \"./types/analytics/time-range\";\r\nimport { TelFacility } from \"./types/analytics/tel-facility\";\r\nimport { CallType } from \"./types/analytics/call-type\";\r\nimport { IntrusionMode } from \"./types/cc-agent/intrusion-mode\";\r\nimport { OperatorType } from \"./types/cc-agent/operator-type\";\r\nimport { OperatorMainState } from \"./types/cc-agent/operator-main-state\";\r\nimport { Page } from \"./types/comlog/page\";\r\nimport { QueryFilter } from \"./types/comlog/query-filter\";\r\nimport { Reason } from \"./types/comlog/reason\";\r\nimport { Role } from \"./types/comlog/role\";\r\nimport { Criteria } from \"./types/directory/criteria\";\r\nimport { FilterItem } from \"./types/directory/filter-item\";\r\nimport { OperationFilter } from \"./types/directory/operation-filter\";\r\nimport { AttributeFilter } from \"./types/pbxmngt/attribute-filter\";\r\nimport { AttributeType } from \"./types/pbxmngt/attribute-type\";\r\nimport { Filter } from \"./types/pbxmngt/filter\";\r\nimport { Option } from './types/comlog/option';\r\nimport { PbxAttributeMap } from \"./types/pbxmngt/pbx-attr-map\";\r\nimport { PbxAttribute } from \"./types/pbxmngt/pbx-attribute\";\r\nimport { Pin } from \"./types/phoneset/pin\";\r\nimport { PinControl } from \"./types/phoneset/pin-control\";\r\nimport { ProgrammableKey } from \"./types/phoneset/programmable-key\";\r\nimport { SoftKey } from \"./types/phoneset/softkey\";\r\nimport { Destination } from \"./types/routing/destination\";\r\nimport { ForwardCondition } from \"./types/routing/forward\";\r\nimport { OverflowCondition } from \"./types/routing/overflow\";\r\nimport { AcrSkill } from \"./types/telephony/acr-skill\";\r\nimport { RecordingAction } from \"./types/telephony/RecordingAction\";\r\nimport {Logger} from './internal/util/logger';\r\nimport { UserManagement } from \"./o2g-user-mngt\";\r\nimport { CallCenterManagement } from \"./o2g-cc-mngt\";\r\nimport { Pilot } from \"./types/cc-mngt/pilot\";\r\nimport { PilotRule } from \"./types/cc-mngt/pilot-rule\";\r\n\r\n// o2g.ts\r\n\r\nexport class O2G {\r\n\r\n public static get O2G_ONCHANNEL_INFORMATION(): string {\r\n return Application.O2G_ONCHANNEL_INFORMATION;\r\n }\r\n\r\n private static _application: Application | null = null;\r\n private static _logger = Logger.create(\"O2G\");\r\n\r\n private static _routing: Routing | null = null;\r\n private static _eventSummary: EventSummary | null = null;\r\n private static _users: Users | null = null;\r\n private static _userManagement: UserManagement | null = null;\r\n private static _telephony: Telephony | null = null;\r\n private static _directory: Directory | null = null;\r\n private static _comlog: CommunicationLog | null = null;\r\n private static _analytics: Analytics | null = null;\r\n private static _callCenterAgent: CallCenterAgent | null = null;\r\n private static _callCenterPilot: CallCenterPilot | null = null;\r\n private static _callCenterManagement: CallCenterManagement | null = null;\r\n private static _maintenance: Maintenance | null = null;\r\n private static _pbxManagement: PbxManagement | null = null;\r\n private static _phoneSetProgramming: PhoneSetProgramming | null = null;\r\n private static _messaging: Messaging | null = null;\r\n\r\n static initialize(appName: string, host: Host, apiVersion: string = \"1.0\"): void {\r\n containerInit();\r\n if (this._application) {\r\n throw new Error(\"O2G has already been initialized.\");\r\n }\r\n this._application = new Application(appName, host, apiVersion);\r\n }\r\n\r\n static async login(loginName: string, password: string): Promise<boolean> {\r\n if (!this._application) throw new Error(\"Application not initialized.\");\r\n\r\n try {\r\n await this._application.login(loginName, password);\r\n\r\n this._routing = this._application.getRoutingService();\r\n this._eventSummary = this._application.getEventSummaryService();\r\n this._users = this._application.getUsersService();\r\n this._userManagement = this._application.getUserManagementService();\r\n this._telephony = this._application.getTelephonyService();\r\n this._directory = this._application.getDirectoryService();\r\n this._comlog = this._application.getCommunicationLogService();\r\n this._analytics = this._application.getAnalyticsService();\r\n this._callCenterAgent = this._application.getCallCenterAgentService();\r\n this._callCenterPilot = this._application.getCallCenterPilotService();\r\n this._callCenterManagement = this._application.getCallCenterManagementService();\r\n this._maintenance = this._application.getMaintenanceService();\r\n this._pbxManagement = this._application.getPbxManagementService();\r\n this._phoneSetProgramming = this._application.getPhoneSetProgrammingService();\r\n this._messaging = this._application.getMessagingService();\r\n\r\n return true;\r\n } \r\n catch (e) {\r\n this._logger.error(\"Unable to login\", e);\r\n return false;\r\n }\r\n }\r\n\r\n static async subscribe(subscription: Subscription): Promise<void> {\r\n if (!this._application) throw new Error(\"Application not initialized.\");\r\n await this._application.subscribe(subscription);\r\n }\r\n\r\n static async shutdown(): Promise<void> {\r\n if (this._application) {\r\n await this._application.close();\r\n this._application = null;\r\n }\r\n }\r\n\r\n static on(event: string, listener: (...args: any[]) => void) {\r\n if (this._application) {\r\n this._application.on(event, listener);\r\n }\r\n else {\r\n throw new Error(\"Application not initialized.\");\r\n }\r\n }\r\n\r\n static off(event: string, listener: (...args: any[]) => void) {\r\n if (this._application) {\r\n this._application.off(event, listener);\r\n }\r\n else {\r\n throw new Error(\"Application not initialized.\");\r\n }\r\n }\r\n\r\n // Getters\r\n public static get routing(): Routing {\r\n if (!this._routing) throw new Error(\"Routing service not available.\");\r\n return this._routing;\r\n }\r\n\r\n public static get eventSummary(): EventSummary {\r\n if (!this._eventSummary) throw new Error(\"EventSummary service not available.\");\r\n return this._eventSummary;\r\n }\r\n\r\n public static get users(): Users {\r\n if (!this._users) throw new Error(\"Users service not available.\");\r\n return this._users;\r\n }\r\n\r\n public static get userManagement(): UserManagement {\r\n if (!this._userManagement) throw new Error(\"UserManagement service not available.\");\r\n return this._userManagement;\r\n }\r\n\r\n public static get telephony(): Telephony {\r\n if (!this._telephony) throw new Error(\"Telephony service not available.\");\r\n return this._telephony;\r\n }\r\n\r\n public static get directory(): Directory {\r\n if (!this._directory) throw new Error(\"Directory service not available.\");\r\n return this._directory;\r\n }\r\n\r\n public static get comlog(): CommunicationLog {\r\n if (!this._comlog) throw new Error(\"CommunicationLog service not available.\");\r\n return this._comlog;\r\n }\r\n\r\n public static get analytics(): Analytics {\r\n if (!this._analytics) throw new Error(\"Analytics service not available.\");\r\n return this._analytics;\r\n }\r\n\r\n public static get callCenterAgent(): CallCenterAgent {\r\n if (!this._callCenterAgent) throw new Error(\"CallCenterAgent service not available.\");\r\n return this._callCenterAgent;\r\n }\r\n\r\n public static get callCenterPilot(): CallCenterPilot {\r\n if (!this._callCenterPilot) throw new Error(\"CallCenterPilot service not available.\");\r\n return this._callCenterPilot;\r\n }\r\n\r\n public static get callCenterManagement(): CallCenterManagement {\r\n if (!this._callCenterManagement) throw new Error(\"CallCenterManagement service not available.\");\r\n return this._callCenterManagement;\r\n }\r\n\r\n public static get maintenance(): Maintenance {\r\n if (!this._maintenance) throw new Error(\"Maintenance service not available.\");\r\n return this._maintenance;\r\n }\r\n\r\n public static get pbxManagement(): PbxManagement {\r\n if (!this._pbxManagement) throw new Error(\"PbxManagement service not available.\");\r\n return this._pbxManagement;\r\n }\r\n\r\n public static get phoneSetProgramming(): PhoneSetProgramming {\r\n if (!this._phoneSetProgramming) throw new Error(\"PhoneSetProgramming service not available.\");\r\n return this._phoneSetProgramming;\r\n }\r\n\r\n public static get messaging(): Messaging {\r\n if (!this._messaging) throw new Error(\"Messaging service not available.\");\r\n return this._messaging;\r\n }\r\n\r\n static readonly types = {\r\n Subscription,\r\n analytics: { TimeRange, CallType, TelFacility },\r\n ccAgent: { IntrusionMode, OperatorType, OperatorMainState },\r\n comlog: { Page, QueryFilter, Role, Option, Reason },\r\n ccManagement: { Pilot, PilotRule },\r\n directory: { Criteria, FilterItem, OperationFilter },\r\n pbxmngt: { PbxAttribute, PbxAttributeMap, AttributeType, AttributeFilter, Filter },\r\n phoneset: { PinControl, Pin, ProgrammableKey, SoftKey },\r\n routing: { Destination, ForwardCondition, OverflowCondition },\r\n telephony: { AcrSkill, RecordingAction }\r\n };\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { IntrusionMode } from \"./types/cc-agent/intrusion-mode\";\r\nimport CallCenterAgentRest from \"./internal/rest/ccAgent-rest\";\r\nimport { OperatorConfig, OperatorState } from \"./types/cc-agent/cc-agent-types\";\r\nimport { WithdrawReason } from \"./types/cc-agent/cc-agent-types\";\r\nimport EventEmitter from \"events\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * CallCenterAgent provides services for CCD operators. Using this\r\n * service requires having a <b>CONTACTCENTER_AGENT</b> license.\r\n */\r\nexport class CallCenterAgent extends EventEmitter {\r\n\r\n /**\r\n * Occurs when an agent state has changed.\r\n * @event\r\n */\r\n public static readonly ON_AGENT_STATE_CHANGED = \"OnAgentStateChanged\";\r\n\r\n\r\n /**\r\n * Occurs when when CCD agent skills is modified: one or several skills has been activate or deactivate.\r\n * @event\r\n */\r\n public static readonly ON_AGENT_SKILL_CHANGED = \"OnAgentSkillChanged\";\r\n\r\n /**\r\n * Occurs when an agent request help from his supervisor.\r\n * @see {@link requestPermanentListening}, {@link requestSupervisorHelp}\r\n * @event\r\n */\r\n public static readonly ON_SUPERVISOR_HELP_REQUESTED = \"OnSupervisorHelpRequested\";\r\n\r\n /**\r\n * Occurs when an agent has requested the assistance of his supervisor and when the request is canceled by the agent \r\n * or when the request is rejected by the supervisor.\r\n * @see {@link cancelSupervisorHelpRequest}, {@link rejectAgentHelpRequest}\r\n * @event\r\n */\r\n public static readonly ON_SUPERVISOR_HELP_CANCELLED = \"OnSupervisorHelpCancelled\"\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _ccAgentRest: CallCenterAgentRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, CallCenterAgent.ON_AGENT_STATE_CHANGED);\r\n eventRegistry.register(this, CallCenterAgent.ON_AGENT_SKILL_CHANGED);\r\n eventRegistry.register(this, CallCenterAgent.ON_SUPERVISOR_HELP_REQUESTED);\r\n eventRegistry.register(this, CallCenterAgent.ON_SUPERVISOR_HELP_CANCELLED);\r\n }\r\n\r\n\r\n /**\r\n * Gets the operator configuration.\r\n * @param loginName the operator login name\r\n * @returns \r\n */\r\n public async getConfiguration(loginName: string | null = null): Promise<OperatorConfig | null> { \r\n\t\treturn await this._ccAgentRest.getConfiguration(loginName);\r\n\t}\r\n\r\n /**\r\n * Gets the specified agent or supervisor state.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the operator login name\r\n */\r\n public async getState(loginName: string | null = null): Promise<OperatorState | null> { \r\n\t\treturn await this._ccAgentRest.getState(loginName);\r\n\t}\r\n\r\n /**\r\n * Logon an agent or a supervisor.\r\n * <p>\r\n * For a Supervisor, if the 'pgNumber' is omitted, the supervisor is logged on out off group.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param proAcdNumber the pro-acd device number\r\n * @param pgNumber the agent processing group number\r\n * @param headset activate the headset mode\r\n * @param loginName the ccd operator login name.\r\n */\r\n public async logon(proAcdNumber: string, pgNumber: string | null = null, headset = false, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.logon(proAcdNumber, pgNumber, headset, loginName);\r\n }\r\n\r\n /**\r\n * Logoff an agent or a supervisor.\r\n * <p>This method does nothing an returns 'true\" if the agent or the supervisor is already logged off.\r\n * \r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the ccd operator login name.\r\n */\r\n public async logoff(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.logoff(loginName);\r\n }\r\n\r\n /**\r\n * Enters in a agent group. Only for a supervisor.\r\n * <p>\r\n * This method is used by a supervisor to enter an agent group when it is in\r\n * pre-assigned state (logged but not in an agent group).\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param pgNumber the agent processing group number\r\n * @param loginName the supervisor login name\r\n */\r\n public async enter(pgNumber: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.enter(pgNumber, loginName);\r\n }\r\n\r\n /**\r\n * Exits from an agent group. Only for a supervisor.\r\n * <p>\r\n * This method is used by a supervisor to leave an agent group an go back in\r\n * pre-assigned state (logged but not in an agent group).\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the supervisor login name\r\n */\r\n public async exit(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.exit(loginName);\r\n }\r\n\r\n /**\r\n * Puts the specified agent in wrapup.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the agent login name\r\n */\r\n public async setWrapup(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.setWrapup(loginName);\r\n }\r\n\r\n /**\r\n * Puts the specified agent in ready state.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the agent login name\r\n */\r\n public async setReady(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.setReady(loginName);\r\n }\r\n \r\n /**\r\n * Puts the specified agent in pause.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the agent login name\r\n */\r\n public async setPause(loginName: string | null = null) {\r\n return await this._ccAgentRest.setPause(loginName);\r\n }\r\n \r\n /**\r\n * Requests to listen to the agent by a supervisor.\r\n * <p>\r\n * On success, an {@link ON_SUPERVISOR_HELP_REQUESTED} event is raised. for both the agent and the supervisor.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param agentNumber the listened agent number\r\n * @param loginName the supervisor login name\r\n */\r\n public async requestPermanentListening(agentNumber: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.requestPermanentListening(agentNumber, loginName);\r\n }\r\n \r\n\r\n /**\r\n * Cancel a permanent listening by a supervisor.\r\n * <p>\r\n * On success, an {@link ON_SUPERVISOR_HELP_REQUESTED} event is raised. for both the agent and the supervisor.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @param loginName the supervisor login name\r\n */\r\n public async cancelPermanentListening(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.cancelPermanentListening(loginName);\r\n }\r\n\r\n /**\r\n * Requests intrusion in a ccd call.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param agentNumber the extension number of the ccd agent who answers the\r\n * ccd call\r\n * @param intrusionMode the intrusion mode\r\n * @param loginName the supervisor login name\r\n */\r\n public async requestIntrusion(agentNumber: string, intrusionMode = IntrusionMode.NORMAL, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.requestIntrusion(agentNumber, intrusionMode, loginName);\r\n }\r\n \r\n /**\r\n * Changes the intrusion mode.\r\n * <p>\r\n * Calling this method allows to change the intrusion mode, or to cancel an intrusion. To cancel an intrusion, the application must pass the current mode\r\n * in the 'newIntrusionMode' parameter.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param newIntrusionMode the new intrusion mode\r\n * @param loginName the supervisor login name\r\n */\r\n public async changeIntrusionMode(newIntrusionMode: IntrusionMode, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.changeIntrusionMode(newIntrusionMode, loginName);\r\n }\r\n \r\n /**\r\n * Requests help of the supervisor.\r\n * <p>\r\n * On success, an {@link ON_SUPERVISOR_HELP_REQUESTED} event is raised for both the agent and supervisor.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param loginName the agent login name\r\n */\r\n public async requestSupervisorHelp(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.requestSupervisorHelp(loginName);\r\n }\r\n \r\n /**\r\n * Rejects an help request from an agent.\r\n * <p>\r\n * This method is invoked by a supervisor when he reject an help request from an agent. On success, an {@link ON_SUPERVISOR_HELP_CANCELLED} event is raised.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param agentNumber the extension number of the agent who has requested help\r\n * @param loginName the supervisor login name\r\n */\r\n public async rejectAgentHelpRequest(agentNumber: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.rejectAgentHelpRequest(agentNumber, loginName);\r\n }\r\n \r\n /**\r\n * Cancels a supervisor help request.\r\n * <p>\r\n * This method is invoked by an agent when he want to cancel an help request. On success, an {@link ON_SUPERVISOR_HELP_CANCELLED} event is raised.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param supervisorNumber the requested supervisor extension number\r\n * @param loginName the agent login name\r\n */\r\n public async cancelSupervisorHelpRequest(supervisorNumber: string, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.cancelSupervisorHelpRequest(supervisorNumber, loginName);\r\n }\r\n \r\n /**\r\n * Asks a snapshot event to receive an {@link ON_AGENT_STATE_CHANGED} event.\r\n * <p>\r\n * The {@link ON_AGENT_STATE_CHANGED} event contain the operator {@link OperatorState} object. If a second\r\n * request is asked since the previous one is still in progress, it has no effect.\r\n * <p>\r\n * If an administrator invokes this method with loginName=null, the snapshot event request is done for all the agents. The event processing can\r\n * be long depending on the number of users.\r\n * \r\n * @param loginName the agent login name\r\n */\r\n public async requestSnapshot(loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.requestSnapshot(loginName);\r\n }\r\n \r\n /**\r\n * Activates the specified skills.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * <p>\r\n * This method doesn't control the skills number. If a skill number is invalid\r\n * (not assigned to the operator), it is ignored and the method returns 'true'.\r\n * \r\n * @param skills the list of skills to activate.\r\n * @param loginName the agent login name\r\n */\r\n public async activateSkills(skillNumbers: number[], loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.activateSkills(skillNumbers, loginName);\r\n }\r\n \r\n /**\r\n * Deactivates the specified skills.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * <p>\r\n * This method doesn't control the skills number. If a skill number is invalid\r\n * (not assigned to the operator), it is ignored and the method returns 'true'.\r\n * \r\n * @param skills the list of skills to activate.\r\n * @param loginName the agent login name\r\n */\r\n public async deactivateSkills(skillNumbers: number[], loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.deactivateSkills(skillNumbers, loginName);\r\n }\r\n \r\n /**\r\n * Returns the list of withdraw reason for the specified processing group.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * \r\n * @param pgNumber the agent processing group number\r\n * @param loginName the agent login name\r\n */\r\n public async getWithdrawReasons(pgNumber: string, loginName: string | null = null): Promise<WithdrawReason[] | null> {\r\n return await this._ccAgentRest.getWithdrawReasons(pgNumber, loginName);\r\n } \r\n\r\n\r\n /**\r\n * Withdraws an agent with the specified reason.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is ignored, but it is mandatory if the session has been opened by an administrator.\r\n * @see {@link getWithdrawReasons}\r\n * \r\n * @param reason the withdraw reason\r\n * @param loginName the agent login name\r\n */\r\n public async setWithdraw(reason: WithdrawReason, loginName: string | null = null): Promise<boolean> {\r\n return await this._ccAgentRest.setWithdraw(reason, loginName);\r\n }\r\n \r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * OperatorMainState represents the login, logoff status of a CCD operator.\r\n */\r\nexport enum OperatorMainState {\r\n \r\n /**\r\n * The O2G server is unable to get the operator main state.\r\n */\r\n UNKNOWN = \"UNKNOWN\",\r\n\r\n /**\r\n * The operator is logged on a pro-acd set.\r\n */\r\n LOG_ON = \"LOG_ON\",\r\n\r\n /**\r\n * The operator is logged off.\r\n */\r\n LOG_OFF = \"LOG_OFF\",\r\n\r\n /**\r\n * Error status.\r\n */\r\n ERROR = \"ERROR\"\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GRoutingState, PresentationRoute } from \"../../internal/types/routing/o2grouting-types\";\r\nimport {Forward} from \"./forward\";\r\nimport {Overflow} from \"./overflow\";\r\nimport { DndState } from \"./routing-types\";\r\n\r\n/**\r\n * RoutingState represente a user routing state. A routing state is\r\n * composed of four elements:\r\n * <table>\r\n * <caption>Routing state elements</caption>\r\n * <tr>\r\n * <td>Remote extension activation</td>\r\n * <td>When the user is configured with a remote extension, he has the\r\n * possibility to activate or deactivate this remote extension. when the remote\r\n * extension is de-activated, call are not presented on the mobile device.</td>\r\n * </tr>\r\n * <tr>\r\n * <td>Forward</td>\r\n * <td>The user can configure a forward, on his voice mail if any or on any\r\n * other number (depending on the cOmniPCX Enterprise configuration).</td>\r\n * </tr>\r\n * <tr>\r\n * <td>Overflow</td>\r\n * <td>The user can configure an overflow on his voice mail.\r\n * If a forward is configured, it is considered prior the overflow.</td>\r\n * </tr>\r\n * <tr>\r\n * <td>Do Not Disturb</td>\r\n * <td>When Do Not Disturb (DND) is activated, call are not presented to the\r\n * user.</td>\r\n * </tr>\r\n * \r\n * </table>\r\n */\r\nexport class RoutingState {\r\n\r\n private _dndState!: DndState;\r\n private _forward!: Forward;\r\n private _overflow!: Overflow;\r\n private _remoteExtensionActivated!: boolean;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * Return the do not disturb state.\r\n */\r\n public get dndState(): DndState {\r\n return this._dndState;\r\n }\r\n\r\n /**\r\n * Returns the forward.\r\n */\r\n public get forward(): Forward {\r\n return this._forward;\r\n }\r\n\r\n /**\r\n * Returns the overflow.\r\n */\r\n public get overflow(): Overflow {\r\n return this._overflow;\r\n }\r\n\r\n /**\r\n * Returns whether the routing on remote extension is activated.\r\n */\r\n public get remoteExtensionActivated(): boolean {\r\n return this._remoteExtensionActivated\r\n }\r\n\r\n\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(routingState: O2GRoutingState) {\r\n\r\n let result: RoutingState = new RoutingState();\r\n\r\n result._dndState = routingState.dndState;\r\n\r\n if (routingState.forwardRoutes && (routingState.forwardRoutes.length > 0)) {\r\n result._forward = Forward.build(routingState.forwardRoutes[0]);\r\n }\r\n else {\r\n result._forward = Forward.build();\r\n }\r\n\r\n if (routingState.overflowRoutes && (routingState.overflowRoutes.length > 0)) {\r\n result._overflow = Overflow.build(routingState.overflowRoutes[0]);\r\n }\r\n else {\r\n result._overflow = Overflow.build();\r\n }\r\n\r\n result._remoteExtensionActivated = this.getRemoteExtensionActivation(routingState.presentationRoutes);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n private static getRemoteExtensionActivation(presentationRoutes: PresentationRoute[]): boolean {\r\n if (presentationRoutes && (presentationRoutes.length > 0)) {\r\n\r\n for (const presentationRoute of presentationRoutes) {\r\n \r\n var mobileDestination = presentationRoute.destinations.find(destination => destination.type === \"MOBILE\");\r\n if (mobileDestination && mobileDestination.selected) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n// model.ts\r\n\r\nimport { AttributeType } from \"./attribute-type\";\r\nimport { O2GAttributeModel, O2GObjectModel } from \"../../internal/types/pbxmngt/o2gpbxmngt-types\";\r\n\r\n/* ---------------------------------------------\r\n * OctetStringLength: Length constraints for byte strings\r\n * --------------------------------------------- */\r\nexport class OctetStringLength {\r\n private constructor(\r\n private readonly _min: number,\r\n private readonly _max: number\r\n ) {}\r\n\r\n public get min(): number {\r\n return this._min;\r\n }\r\n\r\n public get max(): number {\r\n return this._max;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static parseLengthValue(value: string | null | undefined): OctetStringLength | null {\r\n if (!value) return null;\r\n\r\n const values = value.split(\"..\").map(v => parseInt(v));\r\n if (values.length === 2 && !isNaN(values[0]) && !isNaN(values[1])) {\r\n return new OctetStringLength(values[0], values[1]);\r\n } else if (values.length === 1 && !isNaN(values[0])) {\r\n return new OctetStringLength(0, values[0]);\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\n/* ---------------------------------------------\r\n * ModelAttribute: Represents an attribute in a model\r\n * --------------------------------------------- */\r\nexport class ModelAttribute {\r\n private _name!: string;\r\n private _mandatory!: boolean;\r\n private _multiValue!: boolean;\r\n private _allowedValues!: string[];\r\n private _octetStringLength!: OctetStringLength | null;\r\n private _defaultValue!: string;\r\n private _filtering!: boolean;\r\n private _usedWhen!: string;\r\n private _type!: AttributeType;\r\n\r\n constructor() {}\r\n\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n public get mandatory(): boolean {\r\n return this._mandatory;\r\n }\r\n\r\n public get type(): AttributeType {\r\n return this._type;\r\n }\r\n\r\n public get multiValue(): boolean {\r\n return this._multiValue;\r\n }\r\n\r\n public get allowedValues(): string[] {\r\n return this._allowedValues;\r\n }\r\n\r\n public get octetStringLength(): OctetStringLength | null {\r\n return this._octetStringLength;\r\n }\r\n\r\n public get defaultValue(): string {\r\n return this._defaultValue;\r\n }\r\n\r\n public get filtering(): boolean {\r\n return this._filtering;\r\n }\r\n\r\n public get usedWhen(): string {\r\n return this._usedWhen;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(attr: O2GAttributeModel): ModelAttribute {\r\n const result = new ModelAttribute();\r\n result._name = attr.name;\r\n result._mandatory = attr.mandatory;\r\n result._multiValue = attr.multiValue;\r\n result._allowedValues = attr.allowedValues;\r\n result._octetStringLength = OctetStringLength.parseLengthValue(attr.lengthValue);\r\n result._defaultValue = attr.defaultValue;\r\n result._filtering = attr.filtering;\r\n result._usedWhen = attr.usedWhen;\r\n result._type = AttributeType[attr.typeValue as keyof typeof AttributeType];\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/* ---------------------------------------------\r\n * Model: Represents a full object model\r\n * --------------------------------------------- */\r\nexport class Model {\r\n private _name!: string;\r\n private _hidden!: boolean;\r\n private _canCreate!: boolean;\r\n private _canDelete!: boolean;\r\n private _canSet!: boolean;\r\n private _canGet!: boolean;\r\n private _otherActions!: string[];\r\n private _attributes!: Map<string, ModelAttribute>;\r\n private _children!: Map<string, Model>;\r\n\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n public get hidden(): boolean {\r\n return this._hidden;\r\n }\r\n\r\n public get canCreate(): boolean {\r\n return this._canCreate;\r\n }\r\n\r\n public get canDelete(): boolean {\r\n return this._canDelete;\r\n }\r\n\r\n public get canSet(): boolean {\r\n return this._canSet;\r\n }\r\n\r\n public get canGet(): boolean {\r\n return this._canGet;\r\n }\r\n\r\n public get otherActions(): string[] {\r\n return this._otherActions;\r\n }\r\n\r\n public attribute(attrName: string): ModelAttribute | undefined {\r\n return this._attributes.get(attrName);\r\n }\r\n\r\n public child(name: string): Model | undefined {\r\n return this._children.get(name);\r\n }\r\n\r\n public getMandatoryAttributes(): ModelAttribute[] {\r\n return Array.from(this._attributes.values()).filter(attr => attr.mandatory);\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gObjModel: O2GObjectModel): Model {\r\n const children = new Map<string, Model>();\r\n o2gObjModel.objects?.forEach(child => {\r\n const model = Model.build(child);\r\n children.set(model.name, model);\r\n });\r\n\r\n const attributes = new Map<string, ModelAttribute>();\r\n o2gObjModel.attributes?.forEach(attr => {\r\n attributes.set(attr.name, ModelAttribute.build(attr));\r\n });\r\n\r\n const model = new Model();\r\n model._name = o2gObjModel.objectName;\r\n model._hidden = o2gObjModel.hidden;\r\n model._canCreate = o2gObjModel.create;\r\n model._canDelete = o2gObjModel.delete;\r\n model._canSet = o2gObjModel.set;\r\n model._canGet = o2gObjModel.get;\r\n model._otherActions = o2gObjModel.otherActions;\r\n model._attributes = attributes;\r\n model._children = children;\r\n\r\n return model;\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport os from 'os';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nexport default class FileUtil {\r\n\r\n static getTempFolder(): string {\r\n return os.tmpdir();\r\n }\r\n\r\n static getRandomFilename(extension: string | null) : string {\r\n\r\n if (extension) {\r\n return `${Date.now()}-${uuidv4()}${extension}`;\r\n }\r\n else {\r\n return `${Date.now()}-${uuidv4()}`;\r\n }\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GCharging, O2GChargingResult } from \"../../internal/types/analytics/o2ganalytics-types\";\r\nimport {Charging} from \"./charging\";\r\nimport {TimeRange} from \"./time-range\";\r\n\r\n/**\r\n * ChargingResult class represents the result of a charging query to the OmniPCX Enterprise.\r\n * The query can be done from a list of {@link ChargingFile}, or using a {@link TimeRange} to specified the time interval.\r\n * @see {@link Analytics.getChargingsFromFiles} and {@link Analytics.getChargingsFromFilter}\r\n */\r\n export class ChargingResult {\r\n\r\n private _chargings!: Charging[];\r\n private _chargingFileCount!: number;\r\n private _totalTicketCount!: number;\r\n private _valuableTicketCount!: number;\r\n private _range!: TimeRange;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n }\r\n\r\n\r\n /**\r\n * Returns the list of charging elements.\r\n */\r\n public get chargings(): Charging[] {\r\n return this._chargings;\r\n }\r\n\r\n /**\r\n * Returns the range that has been specified to query this result.\r\n */\r\n public get range(): TimeRange {\r\n return this._range;\r\n }\r\n\r\n /**\r\n * Returns the number of analysed charging files in the OmniPCX Enterprise.\r\n */\r\n public get count(): number {\r\n return this._chargingFileCount;\r\n }\r\n\r\n /**\r\n * Returns the total number of analysed tickets.\r\n */\r\n public get totalTicketCount(): number {\r\n return this._totalTicketCount;\r\n }\r\n\r\n /**\r\n * Returns the total number of valuable tickets; tickets with a non zero cost.\r\n */\r\n public get valuableTicketCount(): number {\r\n return this._valuableTicketCount;\r\n }\r\n\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gChargingResult: O2GChargingResult, range: TimeRange | null = null): ChargingResult {\r\n\r\n let result = new ChargingResult();\r\n \r\n result._chargings = o2gChargingResult.chargings.map((c: O2GCharging) => Charging.build(c));\r\n\r\n result._chargingFileCount = o2gChargingResult.nbChargingFiles;\r\n result._totalTicketCount = o2gChargingResult.totalTicketNb;\r\n result._valuableTicketCount = o2gChargingResult.valuableTicketNb;\r\n \r\n if (range) {\r\n result._range = range;\r\n }\r\n\r\n return result;\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport {Model} from '../../types/pbxmngt/model';\r\nimport {PbxObject} from '../../types/pbxmngt/pbx-object';\r\nimport {PbxAttribute} from '../../types/pbxmngt/pbx-attribute';\r\nimport { Pbx } from '../../types/pbxmngt/pbxmngt-types';\r\nimport { O2GObjectModel, O2GPbxAttribute } from '../types/pbxmngt/o2gpbxmngt-types';\r\nimport { O2GPbxObject } from '../types/pbxmngt/o2gpbxmngt-types';\r\nimport { O2GPbxList } from '../types/pbxmngt/o2gpbxmngt-types';\r\nimport { O2GPbxObjectIds } from '../types/pbxmngt/o2gpbxmngt-types';\r\nimport { Filter } from '../../types/pbxmngt/filter';\r\n\r\nexport default class PbxManagementRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getPbxs(): Promise<Array<number> | null> {\r\n\r\n const pbxs: O2GPbxList | null = this.getResult(await RestService._httpClient.get(this._uri));\r\n if (pbxs) {\r\n\r\n return pbxs.nodeIds.map(e => parseInt(e));\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getPbx(nodeId: number): Promise<Pbx | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.positive(nodeId, \"nodeId\").toString());\r\n return this.getResult(await RestService._httpClient.get(uriGet)); \r\n }\r\n\r\n public async getObjectModel(nodeId: number, objectName: string | null): Promise<Model | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.positive(nodeId, \"nodeId\").toString(), \"model\");\r\n if (objectName) {\r\n uriGet = UtilUri.appendPath(uriGet, objectName);\r\n }\r\n\r\n const o2gObjectModel = this.getResult<O2GObjectModel>(await RestService._httpClient.get(uriGet))\r\n if (o2gObjectModel) {\r\n return Model.build(o2gObjectModel);\r\n \r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getNodeObject(nodeId: number): Promise<PbxObject | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.positive(nodeId, \"nodeId\").toString(), \"instances\");\r\n\r\n const o2GPbxObject = this.getResult<O2GPbxObject>(await RestService._httpClient.get(uriGet))\r\n if (o2GPbxObject) {\r\n return PbxObject.build(o2GPbxObject);\r\n \r\n }\r\n else {\r\n return null;\r\n }\r\n\r\n }\r\n\r\n public async getObject(nodeId: number, objectInstanceDefinition: string, objectId: string, attributes: string | PbxAttribute[] | null): Promise<PbxObject | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"instances\",\r\n AssertUtil.notNullOrEmpty(objectInstanceDefinition, \"objectInstanceDefinition\"),\r\n AssertUtil.notNullOrEmpty(objectId, \"objectId\"));\r\n\r\n if (attributes) {\r\n if (Array.isArray(attributes)) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"attributes\", attributes.join());\r\n }\r\n else {\r\n uriGet = UtilUri.appendQuery(uriGet, \"attributes\", attributes);\r\n }\r\n }\r\n\r\n const o2GPbxObject = this.getResult<O2GPbxObject>(await RestService._httpClient.get(uriGet))\r\n if (o2GPbxObject) {\r\n return PbxObject.build(o2GPbxObject);\r\n \r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getObjectInstances(nodeId: number, objectInstanceDefinition: string, filter: string|Filter|null): Promise<string[] | null> {\r\n \r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"instances\",\r\n AssertUtil.notNullOrEmpty(objectInstanceDefinition, \"objectInstanceDefinition\"))\r\n\r\n if (filter) {\r\n if (typeof filter == 'object') {\r\n // Considered as a Filter object\r\n uriGet = UtilUri.appendQuery(uriGet, \"filter\", filter.value);\r\n }\r\n else {\r\n uriGet = UtilUri.appendQuery(uriGet, \"filter\", filter);\r\n }\r\n }\r\n\r\n const objectIds = this.getResult<O2GPbxObjectIds>(await RestService._httpClient.get(uriGet))\r\n if (objectIds && Array.isArray(objectIds.objectIds)) {\r\n return objectIds.objectIds;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async setObject(nodeId: number, objectInstanceDefinition: string, objectId: string, attributes: PbxAttribute[]): Promise<boolean> {\r\n\r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"instances\",\r\n AssertUtil.notNullOrEmpty(objectInstanceDefinition, \"objectInstanceDefinition\"),\r\n AssertUtil.notNullOrEmpty(objectId, \"objectId\"));\r\n\r\n let o2GPbxAttributeList: Array<O2GPbxAttribute> = new Array<O2GPbxAttribute>();\r\n attributes.forEach(a => o2GPbxAttributeList.push(...PbxAttribute.from(a)));\r\n \r\n let json = JSON.stringify({\r\n \"attributes\": o2GPbxAttributeList\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async createObject(nodeId: number, objectInstanceDefinition: string, attributes: PbxAttribute[]): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"instances\",\r\n AssertUtil.notNullOrEmpty(objectInstanceDefinition, \"objectInstanceDefinition\"));\r\n\r\n let o2GPbxAttributeList: Array<O2GPbxAttribute> = new Array<O2GPbxAttribute>();\r\n attributes.forEach(a => o2GPbxAttributeList.push(...PbxAttribute.from(a)));\r\n \r\n let json = JSON.stringify({\r\n \"attributes\": o2GPbxAttributeList\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async deleteObject(nodeId: number, objectInstanceDefinition: string, objectId: string, forceDelete: boolean): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.positive(nodeId, \"nodeId\").toString(), \r\n \"instances\",\r\n AssertUtil.notNullOrEmpty(objectInstanceDefinition, \"objectInstanceDefinition\"),\r\n AssertUtil.notNullOrEmpty(objectId, \"objectId\"));\r\n\r\n if (forceDelete) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"force\");\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport 'reflect-metadata';\r\nimport { Container } from 'inversify';\r\nimport { EventSink, IEventSink } from '../events/event-dispatcher';\r\n\r\nexport const TYPES = {\r\n EventSink: Symbol.for('EventSink'),\r\n};\r\n\r\nconst container = new Container();\r\n\r\nexport function containerInit(): void {\r\n container.bind<IEventSink>(TYPES.EventSink).to(EventSink).inSingletonScope();\r\n}\r\n\r\nexport { container };","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport MaintenanceRest from \"./internal/rest/maint-rest\";\r\nimport { SystemStatus } from \"./types/maint/maint-types\";\r\nimport { OnCtiLinkDown, OnCtiLinkUp, OnPbxLoaded } from \"./types/maint/maint-events\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\nfunction nodeIdAdapter<T extends { eventName: string; nodeId: number }>(raw: any): T {\r\n return {\r\n ...raw, // keep all existing fields as-is\r\n nodeId: Number(raw.nodeId), // only override nodeId\r\n } as T;\r\n}\r\n\r\n/**\r\n * The MaintenanceService allows to retrieve information about the\r\n * system state, in particular information on the pbx nodes and their connection\r\n * state. Informations about license are also provided per item: total allocated\r\n * licenses, numbers of current used and expiration date.\r\n */\r\n export class Maintenance extends EventEmitter {\r\n\r\n\t/**\r\n\t * Occurs when a CTI link is down. \r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_CTI_LINK_DOWN = \"OnCtiLinkDown\";\r\n\t\r\n\t/**\r\n\t * Occurs when a CTI link is up. \r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_CTI_LINK_UP = \"OnCtiLinkUp\";\r\n\t\r\n\t/**\r\n\t * Occurs when datas are fully loaded from an OmniPCX Enterprise node. \r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_PBX_LOADED = \"OnPbxLoaded\";\r\n\r\n\t/**\r\n\t * Occurs when when the license file will soon expire or has recently expired. \r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_LICENSE_EXPIRATION = \"OnLicenseExpiration\";\r\n\r\n\t/**\r\n\t * Occurs when O2G is ready (all oxe nodes are connected and loaded). \r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_SERVER_STARTED = \"OnServerStart\";\r\n\r\n\t/**\r\n\t * @internal\r\n\t */\r\n\tconstructor(\r\n\t\tprivate readonly _maintenanceRest: MaintenanceRest,\r\n\t\teventRegistry: EventRegistry\r\n\t) {\r\n\t\tsuper();\r\n\r\n\t\teventRegistry.register(this, Maintenance.ON_SERVER_STARTED);\r\n\t\teventRegistry.register(this, Maintenance.ON_LICENSE_EXPIRATION);\r\n\t\teventRegistry.register(this, Maintenance.ON_PBX_LOADED, nodeIdAdapter<OnPbxLoaded>);\r\n\t\teventRegistry.register(this, Maintenance.ON_CTI_LINK_UP, nodeIdAdapter<OnCtiLinkUp>);\r\n\t\teventRegistry.register(this, Maintenance.ON_CTI_LINK_DOWN, nodeIdAdapter<OnCtiLinkDown>);\r\n\t}\r\n\r\n \t/**\r\n\t * This operation provides information about the system state , and the total\r\n\t * number of each license type available for the system. This operation is\r\n\t * restricted to an admin session only.\r\n\t */\r\n\t public async getSystemStatus(): Promise<SystemStatus | null> { \r\n\t\treturn await this._maintenanceRest.getSystemStatus();\r\n\t}\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport MessagingRest from \"./internal/rest/messaging-rest\";\r\nimport { MailBox } from \"./types/messaging/messaging-types\";\r\nimport { MailBoxInfo } from \"./types/messaging/messaging-types\";\r\nimport { VoiceMessage } from \"./types/messaging/messaging-types\";\r\n\r\n/**\r\n * Messaging service provides access to user's voice mail box.\r\n * It's possible using this service to connect to the voice mail box, retrieve\r\n * the information and the list of voice mails and manage the mail box. Using\r\n * this service requires having a <b>TELEPHONY_ADVANCED</b> license. <br>It's\r\n * possible to download the voice mail as a wav file and to delete an existing\r\n * messages.\r\n */\r\n export class Messaging {\r\n\r\n private _messagingRest: MessagingRest;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor(messagingRest: MessagingRest) {\r\n this._messagingRest = messagingRest;\r\n\t}\r\n\r\n /**\r\n * Get the specified user's mailboxes. This is the logical first step to access\r\n * further operation on voice mail feature.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param loginName the user login name\r\n */\r\n public async getMailboxes(loginName: string | null = null): Promise<MailBox[] | null> {\r\n return this._messagingRest.getMailboxes(loginName);\r\n }\r\n\r\n\r\n /**\r\n * Get the information on the specified mail box.\r\n * <p>\r\n * The 'password' is optional. if not set, the user password is used to\r\n * connect on the voicemail. This is only possible if the OmniPCX Enterprise\r\n * administrator has managed the same pasword for the user and his mailbox.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailBoxId the mail box identifier given in a {@link MailBox}\r\n * @param password the mail box password\r\n * @param loginName the user login name\r\n * \r\n */\r\n public async getMailboxInfo(mailBoxId: string, password: string | null = null, loginName: string | null = null): Promise<MailBoxInfo | null> {\r\n return this._messagingRest.getMailboxInfo(mailBoxId, password, loginName);\r\n }\r\n\r\n\r\n /**\r\n * Get the list of voice messages in the specified mail box.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailboxId the mail box identifier given in a {@link MailBox}\r\n * object\r\n * @param newOnly filter only unread voicemail if set to 'true'\r\n * @param offset the offset from which to start retrieving the voicemail list\r\n * @param limit the maximum number of items to return\r\n * @param loginName the user login name\r\n */\r\n public async getVoiceMessages(mailboxId: string, newOnly: boolean = false, offset: number | null = null, limit: number | null = null, loginName: string | null = null): Promise<VoiceMessage[] | null> {\r\n return this._messagingRest.getVoiceMessages(mailboxId, newOnly, offset, limit, loginName);\r\n }\r\n\r\n /**\r\n * Delete the specified voice message.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailboxId the mail box identifier given in a {@link MailBox}\r\n * object\r\n * @param voicemailId the voice mail identifier given in a {@link VoiceMessage}\r\n * @param loginName the user login name\r\n */\r\n public async deleteVoiceMessage(mailboxId: string, voicemailId: string, loginName: string | null = null): Promise<boolean> {\r\n return this._messagingRest.deleteVoiceMessage(mailboxId, voicemailId, loginName);\r\n }\r\n\r\n\r\n /**\r\n * Acknowledge the specified voice message.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailboxId the mail box identifier given in a {@link MailBox}\r\n * object\r\n * @param voicemailId the voice mail identifier given in a {@link VoiceMessage}\r\n * @param loginName the user login name\r\n */\r\n public async acknowledgeVoiceMessage(mailboxId: string, voicemailId: string, loginName: string | null = null): Promise<boolean> {\r\n return this._messagingRest.acknowledgeVoiceMessage(mailboxId, voicemailId, loginName);\r\n }\r\n\r\n /**\r\n * Delete the specified list of voice messages.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailboxId the mail box identifier given in a {@link MailBox}\r\n * object\r\n * @param msgIds the voicemail identifiers given in a {@link VoiceMessage}\r\n * @param loginName the user login name\r\n */\r\n public async deleteVoiceMessages(mailboxId: string, msgIds: string[], loginName: string | null = null): Promise<boolean> {\r\n return this._messagingRest.deleteVoiceMessages(mailboxId, msgIds, loginName);\r\n }\r\n\r\n /**\r\n * Download a voice mail as a wav file.\r\n * <p>\r\n * If the session has been opened for a user, the 'loginName' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * \r\n * @param mailboxId the mail box identifier given in a {@link MailBox}\r\n * object\r\n * @param voicemailId the voice mail identifier given in a {@link VoiceMessage}\r\n * @param wavPath an optional destination file name\r\n * @param loginName the user login name\r\n */\r\n public async downloadVoiceMessage(mailboxId: string, voicemailId: string, wavPath: string | null, loginName: string | null = null): Promise<string | null> {\r\n return this._messagingRest.downloadVoiceMessage(mailboxId, voicemailId, wavPath, loginName);\r\n }\r\n\r\n\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {Criteria} from '../../types/directory/criteria';\r\nimport { SearchResult } from '../../types/directory/directory-types';\r\n\r\nexport default class DirectoryRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async search(filter: Criteria, limit: number | null, loginName: string | null): Promise<boolean> {\r\n\r\n var uriPost = UtilUri.appendPath(this._uri, \"search\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.filter = filter;\r\n\r\n if (limit) {\r\n req.limit = limit;\r\n }\r\n var json = JSON.stringify(req);\r\n\r\n var httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async cancel(loginName: string | null): Promise<boolean> {\r\n\r\n var uriDelete = UtilUri.appendPath(this._uri, \"search\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async getResults(loginName: string | null): Promise<SearchResult | null> {\r\n\r\n var uriGet = UtilUri.appendPath(this._uri, \"search\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<SearchResult>(await RestService._httpClient.get(uriGet));\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\nimport {Routing} from '../o2g-routing'\r\nimport {EventSummary} from \"../o2g-eventSummary\";\r\nimport {Directory} from \"../o2g-directory\";\r\nimport {Users} from \"../o2g-users\";\r\nimport {Telephony} from \"../o2g-telephony\";\r\nimport {Analytics} from \"../o2g-analytics\";\r\nimport {Maintenance} from \"../o2g-maint\";\r\nimport {AccessMode} from \"./access-mode\";\r\nimport ChunkEventing from \"./events/chunk-eventing\";\r\nimport {CommunicationLog} from \"../o2g-comlog\";\r\nimport {CallCenterAgent} from \"../o2g-cc-agent\";\r\nimport {CallCenterPilot} from \"../o2g-cc-pilot\";\r\nimport {Rsi} from \"../o2g-rsi\";\r\nimport {PbxManagement} from \"../o2g-pbx-mngt\";\r\nimport {PhoneSetProgramming} from \"../o2g-phone-set-prog\";\r\nimport {Messaging} from \"../o2g-messaging\";\r\nimport ServiceFactory from \"./service-factory\";\r\nimport {Subscription, WebHook} from \"../subscription\";\r\nimport { SessionInfo, SubscriptionResult } from \"./types/common/o2gcommon-types\";\r\nimport { container, TYPES } from \"./util/injection-container\";\r\nimport { EventDispatcher, IEventSink } from \"./events/event-dispatcher\";\r\nimport { UserManagement } from \"../o2g-user-mngt\";\r\nimport { Logger } from './util/logger';\r\nimport {AssertUtil} from './util/assert';\r\nimport { CallCenterManagement } from \"../o2g-cc-mngt\";\r\n\r\nexport default class Session {\r\n private _serviceFactory: ServiceFactory;\r\n private _sessionInfo: SessionInfo;\r\n private _loginName!: string;\r\n private _keepAliveID!: ReturnType<typeof setTimeout>;\r\n private _subscriptionId!: string;\r\n private _chunkEventing!: ChunkEventing;\r\n\r\n\tprivate _logger = Logger.create(\"Session\");\r\n\r\n constructor(serviceFactory: ServiceFactory, sessionInfo: SessionInfo, login: string) {\r\n this._serviceFactory = serviceFactory;\r\n this._sessionInfo = sessionInfo;\r\n this._loginName = login;\r\n\r\n this.startKeepAlive();\r\n }\r\n\r\n public getRoutingService(): Routing {\r\n return new Routing(\r\n this._serviceFactory.getRoutingService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getEventSummaryService(): EventSummary {\r\n return new EventSummary(\r\n this._serviceFactory.getEventSummaryService(), \r\n container.get<IEventSink>(TYPES.EventSink) \r\n );\r\n }\r\n\r\n public getUsersService(): Users {\r\n return new Users(\r\n this._serviceFactory.getUsersService(),\r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getUserManagementService(): UserManagement {\r\n return new UserManagement(this._serviceFactory.getUserManagementService());\r\n }\r\n\r\n public getTelephonyService(): Telephony {\r\n return new Telephony(\r\n this._serviceFactory.getTelephonyService(),\r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getDirectoryService(): Directory {\r\n return new Directory(this._serviceFactory.getDirectoryService());\r\n }\r\n\r\n public getCommunicationLogService(): CommunicationLog {\r\n return new CommunicationLog(\r\n this._serviceFactory.getCommunicationLogService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getAnalyticsService(): Analytics {\r\n return new Analytics(this._serviceFactory.getAnalyticsService());\r\n }\r\n\r\n public getCallCenterAgentService(): CallCenterAgent {\r\n return new CallCenterAgent(\r\n this._serviceFactory.getCallCenterAgentService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getCallCenterPilotService(): CallCenterPilot {\r\n return new CallCenterPilot(\r\n this._serviceFactory.getCallCenterPilotService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getCallCenterManagementService(): CallCenterManagement {\r\n return new CallCenterManagement(this._serviceFactory.getCallCenterManagementService());\r\n }\r\n\r\n public getMaintenanceService(): Maintenance {\r\n return new Maintenance(\r\n this._serviceFactory.getMaintenanceService(),\r\n container.get<IEventSink>(TYPES.EventSink)\r\n );\r\n }\r\n\r\n public getRsiService(): Rsi {\r\n return new Rsi(\r\n this._serviceFactory.getRsiService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getPbxManagementService(): PbxManagement {\r\n return new PbxManagement(\r\n this._serviceFactory.getPbxManagementService(), \r\n container.get<IEventSink>(TYPES.EventSink));\r\n }\r\n\r\n public getPhoneSetProgrammingService(): PhoneSetProgramming {\r\n return new PhoneSetProgramming(this._serviceFactory.getPhoneSetProgrammingService());\r\n }\r\n\r\n public getMessagingService(): Messaging {\r\n\t\treturn new Messaging(this._serviceFactory.getMessagingService());\r\n\t}\r\n\r\n private startKeepAlive() {\r\n const keepAlive_ms = this._sessionInfo.timeToLive * 900;\r\n this._logger.debug(`Keep Alive: ${keepAlive_ms}`);\r\n\r\n this._keepAliveID = setInterval(() => {\r\n\r\n this._logger.debug(\"Send Keep Alive\");\r\n var sessionService = this._serviceFactory.getSessionsService();\r\n sessionService.keepAlive();\r\n\r\n }, keepAlive_ms);\r\n }\r\n\r\n public async close() {\r\n if (this._keepAliveID) {\r\n clearTimeout(this._keepAliveID);\r\n }\r\n\r\n let sessionService = this._serviceFactory.getSessionsService();\r\n await sessionService.close();\r\n \r\n this._logger.info(\"Session is closed.\");\r\n }\r\n\r\n public async listenEvents(subscription: Subscription) {\r\n await this._startEventing(AssertUtil.notNull(subscription, \"subscription\"));\r\n }\r\n\r\n\tprivate async _startEventing(subscription: Subscription): Promise<void> {\r\n\r\n\t\tconst subscriptionsService = this._serviceFactory.getSubscriptionService();\r\n\t\tconst subscriptionResult: SubscriptionResult = await subscriptionsService.create(subscription);\r\n\r\n const eventSink = container.get<IEventSink>(TYPES.EventSink)\r\n\r\n\t\tif (!subscriptionResult || subscriptionResult.status != \"ACCEPTED\") {\r\n const reason = subscriptionResult ? subscriptionResult.status : \"Unknown\";\r\n this._logger.error(\"Subscription has been refused. Fix the subscription request.\");\r\n throw new Error(`Subscription has been refused: ${reason}`);\r\n }\r\n\t\t\r\n this._subscriptionId = subscriptionResult.subscriptionId;\r\n\t\tthis._logger.debug(\"Subscription has been accepted.\");\r\n\r\n // check the eventing:\r\n const webHook: WebHook | null = subscription.webHook;\r\n if (webHook) {\r\n this._logger.info(`Start eventing on webhook mode on : ${webHook.url}`);\r\n\r\n const eventDispatcher: EventDispatcher = container.get<IEventSink>(TYPES.EventSink)\r\n webHook.connectDispatcher(eventDispatcher);\r\n }\r\n else {\r\n this._logger.info(\"Start eventing on chunk mode.\");\r\n\r\n const pollingUrl = this._serviceFactory._accessMode === AccessMode.Private\r\n ? subscriptionResult.privatePollingUrl\r\n : subscriptionResult.publicPollingUrl;\r\n\r\n this._chunkEventing = new ChunkEventing(pollingUrl, eventSink);\r\n this._chunkEventing.start();\r\n\r\n this._logger.info(\"Eventing is started.\");\r\n }\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * ConfigurationType represents the possible O2G server configurations.\r\n */\r\nexport enum ConfigurationType {\r\n /**\r\n * O2G Server is configured for management. An O2G server configured for\r\n * management does not monitor devices on the OmniPCX Enterprise.\r\n */\r\n PBX_MANAGEMENT = 'PBX_MANAGEMENT',\r\n\r\n /**\r\n * O2G Server is configured with full services.\r\n */\r\n FULL_SERVICES = 'FULL_SERVICES' \r\n}\r\n\r\n\r\nexport namespace ConfigurationType {\r\n export function isConfigurationType(value: string): value is ConfigurationType {\r\n return Object.values(ConfigurationType).includes(value as ConfigurationType);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * ServerAddress defines an OmniPCX Enterprise address.\r\n */\r\nexport type ServerAddress = {\r\n\r\n /**\r\n * This address FQDN.\r\n */\r\n fqdn: string;\r\n\r\n /**\r\n * This address IPv4 address.\r\n */\r\n ip: string;\r\n}\r\n\r\n/**\r\n * CTILinkState represents the differents possible states of the CTI\r\n * link between OmniPCX Enterprise and O2G server.\r\n */\r\nexport enum CTILinkState {\r\n\r\n /**\r\n * CTI Link is established with the main OmniPCX Enterprise call server.\r\n */\r\n CONNECTED_MAIN = 'CONNECTED_MAIN',\r\n\r\n /**\r\n * CTI Link is established with the standby OmniPCX Enterprise call server.\r\n */\r\n CONNECTED_SECONDARY = 'CONNECTED_SECONDARY',\r\n\r\n /**\r\n * CTI Link is not established.\r\n */\r\n DISCONNECTED = 'DISCONNECTED'\r\n}\r\n\r\n\r\nexport type PbxStatus = {\r\n\r\n /**\r\n * The name of the OmniPCX Enterprise.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The OmniPCX Enterprise node number.\r\n */\r\n nodeId: number;\r\n\r\n /**\r\n * The OmniPCX Enterprise main address.\r\n */\r\n mainAddress: ServerAddress;\r\n\r\n /**\r\n * The OmniPCX Enterprise secondary address.\r\n */\r\n secondaryAddress: ServerAddress;\r\n\r\n /**\r\n * The OmniPCX Enterprise version.\r\n */\r\n version: string;\r\n\r\n\r\n /**\r\n * Whether this O2G is connected to this OmniPCX Enterprise node.\r\n */\r\n connected: boolean;\r\n\r\n /**\r\n * Whether the O2G has loaded all this OmniPCX Enterprise node's users.\r\n * @see {@link Maintenance.ON_PBX_LOADED} event.\r\n */\r\n loaded: boolean;\r\n\r\n\r\n /**\r\n * The state of the CSTA link between the O2Gserver and this OmniPCX\r\n * Enterprise node.\r\n */\r\n ctiLinkState: CTILinkState;\r\n\r\n\r\n /**\r\n * Whether the OmniPCX Enterprise node is secured. If the OmniPCX\r\n * Enterprise node is secured, the connection with the O2G server is done using\r\n * SSH.\r\n */\r\n secured: boolean;\r\n\r\n /**\r\n * The number of monitored users on this OmniPCX Enterprise node.\r\n */\r\n monitoredUserNumber: number;\r\n}\r\n\r\n/**\r\n * License represents an O2G license.\r\n */\r\nexport type License = {\r\n /**\r\n * The license name.\r\n */\r\n name: string;\r\n\r\n\r\n /**\r\n * The number of licenses.\r\n */\r\n total: number;\r\n\r\n\r\n /**\r\n * The number of licenses used.\r\n */\r\n currentUsed: number;\r\n\r\n /**\r\n * The expiration date.\r\n */\r\n expiration: string \r\n}\r\n\r\n\r\n/**\r\n * SystemStatus provide a full status of the O2G server and its connections.\r\n */\r\nexport type SystemStatus = {\r\n\r\n /**\r\n * This O2G server logical address.\r\n */\r\n logicalAddress: ServerAddress;\r\n\r\n\r\n /**\r\n * The start date of the O2G server.\r\n */\r\n startDate: Date;\r\n\r\n\r\n /**\r\n * Whether this O2G is deployed in high availability mode.\r\n */\r\n haMode: boolean;\r\n\r\n\r\n /**\r\n * The FQDN of the currently active O2G server when it is configured in\r\n * HA mode.\r\n */\r\n primary: string;\r\n\r\n\r\n /**\r\n * The version of the current active O2G server when it is configured in\r\n * HA mode.\r\n */\r\n primaryVersion: string;\r\n\r\n\r\n /**\r\n * The FQDN of the backup O2G server when it is configured in HA mode.\r\n */\r\n secondary: string;\r\n\r\n\r\n /**\r\n * The version of the backup O2G server when it is configured in HA mode.\r\n */\r\n secondaryVersion: string;\r\n\r\n\r\n /**\r\n * The collection of OmniPCX Enterprise nodes connected to this O2G server\r\n */\r\n pbxs: PbxStatus[];\r\n\r\n\r\n /**\r\n * The O2G server licenses.\r\n */\r\n licenses: License[];\r\n \r\n\r\n /**\r\n * The O2G Server configuration\r\n */\r\n configurationType: ConfigurationType;\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * Role defines the roles a participant can have in a com record.\r\n */\r\nexport enum Role {\r\n /**\r\n * The participant is a caller party.\r\n */\r\n CALLER = \"CALLER\",\r\n\r\n /**\r\n * The participant is a called party.\r\n */\r\n CALLEE = \"CALLEE\",\r\n\r\n /**\r\n * The role is unknown.\r\n */\r\n UNKNOWN = \"UNKNOWN\",\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport { ServerAddress, SystemStatus, PbxStatus, License, ConfigurationType } from '../../types/maint/maint-types';\r\n\r\n\r\ntype O2GSystemStatus = {\r\n logicalAddress: ServerAddress;\r\n startDate: string;\r\n ha: boolean;\r\n primary: string;\r\n primaryVersion: string;\r\n secondary: string;\r\n secondaryVersion: string;\r\n pbxs: PbxStatus[];\r\n license: {\r\n lics: License[];\r\n };\r\n configurationType: string;\r\n}\r\n\r\nexport default class MaintenanceRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getSystemStatus(): Promise<SystemStatus | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"status\");\r\n\r\n const o2gSystemStatus = this.getResult<O2GSystemStatus>(await RestService._httpClient.get(uriGet));\r\n if (o2gSystemStatus) {\r\n\r\n return {\r\n \"logicalAddress\": o2gSystemStatus.logicalAddress,\r\n \"startDate\": new Date(o2gSystemStatus.startDate),\r\n \"haMode\": o2gSystemStatus.ha,\r\n \"primary\": o2gSystemStatus.primary,\r\n \"primaryVersion\": o2gSystemStatus.primaryVersion,\r\n \"secondary\": o2gSystemStatus.secondary,\r\n \"secondaryVersion\": o2gSystemStatus.secondaryVersion,\r\n \"pbxs\": o2gSystemStatus.pbxs,\r\n \"licenses\": o2gSystemStatus.license.lics,\r\n \"configurationType\": ConfigurationType.isConfigurationType(o2gSystemStatus.configurationType) ? \r\n ConfigurationType[o2gSystemStatus.configurationType]: ConfigurationType.FULL_SERVICES\r\n };\r\n }\r\n else {\r\n return null;\r\n }\r\n\t}\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { PilotRuleSet } from \"./pilot-rule-set\";\r\n\r\nexport class Pilot {\r\n\r\n private _number: string;\r\n private _name: string;\r\n private _state: Pilot.ServiceState;\r\n private _detailedState: Pilot.Status;\r\n private _waitingTime: number;\r\n private _saturation: boolean;\r\n private _rules: PilotRuleSet;\r\n private _possibleTransfer: boolean;\r\n private _supervisedTransfer: boolean;\r\n\r\n protected constructor(data: {\r\n number: string,\r\n name: string,\r\n state: Pilot.ServiceState,\r\n detailedState: Pilot.Status,\r\n waitingTime: number,\r\n saturation: boolean,\r\n rules: PilotRuleSet,\r\n possibleTransfer: boolean,\r\n supervisedTransfer: boolean\r\n }) {\r\n this._number = data.number;\r\n this._name = data.name;\r\n this._state = data.state;\r\n this._detailedState = data.detailedState;\r\n this._waitingTime = data.waitingTime;\r\n this._saturation = data.saturation;\r\n this._rules = data.rules;\r\n this._possibleTransfer = data.possibleTransfer;\r\n this._supervisedTransfer = data.supervisedTransfer;\r\n }\r\n\r\n get number(): string {\r\n return this._number;\r\n }\r\n\r\n get name(): string {\r\n return this._name;\r\n }\r\n\r\n get state(): Pilot.ServiceState {\r\n return this._state;\r\n }\r\n\r\n get detailedState(): Pilot.Status {\r\n return this._detailedState;\r\n }\r\n\r\n get waitingTime(): number {\r\n return this._waitingTime;\r\n }\r\n\r\n get saturation(): boolean {\r\n return this._saturation;\r\n }\r\n\r\n get rules(): PilotRuleSet {\r\n return this._rules;\r\n }\r\n\r\n get possibleTransfer(): boolean {\r\n return this._possibleTransfer;\r\n }\r\n\r\n get supervisedTransfer(): boolean {\r\n return this._supervisedTransfer;\r\n }\r\n}\r\n\r\n\r\nexport namespace Pilot {\r\n /**\r\n * Service state for th epilot\r\n */\r\n export enum ServiceState {\r\n Closed,\r\n Opened,\r\n Blocked,\r\n unknown\r\n }\r\n\r\n /**\r\n * CCD pilot status.\r\n */\r\n export enum Status {\r\n OPEN,\r\n BLOCKED,\t\r\n BLOCKED_ON_RULE,\t\r\n BLOCKED_ON_BLOCKED_RULE,\t\r\n GENERAL_FORWARDING,\t\r\n GENERAL_FORWARDING_ON_RULE,\t\r\n BLOCKED_ON_GENERAL_FORWARDING_RULE,\t\r\n OTHER\r\n }\r\n}\r\n\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport {Subscription} from '../../subscription';\r\nimport { SubscriptionResult } from '../types/common/o2gcommon-types';\r\n\r\nexport default class SubscriptionsRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async create(subscription: Subscription): Promise<SubscriptionResult | null> {\r\n\r\n const payload: any = {\r\n filter: subscription.filter,\r\n version: subscription.version,\r\n };\r\n\r\n if (subscription.webHook?.url) {\r\n payload.webHookUrl = subscription.webHook.url;\r\n } \r\n else {\r\n payload.timeout = subscription.timeout;\r\n }\r\n\r\n const httpContent = new HttpContent(JSON.stringify(payload));\r\n\r\n const response = await RestService._httpClient.post(this._uri, httpContent);\r\n return this.getResult<SubscriptionResult>(response);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * TelFacility represents the telephonic facilities.\r\n */\r\n export enum TelFacility {\r\n \r\n CallingLineIdentificationPresentation = \"CallingLineIdentificationPresentation\",\r\n ConnectedLineIdentificationPresentation = \"ConnectedLineIdentificationPresentation\",\r\n CallingLineIdentificationRestriction = \"CallingLineIdentificationRestriction\",\r\n ConnectedLineIdentificationRestriction = \"ConnectedLineIdentificationRestriction\",\r\n MaliciousCallIdentification = \"MaliciousCallIdentification\",\r\n CallForwardingUnconditional = \"CallForwardingUnconditional\",\r\n CallForwardingOnBusy = \"CallForwardingOnBusy\",\r\n CallForwardingOnNoReply = \"CallForwardingOnNoReply\",\r\n Transfer = \"Transfer\",\r\n AdviceOfChargeAtSetup = \"AdviceOfChargeAtSetup\",\r\n AdviceOfChargeDuringCall = \"AdviceOfChargeDuringCall\",\r\n AdviceOfChargeAtEnd = \"AdviceOfChargeAtEnd\",\r\n ClosedUserGroup = \"ClosedUserGroup\",\r\n CallWaiting = \"CallWaiting\",\r\n UserToUserSignalling = \"UserToUserSignalling\",\r\n UserToUserFacility = \"UserToUserFacility\",\r\n TerminalPortability = \"TerminalPortability\",\r\n Interception = \"Interception\",\r\n Booking = \"Booking\",\r\n CampOn = \"CampOn\",\r\n Conference = \"Conference\",\r\n MiniMessaging = \"MiniMessaging\",\r\n Subaddressing = \"Subaddressing\",\r\n BasicCall = \"BasicCall\",\r\n OperatorFacility = \"OperatorFacility\",\r\n Substitution = \"Substitution\",\r\n PriorityIncomingCall = \"PriorityIncomingCall\",\r\n Transit = \"Transit\",\r\n PrivateOverflowToPublic = \"PrivateOverflowToPublic\",\r\n ReroutingPublicToPrivate = \"ReroutingPublicToPrivate\",\r\n FaxServer = \"FaxServer\",\r\n VoiceMail = \"VoiceMail\",\r\n CentralAbbreviatedNumbering = \"CentralAbbreviatedNumbering\",\r\n IndividualAbbreviatedNumbering = \"IndividualAbbreviatedNumbering\",\r\n IntegratedServiceVirtualPrivateNetwork = \"IntegratedServiceVirtualPrivateNetwork\",\r\n OverflowVirtualPrivateNetwork = \"OverflowVirtualPrivateNetwork\",\r\n ARSService = \"ARSService\",\r\n DISA = \"DISA\",\r\n None = \"None\" \r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * OperationFilter represents the operation that can be used to filter a directory search. \r\n */\r\nexport enum OperationFilter {\r\n\r\n /**\r\n * The attribute and the given value are equals (case insensitive).\r\n */\r\n EQUAL_IGNORE_CASE = 0, \r\n\r\n /**\r\n * The attribute begins with the value.\r\n */\r\n BEGINS_WITH = 1, \r\n\r\n /**\r\n * The attribute contains the value.\r\n */\r\n CONTAINS = 2, \r\n\r\n /**\r\n * The attribute ends with the value.\r\n */\r\n ENDS_WITH = 3\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { AbstractCalendar } from \"./abstract-calendar\";\r\nimport { Transition } from \"./transition\";\r\n\r\n\r\n\r\n\r\n/**\r\n * Represents the exceptional calendar associated with a CCD pilot.\r\n *\r\n * This calendar defines special days (like holidays) that override the normal calendar behavior.\r\n * Each exceptional day can have up to 10 transitions (time slots).\r\n */\r\nexport class ExceptionCalendar extends AbstractCalendar<Date> {\r\n\r\n constructor(transitions: Map<Date, Transition[]>) {\r\n super(transitions);\r\n }\r\n\r\n /**\r\n * Get the set of exceptional dates in this calendar.\r\n */\r\n getExceptionDates(): Set<Date> {\r\n return new Set(this.transitions.keys());\r\n }\r\n\r\n /**\r\n * Get a specific transition for an exceptional date and index.\r\n * @param date the date\r\n * @param index Index of the transition (0-9)\r\n */\r\n getTransitionAt(date: Date, index: number): Transition | undefined {\r\n const dayTransitions = this.transitions.get(date);\r\n return dayTransitions?.[index];\r\n }\r\n\r\n /**\r\n * Get all transitions for a given exceptional date.\r\n * @param date the date\r\n */\r\n getTransitions(date: Date): Transition[] {\r\n return this.transitions.get(date) || [];\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport default class UtilUri {\r\n\r\n static ensureHttps(uri: string): string {\r\n if (!uri) return uri;\r\n return uri.startsWith('http:') ? 'https:' + uri.slice(5) : uri;\r\n }\r\n\r\n static appendPath(uri: string, ...paths: string[]): string {\r\n if (!uri) return paths.join('/');\r\n\r\n // Remove trailing slash from uri if present\r\n const base = uri.endsWith('/') ? uri.slice(0, -1) : uri;\r\n\r\n // Clean paths to remove leading/trailing slashes\r\n const cleanPaths = paths.map(p => p.replace(/^\\/+|\\/+$/g, ''));\r\n\r\n return [base, ...cleanPaths].join('/');\r\n }\r\n\r\n static appendQuery(uri: string, queryName: string, queryValue: string | null = null): string {\r\n if (!uri || !queryName) return uri;\r\n\r\n try {\r\n const url = new URL(uri);\r\n if (queryValue === null) {\r\n url.searchParams.append(queryName, '');\r\n } \r\n else {\r\n url.searchParams.append(queryName, queryValue);\r\n }\r\n \r\n return url.toString();\r\n } \r\n catch {\r\n // If uri is not a full URL, fallback to manual handling\r\n\r\n const separator = uri.includes('?') ? '&' : '?';\r\n if (queryValue === null) {\r\n return `${uri}${separator}${queryName}`;\r\n }\r\n\r\n return `${uri}${separator}${queryName}=${encodeURIComponent(queryValue)}`;\r\n }\r\n }\r\n}\r\n","module.exports = require(\"path\");","\r\n/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport HttpClient from \"../util/http-client\";\r\nimport HttpResponse from \"../util/http-response\";\r\nimport path from 'path';\r\nimport FileUtil from \"../util/file-utils\"\r\nimport fs from 'fs/promises';\r\n\r\nexport class RestService {\r\n\r\n protected static _httpClient = new HttpClient();\r\n protected _uri: string;\r\n\r\n constructor(uri: string) {\r\n this._uri = uri;\r\n }\r\n\r\n getResult<Type>(httpResponse: HttpResponse): Type | null {\r\n if (httpResponse.isSuccessStatusCode()) {\r\n return httpResponse.fromJson();\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n private getFilename(httpResponse: HttpResponse) : string | null {\r\n\r\n if (httpResponse.headers) {\r\n const contentDisposition = httpResponse.headers.get('content-disposition');\r\n if (contentDisposition) {\r\n const match = /filename\\*?=(?:UTF-8''|\")?([^;\\r\\n\"]+)/i.exec(contentDisposition);\r\n return match ? decodeURIComponent(match[1]) : null;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n async downloadFile(httpResponse: HttpResponse, filePath: string | null, extension: string | null = null) : Promise<string | null> {\r\n\r\n if (httpResponse.isSuccessStatusCode()) {\r\n\r\n if (httpResponse.response instanceof ArrayBuffer) {\r\n\r\n let downloadedFile = filePath; \r\n if (downloadedFile == null) {\r\n let filename: string | null = this.getFilename(httpResponse);\r\n if (filename) {\r\n downloadedFile = path.join(FileUtil.getTempFolder(), filename);\r\n }\r\n else {\r\n downloadedFile = path.join(FileUtil.getTempFolder(), FileUtil.getRandomFilename(extension));\r\n }\r\n }\r\n\r\n try {\r\n const buffer: ArrayBuffer = httpResponse.response;\r\n await fs.writeFile(downloadedFile, Buffer.from(buffer));\r\n\r\n return downloadedFile;\r\n }\r\n catch (error) {\r\n console.error(`Failed to write file to ${downloadedFile}:`, error);\r\n throw new Error(`Failed to write file to ${downloadedFile}: ${error}`);\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n","module.exports = require(\"tough-cookie\");","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nexport enum LogLevel {\r\n DEBUG = 'DEBUG',\r\n INFO = 'INFO',\r\n WARN = 'WARN',\r\n ERROR = 'ERROR',\r\n NONE = 'NONE',\r\n}\r\n\r\nexport enum Color {\r\n Black = 0,\r\n Red = 1,\r\n Green = 2,\r\n Yellow = 3,\r\n Blue = 4,\r\n Magenta = 5,\r\n Cyan = 6,\r\n Grey = 7,\r\n White = 9,\r\n Default = 9,\r\n}\r\n\r\nlet GlobalLogLevel: LogLevel = LogLevel.DEBUG;\r\n\r\nconst logLevelColors: Color[] = [\r\n Color.Cyan, // DEBUG\r\n Color.Green, // INFO\r\n Color.Yellow, // WARN\r\n Color.Red, // ERROR\r\n Color.Default // NONE\r\n];\r\n\r\ninterface LoggerOptions {\r\n useColors?: boolean;\r\n color?: Color;\r\n showTimestamp?: boolean;\r\n useLocalTime?: boolean;\r\n showLevel?: boolean;\r\n}\r\n\r\nconst defaultOptions: Required<LoggerOptions> = {\r\n useColors: false,\r\n color: Color.Default,\r\n showTimestamp: true,\r\n useLocalTime: false,\r\n showLevel: true,\r\n};\r\n\r\nexport class Logger {\r\n private category: string;\r\n private options: Required<LoggerOptions>;\r\n\r\n constructor(category: string, options?: LoggerOptions) {\r\n this.category = category;\r\n this.options = { ...defaultOptions, ...options };\r\n }\r\n\r\n public debug(format: string, ...args: unknown[]): void {\r\n if (this._shouldLog(LogLevel.DEBUG))\r\n this._write(LogLevel.DEBUG, this._formatText(format, args));\r\n }\r\n\r\n public log(format: string, ...args: unknown[]): void {\r\n if (this._shouldLog(LogLevel.DEBUG))\r\n this.debug(format, ...args);\r\n }\r\n\r\n public info(format: string, ...args: unknown[]): void {\r\n if (this._shouldLog(LogLevel.INFO))\r\n this._write(LogLevel.INFO, this._formatText(format, args));\r\n }\r\n\r\n public warn(format: string, ...args: unknown[]): void {\r\n if (this._shouldLog(LogLevel.WARN))\r\n this._write(LogLevel.WARN, this._formatText(format, args));\r\n }\r\n\r\n public error(format: string, ...args: unknown[]): void {\r\n if (this._shouldLog(LogLevel.ERROR))\r\n this._write(LogLevel.ERROR, this._formatText(format, args));\r\n }\r\n\r\n private _shouldLog(level: LogLevel): boolean {\r\n const logLevels = Object.values(LogLevel);\r\n const currentLevel = typeof window !== 'undefined' && (window as any).LOG\r\n ? (window as any).LOG.toUpperCase()\r\n : GlobalLogLevel;\r\n return logLevels.indexOf(level) >= logLevels.indexOf(currentLevel as LogLevel);\r\n }\r\n\r\n private _formatText(format: string, args: unknown[]): string {\r\n let i = 0;\r\n return format.replace(/\\{\\w+\\}/g, () => {\r\n return i < args.length ? String(args[i++]) : '';\r\n });\r\n }\r\n\r\n private _write(level: LogLevel, text: string): void {\r\n const format = this._format(level, text);\r\n const formattedText = this._createLogMessage(level, text, format);\r\n\r\n const output = level === LogLevel.ERROR ? console.error : console.log;\r\n\r\n const parts: any[] = [];\r\n\r\n if (this.options.useColors) {\r\n if (this.options.showTimestamp) parts.push(format.timestamp, this._getTimestamp());\r\n if (this.options.showLevel) parts.push(format.level, `[${level}]`);\r\n parts.push(format.category, this.category);\r\n parts.push(format.text, text);\r\n } else {\r\n let line = '';\r\n if (this.options.showTimestamp) line += this._getTimestamp() + ' ';\r\n if (this.options.showLevel) line += `[${level}] `;\r\n line += `${this.category}: ${text}`;\r\n parts.push(line);\r\n }\r\n\r\n output(...parts);\r\n }\r\n\r\n private _format(level: LogLevel, text: string): Record<string, string> {\r\n const levelIndex = Object.values(LogLevel).indexOf(level);\r\n const levelColor = logLevelColors[levelIndex] ?? Color.Default;\r\n\r\n return {\r\n timestamp: this.options.useColors && this.options.showTimestamp ? `color:${Color.Grey}` : '',\r\n level: this.options.useColors && this.options.showLevel ? `color:${levelColor}` : '',\r\n category: this.options.useColors ? `color:${this.options.color}; font-weight:bold` : '',\r\n text: ': '\r\n };\r\n }\r\n\r\n private _createLogMessage(\r\n level: LogLevel,\r\n text: string,\r\n format: Record<string, string>\r\n ): string {\r\n let result = '';\r\n\r\n if (this.options.showTimestamp) {\r\n result += this._getTimestamp() + ' ';\r\n }\r\n\r\n if (this.options.showLevel) {\r\n result += `[${level}] `;\r\n }\r\n\r\n result += `${this.category}: ${text}`;\r\n return result;\r\n }\r\n\r\n private _getTimestamp(): string {\r\n return this.options.useLocalTime\r\n ? new Date().toLocaleString()\r\n : new Date().toISOString();\r\n }\r\n\r\n public static create(category: string, options?: LoggerOptions): Logger {\r\n return new Logger(category, options);\r\n }\r\n}\r\n\r\n/* Public API */\r\nexport default {\r\n Colors: Color,\r\n LogLevels: LogLevel,\r\n setLogLevel: (level: LogLevel) => {\r\n GlobalLogLevel = level;\r\n }\r\n/*\r\n ,\r\n create: (category: string, options?: LoggerOptions): Logger => {\r\n return new Logger(category, options);\r\n },\r\n */\r\n};\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * FilterItem represents the attributes that can be used to filter a directory search.\r\n */\r\nexport enum FilterItem {\r\n\r\n /**\r\n * The last name.\r\n */\r\n LAST_NAME = 0, \r\n\r\n /**\r\n * The first name.\r\n */\r\n FIRST_NAME = 1, \r\n\r\n /**\r\n * The phone number.\r\n */\r\n PHONE_NUMBER = 2, \r\n\r\n /**\r\n * The login name.\r\n */\r\n LOGIN_NAME = 3\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport { EventSummaryCounters } from '../../types/eventsummary/event-summary-counter';\r\n\r\nexport default class EventSumaryRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async get(loginName: string | null = null): Promise<EventSummaryCounters | null> {\r\n\r\n let uriGet = this._uri;\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<EventSummaryCounters>(await RestService._httpClient.get(uriGet));\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\nimport EventSumaryRest from \"./internal/rest/eventSummary-rest\";\r\nimport { EventSummaryCounters } from \"./types/eventsummary/event-summary-counter\"\r\nimport { EventEmitter } from 'events';\r\n\r\n/**\r\n * The Event summary service allows a user to get its new message\r\n * indicators (missed call, voice mails, callback request, fax).\r\n * <p>Using this service requires having a <b>TELEPHONY_ADVANCED</b> license,\r\n */\r\n export class EventSummary extends EventEmitter {\r\n\r\n\t/**\r\n\t * Event raised each time the user's counters have changed.\r\n\t * @event\r\n\t */\r\n\tpublic static readonly ON_EVENT_SUMMARY_UPDATED = \"OnEventSummaryUpdated\";\r\n\r\n\t/**\r\n\t * \r\n\t * @internal \r\n\t */\r\n constructor(\r\n \tprivate readonly _eventSummaryRest: EventSumaryRest,\r\n \teventRegistry: EventRegistry\r\n \t) {\r\n \tsuper();\r\n\t eventRegistry.register(this, EventSummary.ON_EVENT_SUMMARY_UPDATED);\r\n \t}\r\n\r\n\t/**\r\n\t * Retrieves main counters for the specified user.\r\n\t * <p>\r\n\t * If the session has been opened for a user, the loginName parameter is\r\n\t * ignored, but it is mandatory if the session has been opened by an\r\n\t * administrator.\r\n\t * \r\n\t * @param loginName the user login name\r\n\t * @return the {@link EventSummaryCounters}\r\n\t */\r\n\tpublic get(loginName: string | null = null): Promise<EventSummaryCounters | null> {\r\n\t\treturn this._eventSummaryRest.get(loginName);\r\n\t}\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { ForwardRoute } from \"../../internal/types/routing/forward-route\";\r\nimport { Destination } from \"./destination\";\r\n\r\n/**\r\n * ForwardCondition represents the possible condition a user can associate to a forward.\r\n */\r\nexport enum ForwardCondition {\r\n\r\n /**\r\n * Incoming calls are immediately forwarded on the target.\r\n */\r\n IMMEDIATE = \"IMMEDIATE\",\r\n\r\n /**\r\n * Incoming calls are forwarded on the target if the user is busy.\r\n */\r\n BUSY = \"BUSY\",\r\n\r\n /**\r\n * Incoming calls are forwarded on the target if the user does not answer the call.\r\n */\r\n NO_ANSWER = \"NO_ANSWER\",\r\n\r\n /**\r\n * Incoming calls are forwarded on the target if the user is busy or if the user does not answer the call.\r\n */\r\n BUSY_OR_NO_ANSWER = \"BUSY_OR_NO_ANSWER\" \r\n}\r\n\r\n/**\r\n * Forward represents a forward the user has activated.\r\n */\r\nexport class Forward {\r\n private _destination!: Destination;\r\n private _number: string | null = null;\r\n private _condition: ForwardCondition | null = null;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {}\r\n\r\n /**\r\n * Returns this forward destination.\r\n */\r\n public get destination(): Destination {\r\n return this._destination;\r\n }\r\n\r\n /**\r\n * Returns the number destination of this forward.\r\n */\r\n public get number(): string | null {\r\n return this._number;\r\n }\r\n\r\n /**\r\n * Returns this forward associated condition.\r\n */\r\n public get condition(): ForwardCondition | null {\r\n return this._condition;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(forwardRoute: ForwardRoute | null = null): Forward {\r\n const result = new Forward();\r\n\r\n if (forwardRoute) {\r\n if (forwardRoute.destinations.length === 1) {\r\n const typeKey = forwardRoute.destinations[0].type as keyof typeof Destination;\r\n result._destination = Destination[typeKey] ?? Destination.NONE;\r\n\r\n if (result._destination === Destination.NUMBER) {\r\n result._number = forwardRoute.destinations[0].number;\r\n } else {\r\n result._number = null;\r\n }\r\n } else {\r\n result._destination = Destination.NONE;\r\n result._number = null;\r\n }\r\n\r\n const conditionKey = forwardRoute.forwardType as keyof typeof ForwardCondition;\r\n result._condition = ForwardCondition[conditionKey] ?? null;\r\n } else {\r\n result._condition = null;\r\n result._destination = Destination.NONE;\r\n result._number = null;\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { OverflowCondition } from \"../../../types/routing/overflow\";\r\nimport { O2GDestination } from \"./o2g-destination\";\r\n\r\nexport default class OverflowRoute {\r\n\r\n overflowType!: string;\r\n destinations!: O2GDestination[];\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static createOverflowOnVoiceMail(condition: OverflowCondition): OverflowRoute {\r\n\r\n let result: OverflowRoute = new OverflowRoute();\r\n\r\n result.overflowType = condition.toString();\r\n result.destinations = [\r\n O2GDestination.createVoiceMailDestination()\r\n ]\r\n\r\n return result;\r\n }\r\n\r\n /*\r\n public static getOverflowType(condition: OverflowCondition): string {\r\n if (condition === OverflowCondition.BUSY) return \"BUSY\";\r\n else if (condition === OverflowCondition.NO_ANSWER) return \"NO_ANSWER\";\r\n else return \"BUSY_NO_ANSWER\";\r\n }\r\n */\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {Forward} from '../../types/routing/forward';\r\nimport {Overflow} from '../../types/routing/overflow';\r\nimport {ForwardRoute} from '../types/routing/forward-route';\r\nimport OverflowRoute from '../types/routing/overflow-route';\r\nimport HttpContent from '../util/http-content';\r\nimport {RoutingState} from '../../types/routing/routing-state';\r\nimport { ForwardCondition } from '../../types/routing/forward';\r\nimport { OverflowCondition } from '../../types/routing/overflow';\r\nimport { DndState } from '../../types/routing/routing-types';\r\nimport { RoutingCapabilities } from '../../types/routing/routing-capability';\r\nimport { O2GRoutingCapabilities, O2GRoutingState } from '../types/routing/o2grouting-types';\r\nimport { O2GDestination } from '../types/routing/o2g-destination';\r\n\r\n\r\nexport default class RoutingRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async activateDnd(loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"dnd\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async cancelDnd(loginName: string | null): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(this._uri, \"dnd\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getDndState(loginName: string | null): Promise<DndState | null> {\r\n let uriGet = UtilUri.appendPath(this._uri, \"dnd\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<DndState>(await RestService._httpClient.get(uriGet));\r\n\t}\r\n\r\n\tpublic async getCapabilities(loginName: string | null): Promise<RoutingCapabilities | null> {\r\n let uriGet = this._uri;\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const _capabilities = this.getResult<O2GRoutingCapabilities>(await RestService._httpClient.get(uriGet)); \r\n if (_capabilities) {\r\n\r\n return RoutingCapabilities.build(_capabilities);\r\n }\r\n else {\r\n return null;\r\n }\r\n\t}\r\n\r\n public async cancelForward(loginName: string | null): Promise<boolean> {\r\n let uriDelete = UtilUri.appendPath(this._uri, \"forwardroute\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete)\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getForward(loginName: string | null): Promise<Forward | null> {\r\n let uriGet = UtilUri.appendPath(this._uri, \"forwardroute\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.get(uriGet);\r\n let json = httpResponse.response;\r\n if (httpResponse.isSuccessStatusCode()) {\r\n\r\n if (json.length === 0) {\r\n return Forward.build();\r\n }\r\n else {\r\n let forwardRoute: ForwardRoute = JSON.parse(json);\r\n return Forward.build(forwardRoute);\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n\t}\r\n\r\n\tpublic async forwardOnVoiceMail(condition: ForwardCondition, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"forwardroute\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n forwardRoute: ForwardRoute.createForwardOnVoiceMail(condition)\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n\t}\r\n\r\n public async forwardOnNumber(number: string, condition: ForwardCondition, loginName: string | null): Promise<boolean> {\r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"forwardroute\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n forwardRoute: ForwardRoute.createForwardOnNumber(number, condition)\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async overflowOnVoiceMail(condition: OverflowCondition, loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"overflowroute\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n overflowRoutes: [OverflowRoute.createOverflowOnVoiceMail(condition)]\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getOverflow(loginName: string | null): Promise<Overflow | null> {\r\n let uriGet = UtilUri.appendPath(this._uri, \"overflowroute\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.get(uriGet);\r\n let json = httpResponse.response;\r\n if (httpResponse.isSuccessStatusCode()) {\r\n\r\n if (json.length === 0) {\r\n return Overflow.build();\r\n }\r\n else {\r\n let overflowRoute: OverflowRoute = JSON.parse(json);\r\n return Overflow.build(overflowRoute);\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async cancelOverflow(loginName: string | null): Promise<boolean> {\r\n let uriDelete = UtilUri.appendPath(this._uri, \"overflowroute\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete)\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async setRemoteExtensionActivation(active: boolean, loginName: string | null): Promise<boolean> {\r\n \r\n let uriPost = this._uri;\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n presentationRoutes: [\r\n {\r\n destinations: [\r\n O2GDestination.createMobileDestination(active)\r\n ]\r\n }\r\n ]\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getRoutingState(loginName: string | null): Promise<RoutingState | null> {\r\n var uriGet = UtilUri.appendPath(this._uri, \"state\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const o2gRoutingState = this.getResult<O2GRoutingState>(await RestService._httpClient.get(uriGet));\r\n if (o2gRoutingState) {\r\n return RoutingState.build(o2gRoutingState);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async requestSnapshot(loginName: string | null): Promise<boolean> {\r\n \r\n var uriPost = UtilUri.appendPath(this._uri, \"state/snapshot\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n var httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { EventDispatcher } from \"./internal/events/event-dispatcher\";\r\nimport { EventPackage } from \"./internal/events/event-packages\";\r\n\r\nclass Selector {\r\n private names: string[];\r\n private ids!: string[];\r\n\r\n constructor(ids: string[], names: string[]) {\r\n\r\n if (ids != null) {\r\n this.ids = ids;\r\n }\r\n this.names = names;\r\n }\r\n}\r\n\r\n\r\nclass EventFilter {\r\n private selectors: Selector[];\r\n\r\n constructor() {\r\n this.selectors = [];\r\n }\r\n\r\n add(ids: string[], name: string[]) {\r\n this.selectors.push(new Selector(ids, name));\r\n }\r\n\r\n addPackage(ids: string[], eventPackage: EventPackage) {\r\n this.add(ids, [eventPackage]);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * interface webhook is used when eventing is received via webhook\r\n * This object is passed to the O2G SDK, the connectDispatcher is called by the O2G SDK.\r\n */\r\nexport interface WebHook {\r\n\r\n /**\r\n * The url for the web hook\r\n */\r\n url: string;\r\n\r\n /**\r\n * The connect callback \r\n * @param dispatcher \r\n */\r\n connectDispatcher: (dispatcher: EventDispatcher) => void;\r\n}\r\n\r\n\r\n/**\r\n * A builder of {@link Subscription}.\r\n *\r\n * <p>\r\n * An instance of Builder can be gotten with {@link Subscription.Builder}.\r\n * <p>\r\n * The builder can be used to configure an event subscription for the O2G\r\n * server. Each methods modifies the state of the builder and returns the same\r\n * instance. The {@link build} method returns a new Subscription each time it is invoked.\r\n * @example\r\n * ```typescript\r\n * let subscription = Subscription.Builder\r\n * .addRoutingEvents()\r\n * .addTelephonyEvents()\r\n * .addEventSummaryEvents()\r\n * .setTimeout(10)\r\n * .build();\r\n * \r\n * ```\r\n */\r\nexport interface Builder {\r\n\r\n /**\r\n * Adds routing events to the subscription.\r\n * <p>The following event associated to the {@link Routing} service is added to the subscription:\r\n * <ul>\r\n * <li>{@link Routing.ON_ROUTING_STATE_CHANGED}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the routing events requires having a <b>TELEPHONY_ADVANCED</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addRoutingEvents:(ids: string[]) => Builder;\r\n\r\n /**\r\n * Adds telephony events to the subscription.\r\n * <p>The following event associated to the {@link Telephony} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link Telephony.ON_TELEPHONY_STATE}</li>\r\n\t * <li>{@link Telephony.ON_CALL_CREATED}</li>\r\n\t * <li>{@link Telephony.ON_CALL_MODIFIED}</li>\r\n\t * <li>{@link Telephony.ON_CALL_REMOVED}</li>\r\n\t * <li>{@link Telephony.ON_USER_STATE_MODIFIED}</li>\r\n\t * <li>{@link Telephony.ON_DEVICE_STATE_MODIFIED}</li> \r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the telephony events requires having a <b>TELEPHONY_ADVANCED</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addTelephonyEvents:(ids: string[]) => Builder;\r\n\r\n /**\r\n * Adds user management events to the subscription.\r\n * <p>The following event associated to the {@link Users} service is added to the subscription:\r\n * <ul>\r\n * <li>{@link Users.ON_USER_CREATED}</li>\r\n * <li>{@link Users.ON_USER_DELETED}</li>\r\n * </ul>\r\n * <p>The session must has been opened by an administrator.\r\n * <p>Subscribing to the user management events does not require any license.\r\n */\r\n addUsersManagementEvents:() => Builder;\r\n\r\n /**\r\n * Adds event summary events to the subscription.\r\n * <p>The following event associated to the {@link EventSummary} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link EventSummary.ON_EVENT_SUMMARY_UPDATED}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the event summary events requires having a <b>TELEPHONY_ADVANCED</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addEventSummaryEvents:(ids: string[]) => Builder;\r\n\r\n\r\n /**\r\n * Adds rsi events to the subscription.\r\n * <p>The following event associated to the {@link Rsi} service is added to the subscription:\r\n * <ul>\r\n * <li>{@link Rsi.ON_DIGIT_COLLECTED}</li>\r\n * <li>{@link Rsi.ON_TONE_GENERATED_START}</li>\r\n * <li>{@link Rsi.ON_TONE_GENERATED_STOP}</li>\r\n * <li>{@link Rsi.ON_ROUTE_END}</li>\r\n * <li>{@link Rsi.ON_ROUTE_REQUEST}</li> \r\n * </ul>\r\n * <p>The session must has been opened by an administrator.\r\n * <p>Subscribing to the rsi events requires having a <b>CONTACTCENTER_RSI</b> license.\r\n */\r\n// addRsiEvents:() => Builder;\r\n\r\n\r\n /**\r\n * Adds pbx management events to the subscription.\r\n * <p>The following event associated to the {@link PbxManagement} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link PbxManagement.ON_PBX_OBJECT_INSTANCE_CREATED}</li>\r\n\t * <li>{@link PbxManagement.ON_PBX_OBJECT_INSTANCE_DELETED}</li>\r\n\t * <li>{@link PbxManagement.ON_PBX_OBJECT_INSTANCE_MODIFIED}</li>\r\n * </ul>\r\n * <p>The session must has been opened by an administrator.\r\n * <p>Subscribing to the pbx management events requires having a <b>MANAGEMENT</b> license.\r\n */\r\n addPbxManagementEvents:() => Builder;\r\n\r\n /**\r\n * Adds communication log events to the subscription.\r\n * <p>The following event associated to the {@link CommunicationLog} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link CommunicationLog.ON_COM_RECORD_CREATED}</li>\r\n\t * <li>{@link CommunicationLog.ON_COM_RECORD_MODIFIED}</li>\r\n\t * <li>{@link CommunicationLog.ON_COM_RECORDS_DELETED}</li>\r\n\t * <li>{@link CommunicationLog.ON_COM_RECORDS_ACK}</li>\r\n\t * <li>{@link CommunicationLog.ON_COM_RECORDS_UNACK}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the communication log events requires having a <b>TELEPHONY_ADVANCED</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addCommunicationLogEvents:(ids: string[]) => Builder;\r\n\r\n /**\r\n * Adds call center agent events to the subscription.\r\n * <p>The following event associated to the {@link CallCenterAgent} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link CallCenterAgent.ON_AGENT_STATE_CHANGED}</li>\r\n\t * <li>{@link CallCenterAgent.ON_AGENT_SKILL_CHANGED}</li>\r\n\t * <li>{@link CallCenterAgent.ON_SUPERVISOR_HELP_REQUESTED}</li>\r\n\t * <li>{@link CallCenterAgent.ON_SUPERVISOR_HELP_CANCELLED}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the call center agent events requires having a <b>CONTACTCENTER_AGENT</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addCallCenterAgentEvents:(ids: string[]) => Builder;\r\n\r\n\r\n /**\r\n * Adds call center pilot events to the subscription.\r\n * <p>The following event associated to the {@link CallCenterPilot} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link CallCenterPilot.ON_PILOT_CALL_CREATED}</li>\r\n\t * <li>{@link CallCenterPilot.ON_PILOT_CALL_QUEUED}</li>\r\n\t * <li>{@link CallCenterPilot.ON_PILOT_CALL_REMOVED}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the call center pilot events requires having a <b>CONTACTCENTER_SVCS</b> license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addCallCenterPilotEvents:(ids: string[]) => Builder;\r\n \r\n /**\r\n * Adds maintenance events to the subscription.\r\n * <p>The following event associated to the {@link Maintenance} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link Maintenance.ON_CTI_LINK_DOWN}</li>\r\n\t * <li>{@link Maintenance.ON_CTI_LINK_UP}</li>\r\n\t * <li>{@link Maintenance.ON_PBX_LOADED}</li>\r\n * </ul>\r\n * <p>The session must has been opened by an administrator.\r\n * <p>Subscribing to the maintenance events does not require any license.\r\n */\r\n addMaintenanceEvents:() => Builder;\r\n\r\n /**\r\n * Adds user events to the subscription.\r\n * <p>The following event associated to the {@link Users} service is added to the subscription:\r\n * <ul>\r\n\t * <li>{@link Users.ON_USER_INFO_CHANGED}</li>\r\n * </ul>\r\n * <p>If the session has been opened for a user, the 'ids' parameter is\r\n * ignored, but it is mandatory if the session has been opened by an\r\n * administrator.\r\n * <p>Subscribing to the user events does not require any license.\r\n * @param ids the ids to filter events on.\r\n */\r\n addUserEvents:(ids: string[]) => Builder;\r\n\r\n /**\r\n * Set lifetime of the event channel.\r\n * @param value The lifetime of the event channel in minutes\r\n */\r\n setTimeout:(value: number) => Builder;\r\n\r\n /**\r\n * Set the required event version. By default, the version \"1.0\" is used.\r\n * @param value The event version\r\n */\r\n setVersion:(value: string) => Builder;\r\n\r\n /**\r\n * \r\n * @param value Set the webhook URL to use for notification.\r\n */\r\n setWebHook: (webHook: WebHook) => Builder;\r\n\r\n /**\r\n * Build the subscription.\r\n */\r\n build:() => Subscription;\r\n}\r\n\r\n\r\n/**\r\n * Subscription represents a subscription request used to subscribe events from the O2G Server. \r\n * An application receives event on a http chunk connection established with the O2G server.\r\n * <p>\r\n * The application builds a subscription using the {@link Builder} object. This object provides a builder pattern that eases\r\n * the creation of a subscription.\r\n * @example\r\n * To create a subscription, uses the methods provided by the Builder object.\r\n * ```typescript\r\n * let subscription = Subscription.Builder\r\n * .addRoutingEvents()\r\n * .addTelephonyEvents()\r\n * .addEventSummaryEvents()\r\n * .setTimeout(10)\r\n * .build();\r\n * \r\n * ```\r\n * @see {@link subscribe}\r\n *\r\n */\r\n export abstract class Subscription {\r\n \r\n private _timeout: number;\r\n private _filter: EventFilter;\r\n private _version: string;\r\n private _webHook: WebHook | null;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected constructor(version: string, timeout: number, filter: EventFilter, webHook: WebHook | null) {\r\n this._timeout = timeout;\r\n this._version = version;\r\n this._filter = filter;\r\n this._webHook = webHook;\r\n }\r\n\r\n get timeout(): number {\r\n return this._timeout;\r\n }\r\n\r\n get version(): string {\r\n return this._version;\r\n }\r\n\r\n get filter(): EventFilter {\r\n return this._filter;\r\n }\r\n\r\n get webHook(): WebHook | null {\r\n return this._webHook;\r\n }\r\n\r\n /**\r\n * The subscription builder to use to build a new Subscription.\r\n * @example\r\n * To create a subscription, uses the methods provided by the Builder object.\r\n */\r\n public static Builder: Builder = new class implements Builder {\r\n _version: string;\r\n _timeout: number;\r\n _filter: EventFilter;\r\n _webHook: WebHook | null;\r\n \r\n constructor() {\r\n this._version = \"1.0\";\r\n this._timeout = 0;\r\n this._filter = new EventFilter();\r\n this._webHook = null;\r\n }\r\n \r\n addRoutingEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.Routing);\r\n return this;\r\n }\r\n \r\n addTelephonyEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.Telephony);\r\n return this;\r\n }\r\n\r\n addEventSummaryEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.EventSummary);\r\n return this;\r\n }\r\n \r\n addUsersManagementEvents() {\r\n this._filter.addPackage([], EventPackage.Users);\r\n return this;\r\n }\r\n \r\n addMaintenanceEvents() {\r\n this._filter.addPackage([], EventPackage.System);\r\n return this;\r\n }\r\n\r\n addRsiEvents() {\r\n this._filter.addPackage([], EventPackage.Rsi);\r\n return this;\r\n }\r\n\r\n addPbxManagementEvents() {\r\n this._filter.addPackage([], EventPackage.PbxManagement);\r\n return this;\r\n }\r\n \r\n addCommunicationLogEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.CommunicationLog);\r\n return this;\r\n }\r\n \r\n addCallCenterAgentEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.Agent);\r\n return this;\r\n }\r\n\r\n addCallCenterPilotEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.Pilot);\r\n return this;\r\n }\r\n \r\n addUserEvents(ids: string[]) {\r\n this._filter.addPackage(ids, EventPackage.User);\r\n return this;\r\n }\r\n \r\n setTimeout(value: number) {\r\n this._timeout = value;\r\n return this;\r\n }\r\n \r\n setVersion(value: string) {\r\n this._version = value;\r\n return this;\r\n }\r\n\r\n setWebHook(value: WebHook) {\r\n this._webHook = value;\r\n return this;\r\n }\r\n \r\n build() {\r\n return new SubscriptionImpl(this._version, this._timeout, this._filter, this._webHook);\r\n } \r\n };\r\n}\r\n\r\nclass SubscriptionImpl extends Subscription {\r\n \r\n /**\r\n * @internal\r\n */\r\n public constructor(version: string, timeout: number, filter: EventFilter, webHook: WebHook | null) {\r\n super(version, timeout, filter, webHook);\r\n } \r\n} ","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * CallType represents the possible call types in a charging ticket.\r\n */\r\n export enum CallType {\r\n\r\n PublicNetworkCall = \"PublicNetworkCall\",\r\n PublicNetworkCallThroughPrivateNetwork = \"PublicNetworkCallThroughPrivateNetwork\",\r\n PrivateNetworkCall = \"PrivateNetworkCall\",\r\n LocalNetworkCall = \"Local etworkCall\",\r\n PublicNetworkIncomingCall = \"PublicNetwork IncomingCall\",\r\n PublicNetworkIncomingCallThroughPrivateNetwork = \"PublicNetworkIncomingCallThroughPrivateNetwork\",\r\n Unspecified = \"Unspecified\",\r\n PrivateNetworkOutgoingCallToPublicNetwork = \"PrivateNetworkOutgoingCallToPublicNetwork\",\r\n PrivateNetworkOutgoingCallToPrivateNetwork = \"PrivateNetworkOutgoingCallToPrivateNetwork\",\r\n PublicNetworkIncomingCallToPrivateNetwork = \"PublicNetworkIncomingCallToPrivateNetwork\",\r\n PrivateNetworkIncomingCallToPrivateNetwork = \"PrivateNetworkIncomingCallToPrivateNetwork\",\r\n PublicOrPrivateNetworkOutgoingCallThroughPrivateNetwork = \"PublicOrPrivateNetworkOutgoingCallThroughPrivateNetwork\",\r\n PublicOrPrivateNetworkIncomingCallThroughPrivateNetwork = \"PublicOrPrivateNetworkIncomingCallThroughPrivateNetwork\",\r\n PrivateNetworkIncomingCall = \"PrivateNetworkIncomingCall\",\r\n LocalNode = \"LocalNode\",\r\n LocalTransit = \"LocalTransit\"\r\n}\r\n\r\nexport namespace CallType {\r\n export function isCallType(value: string): value is CallType {\r\n return Object.values(CallType).includes(value as CallType);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * The type of access of a PIN code.\r\n */\r\nexport enum PinControl {\r\n\r\n /**\r\n * PIN code can be used from any set according to categories.\r\n */\r\n ByCategory = \"PIN_Category\",\r\n\r\n /**\r\n * PIN code is restricted to the users set.\r\n */\r\n RestrictedToOwner = \"PIN_Restricted_To_Owner_Set\",\r\n\r\n /**\r\n * PIN code can be used on any set in the system.\r\n */\r\n UniversalAccess = \"PIN_Universal_Access\",\r\n\r\n /**\r\n * PIN code is limited to specific group.\r\n */\r\n ByGroup = \"PIN_By_Group\"\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport HttpContent from '../util/http-content';\r\nimport {AssertUtil} from '../util/assert';\r\nimport { User } from '../../types/users/users-types';\r\n\r\ntype LoginsResponse = {\r\n loginNames: string[];\r\n}\r\n\r\nexport default class UserManagementRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getLogins(nodeIds: number[] | null): Promise<string[] | null> {\r\n\r\n let uriGet = this._uri;\r\n if (nodeIds) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"nodeIds\", nodeIds.join(';'));\r\n }\r\n\r\n const logins = this.getResult<LoginsResponse>(await RestService._httpClient.get(uriGet));\r\n if (logins && Array.isArray(logins.loginNames)) {\r\n return logins.loginNames;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getByDeviceNumber(deviceNumber: string): Promise<string | null> {\r\n\r\n const uriGet = UtilUri.appendQuery(this._uri, \"deviceNumber=\", AssertUtil.notNullOrEmpty(deviceNumber, \"deviceNumber\"));\r\n\r\n const logins = this.getResult<LoginsResponse>(await RestService._httpClient.get(uriGet));\r\n if (logins && Array.isArray(logins.loginNames)) {\r\n return logins.loginNames[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n\t}\r\n\r\n public async createUsers(nodeId: number, deviceNumbers: string[] | null): Promise<boolean> {\r\n\r\n let uriPost = this._uri;\r\n\r\n let req: any = new Object();\r\n req.nodeId = AssertUtil.positive(nodeId, \"nodeId\");\r\n\r\n if (deviceNumbers && (deviceNumbers.length > 0)) {\r\n req.deviceNumbers = deviceNumbers;\r\n }\r\n else {\r\n req.all = true;\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(JSON.stringify(req)));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async getByLoginName(loginName: string): Promise<User | null> {\r\n\r\n const uriGet = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(loginName, \"loginName\"));\r\n return this.getResult<User>(await RestService._httpClient.get(uriGet));\r\n \r\n }\r\n\r\n public async deleteUser(loginName: string): Promise<boolean> {\r\n\r\n const uriDelete = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(loginName, \"loginName\"));\r\n\r\n const httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { Calendar } from \"../../../types/cc-mngt/calendar/calendar\";\r\nimport { DayOfWeek } from \"../../../types/cc-mngt/calendar/day-of-week\";\r\nimport { ExceptionCalendar } from \"../../../types/cc-mngt/calendar/exception-calendar\";\r\nimport { NormalCalendar } from \"../../../types/cc-mngt/calendar/normal-calendar\";\r\nimport { Transition, PilotOperatingMode } from \"../../../types/cc-mngt/calendar/transition\";\r\nimport { Pilot } from \"../../../types/cc-mngt/pilot\";\r\n\r\n\r\nexport interface O2GPilot {\r\n number: string;\r\n name: string;\r\n state: Pilot.ServiceState;\r\n detailedState: Pilot.Status;\r\n waitingTime: number;\r\n saturation: boolean;\r\n rules: {\r\n ruleList: {\r\n ruleNumber: string;\r\n name: string;\r\n active: boolean;\r\n } []\r\n };\r\n possibleTransfer: boolean;\r\n supervisedTransfer: boolean;\r\n}\r\n\r\n\r\nenum O2GPilotOperatingMode {\r\n normal = \"normal\",\r\n closed = \"closed\",\r\n forward = \"forward\"\r\n}\r\n\r\nexport enum O2GDayOfWeek {\r\n monday = \"monday\",\r\n tuesday = \"tuesday\",\r\n wednesday = \"wednesday\",\r\n thursday = \"thursday\",\r\n friday = \"friday\",\r\n saturday = \"saturday\",\r\n sunday = \"sunday\"\r\n}\r\n\r\nexport interface PilotTransition {\r\n time: string;\r\n ruleNumber: number;\r\n mode: O2GPilotOperatingMode;\r\n}\r\n\r\nexport const toPilotTransition = (transition: Transition): PilotTransition => ({\r\n time: transition.time.toString(),\r\n ruleNumber: transition.ruleNumber,\r\n mode: O2GPilotOperatingMode[transition.mode.toLowerCase() as keyof typeof O2GPilotOperatingMode],\r\n});\r\n\r\nexport const fromPilotTransition = (pilot: PilotTransition): Transition => ({\r\n time: Transition.Time.parse(pilot.time),\r\n ruleNumber: pilot.ruleNumber,\r\n mode: PilotOperatingMode[pilot.mode.toUpperCase() as keyof typeof PilotOperatingMode],\r\n});\r\n\r\n\r\nexport interface PilotTransitions {\r\n number: number;\r\n transition: PilotTransition;\r\n}\r\n\r\nexport const createPilotTransitions = (number: number, transition: PilotTransition): PilotTransitions => ({\r\n number,\r\n transition\r\n});\r\n\r\nexport const getTransitionIndex = (pt: PilotTransitions): number => pt.number;\r\nexport const toTransition = (pt: PilotTransitions): Transition => fromPilotTransition(pt.transition);\r\n\r\n//------------------------------------------------------------\r\n// NormalTransitions\r\n//------------------------------------------------------------\r\nexport interface NormalTransitions {\r\n day: O2GDayOfWeek;\r\n list: PilotTransitions[];\r\n}\r\n\r\n// NormalTransitions => Transition[]\r\nexport const toDayTransitions = (normal: NormalTransitions): Transition[] => {\r\n const transitions: Transition[] = [];\r\n\r\n if (normal.list) {\r\n normal.list.forEach(t => {\r\n transitions[t.number - 1] = toTransition(t);\r\n });\r\n }\r\n\r\n return transitions;\r\n};\r\n\r\n//------------------------------------------------------------\r\n// ExceptionTransitions\r\n//------------------------------------------------------------\r\nexport interface ExceptionTransitions {\r\n date: string;\r\n list: PilotTransitions[];\r\n}\r\n\r\nexport const formatCalendarDate = (date: Date): string => {\r\n const year = date.getFullYear();\r\n const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based\r\n const day = String(date.getDate()).padStart(2, '0');\r\n return `${year}${month}${day}`;\r\n};\r\n\r\nexport const parseCalendarDate = (date: string): Date => {\r\n if (!/^\\d{8}$/.test(date)) {\r\n throw new Error(\"Invalid date format in calendar. Expected yyyymmdd.\");\r\n }\r\n\r\n const year = parseInt(date.substring(0, 4), 10);\r\n const month = parseInt(date.substring(4, 6), 10) - 1; // Month is 0-based\r\n const day = parseInt(date.substring(6, 8), 10);\r\n\r\n const parsedDate = new Date(year, month, day);\r\n\r\n if (isNaN(parsedDate.getTime())) {\r\n throw new Error(\"Invalid date components in calendar.\");\r\n }\r\n\r\n return parsedDate;\r\n };\r\n\r\n\r\nexport const toDateTransitions = (exception: ExceptionTransitions): Transition[] => {\r\n const transitions: Transition[] = [];\r\n\r\n if (exception.list) {\r\n exception.list.forEach(t => {\r\n transitions[t.number - 1] = toTransition(t);\r\n });\r\n }\r\n\r\n return transitions;\r\n};\r\n\r\n\r\n//------------------------------------------------------------\r\n// O2GExceptionCalendar\r\n//------------------------------------------------------------\r\nexport interface O2GExceptionCalendar {\r\n calendar?: ExceptionTransitions[];\r\n}\r\n\r\nexport const toExceptionCalendar = (exceptionCalendar: O2GExceptionCalendar): ExceptionCalendar => {\r\n \r\n const dayTransitions = new Map<Date, Transition[]>();\r\n\r\n if (exceptionCalendar.calendar) {\r\n exceptionCalendar.calendar.forEach(t => {\r\n const date: Date = parseCalendarDate(t.date);\r\n const transitions = toDateTransitions(t);\r\n\r\n dayTransitions.set(date, transitions);\r\n });\r\n }\r\n\r\n return new ExceptionCalendar(dayTransitions);\r\n};\r\n\r\n\r\n//------------------------------------------------------------\r\n// O2GNormalCalendar\r\n//------------------------------------------------------------\r\nexport interface O2GNormalCalendar {\r\n calendar: NormalTransitions[];\r\n}\r\n\r\nexport const toNormalCalendar = (normalCalendar: O2GNormalCalendar): NormalCalendar => {\r\n \r\n const dayTransitions = new Map<DayOfWeek, Transition[]>();\r\n\r\n if (normalCalendar.calendar) {\r\n normalCalendar.calendar.forEach(t => {\r\n const dayOfWeek: DayOfWeek = DayOfWeek[t.day.toUpperCase() as keyof typeof DayOfWeek];\r\n const transitions = toDayTransitions(t);\r\n dayTransitions.set(dayOfWeek, transitions);\r\n });\r\n }\r\n\r\n return new NormalCalendar(dayTransitions);\r\n};\r\n\r\n\r\n//------------------------------------------------------------\r\n// O2GNormalCalendar\r\n//------------------------------------------------------------\r\nexport interface O2GCalendar {\r\n normalDays?: O2GNormalCalendar;\r\n exceptionDays?: O2GExceptionCalendar;\r\n}\r\n\r\nexport const toCalendar = (calendar: O2GCalendar): Calendar => {\r\n return {\r\n normalDays: calendar.normalDays ? toNormalCalendar(calendar.normalDays) : null,\r\n exceptionDays: calendar.exceptionDays ? toExceptionCalendar(calendar.exceptionDays) : null,\r\n }\r\n};\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { AbstractCalendar } from \"./abstract-calendar\";\r\nimport { DayOfWeek } from \"./day-of-week\";\r\nimport { Transition } from \"./transition\";\r\n\r\n/**\r\n * Represents the normal calendar associated with a CCD pilot.\r\n *\r\n * The normal calendar defines pilot behavior for each day of the week.\r\n * You can define up to 10 time slots per day, for a maximum of 70 per week.\r\n */\r\nexport class NormalCalendar extends AbstractCalendar<DayOfWeek> {\r\n \r\n constructor(transitions: Map<DayOfWeek, Transition[]>) {\r\n super(transitions);\r\n }\r\n\r\n /**\r\n * Get the set of days of week that have transitions configured.\r\n */\r\n getDays(): Set<DayOfWeek> {\r\n return new Set(this.transitions.keys());\r\n }\r\n\r\n /**\r\n * Get a specific transition by day and index.\r\n * @param day The day of the week\r\n * @param index The transition index\r\n */\r\n getTransitionAt(day: DayOfWeek, index: number): Transition | undefined {\r\n const dayTransitions = this.transitions.get(day);\r\n return dayTransitions?.[index];\r\n }\r\n\r\n /**\r\n * Get all transitions for a specific day.\r\n * @param day The day of the week\r\n */\r\n getTransitions(day: DayOfWeek): Transition[] {\r\n return this.transitions.get(day) || [];\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { injectable } from 'inversify';\r\nimport EventEmitter from \"events\";\r\nimport { EventMap } from '../../types/events/events';\r\n\r\n\r\n// Adapter functions\r\nexport type EventAdapter<Name extends keyof EventMap> = (eventData: any) => EventMap[Name];\r\n\r\n\r\nexport interface EventRegistry {\r\n register<Name extends keyof EventMap>(\r\n emitter: EventEmitter, \r\n eventName: Name, \r\n adapter?: (rawData: any) => EventMap[Name]\r\n ): void;\r\n}\r\n\r\nexport interface EventDispatcher {\r\n dispatch(event: { eventName: string; [key: string]: any }): void\r\n}\r\n\r\nexport interface IEventSink extends EventDispatcher, EventRegistry {}\r\n\r\n\r\n@injectable()\r\nexport class EventSink implements IEventSink {\r\n\t\r\n private _emitters: Map<keyof EventMap, EventEmitter> = new Map();\r\n private _adapters: Map<keyof EventMap, (event: EventMap[keyof EventMap]) => any> = new Map();\r\n\r\n constructor() {\r\n this._emitters = new Map();\r\n this._adapters = new Map();\r\n }\r\n\r\n register<Name extends keyof EventMap>(\r\n emitter: EventEmitter, \r\n eventName: Name, \r\n adapter?: (rawData: any) => EventMap[Name]\r\n ): void {\r\n this._emitters.set(eventName, emitter);\r\n\r\n if (adapter) {\r\n this._adapters.set(eventName, adapter);\r\n }\r\n }\r\n\r\n dispatch<Name extends keyof EventMap>(event: EventMap[Name]): void {\r\n const eventName = event.eventName;\r\n const emitter = this._emitters.get(eventName);\r\n\r\n if (emitter) {\r\n const adapter = this._adapters.get(eventName);\r\n if (adapter) {\r\n emitter.emit(eventName, adapter(event));\r\n } else {\r\n emitter.emit(eventName, event);\r\n }\r\n }\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport HttpContent from '../util/http-content';\r\nimport {ProgrammableKey} from '../../types/phoneset/programmable-key';\r\nimport {SoftKey} from '../../types/phoneset/softkey';\r\nimport {Pin} from '../../types/phoneset/pin';\r\nimport { DynamicState } from '../../types/phoneset/phoneset-types';\r\nimport {O2GPinCode} from '../types/phoneset/phoneset-types';\r\nimport { Device } from '../../types/users/users-types';\r\n\r\n\r\ntype DeviceList = {\r\n devices: Device[];\r\n}\r\n\r\ntype ProgrammableKeyList = {\r\n pkeys: ProgrammableKey[];\r\n}\r\n\r\ntype SoftKeyList = {\r\n skeys: SoftKey[];\r\n}\r\n\r\nexport default class PhoneSetProgrammingRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async getDevices(loginName: string | null): Promise<Device[] | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \"devices\");\r\n\r\n const devices = this.getResult<DeviceList>(await RestService._httpClient.get(uriGet));\r\n if (devices && Array.isArray(devices.devices)) {\r\n return devices.devices;\r\n \r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getDevice(loginName: string | null, deviceId: string): Promise<Device | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"));\r\n\r\n return this.getResult<Device>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n public async getProgrammableKeys(loginName: string | null, deviceId: string): Promise<ProgrammableKey[] | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"programmeableKeys\");\r\n\r\n const pkeys = this.getResult<ProgrammableKeyList>(await RestService._httpClient.get(uriGet));\r\n if (pkeys && Array.isArray(pkeys.pkeys)) {\r\n return pkeys.pkeys;\r\n \r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getProgrammedKeys(loginName: string | null, deviceId: string): Promise<ProgrammableKey[] | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"programmedKeys\");\r\n\r\n const pkeys = this.getResult<ProgrammableKeyList>(await RestService._httpClient.get(uriGet));\r\n if (pkeys && Array.isArray(pkeys.pkeys)) {\r\n return pkeys.pkeys;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async setProgrammableKey(loginName: string | null, deviceId: string, key: ProgrammableKey): Promise<boolean> {\r\n\r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"programmeableKeys\",\r\n AssertUtil.positiveStrict(AssertUtil.notNull(key, \"key\").position, \"key.position\").toString());\r\n\r\n let json = JSON.stringify(key);\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteProgrammableKey(loginName: string | null, deviceId: string, position: number): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"programmeableKeys\",\r\n AssertUtil.positiveStrict(position, \"position\").toString());\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async getSoftKeys(loginName: string | null, deviceId: string): Promise<SoftKey[] | null> {\r\n \r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"softKeys\");\r\n\r\n const skeys = this.getResult<SoftKeyList>(await RestService._httpClient.get(uriGet));\r\n if (skeys && Array.isArray(skeys.skeys)) {\r\n return skeys.skeys;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async setSoftKey(loginName: string | null, deviceId: string, key: SoftKey): Promise<boolean> {\r\n \r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"softKeys\",\r\n AssertUtil.positiveStrict(AssertUtil.notNull(key, \"key\").position, \"key.position\").toString());\r\n\r\n let json = JSON.stringify(key);\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteSoftKey(loginName: string | null, deviceId: string, position: number): Promise<boolean> {\r\n\r\n let uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"softKeys\",\r\n AssertUtil.positiveStrict(position, \"position\").toString());\r\n\r\n var httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n private async _doDeviceAction(loginName: string | null, deviceId: string, action: string, activate: boolean): Promise<boolean> {\r\n\r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n action);\r\n \r\n uriPut = UtilUri.appendQuery(uriPut, \"activate\", activate ? \"true\" : \"false\");\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async lockDevice(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"lock\", true);\r\n }\r\n\r\n public async unlockDevice(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"lock\", false);\r\n }\r\n\r\n public async enableCampon(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"campon\", true);\r\n }\r\n \r\n public async disableCampon(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"campon\", false);\r\n }\r\n \r\n public async getPinCode(loginName: string | null, deviceId: string): Promise<Pin | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"pin\");\r\n \r\n const pin = this.getResult<O2GPinCode>(await RestService._httpClient.get(uriGet));\r\n if (pin) {\r\n return Pin.build(pin);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n \r\n public async setPinCode(loginName: string | null, deviceId: string, code: Pin): Promise<boolean> {\r\n\r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"pin\");\r\n\r\n let json = JSON.stringify(Pin.from(code));\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n \r\n public async getDynamicState(loginName: string | null, deviceId: string): Promise<DynamicState | null> {\r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"dynamicState\");\r\n \r\n return this.getResult<DynamicState>(await RestService._httpClient.get(uriGet));\r\n }\r\n \r\n public async setAssociate(loginName: string | null, deviceId: string, associate: string): Promise<boolean> {\r\n \r\n let uriPut = UtilUri.appendPath(\r\n this._uri, \r\n AssertUtil.notNullOrEmpty(loginName, \"loginName\"), \r\n \"devices\",\r\n AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n \"associate\");\r\n\r\n let json = JSON.stringify({\r\n \"associate\": AssertUtil.notNullOrEmpty(associate, \"associate\")\r\n });\r\n\r\n var httpResponse = await RestService._httpClient.put(uriPut, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n \r\n public async activateRemoteExtension(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"REActive\", true);\r\n }\r\n \r\n public async deactivateRemoteExtension(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._doDeviceAction(loginName, deviceId, \"REActive\", false);\r\n }\r\n\r\n\r\n}","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GPinCode } from \"../../internal/types/phoneset/phoneset-types\";\r\nimport { PinControl } from \"./pin-control\";\r\n\r\n/**\r\n * Pin class represents a PIN (Personal Identification Number)\r\n * <p>\r\n * This service allows the user to announce that the call he is making is a personal (external) call and not a business call. \r\n * Using pulse metering tickets, the company is then able to invoice this call again as a personal call.\r\n * <p>\r\n * This service can be applied to local users (employees) or visitors (in this case, the created user set is a virtual set without a physical address). \r\n * <p>\r\n * To use this service, users must dial the personal prefix followed by the PIN No. and then the secret code followed by the external number. \r\n * <p>\r\n * The Personal Identification Number is private and secret; only the administrator and, in certain cases, the pulse metering administrator may know it.\r\n */\r\nexport class Pin {\r\n private _number!: string;\r\n private _withSecretCode!: boolean;\r\n private _control!: PinControl;\r\n private _group!: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n // Fields are initialized via the static `build` method.\r\n }\r\n\r\n /**\r\n * Returns the PIN number.\r\n */\r\n public get number(): string {\r\n return this._number;\r\n }\r\n\r\n /**\r\n * Returns whether the PIN code requires validation via the user's secret code.\r\n */\r\n public get withSecretCode(): boolean {\r\n return this._withSecretCode;\r\n }\r\n\r\n /**\r\n * Returns the access control associated with this PIN code.\r\n */\r\n public get control(): PinControl {\r\n return this._control;\r\n }\r\n\r\n /**\r\n * Returns the PIN group associated with this PIN code.\r\n */\r\n public get group(): number {\r\n return this._group;\r\n }\r\n\r\n /**\r\n * Builds a Pin object from an O2GPinCode object.\r\n * @internal\r\n */\r\n public static build(pin: O2GPinCode): Pin {\r\n const p = new Pin();\r\n\r\n p._number = pin.Pin_Number;\r\n p._withSecretCode = pin.With_Secret_Code;\r\n p._group = pin.Pin_Group;\r\n p._control = PinControl[pin.Pin_Type_Of_Control as keyof typeof PinControl];\r\n\r\n return p;\r\n }\r\n\r\n /**\r\n * Converts a Pin instance into an O2GPinCode object.\r\n * @internal\r\n */\r\n public static from(pin: Pin): O2GPinCode {\r\n return {\r\n Pin_Number: pin._number,\r\n Pin_Group: pin._group,\r\n With_Secret_Code: pin._withSecretCode,\r\n Pin_Type_Of_Control: pin._control.toString()\r\n };\r\n }\r\n}\r\n","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { PilotRule } from \"./pilot-rule\";\r\n\r\n\r\n\r\nexport class PilotRuleSet {\r\n private rules: Map<number, PilotRule>;\r\n\r\n protected constructor(rules: Map<number, PilotRule>) {\r\n this.rules = rules;\r\n }\r\n\r\n /**\r\n * Returns the rule with the specified number.\r\n * @param number The rule number\r\n * @returns The pilot rule with the specified number or undefined if not found.\r\n */\r\n public get(number: number): PilotRule | undefined {\r\n return this.rules.get(number);\r\n }\r\n\r\n /**\r\n * Determines whether the specified rule exists in this rule set.\r\n * @param number The rule number to search\r\n * @returns true if the rule is present; false otherwise.\r\n */\r\n public contains(number: number): boolean {\r\n return this.rules.has(number);\r\n }\r\n\r\n /**\r\n * Returns the set of rule numbers contained in this rule set.\r\n * @returns A Set containing the rule numbers.\r\n */\r\n public getRulesNumbers(): Set<number> {\r\n return new Set(this.rules.keys());\r\n }\r\n\r\n /**\r\n * Returns the rules in this rule set.\r\n * @returns A collection (array) of PilotRule.\r\n */\r\n public getRules(): PilotRule[] {\r\n return Array.from(this.rules.values());\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * Option enum defines the possible filter option when querying a communication log.\r\n * It's possible to combine the options:\r\n * @example\r\n * ```typescript\r\n * let options = Option.UNANSWERED | Option.UNACKNOWLEDGED\r\n * ```\r\n * @see {@link QueryFilter}\r\n */\r\n\r\nexport enum Option {\r\n\r\n /**\r\n * The default value that represents no filtering.\r\n */\r\n ONE = 0,\r\n\r\n /**\r\n * Use this value to filter unanswered calls.\r\n */\r\n UNANSWERED = 1, \r\n\r\n /**\r\n * Use this value to filter unacknowledged calls.\r\n */\r\n UNACKNOWLEDGED = 2\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n\r\n/**\r\n * Defines the day of a week.\r\n */\r\nexport enum DayOfWeek {\r\n /**\r\n * The day-of-week of Monday.\r\n */\r\n MONDAY = 'MONDAY',\r\n\r\n /**\r\n * The day-of-week of Tuesday.\r\n */\r\n TUESDAY = 'TUESDAY',\r\n\r\n /**\r\n * The day-of-week of Wednesday.\r\n */\r\n WEDNESDAY = 'WEDNESDAY',\r\n\r\n /**\r\n * The day-of-week of Thursday.\r\n */\r\n THURSDAY = 'THURSDAY',\r\n\r\n /**\r\n * The day-of-week of Friday.\r\n */\r\n FRIDAY = 'FRIDAY',\r\n\r\n /**\r\n * The day-of-week of Saturday.\r\n */\r\n SATURDAY = 'SATURDAY',\r\n\r\n /**\r\n * The day-of-week of Sunday.\r\n */\r\n SUNDAY = 'SUNDAY',\r\n}\r\n","/*\r\n* Copyright 2022 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {DeviceKey} from \"./device-key\";\r\n\r\n/**\r\n * SoftKey class represents a software key on an OmniPcx Enterprise device.\r\n */\r\nexport class SoftKey extends DeviceKey {\r\n\r\n /**\r\n * Construct a new SoftKey with the specified parameters.\r\n * @param position the key position\r\n * @param number the associated number\r\n * @param mnemonic the key mnemonic\r\n */\r\n constructor(position: number, number: string, mnemonic: string | null = null) {\r\n super(position, number, mnemonic);\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(pkey: any): SoftKey {\r\n return new SoftKey(pkey.position, pkey.number, pkey.mnemonic);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport PhoneSetProgrammingRest from \"./internal/rest/phone-set-prog-rest\";\r\nimport { Device } from \"./types/users/users-types\";\r\nimport { DynamicState } from \"./types/phoneset/phoneset-types\";\r\nimport {Pin} from \"./types/phoneset/pin\";\r\nimport {ProgrammableKey} from \"./types/phoneset/programmable-key\";\r\nimport {SoftKey} from \"./types/phoneset/softkey\";\r\n\r\nexport class PhoneSetProgramming {\r\n\r\n private _phoneSetProgrRest: PhoneSetProgrammingRest;\r\n\r\n constructor(phoneSetProgrRest: PhoneSetProgrammingRest) {\r\n this._phoneSetProgrRest = phoneSetProgrRest;\r\n\t}\r\n\r\n public async getDevices(loginName: string | null): Promise<Device[] | null> {\r\n return this._phoneSetProgrRest.getDevices(loginName);\r\n }\r\n \r\n public async getDevice(loginName: string | null, deviceId: string): Promise<Device | null> {\r\n return this._phoneSetProgrRest.getDevice(loginName, deviceId);\r\n }\r\n \r\n public async getProgrammableKeys(loginName: string | null, deviceId: string): Promise<ProgrammableKey[] | null> {\r\n return this._phoneSetProgrRest.getProgrammableKeys(loginName, deviceId);\r\n }\r\n \r\n public async getProgrammedKeys(loginName: string | null, deviceId: string): Promise<ProgrammableKey[] | null> {\r\n return this._phoneSetProgrRest.getProgrammedKeys(loginName, deviceId);\r\n }\r\n \r\n public async setProgrammableKey(loginName: string | null, deviceId: string, key: ProgrammableKey): Promise<boolean> {\r\n return this._phoneSetProgrRest.setProgrammableKey(loginName, deviceId, key);\r\n }\r\n \r\n public async deleteProgrammableKey(loginName: string | null, deviceId: string, position: number): Promise<boolean> {\r\n return this._phoneSetProgrRest.deleteProgrammableKey(loginName, deviceId, position);\r\n }\r\n \r\n public async getSoftKeys(loginName: string | null, deviceId: string): Promise<SoftKey[] | null> {\r\n return this._phoneSetProgrRest.getSoftKeys(loginName, deviceId);\r\n }\r\n \r\n public async setSoftKey(loginName: string | null, deviceId: string, key: SoftKey): Promise<boolean> {\r\n return this._phoneSetProgrRest.setSoftKey(loginName, deviceId, key);\r\n }\r\n \r\n public async deleteSoftKey(loginName: string | null, deviceId: string, position: number): Promise<boolean> {\r\n return this._phoneSetProgrRest.deleteSoftKey(loginName, deviceId, position);\r\n }\r\n \r\n public async lockDevice(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.lockDevice(loginName, deviceId);\r\n }\r\n \r\n public async unlockDevice(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.unlockDevice(loginName, deviceId);\r\n }\r\n \r\n public async enableCampon(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.enableCampon(loginName, deviceId);\r\n }\r\n \r\n public async disableCampon(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.disableCampon(loginName, deviceId);\r\n }\r\n \r\n public async getPinCode(loginName: string | null, deviceId: string): Promise<Pin | null> {\r\n return this._phoneSetProgrRest.getPinCode(loginName, deviceId);\r\n }\r\n \r\n public async setPinCode(loginName: string | null, deviceId: string, code: Pin): Promise<boolean> {\r\n return this._phoneSetProgrRest.setPinCode(loginName, deviceId, code);\r\n }\r\n \r\n public async getDynamicState(loginName: string | null, deviceId: string): Promise<DynamicState | null> {\r\n return this._phoneSetProgrRest.getDynamicState(loginName, deviceId);\r\n }\r\n \r\n public async setAssociate(loginName: string | null, deviceId: string, associate: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.setAssociate(loginName, deviceId, associate);\r\n }\r\n \r\n public async activateRemoteExtension(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.activateRemoteExtension(loginName, deviceId);\r\n }\r\n \r\n public async deactivateRemoteExtension(loginName: string | null, deviceId: string): Promise<boolean> {\r\n return this._phoneSetProgrRest.deactivateRemoteExtension(loginName, deviceId);\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { ComRecord } from \"./com-record\";\r\nimport { Page } from \"./page\";\r\nimport { O2GComHistoryRecords } from \"../../internal/types/comlog/o2gcomlog-types\";\r\n\r\n/**\r\n * QueryResult class represents the result of a communication log query.\r\n * The {@link CommunicationLog} service provides a paging mechanism that allows the application to query the result by pages.\r\n */\r\nexport class QueryResult {\r\n private _count!: number;\r\n private _page!: Page;\r\n private _records!: ComRecord[];\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {} // Keep constructor private to enforce static build usage.\r\n\r\n /** Returns the number of records in this result. */\r\n public get count(): number {\r\n return this._count;\r\n }\r\n\r\n /** Returns the page associated with this result. */\r\n public get page(): Page {\r\n return this._page;\r\n }\r\n\r\n /** Gets the list of communication records returned by the query. */\r\n public get records(): ComRecord[] {\r\n return this._records;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Factory method to build a QueryResult from raw O2G records.\r\n */\r\n public static build(o2gComRecords: O2GComHistoryRecords): QueryResult {\r\n const result = new QueryResult();\r\n\r\n const offset = o2gComRecords.offset ?? 0;\r\n const limit = o2gComRecords.limit ?? 0;\r\n\r\n result._page = new Page(offset, limit);\r\n result._count = o2gComRecords.totalCount ?? 0;\r\n result._records = (o2gComRecords.comHistoryRecords ?? []).map(ComRecord.build);\r\n\r\n return result;\r\n }\r\n}\r\n","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\n/**\r\n * The Page class allows to define a paging mechanism to query the\r\n * communication log.\r\n * @see {@link CommunicationLog.getComRecords}\r\n */\r\n export class Page {\r\n\r\n private _offset: number;\r\n private _limit: number;\r\n\r\n /**\r\n * Constructs a new Page starting with the specified offset and with the\r\n * specified length.\r\n * \r\n * @param offset the page offset\r\n * @param length the page length\r\n */\r\n constructor(offset: number, limit: number) {\r\n this._offset = offset;\r\n this._limit = limit;\r\n }\r\n\r\n /**\r\n * Moves to the next page.\r\n */\r\n public next() {\r\n this._offset += this._limit;\r\n }\r\n\r\n /**\r\n * Moves to the previous page.\r\n */\r\n public previous() {\r\n this._offset -= this._limit;\r\n if (this._offset < 0) {\r\n this._offset = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the offset of the page that is the offset of the first com record.\r\n */\r\n public get offset(): number {\r\n return this._offset;\r\n }\r\n\r\n /**\r\n * Returns the maximum number of record in this page.\r\n */\r\n public get limit(): number {\r\n return this._limit;\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { O2GChargingFile } from \"../../internal/types/analytics/o2ganalytics-types\";\r\n\r\n/**\r\n * ChargingFile class represent a charging file on OmniPCX Enterprise.\r\n * @see {@link Analytics.getChargingFiles}\r\n */\r\n export class ChargingFile {\r\n\r\n private _name!: string;\r\n private _date!: Date;\r\n \r\n /**\r\n * @internal\r\n */\r\n constructor() {\r\n }\r\n\r\n /**\r\n * Returns the file name.\r\n */\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n /**\r\n * Returns this file timestamp.\r\n */\r\n public get timestamp(): Date {\r\n return this._date;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(o2gChargingFile: O2GChargingFile) {\r\n\r\n let result = new ChargingFile();\r\n\r\n result._name = o2gChargingFile.name;\r\n result._date = this._makeDate(o2gChargingFile.date, o2gChargingFile.time)\r\n\r\n return result;\r\n }\r\n\r\n\r\n private static _makeIsoDate(date: string): string {\r\n\r\n let dateItem = date.trim().split('/');\r\n return (2000 + parseInt(dateItem[2])).toString() + '-' + dateItem[1] + '-' + dateItem[0];\r\n }\r\n\r\n private static _makeDate(date: string, hour: string) {\r\n return new Date(this._makeIsoDate(date) + 'T' + hour.trim());\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport { ComRecordParticipant } from \"./comlog-types\";\r\nimport { O2GComHistoryRecord } from \"../../internal/types/comlog/o2gcomlog-types\";\r\n\r\n/**\r\n * ComRecord class represents a communication record, that is an history\r\n * call ticket stored by the O2G server for each conversation.\r\n */\r\nexport class ComRecord {\r\n\r\n private _id!: number;\r\n private _callRef!: string;\r\n private _acknowledged!: boolean;\r\n private _participants!: ComRecordParticipant[];\r\n private _begin!: Date;\r\n private _end!: Date;\r\n private _beginConv!: Date;\r\n\r\n /**\r\n * @internal\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * Returns this communication record identifier.\r\n */\r\n public get id(): number {\r\n return this._id;\r\n }\r\n\r\n /**\r\n * Returns the reference of the call that has created this communication record.\r\n * \r\n * @return the callRef the call reference.\r\n */\r\n public get callRef(): string {\r\n return this._callRef;\r\n }\r\n\r\n /**\r\n * Returns whether this communication record has been acknowledged. This\r\n * parameter can only be 'true' for a missed incoming call.\r\n */\r\n public get acknowledged(): boolean {\r\n return this._acknowledged;\r\n }\r\n\r\n /**\r\n * Returns the start date of this call.\r\n */\r\n public get begin(): Date {\r\n return this._begin;\r\n }\r\n\r\n /**\r\n * Returns the end date of this call.\r\n */\r\n public get end(): Date {\r\n return this._end;\r\n }\r\n\r\n /**\r\n * Return the participants\r\n */\r\n public get participants(): ComRecordParticipant[] {\r\n return this._participants;\r\n }\r\n\r\n public get beginConversation(): Date {\r\n return this._beginConv;\r\n }\r\n\r\n\r\n /**\r\n * @ignore\r\n */\r\n public static build(record: O2GComHistoryRecord): ComRecord {\r\n\r\n return Object.assign(new ComRecord(), {\r\n _id: record.recordId,\r\n _callRef: record.comRef,\r\n _acknowledged: record.acknowledged,\r\n _participants: record.participants,\r\n _begin: new Date(record.beginDate),\r\n _end: new Date(record.endDate),\r\n _beginConv: new Date(record.convDate),\r\n });\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {RestService} from './rest-service'\r\nimport HttpContent from '../util/http-content';\r\nimport UtilUri from \"../util/util-uri\";\r\nimport {AssertUtil} from \"../util/assert\";\r\nimport {AcrSkill} from '../../types/telephony/acr-skill';\r\nimport { RecordingAction } from '../../types/telephony/RecordingAction';\r\nimport { Call, Leg, Callback, MiniMessage, Participant, HuntingGroups, HuntingGroupStatus, DeviceState, TelephonicState } from '../../types/telephony/telephony-types';\r\n\r\n\r\ntype CallList = {\r\n calls: Call[];\r\n}\r\n\r\ntype LegList = {\r\n legs: Leg[];\r\n}\r\n\r\ntype ParticipantList = {\r\n participants: Participant[];\r\n}\r\n\r\ntype DeviceStateList = {\r\n deviceStates: DeviceState[];\r\n}\r\n\r\ntype CallbackList = {\r\n callbacks: Callback[];\r\n}\r\n\r\nexport default class TelephonyRest extends RestService {\r\n\r\n constructor(uri: string) {\r\n super(uri);\r\n }\r\n\r\n public async basicMakeCall(deviceId: string, callee: string, autoAnswer: boolean): Promise<boolean> {\r\n\r\n const json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n callee: AssertUtil.notNullOrEmpty(callee, \"callee\"),\r\n autoAnswer: autoAnswer\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(UtilUri.appendPath(this._uri, \"basicCall\") , new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async basicAnswerCall(deviceId: string): Promise<boolean> { \r\n\r\n const json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(UtilUri.appendPath(this._uri, \"basicCall/answer\") , new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async basicDropMe(loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"basicCall/dropme\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost)\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n public async getState(loginName: string | null): Promise<TelephonicState | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"state\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<TelephonicState>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n public async getCalls(loginName: string | null): Promise<Call[] | null> {\r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const calls = this.getResult<CallList>(await RestService._httpClient.get(uriGet));\r\n if (calls && Array.isArray(calls.calls)) {\r\n return calls.calls;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n public async getCall(callRef: string, loginName: string | null): Promise<Call | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"));\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<Call>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n public async makeCall(deviceId: string, callee: string, autoAnswer: boolean, loginName: string | null): Promise<boolean> {\r\n return this.makeCallEx(deviceId, callee, autoAnswer, false, null, null, loginName)\r\n }\r\n\r\n\tpublic async makeCallEx(deviceId: string, callee: string, autoAnswer: boolean = true, inhibitProgressTone: boolean = false, associatedData: string | null = null, callingNumber: string | null = null, loginName: string | null = null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.deviceId = AssertUtil.notNullOrEmpty(deviceId, \"deviceId\");\r\n req.callee = AssertUtil.notNullOrEmpty(callee, \"callee\");\r\n req.autoAnswer = autoAnswer;\r\n if (inhibitProgressTone) {\r\n req.inhibitProgressTone = inhibitProgressTone;\r\n }\r\n\r\n if (associatedData) {\r\n req.associateData = associatedData;\r\n }\r\n\r\n if (callingNumber) {\r\n req.callingNumber = callingNumber;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async makePrivateCall(deviceId: string, callee: string, pin: string, secretCode: string | null, loginName: string | null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.deviceId = AssertUtil.notNullOrEmpty(deviceId, \"deviceId\");\r\n req.callee = AssertUtil.notNullOrEmpty(callee, \"callee\");\r\n req.pin = AssertUtil.notNullOrEmpty(pin, \"pin\");;\r\n if (secretCode) {\r\n req.secretCode = secretCode;\r\n }\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n\t}\r\n\r\n\tpublic async makeBusinessCall(deviceId: string, callee: string, businessCode: string, loginName: string | null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n callee: AssertUtil.notNullOrEmpty(callee, \"callee\"),\r\n businessCode: AssertUtil.notNullOrEmpty(businessCode, \"businessCode\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async makeSupervisorCall(deviceId: string, autoAnswer: boolean, loginName: string | null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n autoAnswer: autoAnswer,\r\n acdCall: {\r\n callToSupervisor: true\r\n }\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async makePilotOrRSISupervisedTransferCall(deviceId: string, pilot: string, associatedData: string | null, callProfile: AcrSkill[] | null, loginName: string | null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n\r\n let req: any = new Object();\r\n req.deviceId = AssertUtil.notNullOrEmpty(deviceId, \"deviceId\");\r\n req.callee = AssertUtil.notNullOrEmpty(pilot, \"pilot\");\r\n if (associatedData) {\r\n req.associateData = associatedData;\r\n }\r\n\r\n req.acdCall = new Object();\r\n req.acdCall.supervisedTransfer = true;\r\n\r\n if (callProfile) {\r\n req.acdCall.skills = callProfile;\r\n }\r\n\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async makePilotOrRSICall(deviceId: string, pilot: string, autoAnswer: boolean, associatedData: string, callProfile: AcrSkill[], loginName: string | null): Promise<boolean> { \r\n \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let req: any = new Object();\r\n req.deviceId = AssertUtil.notNullOrEmpty(deviceId, \"deviceId\");\r\n req.callee = AssertUtil.notNullOrEmpty(pilot, \"pilot\");\r\n req.autoAnswer = autoAnswer;\r\n if (associatedData) {\r\n req.associateData = associatedData;\r\n }\r\n\r\n if (callProfile) {\r\n req.acdCall = new Object();\r\n req.acdCall.skills = callProfile;\r\n }\r\n\r\n let json = JSON.stringify(req);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async alternate(callRef: string, deviceId: string): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"alternate\");\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async answer(callRef: string, deviceId: string): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"answer\");\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async attachData(callRef: string, deviceId: string, associatedData: string): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"attachdata\");\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n associatedData: AssertUtil.notNullOrEmpty(associatedData, \"associatedData\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async blindTransfer(callRef: string, transferTo: string, anonymous: boolean, loginName: string | null): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"blindtransfer\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n transferTo: AssertUtil.notNullOrEmpty(transferTo, \"transferTo\"),\r\n anonymous: anonymous\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async callback(callRef: string, loginName: string | null): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"callback\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async getDeviceLegs(callRef: string, loginName: string | null): Promise<Leg[] | null> { \r\n let uriGet = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"deviceLegs\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const legs = this.getResult<LegList>(await RestService._httpClient.get(uriGet));\r\n if (legs && Array.isArray(legs.legs)) {\r\n return legs.legs;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n\tpublic async getDeviceLeg(callRef: string, legId: string, loginName: string | null): Promise<Leg | null> { \r\n \r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n \"calls\", \r\n AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \r\n \"deviceLegs\",\r\n AssertUtil.notNullOrEmpty(legId, \"legId\"));\r\n \r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<Leg>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async dropme(callRef: string, loginName: string | null): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"dropme\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async hold(callRef: string, deviceId: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"hold\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async merge(callRef: string, heldCallRef: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"merge\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n heldCallRef: AssertUtil.notNullOrEmpty(heldCallRef, \"heldCallRef\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n\tpublic async overflowToVoiceMail(callRef: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"overflowToVoiceMail\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n public async park(callRef: string, parkTo: string | null, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"park\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n parkTo: AssertUtil.notNullOrEmpty(parkTo, \"parkTo\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n\tpublic async getParticipants(callRef: string, loginName: string | null): Promise<Participant[] | null> { \r\n let uriGet = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"participants\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const participants = this.getResult<ParticipantList>(await RestService._httpClient.get(uriGet));\r\n if (participants && Array.isArray(participants.participants)) {\r\n return participants.participants;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n\tpublic async getParticipant(callRef: string, participantId: string, loginName: string | null): Promise<Participant | null> { \r\n\r\n let uriGet = UtilUri.appendPath(\r\n this._uri, \r\n \"calls\", \r\n AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \r\n \"participants\",\r\n AssertUtil.notNullOrEmpty(participantId, \"participantId\"));\r\n\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<Participant>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async dropParticipant(callRef: string, participantId: string, loginName: string | null): Promise<boolean> { \r\n\r\n var uriDelete = UtilUri.appendPath(\r\n this._uri, \r\n \"calls\", \r\n AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \r\n \"participants\",\r\n AssertUtil.notNullOrEmpty(participantId, \"participantId\"));\r\n\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode(); \r\n }\r\n\r\n\tpublic async reconnect(callRef: string, deviceId: string, enquiryCallRef: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"reconnect\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n enquiryCallRef: AssertUtil.notNullOrEmpty(enquiryCallRef, \"enquiryCallRef\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async doRecordAction(callRef: string, action: RecordingAction, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"recording\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n uriPost = UtilUri.appendQuery(uriPost, \"action\", action);\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async redirect(callRef: string, redirectTo: string, anonymous: boolean, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"redirect\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n redirectTo: AssertUtil.notNullOrEmpty(redirectTo, \"redirectTo\"),\r\n anonymous: anonymous\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async retrieve(callRef: string, deviceId: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"retrieve\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async sendDtmf(callRef: string, deviceId: string, number: string): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"sendDtmf\");\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n number: AssertUtil.notNullOrEmpty(number, \"number\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async sendAccountInfo(callRef: string, deviceId: string, accountInfo: string): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"sendaccountinfo\");\r\n\r\n let json = JSON.stringify({\r\n deviceId: AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"),\r\n accountInfo: AssertUtil.notNullOrEmpty(accountInfo, \"accountInfo\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async transfer(callRef: string, heldCallRef: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"calls\", AssertUtil.notNullOrEmpty(callRef, \"callRef\"), \"transfer\");\r\n\r\n let json = JSON.stringify({\r\n heldCallRef: AssertUtil.notNullOrEmpty(heldCallRef, \"heldCallRef\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async deskSharingLogOn(dssDeviceNumber: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"deskSharing\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n dssDeviceNumber: AssertUtil.notNullOrEmpty(dssDeviceNumber, \"dssDeviceNumber\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async deskSharingLogOff(loginName: string | null): Promise<boolean> { \r\n\r\n var uriDelete = UtilUri.appendPath(this._uri, \"deskSharing\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async getDevicesState(loginName: string | null): Promise<DeviceState[] | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"devices\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const states = this.getResult<DeviceStateList>(await RestService._httpClient.get(uriGet));\r\n if (states && Array.isArray(states.deviceStates)) {\r\n return states.deviceStates;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n\tpublic async getDeviceState(deviceId: string, loginName: string | null): Promise<DeviceState | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"devices\", AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"));\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<DeviceState>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async pickUp(deviceId: string, otherCallRef: string, otherPhoneNumber: string, autoAnswer: boolean): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"devices\", AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"), \"pickup\");\r\n\r\n let json = JSON.stringify({\r\n otherCallRef: AssertUtil.notNullOrEmpty(otherCallRef, \"otherCallRef\"), \r\n otherPhoneNumber: AssertUtil.notNullOrEmpty(otherPhoneNumber, \"otherPhoneNumber\"), \r\n autoAnswer: autoAnswer\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async intrusion(deviceId: string): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"devices\", AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"), \"intrusion\");\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async toggleInterphony(deviceId: string): Promise<boolean> { \r\n let uriPut = UtilUri.appendPath(this._uri, \"devices\", AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"), \"ithmicro\");\r\n\r\n let httpResponse = await RestService._httpClient.put(uriPut);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async unPark(deviceId: string, heldCallRef: string): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"devices\", AssertUtil.notNullOrEmpty(deviceId, \"deviceId\"), \"unpark\");\r\n\r\n let json = JSON.stringify({\r\n heldCallRef: AssertUtil.notNullOrEmpty(heldCallRef, \"heldCallRef\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\r\n\tpublic async getHuntingGroupStatus(loginName: string | null): Promise<HuntingGroupStatus | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"huntingGroupLogOn\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<HuntingGroupStatus>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async huntingGroupLogOn(loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"huntingGroupLogOn\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async huntingGroupLogOff(loginName: string | null): Promise<boolean> { \r\n\r\n var uriDelete = UtilUri.appendPath(this._uri, \"huntingGroupLogOn\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async addHuntingGroupMember(hgNumber: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"huntingGroupMember\", AssertUtil.notNullOrEmpty(hgNumber, \"hgNumber\"));\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async deleteHuntingGroupMember(hgNumber: string, loginName: string | null): Promise<boolean> { \r\n\r\n var uriDelete = UtilUri.appendPath(this._uri, \"huntingGroupMember\", AssertUtil.notNullOrEmpty(hgNumber, \"hgNumber\"));\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async queryHuntingGroups(loginName: string | null): Promise<HuntingGroups | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"huntingGroups\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<HuntingGroups>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async getCallbacks(loginName: string | null): Promise<Callback[] | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"incomingCallbacks\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n const callbacks = this.getResult<CallbackList>(await RestService._httpClient.get(uriGet));\r\n if (callbacks && Array.isArray(callbacks.callbacks)) {\r\n return callbacks.callbacks;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n\tpublic async deleteCallbacks(loginName: string | null): Promise<boolean> { \r\n\r\n var uriDelete = UtilUri.appendPath(this._uri, \"incomingCallbacks\");\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async deleteCallback(callbackId: string, loginName: string | null): Promise<boolean> {\r\n var uriDelete = UtilUri.appendPath(this._uri, \"incomingCallbacks\", AssertUtil.notNullOrEmpty(callbackId, \"callbackId\"));\r\n if (loginName) {\r\n uriDelete = UtilUri.appendQuery(uriDelete, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.delete(uriDelete);\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async getMiniMessage(loginName: string | null): Promise<MiniMessage | null> { \r\n\r\n let uriGet = UtilUri.appendPath(this._uri, \"miniMessages\");\r\n if (loginName) {\r\n uriGet = UtilUri.appendQuery(uriGet, \"loginName\", loginName);\r\n }\r\n\r\n return this.getResult<MiniMessage>(await RestService._httpClient.get(uriGet));\r\n }\r\n\r\n\tpublic async sendMiniMessage(recipient: string, message: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"miniMessages\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n recipient: AssertUtil.notNullOrEmpty(recipient, \"recipient\"),\r\n message: AssertUtil.notNullOrEmpty(message, \"message\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n\tpublic async requestCallback(callee: string, loginName: string | null): Promise<boolean> { \r\n\r\n let uriPost = UtilUri.appendPath(this._uri, \"outgoingCallbacks\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let json = JSON.stringify({\r\n callee: AssertUtil.notNullOrEmpty(callee, \"callee\")\r\n });\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost, new HttpContent(json));\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n\r\n public async requestSnapshot(loginName: string | null): Promise<boolean> { \r\n let uriPost = UtilUri.appendPath(this._uri, \"state/snapshot\");\r\n if (loginName) {\r\n uriPost = UtilUri.appendQuery(uriPost, \"loginName\", loginName);\r\n }\r\n\r\n let httpResponse = await RestService._httpClient.post(uriPost)\r\n return httpResponse.isSuccessStatusCode();\r\n }\r\n}","/*\r\n* Copyright 2021 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport {AssertUtil} from \"../../internal/util/assert\";\r\nimport { AttributeFilter } from \"./attribute-filter\";\r\nimport {PbxAttribute} from \"./pbx-attribute\";\r\n\r\n/**\r\n * Filter class represents a filter that can be used to query OmniPCX Enterprise Object instances.\r\n * <p>\r\n * @example\r\n * ```typescript\r\n * let complex = Filter.and(\r\n * Filter.or(\r\n * Filter.create(\"Station_Type\", AttributeFilter.Equals, \"ANALOG\"),\r\n * Filter.create(\"Station_Type\", AttributeFilter.Equals, \"ALE-300\")\r\n * ),\r\n * Filter.create(\"Directory_Name\", OperationFilter.StartsWith, \"f\")\r\n * );\r\n * ```\r\n */\r\nexport class Filter {\r\n\r\n private _value: string;\r\n\r\n /**\r\n * @internal\r\n */\r\n constructor(value: string) {\r\n this._value = value;\r\n }\r\n\r\n public get value(): string {\r\n return this._value;\r\n }\r\n\r\n\r\n /**\r\n * Create a new filter with the specified attribute, operation and value.\r\n * @param attribute the attribute, either a {@link PbxAttribute} value, or a string object\r\n * @param operation the operation\r\n * @param value the value to test\r\n */\r\n public static create(attribute: string|PbxAttribute, operation: AttributeFilter, value: string): Filter {\r\n\r\n let attrName = (typeof attribute == 'object') ? attribute.name : attribute;\r\n\r\n if (operation == AttributeFilter.Equals) return new Filter(attrName + \"==\" + value);\r\n else if (operation == AttributeFilter.NotEquals) return new Filter(attrName + \"!=\" + value);\r\n else if (operation == AttributeFilter.StartsWith) return new Filter(attrName + \"==\" + value + \"*\");\r\n else if (operation == AttributeFilter.EndsWith) return new Filter(attrName + \"==*\" + value);\r\n else if (operation == AttributeFilter.GreatherThanOrEquals) return new Filter(attrName + \"=ge=\" + value);\r\n else if (operation == AttributeFilter.LessThanOrEquals) return new Filter(attrName + \"=le=\" + value);\r\n else {\r\n throw new Error(\"Unknown operation: \" + operation);\r\n }\r\n }\r\n\r\n private static combineOperator(ope: string, filter1: Filter, filter2: Filter, otherFilters: Filter[]): Filter {\r\n\r\n let result = AssertUtil.notNull(filter1, \"filter1\").value + ' ' + ope + ' ' + AssertUtil.notNull(filter2, \"filter2\").value;\r\n\r\n otherFilters.forEach(f => result = result + ' ' + ope + ' ' + f.value);\r\n return new Filter(result);\r\n }\r\n\r\n /**\r\n * Combine a set of filter with a logical And. \r\n * @param filter1 the first filter\r\n * @param filter2 the second filter\r\n * @param otherFilters other optional filters\r\n */\r\n public static and(filter1: Filter, filter2: Filter, ...otherFilters: Filter[]): Filter { \r\n return this.combineOperator(\"and\", filter1, filter2, otherFilters);\r\n }\r\n\r\n /**\r\n * Combine a set of filter with a logical Or. \r\n * @param filter1 the first filter\r\n * @param filter2 the second filter\r\n * @param otherFilters other optional filters\r\n */\r\n public static or(filter1: Filter, filter2: Filter, ...otherFilters: Filter[]): Filter { \r\n return this.combineOperator(\"or\", filter1, filter2, otherFilters);\r\n }\r\n}","/*\r\n* Copyright 2025 ALE International\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy of this \r\n* software and associated documentation files (the \"Software\"), to deal in the Software \r\n* without restriction, including without limitation the rights to use, copy, modify, merge, \r\n* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\n* to whom the Software is furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in all copies or \r\n* substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \r\n* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \r\n* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\nimport EventEmitter from \"events\";\r\nimport CallCenterPilotRest from \"./internal/rest/ccPilot-rest\";\r\nimport { EventRegistry } from \"./internal/events/event-dispatcher\";\r\n\r\n/**\r\n * CallCenterPilot allows an administrator to monitor the CCD pilots. Using this\r\n * service requires having a <b>CONTACTCENTER_SRV</b> license.\r\n */\r\nexport class CallCenterPilot extends EventEmitter {\r\n\r\n /**\r\n * Occurs when a new call arrives on a pilot.\r\n * @event\r\n */\r\n public static readonly ON_PILOT_CALL_CREATED = \"OnPilotCallCreated\";\r\n\r\n /**\r\n * Occurs when the call has been queued.\r\n * @event\r\n */\r\n public static readonly ON_PILOT_CALL_QUEUED = \"OnPilotCallQueued\";\r\n\r\n /**\r\n * Occurs when a the call has been removed from the pilot: cause distribution, cancel or overflow.\r\n * @event\r\n */\r\n public static readonly ON_PILOT_CALL_REMOVED = \"OnPilotCallRemoved\";\r\n\r\n /**\r\n * \r\n * @internal\r\n */\r\n constructor(\r\n private readonly _ccPilotRest: CallCenterPilotRest,\r\n eventRegistry: EventRegistry\r\n ) {\r\n super();\r\n\r\n eventRegistry.register(this, CallCenterPilot.ON_PILOT_CALL_CREATED);\r\n eventRegistry.register(this, CallCenterPilot.ON_PILOT_CALL_QUEUED);\r\n eventRegistry.register(this, CallCenterPilot.ON_PILOT_CALL_REMOVED);\r\n }\r\n\r\n /**\r\n * Start the monitoring of a pilot.\r\n * If the pilot is already monitored, no error is returned.\r\n * @param pilotNumber the pilot number\r\n */\r\n public async monitorStart(pilotNumber: string): Promise<boolean> { \r\n return await this._ccPilotRest.monitorStart(pilotNumber);\r\n }\r\n\r\n /**\r\n * Stop the monitoring of a pilot.\r\n * If the pilot is already monitored, no error is returned.\r\n * @param pilotNumber the pilot number\r\n */\r\n public async monitorStop(pilotNumber: string): Promise<boolean> { \r\n return await this._ccPilotRest.monitorStop(pilotNumber);\r\n }\r\n}\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(5438);\n"],"names":["constructor","position","number","mnemonic","this","_position","_number","_mnemonic","O2GService","registerService","service","_map","set","_value","name","get","lower","toLowerCase","has","Map","O2G","Authentication","Sessions","Subscriptions","EventSummary","Telephony","Users","UserManagement","Routing","Messaging","Maintenance","Directory","PbxManagement","CommunicationLog","PhoneSetProgramming","CallCenterPilot","CallCenterAgent","CallCenterRsi","CallCenterManagement","Analytics","version","_logger","Logger","create","_services","_servicesUri","_accessMode","AccessMode","Private","ApiVersion","_apiVersion","throwUnableToConnect","host","privateAddress","publicAddress","Error","setO2GServiceUri","address","delete","getOrCreate","serviceName","restService","getSubscriptionService","getO2GService","getAuthenticationService","getSessionsService","getEventSummaryService","getRoutingService","getUsersService","getUserManagementService","getTelephonyService","getDirectoryService","getCommunicationLogService","getAnalyticsService","getCallCenterAgentService","getCallCenterPilotService","getCallCenterManagementService","getMaintenanceService","getRsiService","getPbxManagementService","getPhoneSetProgrammingService","getMessagingService","bootstrapAddress","Promise","resolve","reject","then","apiDescriptor","catch","error","getVersion","descriptor","versions","find","id","status","bootstrap","e","debug","Public","ensureHttps","internalUrl","publicUrl","serverInfo","setSessionUris","privateUri","publicUri","setServices","sessionInfo","baseUrl","privateBaseUrl","publicBaseUrl","services","forEach","relativeUrl","startsWith","UsersRest","RestService","uri","super","getByLoginName","loginName","uriGet","_uri","appendPath","_user","getResult","_httpClient","nodeId","Number","getLogins","nodeIds","onlyACD","onlyWithExtLogin","replace","appendQuery","join","logins","Array","isArray","loginNames","getByCompanyPhone","companyPhone","getPreferences","getSupportedLanguages","changePassword","oldPassword","newPassword","json","JSON","stringify","put","isSuccessStatusCode","AnalyticsRest","padTo2Digits","num","toString","padStart","_formatDateFilter","date","getFullYear","getMonth","getDate","getIncidents","last","AssertUtil","positive","o2gIncidentsResult","o2gIncident","incidents","map","inc","Incident","build","getChargingFiles","filter","from","to","o2gChargingFilesResult","o2gChargingFiles","files","cf","ChargingFile","getChargingsFromFilter","topResults","all","o2gChargingResult","ChargingResult","getChargingsFromFiles","notNull","file","Reason","Charging","caller","_caller","_name","called","_called","initialDialedNumber","_initialDialedNumber","callNumber","_callNumber","chargingUnits","_chargingUnits","cost","_cost","startDate","_startDate","duration","_duration","callType","_callType","effectiveCallDuration","_effectiveCallDuration","actingExtensionNumberNode","_actingExtensionNumberNode","internalFacilities","_internalFacilities","externalFacilities","_externalFacilities","o2gCharging","result","initialDialledNumber","_makeDate","CallType","isCallType","Unspecified","facilities","f","TelFacility","fac","undefined","items","split","Date","substring","_from","_to","O2GRest","httpResponse","fromJson","AuthenticationRest","authenticate","login","password","basicAuth","Buffer","additionalHeaders","IntrusionMode","module","exports","require","PbxAttribute","_values","_attributeMaps","_sequenceMap","attr","attribute","value","complexValue","PbxAttributeMap","addSequenceAttribute","pbxAttribute","add","createSetOfStrings","attrName","values","createString","createBoolean","createInteger","createSequence","sequence","createSequenceSet","setOfSequences","getAt","index","asAttributeMap","asListOfMaps","_assertUnique","length","asBoolean","setBoolean","asInteger","parseInt","isNaN","setInteger","asString","setString","asEnum","listAttr","names","nestedAttr","getAttribute","push","attrMap","analyticsRest","_analyticsRest","Criteria","_makeField","FilterItem","LAST_NAME","FIRST_NAME","PHONE_NUMBER","_makeOperation","operation","OperationFilter","BEGINS_WITH","EQUAL_IGNORE_CASE","CONTAINS","field","criteria","operand","or","arguments","and","_id","_date","severity","_severity","description","_description","nbOccurs","_nbOccurs","node","_node","main","_main","rack","_rack","board","_board","equipment","_equipment","termination","_termination","type","hour","_makeIsoDate","day","month","yearSuffix","trim","PrivatePilotRuleSet","PilotRuleSet","rules","PrivatePilot","Pilot","data","CallCenterManagementRest","getPilots","o2gPilotList","pilotList","o2gPilot","ruleList","r","pilotRule","PilotRule","ruleNumber","active","getPilot","pilotNumber","notNullOrEmpty","getCalendar","calendar","toCalendar","getExceptionCalendar","toExceptionCalendar","addExceptionTransition","dateTransition","transition","uriPost","formatCalendarDate","toPilotTransition","post","deleteExceptionTransition","transitionIndex","uriDelete","setExceptionTransition","uriPut","getNormalCalendar","toNormalCalendar","addNormalTransition","O2GDayOfWeek","deleteNormalTransition","setNormalTransition","openPilot","closePilot","AttributeType","Destination","RoutingCapabilities","canManageRemoteExtension","_presentationRoute","canManageForward","_forwardRoute","canManageOverflow","_overflowRoute","canManageDnd","_dnd","capabilities","presentationRoute","forwardRoute","overflowRoute","dnd","RecordingAction","_pbxMngtRest","eventRegistry","register","ON_PBX_OBJECT_INSTANCE_CREATED","ON_PBX_OBJECT_INSTANCE_MODIFIED","ON_PBX_OBJECT_INSTANCE_DELETED","getPbxs","getPbx","getObjectModel","objectName","getNodeObject","getObject","objectInstanceDefinition","objectId","attributes","getObjectInstances","setObject","deleteObject","forceDelete","createObject","CallCenterPilotRest","monitorStart","monitorStop","userManagementRest","_userManagementRest","getByDeviceNumber","deviceNumber","createUsers","deviceNumbers","deleteUser","_active","obj","_routingRest","ON_ROUTING_STATE_CHANGED","activateDnd","cancelDnd","getDndState","getCapabilities","activateRemoteExtension","setRemoteExtensionActivation","deactivateRemoteExtension","getForward","cancelForward","forwardOnVoiceMail","condition","forwardOnNumber","cancelOverflow","getOverflow","overflowOnVoiceMail","getRoutingState","requestSnapshot","AttributeFilter","PbxObject","objectNames","_objectNames","_objectName","_attributes","o2GPbxObject","mapAttributes","parentAttr","EventPackage","serviceFactory","_serviceFactory","_serverInfo","openSession","applicationName","authenticationService","authenticationResult","info","sessionsService","open","timeToLive","close","str","positiveStrict","keys","createWith","o2gPbxComplexAttribute","attributeMaps","o2gPbxAttributes","Application","apiVersion","_applicationName","_host","connect","_session","serviceEndPoint","session","container","TYPES","EventSink","O2G_ONCHANNEL_INFORMATION","subscribe","subscription","listenEvents","code","headers","response","_code","_headers","_response","parse","transitions","_getTransitions","element","_getItemAt","directoryRest","_directoryRest","search","limit","cancel","getResults","OperatorType","isOperatorType","Object","includes","nodeIdAdapter","raw","user","_usersRest","ON_USER_CREATED","ON_USER_INFO_CHANGED","ON_USER_DELETED","cookieJar","CookieJar","fetchFunction","HttpMethod","fetch","HttpClient","printCookies","url","cookies","getCookies","console","log","cookie","key","sendRequest","method","content","responseType","fetchOptions","credentials","body","POST","DUMP_COOKIES","fetchResolved","text","arrayBuffer","message","GET","DELETE","PUT","ForwardRoute","createForwardOnVoiceMail","destinations","O2GDestination","createVoiceMailDestination","ForwardCondition","IMMEDIATE","forwardType","createForwardOnNumber","createNumberDestination","eventDispatcher","_abortController","_isRunning","_reconnectScheduled","_eventDispatcher","start","warn","AbortController","signal","ok","statusText","errorBody","scheduleReconnect","decoder","TextDecoder","reader","getReader","buffer","done","read","newlineIndex","decode","stream","indexOf","line","slice","event","dispatch","finalEvent","stop","abort","initial","delay","setTimeout","err","level","mandatory","skillNumber","expertEvalLevel","acrStatus","evalLevel","RsiRest","getRsiPoints","rsiPoints","enableRsiPoint","rsiNumber","disableRsiPoint","startCollectDigits","callRef","numChars","flushChar","timeout","additionalCriteria","req","stopCollectDigits","collCrid","playTone","tone","cancelTone","playVoiceGuide","guideNumber","routeEnd","routeCrid","routeSelect","selectedRoute","callingLine","associatedData","routeToVoiceMail","getRouteSessions","routeSessions","getRouteSession","ccManagementRest","_ccManagementRest","CallCenterAgentRest","getConfiguration","o2gAgentConfig","mapSkills","skills","s","AGENT","proacd","processingGroups","selfAssign","headset","help","multiline","getState","logon","proAcdNumber","pgNumber","proAcdDeviceNumber","pgGroupNumber","logoff","enter","exit","state","_doAgentAction","action","setWrapup","setReady","setPause","requestPermanentListening","agentNumber","cancelPermanentListening","requestIntrusion","intrusionMode","changeIntrusionMode","newIntrusionMode","requestSupervisorHelp","_doCancelSupervisorHelpRequest","otherNumber","rejectAgentHelpRequest","cancelSupervisorHelpRequest","supervisorNumber","activateSkills","skillNumbers","deactivateSkills","getWithdrawReasons","o2gWithdrawReasons","reasons","setWithdraw","reason","MessagingRest","getMailboxes","mailboxes","getMailboxInfo","mailboxId","getVoiceMessages","newOnly","offset","voicemails","vms","vm","downloadVoiceMessage","voicemailId","wavPath","downloadFile","acknowledgeVoiceMessage","deleteVoiceMessages","msgIds","deleteVoiceMessage","_content","_type","_telephonyRest","ON_TELEPHONY_STATE","ON_CALL_CREATED","ON_CALL_MODIFIED","ON_CALL_REMOVED","ON_USER_STATE_MODIFIED","ON_DEVICE_STATE_MODIFIED","ON_DYNAMIC_STATE_CHANGED","basicMakeCall","deviceId","callee","autoAnswer","basicAnswerCall","basicDropMe","getCalls","getCall","makeCall","makeCallEx","inhibitProgressTone","callingNumber","makePrivateCall","pin","secretCode","makeBusinessCall","businessCode","makeSupervisorCall","makePilotOrRSISupervisedTransferCall","pilot","callProfile","makePilotOrRSICall","alternate","answer","attachData","blindTransfer","transferTo","anonymous","callback","getDeviceLegs","getDeviceLeg","legId","dropme","hold","merge","heldCallRef","overflowToVoiceMail","park","parkTo","getParticipants","getParticipant","participantId","dropParticipant","reconnect","enquiryCallRef","doRecordAction","redirect","redirectTo","retrieve","sendDtmf","sendAccountInfo","accountInfo","transfer","deskSharingLogOn","dssDeviceNumber","deskSharingLogOff","getDevicesState","getDeviceState","pickUp","otherCallRef","otherPhoneNumber","intrusion","unPark","getHuntingGroupStatus","huntingGroupLogOn","huntingGroupLogOff","addHuntingGroupMember","hgNumber","deleteHuntingGroupMember","queryHuntingGroups","getCallbacks","deleteCallbacks","deleteCallback","callbackId","getMiniMessage","sendMiniMessage","recipient","requestCallback","toggleInterphony","SessionsRest","params","httpContent","keepAlive","OverflowCondition","Overflow","_condition","destination","_destination","NONE","overflowType","PilotOperatingMode","Transition","Time","_hour","_minute","minute","pad","n","hourStr","minuteStr","Rsi","_rsiRest","ON_DIGIT_COLLECTED","ON_TONE_GENERATED_START","ON_TONE_GENERATED_STOP","ON_ROUTE_END","ON_ROUTE_REQUEST","_comLogRest","ON_COM_RECORD_CREATED","ON_COM_RECORD_MODIFIED","ON_COM_RECORDS_DELETED","ON_COM_RECORDS_ACK","ON_COM_RECORDS_UNACK","getComRecords","page","optimized","getComRecord","recordId","deleteComRecord","deleteComRecordsById","recordIds","deleteComRecords","acknowledgeComRecords","acknowledgeComRecord","unacknowledgeComRecords","unacknowledgeComRecord","selected","createMobileDestination","CommunicationLogRest","after","before","options","Option","UNACKNOWLEDGED","UNANSWERED","role","Role","CALLEE","CALLER","remotePartyId","o2gComRecords","QueryResult","o2gComRecord","ComRecord","_ackOrUnAckComRecords","ack","ProgrammableKey","DeviceKey","locked","_locked","pkey","initialize","appName","containerInit","_application","_routing","_eventSummary","_users","_userManagement","_telephony","_directory","_comlog","_analytics","_callCenterAgent","_callCenterPilot","_callCenterManagement","_maintenance","_pbxManagement","_phoneSetProgramming","_messaging","shutdown","on","listener","off","routing","eventSummary","users","userManagement","telephony","directory","comlog","analytics","callCenterAgent","callCenterPilot","callCenterManagement","maintenance","pbxManagement","phoneSetProgramming","messaging","types","Subscription","TimeRange","ccAgent","OperatorMainState","Page","QueryFilter","ccManagement","pbxmngt","Filter","phoneset","PinControl","Pin","SoftKey","AcrSkill","_ccAgentRest","ON_AGENT_STATE_CHANGED","ON_AGENT_SKILL_CHANGED","ON_SUPERVISOR_HELP_REQUESTED","ON_SUPERVISOR_HELP_CANCELLED","NORMAL","RoutingState","dndState","_dndState","forward","_forward","overflow","_overflow","remoteExtensionActivated","_remoteExtensionActivated","routingState","forwardRoutes","Forward","overflowRoutes","getRemoteExtensionActivation","presentationRoutes","mobileDestination","OctetStringLength","_min","_max","min","max","parseLengthValue","v","ModelAttribute","_mandatory","multiValue","_multiValue","allowedValues","_allowedValues","octetStringLength","_octetStringLength","defaultValue","_defaultValue","filtering","_filtering","usedWhen","_usedWhen","lengthValue","typeValue","Model","hidden","_hidden","canCreate","_canCreate","canDelete","_canDelete","canSet","_canSet","canGet","_canGet","otherActions","_otherActions","child","_children","getMandatoryAttributes","o2gObjModel","children","objects","model","getTempFolder","tmpdir","getRandomFilename","extension","now","chargings","_chargings","range","_range","count","_chargingFileCount","totalTicketCount","_totalTicketCount","valuableTicketCount","_valuableTicketCount","c","nbChargingFiles","totalTicketNb","valuableTicketNb","PbxManagementRest","pbxs","o2gObjectModel","objectIds","o2GPbxAttributeList","a","bind","inSingletonScope","Symbol","for","Container","_maintenanceRest","ON_SERVER_STARTED","ON_LICENSE_EXPIRATION","ON_PBX_LOADED","ON_CTI_LINK_UP","ON_CTI_LINK_DOWN","getSystemStatus","messagingRest","_messagingRest","mailBoxId","DirectoryRest","_sessionInfo","_loginName","startKeepAlive","keepAlive_ms","_keepAliveID","setInterval","clearTimeout","sessionService","_startEventing","subscriptionsService","subscriptionResult","eventSink","_subscriptionId","subscriptionId","webHook","connectDispatcher","pollingUrl","privatePollingUrl","publicPollingUrl","_chunkEventing","ConfigurationType","CTILinkState","isConfigurationType","MaintenanceRest","o2gSystemStatus","logicalAddress","ha","primary","primaryVersion","secondary","secondaryVersion","license","lics","configurationType","FULL_SERVICES","_state","_detailedState","detailedState","_waitingTime","waitingTime","_saturation","saturation","_rules","_possibleTransfer","possibleTransfer","_supervisedTransfer","supervisedTransfer","ServiceState","Status","SubscriptionsRest","payload","webHookUrl","ExceptionCalendar","AbstractCalendar","getExceptionDates","Set","getTransitionAt","dayTransitions","getTransitions","paths","endsWith","p","queryName","queryValue","URL","searchParams","append","separator","encodeURIComponent","getFilename","contentDisposition","match","exec","decodeURIComponent","filePath","ArrayBuffer","downloadedFile","filename","writeFile","LogLevel","Color","GlobalLogLevel","DEBUG","logLevelColors","Cyan","Green","Yellow","Red","Default","defaultOptions","useColors","color","showTimestamp","useLocalTime","showLevel","category","format","args","_shouldLog","_write","_formatText","INFO","WARN","ERROR","logLevels","currentLevel","window","LOG","toUpperCase","i","String","_format","output","_createLogMessage","parts","timestamp","_getTimestamp","levelIndex","levelColor","Grey","toLocaleString","toISOString","Colors","LogLevels","setLogLevel","EventSumaryRest","EventEmitter","_eventSummaryRest","ON_EVENT_SUMMARY_UPDATED","typeKey","NUMBER","conditionKey","OverflowRoute","createOverflowOnVoiceMail","RoutingRest","_capabilities","o2gRoutingState","Selector","ids","EventFilter","selectors","addPackage","eventPackage","_timeout","_version","_filter","_webHook","Builder","addRoutingEvents","addTelephonyEvents","addEventSummaryEvents","addUsersManagementEvents","addMaintenanceEvents","System","addRsiEvents","addPbxManagementEvents","addCommunicationLogEvents","addCallCenterAgentEvents","Agent","addCallCenterPilotEvents","addUserEvents","User","setVersion","setWebHook","SubscriptionImpl","UserManagementRest","O2GPilotOperatingMode","time","mode","fromPilotTransition","createPilotTransitions","getTransitionIndex","pt","toTransition","toDayTransitions","normal","list","t","parseCalendarDate","test","year","parsedDate","getTime","toDateTransitions","exception","exceptionCalendar","normalCalendar","dayOfWeek","DayOfWeek","NormalCalendar","normalDays","exceptionDays","getDays","_emitters","_adapters","emitter","eventName","adapter","emit","injectable","PhoneSetProgrammingRest","getDevices","devices","getDevice","getProgrammableKeys","pkeys","getProgrammedKeys","setProgrammableKey","deleteProgrammableKey","getSoftKeys","skeys","setSoftKey","deleteSoftKey","_doDeviceAction","activate","lockDevice","unlockDevice","enableCampon","disableCampon","getPinCode","setPinCode","getDynamicState","setAssociate","associate","withSecretCode","_withSecretCode","control","_control","group","_group","Pin_Number","With_Secret_Code","Pin_Group","Pin_Type_Of_Control","contains","getRulesNumbers","getRules","phoneSetProgrRest","_phoneSetProgrRest","_count","_page","records","_records","totalCount","comHistoryRecords","_offset","_limit","next","previous","o2gChargingFile","dateItem","_callRef","acknowledged","_acknowledged","begin","_begin","end","_end","participants","_participants","beginConversation","_beginConv","record","assign","comRef","beginDate","endDate","convDate","TelephonyRest","calls","associateData","acdCall","callToSupervisor","legs","states","deviceStates","callbacks","Equals","NotEquals","StartsWith","EndsWith","GreatherThanOrEquals","LessThanOrEquals","combineOperator","ope","filter1","filter2","otherFilters","_ccPilotRest","ON_PILOT_CALL_CREATED","ON_PILOT_CALL_QUEUED","ON_PILOT_CALL_REMOVED","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call"],"sourceRoot":""}
|