webitel-sdk 0.1.112 → 0.1.115
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/bundles/index.esm.js +70 -23530
- package/bundles/index.esm.js.map +1 -1
- package/bundles/index.esm.min.js +1 -1
- package/bundles/index.esm.min.js.map +1 -1
- package/bundles/index.umd.js +25 -26474
- package/bundles/index.umd.js.map +1 -1
- package/bundles/index.umd.min.js +1 -1
- package/bundles/index.umd.min.js.map +1 -1
- package/esm2015/api/agent-in-queue-agents-in-queue.js +1 -1
- package/esm2015/api/agent-in-queue-statistics-agent-in-queue-statistics-item.js +1 -1
- package/esm2015/api/agent-pause-cause-service-api.js +1 -1
- package/esm2015/api/agent-service-api.js +1 -1
- package/esm2015/api/agent-skill-service-api.js +1 -1
- package/esm2015/api/agent-team-service-api.js +1 -1
- package/esm2015/api/aggregate-request-group.js +1 -1
- package/esm2015/api/backend-profile-service-api.js +1 -1
- package/esm2015/api/bucket-service-api.js +1 -1
- package/esm2015/api/calendar-service-api.js +1 -1
- package/esm2015/api/call-service-api.js +1 -1
- package/esm2015/api/cognitive-profile-service-api.js +5 -5
- package/esm2015/api/cognitive-profile-service-api.js.map +1 -1
- package/esm2015/api/communication-type-service-api.js +1 -1
- package/esm2015/api/create-call-request-call-settings.js +1 -1
- package/esm2015/api/create-call-request-endpoint-request.js +1 -1
- package/esm2015/api/default-device-config-response-sip-device-config.js +1 -1
- package/esm2015/api/default-device-config-response-web-rtcdevice-config.js +1 -1
- package/esm2015/api/email-profile-service-api.js +1 -1
- package/esm2015/api/engine-accept-of-day.js +1 -1
- package/esm2015/api/engine-active-call.js +1 -1
- package/esm2015/api/engine-agent-call-statistics-list.js +1 -1
- package/esm2015/api/engine-agent-call-statistics.js +1 -1
- package/esm2015/api/engine-agent-channel.js +1 -1
- package/esm2015/api/engine-agent-in-queue-statistics-list.js +1 -1
- package/esm2015/api/engine-agent-in-queue-statistics.js +1 -1
- package/esm2015/api/engine-agent-in-queue.js +1 -1
- package/esm2015/api/engine-agent-in-team.js +1 -1
- package/esm2015/api/engine-agent-pause-cause.js +1 -1
- package/esm2015/api/engine-agent-set-state-request.js +1 -1
- package/esm2015/api/engine-agent-skill-item.js +1 -1
- package/esm2015/api/engine-agent-skill.js +1 -1
- package/esm2015/api/engine-agent-state.js +1 -1
- package/esm2015/api/engine-agent-stats-statistic.js +1 -1
- package/esm2015/api/engine-agent-status-request.js +1 -1
- package/esm2015/api/engine-agent-status-statistic-item.js +1 -1
- package/esm2015/api/engine-agent-team.js +1 -1
- package/esm2015/api/engine-agent-user.js +1 -1
- package/esm2015/api/engine-agent.js +1 -1
- package/esm2015/api/engine-aggregate-history-call-request.js +1 -1
- package/esm2015/api/engine-aggregate-request.js +1 -1
- package/esm2015/api/engine-aggregate-result.js +1 -1
- package/esm2015/api/engine-attempt-callback-request.js +1 -1
- package/esm2015/api/engine-attempt-history.js +1 -1
- package/esm2015/api/engine-attempt-renewal-result-request.js +1 -1
- package/esm2015/api/engine-attempt-result-request.js +1 -1
- package/esm2015/api/engine-attempt-result-response.js +1 -1
- package/esm2015/api/engine-attempt.js +1 -1
- package/esm2015/api/engine-blind-transfer-call-request.js +1 -1
- package/esm2015/api/engine-bucket.js +1 -1
- package/esm2015/api/engine-calendar.js +1 -1
- package/esm2015/api/engine-call-annotation.js +1 -1
- package/esm2015/api/engine-call-file.js +1 -1
- package/esm2015/api/engine-call-hold.js +1 -1
- package/esm2015/api/engine-chat-plan.js +1 -1
- package/esm2015/api/engine-communication-type-request.js +1 -1
- package/esm2015/api/engine-communication-type.js +1 -1
- package/esm2015/api/engine-create-agent-pause-cause-request.js +1 -1
- package/esm2015/api/engine-create-agent-request.js +1 -1
- package/esm2015/api/engine-create-agent-skill-request.js +1 -1
- package/esm2015/api/engine-create-agent-team-request.js +1 -1
- package/esm2015/api/engine-create-attempt-request.js +1 -1
- package/esm2015/api/engine-create-attempt-response.js +1 -1
- package/esm2015/api/engine-create-bucket-request.js +1 -1
- package/esm2015/api/engine-create-calendar-request.js +1 -1
- package/esm2015/api/engine-create-call-annotation-request.js +1 -1
- package/esm2015/api/engine-create-call-request.js +1 -1
- package/esm2015/api/engine-create-call-response.js +1 -1
- package/esm2015/api/engine-create-chat-plan-request.js +1 -1
- package/esm2015/api/engine-create-email-profile-request.js +1 -1
- package/esm2015/api/engine-create-list-communication-request.js +1 -1
- package/esm2015/api/engine-create-list-request.js +1 -1
- package/esm2015/api/engine-create-member-bulk-item.js +1 -1
- package/esm2015/api/engine-create-member-bulk-request.js +1 -1
- package/esm2015/api/engine-create-member-request.js +1 -1
- package/esm2015/api/engine-create-outbound-resource-display-request.js +1 -1
- package/esm2015/api/engine-create-outbound-resource-group-request.js +1 -1
- package/esm2015/api/engine-create-outbound-resource-in-group-request.js +1 -1
- package/esm2015/api/engine-create-outbound-resource-request.js +1 -1
- package/esm2015/api/engine-create-queue-bucket-request.js +1 -1
- package/esm2015/api/engine-create-queue-hook-request.js +1 -1
- package/esm2015/api/engine-create-queue-request.js +1 -1
- package/esm2015/api/engine-create-queue-resource-group-request.js +1 -1
- package/esm2015/api/engine-create-queue-skill-request.js +1 -1
- package/esm2015/api/engine-create-region-request.js +1 -1
- package/esm2015/api/engine-create-routing-outbound-call-request.js +1 -1
- package/esm2015/api/engine-create-routing-schema-request.js +1 -1
- package/esm2015/api/engine-create-routing-variable-request.js +1 -1
- package/esm2015/api/engine-create-skill-request.js +1 -1
- package/esm2015/api/engine-default-device-config-response.js +1 -1
- package/esm2015/api/engine-delete-members-request.js +1 -1
- package/esm2015/api/engine-dtmf-call-request.js +1 -1
- package/esm2015/api/engine-eavesdrop-call-request.js +1 -1
- package/esm2015/api/engine-email-profile.js +1 -1
- package/esm2015/api/engine-endpoint.js +1 -1
- package/esm2015/api/engine-except-date.js +1 -1
- package/esm2015/api/engine-filter-between.js +1 -1
- package/esm2015/api/engine-for-agent-pause-cause-list.js +1 -1
- package/esm2015/api/engine-for-agent-pause-cause.js +1 -1
- package/esm2015/api/engine-hangup-call-request.js +1 -1
- package/esm2015/api/engine-history-call.js +1 -1
- package/esm2015/api/engine-hold-call-response.js +1 -1
- package/esm2015/api/engine-list-agent-in-queue.js +1 -1
- package/esm2015/api/engine-list-agent-in-team.js +1 -1
- package/esm2015/api/engine-list-agent-pause-cause.js +1 -1
- package/esm2015/api/engine-list-agent-skill.js +1 -1
- package/esm2015/api/engine-list-agent-state-history.js +1 -1
- package/esm2015/api/engine-list-agent-stats-statistic.js +1 -1
- package/esm2015/api/engine-list-agent-team.js +1 -1
- package/esm2015/api/engine-list-agent-user.js +1 -1
- package/esm2015/api/engine-list-agent.js +1 -1
- package/esm2015/api/engine-list-aggregate.js +1 -1
- package/esm2015/api/engine-list-attempt.js +1 -1
- package/esm2015/api/engine-list-bucket.js +1 -1
- package/esm2015/api/engine-list-calendar.js +1 -1
- package/esm2015/api/engine-list-call.js +1 -1
- package/esm2015/api/engine-list-chat-plan.js +1 -1
- package/esm2015/api/engine-list-communication-type.js +1 -1
- package/esm2015/api/engine-list-communication.js +1 -1
- package/esm2015/api/engine-list-email-profile.js +1 -1
- package/esm2015/api/engine-list-history-attempt.js +1 -1
- package/esm2015/api/engine-list-history-call.js +1 -1
- package/esm2015/api/engine-list-member-attempt.js +1 -1
- package/esm2015/api/engine-list-member.js +1 -1
- package/esm2015/api/engine-list-of-list-communication.js +1 -1
- package/esm2015/api/engine-list-of-list.js +1 -1
- package/esm2015/api/engine-list-outbound-resource-display.js +1 -1
- package/esm2015/api/engine-list-outbound-resource-group.js +1 -1
- package/esm2015/api/engine-list-outbound-resource-in-group.js +1 -1
- package/esm2015/api/engine-list-outbound-resource.js +1 -1
- package/esm2015/api/engine-list-queue-bucket.js +1 -1
- package/esm2015/api/engine-list-queue-hook.js +1 -1
- package/esm2015/api/engine-list-queue-resource-group.js +1 -1
- package/esm2015/api/engine-list-queue-skill.js +1 -1
- package/esm2015/api/engine-list-queue.js +1 -1
- package/esm2015/api/engine-list-region.js +1 -1
- package/esm2015/api/engine-list-report-general.js +1 -1
- package/esm2015/api/engine-list-routing-outbound-call.js +1 -1
- package/esm2015/api/engine-list-routing-schema.js +1 -1
- package/esm2015/api/engine-list-routing-variable.js +1 -1
- package/esm2015/api/engine-list-skill.js +1 -1
- package/esm2015/api/engine-list-timezone-response.js +1 -1
- package/esm2015/api/engine-list.js +1 -1
- package/esm2015/api/engine-lookup.js +1 -1
- package/esm2015/api/engine-member-attempt.js +1 -1
- package/esm2015/api/engine-member-bulk-response.js +1 -1
- package/esm2015/api/engine-member-communication-create-request.js +1 -1
- package/esm2015/api/engine-member-communication.js +1 -1
- package/esm2015/api/engine-member-in-queue.js +1 -1
- package/esm2015/api/engine-move-position-routing-outbound-call-request.js +1 -1
- package/esm2015/api/engine-move-position-routing-outbound-call-response.js +1 -1
- package/esm2015/api/engine-outbound-resource-group.js +1 -1
- package/esm2015/api/engine-outbound-resource-in-group.js +1 -1
- package/esm2015/api/engine-outbound-resource-parameters.js +1 -1
- package/esm2015/api/engine-outbound-resource-time-range.js +1 -1
- package/esm2015/api/engine-outbound-resource-view-group.js +1 -1
- package/esm2015/api/engine-outbound-resource.js +1 -1
- package/esm2015/api/engine-patch-agent-pause-cause-request.js +1 -1
- package/esm2015/api/engine-patch-agent-request.js +1 -1
- package/esm2015/api/engine-patch-agent-skill-request.js +1 -1
- package/esm2015/api/engine-patch-chat-plan-request.js +1 -1
- package/esm2015/api/engine-patch-member-request.js +1 -1
- package/esm2015/api/engine-patch-outbound-resource-request.js +1 -1
- package/esm2015/api/engine-patch-queue-bucket-request.js +1 -1
- package/esm2015/api/engine-patch-queue-hook-request.js +1 -1
- package/esm2015/api/engine-patch-queue-request.js +1 -1
- package/esm2015/api/engine-patch-queue-skill-request.js +1 -1
- package/esm2015/api/engine-patch-region-request.js +1 -1
- package/esm2015/api/engine-patch-routing-outbound-call-request.js +1 -1
- package/esm2015/api/engine-patch-routing-schema-request.js +1 -1
- package/esm2015/api/engine-queue-bucket.js +1 -1
- package/esm2015/api/engine-queue-hook.js +1 -1
- package/esm2015/api/engine-queue-report-general-agent-status.js +1 -1
- package/esm2015/api/engine-queue-report-general.js +1 -1
- package/esm2015/api/engine-queue-resource-group.js +1 -1
- package/esm2015/api/engine-queue-skill.js +1 -1
- package/esm2015/api/engine-queue.js +1 -1
- package/esm2015/api/engine-region.js +1 -1
- package/esm2015/api/engine-reset-members-request.js +1 -1
- package/esm2015/api/engine-reset-members-response.js +1 -1
- package/esm2015/api/engine-resource-display.js +1 -1
- package/esm2015/api/engine-response.js +1 -1
- package/esm2015/api/engine-routing-outbound-call-compact.js +1 -1
- package/esm2015/api/engine-routing-outbound-call.js +1 -1
- package/esm2015/api/engine-routing-schema.js +1 -1
- package/esm2015/api/engine-routing-variable.js +1 -1
- package/esm2015/api/engine-skill.js +1 -1
- package/esm2015/api/engine-timezone.js +1 -1
- package/esm2015/api/engine-update-agent-pause-cause-request.js +1 -1
- package/esm2015/api/engine-update-agent-request.js +1 -1
- package/esm2015/api/engine-update-agent-skill-request.js +1 -1
- package/esm2015/api/engine-update-agent-team-request.js +1 -1
- package/esm2015/api/engine-update-bucket-request.js +1 -1
- package/esm2015/api/engine-update-calendar-request.js +1 -1
- package/esm2015/api/engine-update-call-annotation-request.js +1 -1
- package/esm2015/api/engine-update-chat-plan-request.js +1 -1
- package/esm2015/api/engine-update-communication-type-request.js +1 -1
- package/esm2015/api/engine-update-email-profile-request.js +1 -1
- package/esm2015/api/engine-update-list-communication-request.js +1 -1
- package/esm2015/api/engine-update-list-request.js +1 -1
- package/esm2015/api/engine-update-member-request.js +1 -1
- package/esm2015/api/engine-update-outbound-resource-display-request.js +1 -1
- package/esm2015/api/engine-update-outbound-resource-group-request.js +1 -1
- package/esm2015/api/engine-update-outbound-resource-in-group-request.js +1 -1
- package/esm2015/api/engine-update-outbound-resource-request.js +1 -1
- package/esm2015/api/engine-update-queue-bucket-request.js +1 -1
- package/esm2015/api/engine-update-queue-hook-request.js +1 -1
- package/esm2015/api/engine-update-queue-request.js +1 -1
- package/esm2015/api/engine-update-queue-resource-group-request.js +1 -1
- package/esm2015/api/engine-update-queue-skill-request.js +1 -1
- package/esm2015/api/engine-update-region-request.js +1 -1
- package/esm2015/api/engine-update-routing-outbound-call-request.js +1 -1
- package/esm2015/api/engine-update-routing-schema-request.js +1 -1
- package/esm2015/api/engine-update-routing-variable-request.js +1 -1
- package/esm2015/api/engine-update-skill-request.js +1 -1
- package/esm2015/api/engine-user-call-request.js +1 -1
- package/esm2015/api/file-service-api.js +1 -1
- package/esm2015/api/index.js +2 -0
- package/esm2015/api/index.js.map +1 -1
- package/esm2015/api/list-service-api.js +1 -1
- package/esm2015/api/media-file-service-api.js +1 -1
- package/esm2015/api/member-service-api.js +1 -1
- package/esm2015/api/outbound-resource-group-service-api.js +1 -1
- package/esm2015/api/outbound-resource-service-api.js +1 -1
- package/esm2015/api/protobuf-null-value.js +1 -1
- package/esm2015/api/queue-bucket-service-api.js +1 -1
- package/esm2015/api/queue-hook-service-api.js +1 -1
- package/esm2015/api/queue-resources-service-api.js +1 -1
- package/esm2015/api/queue-service-api.js +1 -1
- package/esm2015/api/queue-skill-service-api.js +1 -1
- package/esm2015/api/region-service-api.js +1 -1
- package/esm2015/api/routing-chat-plan-service-api.js +1 -1
- package/esm2015/api/routing-outbound-call-service-api.js +1 -1
- package/esm2015/api/routing-schema-service-api.js +1 -1
- package/esm2015/api/routing-variable-service-api.js +1 -1
- package/esm2015/api/skill-service-api.js +1 -1
- package/esm2015/api/storage-backend-profile.js +1 -1
- package/esm2015/api/storage-cognitive-profile.js +1 -1
- package/esm2015/api/storage-create-backend-profile-request.js +1 -1
- package/esm2015/api/storage-create-cognitive-profile-request.js +1 -1
- package/esm2015/api/storage-delete-files-request.js +1 -1
- package/esm2015/api/storage-list-backend-profile.js +1 -1
- package/esm2015/api/storage-list-cognitive-profile.js +1 -1
- package/esm2015/api/storage-list-media.js +1 -1
- package/esm2015/api/storage-media-file.js +1 -1
- package/esm2015/api/storage-patch-backend-profile-request.js +1 -1
- package/esm2015/api/storage-patch-cognitive-profile-request.js +1 -1
- package/esm2015/api/{protobuf-any.js → storage-provider-type.js} +11 -2
- package/esm2015/api/storage-provider-type.js.map +1 -0
- package/esm2015/api/storage-service-type.js +23 -0
- package/esm2015/api/storage-service-type.js.map +1 -0
- package/esm2015/api/storage-update-backend-profile-request.js +1 -1
- package/esm2015/api/storage-update-cognitive-profile-request.js +1 -1
- package/esm2015/api/storage-upload-file-response.js +1 -1
- package/esm2015/api/storage-upload-file-url-response.js +1 -1
- package/esm2015/api/storage-upload-status-code.js +1 -1
- package/esm2015/api/upload-file-request-metadata.js +1 -1
- package/esm2015/api/user-helper-service-api.js +1 -1
- package/esm2015/api.js +1 -1
- package/esm2015/base.js +1 -1
- package/esm2015/configuration.js +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/index.js.map +1 -1
- package/esm2015/socket/client.js +3 -2
- package/esm2015/socket/client.js.map +1 -1
- package/esm2015/socket/task.js.map +1 -1
- package/esm5/api/agent-in-queue-agents-in-queue.js +1 -1
- package/esm5/api/agent-in-queue-statistics-agent-in-queue-statistics-item.js +1 -1
- package/esm5/api/agent-pause-cause-service-api.js +1 -1
- package/esm5/api/agent-service-api.js +1 -1
- package/esm5/api/agent-skill-service-api.js +1 -1
- package/esm5/api/agent-team-service-api.js +1 -1
- package/esm5/api/aggregate-request-group.js +1 -1
- package/esm5/api/backend-profile-service-api.js +1 -1
- package/esm5/api/bucket-service-api.js +1 -1
- package/esm5/api/calendar-service-api.js +1 -1
- package/esm5/api/call-service-api.js +1 -1
- package/esm5/api/cognitive-profile-service-api.js +5 -5
- package/esm5/api/cognitive-profile-service-api.js.map +1 -1
- package/esm5/api/communication-type-service-api.js +1 -1
- package/esm5/api/create-call-request-call-settings.js +1 -1
- package/esm5/api/create-call-request-endpoint-request.js +1 -1
- package/esm5/api/default-device-config-response-sip-device-config.js +1 -1
- package/esm5/api/default-device-config-response-web-rtcdevice-config.js +1 -1
- package/esm5/api/email-profile-service-api.js +1 -1
- package/esm5/api/engine-accept-of-day.js +1 -1
- package/esm5/api/engine-active-call.js +1 -1
- package/esm5/api/engine-agent-call-statistics-list.js +1 -1
- package/esm5/api/engine-agent-call-statistics.js +1 -1
- package/esm5/api/engine-agent-channel.js +1 -1
- package/esm5/api/engine-agent-in-queue-statistics-list.js +1 -1
- package/esm5/api/engine-agent-in-queue-statistics.js +1 -1
- package/esm5/api/engine-agent-in-queue.js +1 -1
- package/esm5/api/engine-agent-in-team.js +1 -1
- package/esm5/api/engine-agent-pause-cause.js +1 -1
- package/esm5/api/engine-agent-set-state-request.js +1 -1
- package/esm5/api/engine-agent-skill-item.js +1 -1
- package/esm5/api/engine-agent-skill.js +1 -1
- package/esm5/api/engine-agent-state.js +1 -1
- package/esm5/api/engine-agent-stats-statistic.js +1 -1
- package/esm5/api/engine-agent-status-request.js +1 -1
- package/esm5/api/engine-agent-status-statistic-item.js +1 -1
- package/esm5/api/engine-agent-team.js +1 -1
- package/esm5/api/engine-agent-user.js +1 -1
- package/esm5/api/engine-agent.js +1 -1
- package/esm5/api/engine-aggregate-history-call-request.js +1 -1
- package/esm5/api/engine-aggregate-request.js +1 -1
- package/esm5/api/engine-aggregate-result.js +1 -1
- package/esm5/api/engine-attempt-callback-request.js +1 -1
- package/esm5/api/engine-attempt-history.js +1 -1
- package/esm5/api/engine-attempt-renewal-result-request.js +1 -1
- package/esm5/api/engine-attempt-result-request.js +1 -1
- package/esm5/api/engine-attempt-result-response.js +1 -1
- package/esm5/api/engine-attempt.js +1 -1
- package/esm5/api/engine-blind-transfer-call-request.js +1 -1
- package/esm5/api/engine-bucket.js +1 -1
- package/esm5/api/engine-calendar.js +1 -1
- package/esm5/api/engine-call-annotation.js +1 -1
- package/esm5/api/engine-call-file.js +1 -1
- package/esm5/api/engine-call-hold.js +1 -1
- package/esm5/api/engine-chat-plan.js +1 -1
- package/esm5/api/engine-communication-type-request.js +1 -1
- package/esm5/api/engine-communication-type.js +1 -1
- package/esm5/api/engine-create-agent-pause-cause-request.js +1 -1
- package/esm5/api/engine-create-agent-request.js +1 -1
- package/esm5/api/engine-create-agent-skill-request.js +1 -1
- package/esm5/api/engine-create-agent-team-request.js +1 -1
- package/esm5/api/engine-create-attempt-request.js +1 -1
- package/esm5/api/engine-create-attempt-response.js +1 -1
- package/esm5/api/engine-create-bucket-request.js +1 -1
- package/esm5/api/engine-create-calendar-request.js +1 -1
- package/esm5/api/engine-create-call-annotation-request.js +1 -1
- package/esm5/api/engine-create-call-request.js +1 -1
- package/esm5/api/engine-create-call-response.js +1 -1
- package/esm5/api/engine-create-chat-plan-request.js +1 -1
- package/esm5/api/engine-create-email-profile-request.js +1 -1
- package/esm5/api/engine-create-list-communication-request.js +1 -1
- package/esm5/api/engine-create-list-request.js +1 -1
- package/esm5/api/engine-create-member-bulk-item.js +1 -1
- package/esm5/api/engine-create-member-bulk-request.js +1 -1
- package/esm5/api/engine-create-member-request.js +1 -1
- package/esm5/api/engine-create-outbound-resource-display-request.js +1 -1
- package/esm5/api/engine-create-outbound-resource-group-request.js +1 -1
- package/esm5/api/engine-create-outbound-resource-in-group-request.js +1 -1
- package/esm5/api/engine-create-outbound-resource-request.js +1 -1
- package/esm5/api/engine-create-queue-bucket-request.js +1 -1
- package/esm5/api/engine-create-queue-hook-request.js +1 -1
- package/esm5/api/engine-create-queue-request.js +1 -1
- package/esm5/api/engine-create-queue-resource-group-request.js +1 -1
- package/esm5/api/engine-create-queue-skill-request.js +1 -1
- package/esm5/api/engine-create-region-request.js +1 -1
- package/esm5/api/engine-create-routing-outbound-call-request.js +1 -1
- package/esm5/api/engine-create-routing-schema-request.js +1 -1
- package/esm5/api/engine-create-routing-variable-request.js +1 -1
- package/esm5/api/engine-create-skill-request.js +1 -1
- package/esm5/api/engine-default-device-config-response.js +1 -1
- package/esm5/api/engine-delete-members-request.js +1 -1
- package/esm5/api/engine-dtmf-call-request.js +1 -1
- package/esm5/api/engine-eavesdrop-call-request.js +1 -1
- package/esm5/api/engine-email-profile.js +1 -1
- package/esm5/api/engine-endpoint.js +1 -1
- package/esm5/api/engine-except-date.js +1 -1
- package/esm5/api/engine-filter-between.js +1 -1
- package/esm5/api/engine-for-agent-pause-cause-list.js +1 -1
- package/esm5/api/engine-for-agent-pause-cause.js +1 -1
- package/esm5/api/engine-hangup-call-request.js +1 -1
- package/esm5/api/engine-history-call.js +1 -1
- package/esm5/api/engine-hold-call-response.js +1 -1
- package/esm5/api/engine-list-agent-in-queue.js +1 -1
- package/esm5/api/engine-list-agent-in-team.js +1 -1
- package/esm5/api/engine-list-agent-pause-cause.js +1 -1
- package/esm5/api/engine-list-agent-skill.js +1 -1
- package/esm5/api/engine-list-agent-state-history.js +1 -1
- package/esm5/api/engine-list-agent-stats-statistic.js +1 -1
- package/esm5/api/engine-list-agent-team.js +1 -1
- package/esm5/api/engine-list-agent-user.js +1 -1
- package/esm5/api/engine-list-agent.js +1 -1
- package/esm5/api/engine-list-aggregate.js +1 -1
- package/esm5/api/engine-list-attempt.js +1 -1
- package/esm5/api/engine-list-bucket.js +1 -1
- package/esm5/api/engine-list-calendar.js +1 -1
- package/esm5/api/engine-list-call.js +1 -1
- package/esm5/api/engine-list-chat-plan.js +1 -1
- package/esm5/api/engine-list-communication-type.js +1 -1
- package/esm5/api/engine-list-communication.js +1 -1
- package/esm5/api/engine-list-email-profile.js +1 -1
- package/esm5/api/engine-list-history-attempt.js +1 -1
- package/esm5/api/engine-list-history-call.js +1 -1
- package/esm5/api/engine-list-member-attempt.js +1 -1
- package/esm5/api/engine-list-member.js +1 -1
- package/esm5/api/engine-list-of-list-communication.js +1 -1
- package/esm5/api/engine-list-of-list.js +1 -1
- package/esm5/api/engine-list-outbound-resource-display.js +1 -1
- package/esm5/api/engine-list-outbound-resource-group.js +1 -1
- package/esm5/api/engine-list-outbound-resource-in-group.js +1 -1
- package/esm5/api/engine-list-outbound-resource.js +1 -1
- package/esm5/api/engine-list-queue-bucket.js +1 -1
- package/esm5/api/engine-list-queue-hook.js +1 -1
- package/esm5/api/engine-list-queue-resource-group.js +1 -1
- package/esm5/api/engine-list-queue-skill.js +1 -1
- package/esm5/api/engine-list-queue.js +1 -1
- package/esm5/api/engine-list-region.js +1 -1
- package/esm5/api/engine-list-report-general.js +1 -1
- package/esm5/api/engine-list-routing-outbound-call.js +1 -1
- package/esm5/api/engine-list-routing-schema.js +1 -1
- package/esm5/api/engine-list-routing-variable.js +1 -1
- package/esm5/api/engine-list-skill.js +1 -1
- package/esm5/api/engine-list-timezone-response.js +1 -1
- package/esm5/api/engine-list.js +1 -1
- package/esm5/api/engine-lookup.js +1 -1
- package/esm5/api/engine-member-attempt.js +1 -1
- package/esm5/api/engine-member-bulk-response.js +1 -1
- package/esm5/api/engine-member-communication-create-request.js +1 -1
- package/esm5/api/engine-member-communication.js +1 -1
- package/esm5/api/engine-member-in-queue.js +1 -1
- package/esm5/api/engine-move-position-routing-outbound-call-request.js +1 -1
- package/esm5/api/engine-move-position-routing-outbound-call-response.js +1 -1
- package/esm5/api/engine-outbound-resource-group.js +1 -1
- package/esm5/api/engine-outbound-resource-in-group.js +1 -1
- package/esm5/api/engine-outbound-resource-parameters.js +1 -1
- package/esm5/api/engine-outbound-resource-time-range.js +1 -1
- package/esm5/api/engine-outbound-resource-view-group.js +1 -1
- package/esm5/api/engine-outbound-resource.js +1 -1
- package/esm5/api/engine-patch-agent-pause-cause-request.js +1 -1
- package/esm5/api/engine-patch-agent-request.js +1 -1
- package/esm5/api/engine-patch-agent-skill-request.js +1 -1
- package/esm5/api/engine-patch-chat-plan-request.js +1 -1
- package/esm5/api/engine-patch-member-request.js +1 -1
- package/esm5/api/engine-patch-outbound-resource-request.js +1 -1
- package/esm5/api/engine-patch-queue-bucket-request.js +1 -1
- package/esm5/api/engine-patch-queue-hook-request.js +1 -1
- package/esm5/api/engine-patch-queue-request.js +1 -1
- package/esm5/api/engine-patch-queue-skill-request.js +1 -1
- package/esm5/api/engine-patch-region-request.js +1 -1
- package/esm5/api/engine-patch-routing-outbound-call-request.js +1 -1
- package/esm5/api/engine-patch-routing-schema-request.js +1 -1
- package/esm5/api/engine-queue-bucket.js +1 -1
- package/esm5/api/engine-queue-hook.js +1 -1
- package/esm5/api/engine-queue-report-general-agent-status.js +1 -1
- package/esm5/api/engine-queue-report-general.js +1 -1
- package/esm5/api/engine-queue-resource-group.js +1 -1
- package/esm5/api/engine-queue-skill.js +1 -1
- package/esm5/api/engine-queue.js +1 -1
- package/esm5/api/engine-region.js +1 -1
- package/esm5/api/engine-reset-members-request.js +1 -1
- package/esm5/api/engine-reset-members-response.js +1 -1
- package/esm5/api/engine-resource-display.js +1 -1
- package/esm5/api/engine-response.js +1 -1
- package/esm5/api/engine-routing-outbound-call-compact.js +1 -1
- package/esm5/api/engine-routing-outbound-call.js +1 -1
- package/esm5/api/engine-routing-schema.js +1 -1
- package/esm5/api/engine-routing-variable.js +1 -1
- package/esm5/api/engine-skill.js +1 -1
- package/esm5/api/engine-timezone.js +1 -1
- package/esm5/api/engine-update-agent-pause-cause-request.js +1 -1
- package/esm5/api/engine-update-agent-request.js +1 -1
- package/esm5/api/engine-update-agent-skill-request.js +1 -1
- package/esm5/api/engine-update-agent-team-request.js +1 -1
- package/esm5/api/engine-update-bucket-request.js +1 -1
- package/esm5/api/engine-update-calendar-request.js +1 -1
- package/esm5/api/engine-update-call-annotation-request.js +1 -1
- package/esm5/api/engine-update-chat-plan-request.js +1 -1
- package/esm5/api/engine-update-communication-type-request.js +1 -1
- package/esm5/api/engine-update-email-profile-request.js +1 -1
- package/esm5/api/engine-update-list-communication-request.js +1 -1
- package/esm5/api/engine-update-list-request.js +1 -1
- package/esm5/api/engine-update-member-request.js +1 -1
- package/esm5/api/engine-update-outbound-resource-display-request.js +1 -1
- package/esm5/api/engine-update-outbound-resource-group-request.js +1 -1
- package/esm5/api/engine-update-outbound-resource-in-group-request.js +1 -1
- package/esm5/api/engine-update-outbound-resource-request.js +1 -1
- package/esm5/api/engine-update-queue-bucket-request.js +1 -1
- package/esm5/api/engine-update-queue-hook-request.js +1 -1
- package/esm5/api/engine-update-queue-request.js +1 -1
- package/esm5/api/engine-update-queue-resource-group-request.js +1 -1
- package/esm5/api/engine-update-queue-skill-request.js +1 -1
- package/esm5/api/engine-update-region-request.js +1 -1
- package/esm5/api/engine-update-routing-outbound-call-request.js +1 -1
- package/esm5/api/engine-update-routing-schema-request.js +1 -1
- package/esm5/api/engine-update-routing-variable-request.js +1 -1
- package/esm5/api/engine-update-skill-request.js +1 -1
- package/esm5/api/engine-user-call-request.js +1 -1
- package/esm5/api/file-service-api.js +1 -1
- package/esm5/api/index.js +2 -0
- package/esm5/api/index.js.map +1 -1
- package/esm5/api/list-service-api.js +1 -1
- package/esm5/api/media-file-service-api.js +1 -1
- package/esm5/api/member-service-api.js +1 -1
- package/esm5/api/outbound-resource-group-service-api.js +1 -1
- package/esm5/api/outbound-resource-service-api.js +1 -1
- package/esm5/api/protobuf-null-value.js +1 -1
- package/esm5/api/queue-bucket-service-api.js +1 -1
- package/esm5/api/queue-hook-service-api.js +1 -1
- package/esm5/api/queue-resources-service-api.js +1 -1
- package/esm5/api/queue-service-api.js +1 -1
- package/esm5/api/queue-skill-service-api.js +1 -1
- package/esm5/api/region-service-api.js +1 -1
- package/esm5/api/routing-chat-plan-service-api.js +1 -1
- package/esm5/api/routing-outbound-call-service-api.js +1 -1
- package/esm5/api/routing-schema-service-api.js +1 -1
- package/esm5/api/routing-variable-service-api.js +1 -1
- package/esm5/api/skill-service-api.js +1 -1
- package/esm5/api/storage-backend-profile.js +1 -1
- package/esm5/api/storage-cognitive-profile.js +1 -1
- package/esm5/api/storage-create-backend-profile-request.js +1 -1
- package/esm5/api/storage-create-cognitive-profile-request.js +1 -1
- package/esm5/api/storage-delete-files-request.js +1 -1
- package/esm5/api/storage-list-backend-profile.js +1 -1
- package/esm5/api/storage-list-cognitive-profile.js +1 -1
- package/esm5/api/storage-list-media.js +1 -1
- package/esm5/api/storage-media-file.js +1 -1
- package/esm5/api/storage-patch-backend-profile-request.js +1 -1
- package/esm5/api/storage-patch-cognitive-profile-request.js +1 -1
- package/esm5/api/{engine-delete-call-annotation-request.js → storage-provider-type.js} +11 -2
- package/esm5/api/storage-provider-type.js.map +1 -0
- package/esm5/api/storage-service-type.js +23 -0
- package/esm5/api/storage-service-type.js.map +1 -0
- package/esm5/api/storage-update-backend-profile-request.js +1 -1
- package/esm5/api/storage-update-cognitive-profile-request.js +1 -1
- package/esm5/api/storage-upload-file-response.js +1 -1
- package/esm5/api/storage-upload-file-url-response.js +1 -1
- package/esm5/api/storage-upload-status-code.js +1 -1
- package/esm5/api/upload-file-request-metadata.js +1 -1
- package/esm5/api/user-helper-service-api.js +1 -1
- package/esm5/api.js +1 -1
- package/esm5/base.js +1 -1
- package/esm5/configuration.js +1 -1
- package/esm5/index.js +2 -2
- package/esm5/index.js.map +1 -1
- package/esm5/socket/client.js +3 -2
- package/esm5/socket/client.js.map +1 -1
- package/esm5/socket/task.js.map +1 -1
- package/package.json +1 -1
- package/types/api/agent-in-queue-agents-in-queue.d.ts +1 -1
- package/types/api/agent-in-queue-statistics-agent-in-queue-statistics-item.d.ts +1 -1
- package/types/api/agent-pause-cause-service-api.d.ts +1 -1
- package/types/api/agent-service-api.d.ts +1 -1
- package/types/api/agent-skill-service-api.d.ts +1 -1
- package/types/api/agent-team-service-api.d.ts +1 -1
- package/types/api/aggregate-request-group.d.ts +1 -1
- package/types/api/backend-profile-service-api.d.ts +1 -1
- package/types/api/bucket-service-api.d.ts +1 -1
- package/types/api/calendar-service-api.d.ts +1 -1
- package/types/api/call-service-api.d.ts +1 -1
- package/types/api/cognitive-profile-service-api.d.ts +9 -9
- package/types/api/cognitive-profile-service-api.d.ts.map +1 -1
- package/types/api/communication-type-service-api.d.ts +1 -1
- package/types/api/create-call-request-call-settings.d.ts +1 -1
- package/types/api/create-call-request-endpoint-request.d.ts +1 -1
- package/types/api/default-device-config-response-sip-device-config.d.ts +1 -1
- package/types/api/default-device-config-response-web-rtcdevice-config.d.ts +1 -1
- package/types/api/email-profile-service-api.d.ts +1 -1
- package/types/api/engine-accept-of-day.d.ts +1 -1
- package/types/api/engine-active-call.d.ts +1 -1
- package/types/api/engine-agent-call-statistics-list.d.ts +1 -1
- package/types/api/engine-agent-call-statistics.d.ts +1 -1
- package/types/api/engine-agent-channel.d.ts +1 -1
- package/types/api/engine-agent-in-queue-statistics-list.d.ts +1 -1
- package/types/api/engine-agent-in-queue-statistics.d.ts +1 -1
- package/types/api/engine-agent-in-queue.d.ts +1 -1
- package/types/api/engine-agent-in-team.d.ts +1 -1
- package/types/api/engine-agent-pause-cause.d.ts +1 -1
- package/types/api/engine-agent-set-state-request.d.ts +1 -1
- package/types/api/engine-agent-skill-item.d.ts +1 -1
- package/types/api/engine-agent-skill.d.ts +1 -1
- package/types/api/engine-agent-state.d.ts +1 -1
- package/types/api/engine-agent-stats-statistic.d.ts +1 -1
- package/types/api/engine-agent-status-request.d.ts +1 -1
- package/types/api/engine-agent-status-statistic-item.d.ts +1 -1
- package/types/api/engine-agent-team.d.ts +1 -1
- package/types/api/engine-agent-user.d.ts +1 -1
- package/types/api/engine-agent.d.ts +1 -1
- package/types/api/engine-aggregate-history-call-request.d.ts +1 -1
- package/types/api/engine-aggregate-request.d.ts +1 -1
- package/types/api/engine-aggregate-result.d.ts +1 -1
- package/types/api/engine-attempt-callback-request.d.ts +1 -1
- package/types/api/engine-attempt-history.d.ts +1 -1
- package/types/api/engine-attempt-renewal-result-request.d.ts +1 -1
- package/types/api/engine-attempt-result-request.d.ts +1 -1
- package/types/api/engine-attempt-result-response.d.ts +1 -1
- package/types/api/engine-attempt.d.ts +1 -1
- package/types/api/engine-blind-transfer-call-request.d.ts +1 -1
- package/types/api/engine-bucket.d.ts +1 -1
- package/types/api/engine-calendar.d.ts +1 -1
- package/types/api/engine-call-annotation.d.ts +1 -1
- package/types/api/engine-call-file.d.ts +1 -1
- package/types/api/engine-call-hold.d.ts +1 -1
- package/types/api/engine-chat-plan.d.ts +1 -1
- package/types/api/engine-communication-type-request.d.ts +1 -1
- package/types/api/engine-communication-type.d.ts +1 -1
- package/types/api/engine-create-agent-pause-cause-request.d.ts +1 -1
- package/types/api/engine-create-agent-request.d.ts +1 -1
- package/types/api/engine-create-agent-skill-request.d.ts +1 -1
- package/types/api/engine-create-agent-team-request.d.ts +1 -1
- package/types/api/engine-create-attempt-request.d.ts +1 -1
- package/types/api/engine-create-attempt-response.d.ts +1 -1
- package/types/api/engine-create-bucket-request.d.ts +1 -1
- package/types/api/engine-create-calendar-request.d.ts +1 -1
- package/types/api/engine-create-call-annotation-request.d.ts +1 -1
- package/types/api/engine-create-call-request.d.ts +1 -1
- package/types/api/engine-create-call-response.d.ts +1 -1
- package/types/api/engine-create-chat-plan-request.d.ts +1 -1
- package/types/api/engine-create-email-profile-request.d.ts +1 -1
- package/types/api/engine-create-list-communication-request.d.ts +1 -1
- package/types/api/engine-create-list-request.d.ts +1 -1
- package/types/api/engine-create-member-bulk-item.d.ts +1 -1
- package/types/api/engine-create-member-bulk-request.d.ts +1 -1
- package/types/api/engine-create-member-request.d.ts +1 -1
- package/types/api/engine-create-outbound-resource-display-request.d.ts +1 -1
- package/types/api/engine-create-outbound-resource-group-request.d.ts +1 -1
- package/types/api/engine-create-outbound-resource-in-group-request.d.ts +1 -1
- package/types/api/engine-create-outbound-resource-request.d.ts +1 -1
- package/types/api/engine-create-queue-bucket-request.d.ts +1 -1
- package/types/api/engine-create-queue-hook-request.d.ts +1 -1
- package/types/api/engine-create-queue-request.d.ts +1 -1
- package/types/api/engine-create-queue-resource-group-request.d.ts +1 -1
- package/types/api/engine-create-queue-skill-request.d.ts +1 -1
- package/types/api/engine-create-region-request.d.ts +1 -1
- package/types/api/engine-create-routing-outbound-call-request.d.ts +1 -1
- package/types/api/engine-create-routing-schema-request.d.ts +1 -1
- package/types/api/engine-create-routing-variable-request.d.ts +1 -1
- package/types/api/engine-create-skill-request.d.ts +1 -1
- package/types/api/engine-default-device-config-response.d.ts +1 -1
- package/types/api/engine-delete-members-request.d.ts +1 -1
- package/types/api/engine-dtmf-call-request.d.ts +1 -1
- package/types/api/engine-eavesdrop-call-request.d.ts +1 -1
- package/types/api/engine-email-profile.d.ts +1 -1
- package/types/api/engine-endpoint.d.ts +1 -1
- package/types/api/engine-except-date.d.ts +1 -1
- package/types/api/engine-filter-between.d.ts +1 -1
- package/types/api/engine-for-agent-pause-cause-list.d.ts +1 -1
- package/types/api/engine-for-agent-pause-cause.d.ts +1 -1
- package/types/api/engine-hangup-call-request.d.ts +1 -1
- package/types/api/engine-history-call.d.ts +1 -1
- package/types/api/engine-hold-call-response.d.ts +1 -1
- package/types/api/engine-list-agent-in-queue.d.ts +1 -1
- package/types/api/engine-list-agent-in-team.d.ts +1 -1
- package/types/api/engine-list-agent-pause-cause.d.ts +1 -1
- package/types/api/engine-list-agent-skill.d.ts +1 -1
- package/types/api/engine-list-agent-state-history.d.ts +1 -1
- package/types/api/engine-list-agent-stats-statistic.d.ts +1 -1
- package/types/api/engine-list-agent-team.d.ts +1 -1
- package/types/api/engine-list-agent-user.d.ts +1 -1
- package/types/api/engine-list-agent.d.ts +1 -1
- package/types/api/engine-list-aggregate.d.ts +1 -1
- package/types/api/engine-list-attempt.d.ts +1 -1
- package/types/api/engine-list-bucket.d.ts +1 -1
- package/types/api/engine-list-calendar.d.ts +1 -1
- package/types/api/engine-list-call.d.ts +1 -1
- package/types/api/engine-list-chat-plan.d.ts +1 -1
- package/types/api/engine-list-communication-type.d.ts +1 -1
- package/types/api/engine-list-communication.d.ts +1 -1
- package/types/api/engine-list-email-profile.d.ts +1 -1
- package/types/api/engine-list-history-attempt.d.ts +1 -1
- package/types/api/engine-list-history-call.d.ts +1 -1
- package/types/api/engine-list-member-attempt.d.ts +1 -1
- package/types/api/engine-list-member.d.ts +1 -1
- package/types/api/engine-list-of-list-communication.d.ts +1 -1
- package/types/api/engine-list-of-list.d.ts +1 -1
- package/types/api/engine-list-outbound-resource-display.d.ts +1 -1
- package/types/api/engine-list-outbound-resource-group.d.ts +1 -1
- package/types/api/engine-list-outbound-resource-in-group.d.ts +1 -1
- package/types/api/engine-list-outbound-resource.d.ts +1 -1
- package/types/api/engine-list-queue-bucket.d.ts +1 -1
- package/types/api/engine-list-queue-hook.d.ts +1 -1
- package/types/api/engine-list-queue-resource-group.d.ts +1 -1
- package/types/api/engine-list-queue-skill.d.ts +1 -1
- package/types/api/engine-list-queue.d.ts +1 -1
- package/types/api/engine-list-region.d.ts +1 -1
- package/types/api/engine-list-report-general.d.ts +1 -1
- package/types/api/engine-list-routing-outbound-call.d.ts +1 -1
- package/types/api/engine-list-routing-schema.d.ts +1 -1
- package/types/api/engine-list-routing-variable.d.ts +1 -1
- package/types/api/engine-list-skill.d.ts +1 -1
- package/types/api/engine-list-timezone-response.d.ts +1 -1
- package/types/api/engine-list.d.ts +1 -1
- package/types/api/engine-lookup.d.ts +1 -1
- package/types/api/engine-member-attempt.d.ts +1 -1
- package/types/api/engine-member-bulk-response.d.ts +1 -1
- package/types/api/engine-member-communication-create-request.d.ts +1 -1
- package/types/api/engine-member-communication.d.ts +1 -1
- package/types/api/engine-member-in-queue.d.ts +1 -1
- package/types/api/engine-move-position-routing-outbound-call-request.d.ts +1 -1
- package/types/api/engine-move-position-routing-outbound-call-response.d.ts +1 -1
- package/types/api/engine-outbound-resource-group.d.ts +1 -1
- package/types/api/engine-outbound-resource-in-group.d.ts +1 -1
- package/types/api/engine-outbound-resource-parameters.d.ts +1 -1
- package/types/api/engine-outbound-resource-time-range.d.ts +1 -1
- package/types/api/engine-outbound-resource-view-group.d.ts +1 -1
- package/types/api/engine-outbound-resource.d.ts +1 -1
- package/types/api/engine-patch-agent-pause-cause-request.d.ts +1 -1
- package/types/api/engine-patch-agent-request.d.ts +1 -1
- package/types/api/engine-patch-agent-skill-request.d.ts +1 -1
- package/types/api/engine-patch-chat-plan-request.d.ts +1 -1
- package/types/api/engine-patch-member-request.d.ts +1 -1
- package/types/api/engine-patch-outbound-resource-request.d.ts +1 -1
- package/types/api/engine-patch-queue-bucket-request.d.ts +1 -1
- package/types/api/engine-patch-queue-hook-request.d.ts +1 -1
- package/types/api/engine-patch-queue-request.d.ts +1 -1
- package/types/api/engine-patch-queue-skill-request.d.ts +1 -1
- package/types/api/engine-patch-region-request.d.ts +1 -1
- package/types/api/engine-patch-routing-outbound-call-request.d.ts +1 -1
- package/types/api/engine-patch-routing-schema-request.d.ts +1 -1
- package/types/api/engine-queue-bucket.d.ts +1 -1
- package/types/api/engine-queue-hook.d.ts +1 -1
- package/types/api/engine-queue-report-general-agent-status.d.ts +1 -1
- package/types/api/engine-queue-report-general.d.ts +1 -1
- package/types/api/engine-queue-resource-group.d.ts +1 -1
- package/types/api/engine-queue-skill.d.ts +1 -1
- package/types/api/engine-queue.d.ts +1 -1
- package/types/api/engine-region.d.ts +1 -1
- package/types/api/engine-reset-members-request.d.ts +1 -1
- package/types/api/engine-reset-members-response.d.ts +1 -1
- package/types/api/engine-resource-display.d.ts +1 -1
- package/types/api/engine-response.d.ts +1 -1
- package/types/api/engine-routing-outbound-call-compact.d.ts +1 -1
- package/types/api/engine-routing-outbound-call.d.ts +1 -1
- package/types/api/engine-routing-schema.d.ts +1 -1
- package/types/api/engine-routing-variable.d.ts +1 -1
- package/types/api/engine-skill.d.ts +1 -1
- package/types/api/engine-timezone.d.ts +1 -1
- package/types/api/engine-update-agent-pause-cause-request.d.ts +1 -1
- package/types/api/engine-update-agent-request.d.ts +1 -1
- package/types/api/engine-update-agent-skill-request.d.ts +1 -1
- package/types/api/engine-update-agent-team-request.d.ts +1 -1
- package/types/api/engine-update-bucket-request.d.ts +1 -1
- package/types/api/engine-update-calendar-request.d.ts +1 -1
- package/types/api/engine-update-call-annotation-request.d.ts +1 -1
- package/types/api/engine-update-chat-plan-request.d.ts +1 -1
- package/types/api/engine-update-communication-type-request.d.ts +1 -1
- package/types/api/engine-update-email-profile-request.d.ts +1 -1
- package/types/api/engine-update-list-communication-request.d.ts +1 -1
- package/types/api/engine-update-list-request.d.ts +1 -1
- package/types/api/engine-update-member-request.d.ts +1 -1
- package/types/api/engine-update-outbound-resource-display-request.d.ts +1 -1
- package/types/api/engine-update-outbound-resource-group-request.d.ts +1 -1
- package/types/api/engine-update-outbound-resource-in-group-request.d.ts +1 -1
- package/types/api/engine-update-outbound-resource-request.d.ts +1 -1
- package/types/api/engine-update-queue-bucket-request.d.ts +1 -1
- package/types/api/engine-update-queue-hook-request.d.ts +1 -1
- package/types/api/engine-update-queue-request.d.ts +1 -1
- package/types/api/engine-update-queue-resource-group-request.d.ts +1 -1
- package/types/api/engine-update-queue-skill-request.d.ts +1 -1
- package/types/api/engine-update-region-request.d.ts +1 -1
- package/types/api/engine-update-routing-outbound-call-request.d.ts +1 -1
- package/types/api/engine-update-routing-schema-request.d.ts +1 -1
- package/types/api/engine-update-routing-variable-request.d.ts +1 -1
- package/types/api/engine-update-skill-request.d.ts +1 -1
- package/types/api/engine-user-call-request.d.ts +1 -1
- package/types/api/file-service-api.d.ts +1 -1
- package/types/api/index.d.ts +2 -0
- package/types/api/index.d.ts.map +1 -1
- package/types/api/list-service-api.d.ts +1 -1
- package/types/api/media-file-service-api.d.ts +1 -1
- package/types/api/member-service-api.d.ts +1 -1
- package/types/api/outbound-resource-group-service-api.d.ts +1 -1
- package/types/api/outbound-resource-service-api.d.ts +1 -1
- package/types/api/protobuf-null-value.d.ts +1 -1
- package/types/api/queue-bucket-service-api.d.ts +1 -1
- package/types/api/queue-hook-service-api.d.ts +1 -1
- package/types/api/queue-resources-service-api.d.ts +1 -1
- package/types/api/queue-service-api.d.ts +1 -1
- package/types/api/queue-skill-service-api.d.ts +1 -1
- package/types/api/region-service-api.d.ts +1 -1
- package/types/api/routing-chat-plan-service-api.d.ts +1 -1
- package/types/api/routing-outbound-call-service-api.d.ts +1 -1
- package/types/api/routing-schema-service-api.d.ts +1 -1
- package/types/api/routing-variable-service-api.d.ts +1 -1
- package/types/api/skill-service-api.d.ts +1 -1
- package/types/api/storage-backend-profile.d.ts +1 -1
- package/types/api/storage-cognitive-profile.d.ts +7 -5
- package/types/api/storage-cognitive-profile.d.ts.map +1 -1
- package/types/api/storage-create-backend-profile-request.d.ts +1 -1
- package/types/api/storage-create-cognitive-profile-request.d.ts +10 -8
- package/types/api/storage-create-cognitive-profile-request.d.ts.map +1 -1
- package/types/api/storage-delete-files-request.d.ts +1 -1
- package/types/api/storage-list-backend-profile.d.ts +1 -1
- package/types/api/storage-list-cognitive-profile.d.ts +1 -1
- package/types/api/storage-list-media.d.ts +1 -1
- package/types/api/storage-media-file.d.ts +1 -1
- package/types/api/storage-patch-backend-profile-request.d.ts +1 -1
- package/types/api/storage-patch-cognitive-profile-request.d.ts +7 -5
- package/types/api/storage-patch-cognitive-profile-request.d.ts.map +1 -1
- package/{esm2015/api/engine-delete-call-annotation-request.js → types/api/storage-provider-type.d.ts} +10 -3
- package/types/api/storage-provider-type.d.ts.map +1 -0
- package/{esm2015/api/runtime-error.js → types/api/storage-service-type.d.ts} +11 -3
- package/types/api/storage-service-type.d.ts.map +1 -0
- package/types/api/storage-update-backend-profile-request.d.ts +1 -1
- package/types/api/storage-update-cognitive-profile-request.d.ts +7 -5
- package/types/api/storage-update-cognitive-profile-request.d.ts.map +1 -1
- package/types/api/storage-upload-file-response.d.ts +1 -1
- package/types/api/storage-upload-file-url-response.d.ts +1 -1
- package/types/api/storage-upload-status-code.d.ts +1 -1
- package/types/api/upload-file-request-metadata.d.ts +1 -1
- package/types/api/user-helper-service-api.d.ts +1 -1
- package/types/api.d.ts +1 -1
- package/types/base.d.ts +1 -1
- package/types/configuration.d.ts +1 -1
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +1 -1
- package/types/socket/client.d.ts.map +1 -1
- package/types/socket/task.d.ts +2 -0
- package/types/socket/task.d.ts.map +1 -1
- package/esm2015/api/engine-delete-call-annotation-request.js.map +0 -1
- package/esm2015/api/protobuf-any.js.map +0 -1
- package/esm2015/api/runtime-error.js.map +0 -1
- package/esm5/api/engine-delete-call-annotation-request.js.map +0 -1
- package/esm5/api/protobuf-any.js +0 -13
- package/esm5/api/protobuf-any.js.map +0 -1
- package/esm5/api/runtime-error.js +0 -13
- package/esm5/api/runtime-error.js.map +0 -1
- package/types/api/engine-delete-call-annotation-request.d.ts +0 -31
- package/types/api/engine-delete-call-annotation-request.d.ts.map +0 -1
- package/types/api/protobuf-any.d.ts +0 -31
- package/types/api/protobuf-any.d.ts.map +0 -1
- package/types/api/runtime-error.d.ts +0 -44
- package/types/api/runtime-error.d.ts.map +0 -1
package/bundles/index.umd.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("url"),require("axios"),require("ee-ts"),require("jssip")):"function"==typeof define&&define.amd?define(["exports","tslib","url","axios","ee-ts","jssip"],t):t((e=e||self).WebitelSdk={},e.tslib,e.globalImportUrl,e.globalAxios,e.eeTs,e.JsSip)}(this,function(f,H,L,Q,i,s){"use strict";Q=Q&&Q.hasOwnProperty("default")?Q.default:Q;function e(e,t,n){void 0===t&&(t=U),void 0===n&&(n=Q),this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var r,U="https://dev.webitel.com/api".replace(/\/+$/,""),C=(r=Error,H.__extends(t,r),t);function t(e,t){var n=r.call(this,t)||this;return n.field=e,n.name="RequiredError",n}function l(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return t=L.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteAgentPauseCause:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},patchAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readAgentPauseCause:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function d(c){return{createAgentPauseCause:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).createAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentPauseCause:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).deleteAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentPauseCause:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).patchAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentPauseCause:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).readAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentPauseCause:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).searchAgentPauseCause(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentPauseCause:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).updateAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var n,a=(n=e,H.__extends(o,n),o.prototype.createAgentPauseCause=function(e,t){var n=this;return d(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.deleteAgentPauseCause=function(e,t){var n=this;return d(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o.prototype.readAgentPauseCause=function(e,t){var n=this;return d(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return d(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},o.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o);function o(){return null!==n&&n.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling agentSetState.");return t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},agentStateHistory:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");return t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.time_from=_),void 0!==h&&(s.time_to=h),void 0!==p&&(s.q=p),void 0!==f&&(s.domain_id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createAgent.");return t=L.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteAgent:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchAgent:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchAgent.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readAgent:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchAgent:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),f&&(a.supervisor_id=f),g&&(a.team_id=g),v&&(a.region_id=v),y&&(a.auditor_id=y),void 0!==b&&(a.is_supervisor=b),w&&(a.skill_id=w),m&&(a.queue_id=m),void 0!==q&&(a.not_supervisor=q),A&&(a.user_id=A),C&&(a.extension=C),R&&(a.not_team_id=R),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),S.headers),[2,{url:L.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),v),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),f&&(a.fields=f),void 0!==g&&(a.sort=g),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),v.headers),[2,{url:L.format(t),options:r}]}})})},searchAgentInQueue:function(c,l,d,_,h,p,f){return void 0===f&&(f={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),f),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),f.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),f.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentInQueueStatistics:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");return t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentInTeam:function(c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),p),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),p.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),g),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.sort=h),void 0!==p&&(a.domain_id=p),void 0!==f&&(a.from_id=f),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),g.headers),[2,{url:L.format(t),options:r}]}})})},searchAgentStatusStatistic:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==f&&(a["time.to"]=f),g&&(a.status=g),v&&(a.queue_id=v),y&&(a.team_id=y),void 0!==b&&(a["utilization.from"]=b),void 0!==w&&(a["utilization.to"]=w),void 0!==m&&(a.has_call=m),q&&(a.skill_id=q),A&&(a.region_id=A),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),S.headers),[2,{url:L.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");return t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s["time.from"]=l),void 0!==d&&(s["time.to"]=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),_),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),_.headers),[2,{url:L.format(t),options:r}]}})})},searchPauseCauseForAgent:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");return t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.allow_change=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},updateAgent:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateAgent.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},updateAgentStatus:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateAgentStatus.");return t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),K&&(r=K.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function A(m){return{agentSetState:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentSetState(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},agentStateHistory:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentStateHistory(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAgent:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).createAgent(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgent:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).deleteAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgent:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).patchAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgent:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).readAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgent:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgent(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentCallStatistics:function(t,n,i,a,s,o,u,c,l,d){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentCallStatistics(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueue:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueue(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueueStatistics:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueueStatistics(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInTeam:function(t,n,i,a,s,o){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInTeam(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStateHistory:function(t,n,i,a,s,o,u,c,l){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStateHistory(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatistic:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatistic(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatisticItem:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatisticItem(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupUsersAgentNotExists:function(t,n,i,a,s){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchLookupUsersAgentNotExists(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchPauseCauseForAgent:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchPauseCauseForAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgent:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentStatus:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgentStatus(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var u,c=(u=e,H.__extends(_,u),_.prototype.agentSetState=function(e,t,n){var r=this;return A(this.configuration).agentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.agentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return A(this.configuration).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_.prototype.createAgent=function(e,t){var n=this;return A(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},_.prototype.deleteAgent=function(e,t,n){var r=this;return A(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.patchAgent=function(e,t,n){var r=this;return A(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.readAgent=function(e,t,n){var r=this;return A(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return A(this.configuration).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(b.axios,b.basePath)})},_.prototype.searchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return A(this.configuration).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},_.prototype.searchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return A(this.configuration).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},_.prototype.searchAgentInQueueStatistics=function(e,t,n){var r=this;return A(this.configuration).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgentInTeam=function(e,t,n,r,i,a){var s=this;return A(this.configuration).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},_.prototype.searchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return A(this.configuration).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},_.prototype.searchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return A(this.configuration).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(b.axios,b.basePath)})},_.prototype.searchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return A(this.configuration).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_.prototype.searchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return A(this.configuration).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},_.prototype.searchPauseCauseForAgent=function(e,t,n){var r=this;return A(this.configuration).searchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgent=function(e,t,n){var r=this;return A(this.configuration).updateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgentStatus=function(e,t,n){var r=this;return A(this.configuration).updateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_);function _(){return null!==u&&u.apply(this,arguments)||this}function h(v){var e=this;return{createAgentSkill:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteAgentSkill.");return t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},patchAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling patchAgentSkill.");return t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},readAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readAgentSkill.");return t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentSkill:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},searchLookupAgentNotExistsSkill:function(c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");return t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),p),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),p.headers),[2,{url:L.format(n),options:i}]}})})},updateAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateAgentSkill.");return t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function p(l){return{createAgentSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).createAgentSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).deleteAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).patchAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).readAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentSkill:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchAgentSkill(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupAgentNotExistsSkill:function(t,n,i,a,s,o){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchLookupAgentNotExistsSkill(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).updateAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var g,v=(g=e,H.__extends(y,g),y.prototype.createAgentSkill=function(e,t,n){var r=this;return p(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},y.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.readAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return p(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},y.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return p(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},y.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y);function y(){return null!==g&&g.apply(this,arguments)||this}function b(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createAgentTeam.");return t=L.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteAgentTeam:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readAgentTeam:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.strategy=p),f&&(a.admin_id=f),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),g.headers),[2,{url:L.format(t),options:r}]}})})},updateAgentTeam:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function w(d){return{createAgentTeam:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).createAgentTeam(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentTeam:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).deleteAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentTeam:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).readAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentTeam:function(t,n,i,a,s,o,u,c,l){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).searchAgentTeam(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentTeam:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).updateAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var m,R=(m=e,H.__extends(S,m),S.prototype.createAgentTeam=function(e,t){var n=this;return w(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},S.prototype.deleteAgentTeam=function(e,t,n){var r=this;return w(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},S.prototype.readAgentTeam=function(e,t,n){var r=this;return w(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},S.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return w(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},S.prototype.updateAgentTeam=function(e,t,n){var r=this;return w(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},S);function S(){return null!==m&&m.apply(this,arguments)||this}function K(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createBackendProfile.");return t=L.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteBackendProfile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchBackendProfile:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readBackendProfile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateBackendProfile:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function P(c){return{createBackendProfile:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).createBackendProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBackendProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).deleteBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchBackendProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).patchBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBackendProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).readBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBackendProfile:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).searchBackendProfile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBackendProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,K(c).updateBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var O,k=(O=e,H.__extends(T,O),T.prototype.createBackendProfile=function(e,t){var n=this;return P(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},T.prototype.deleteBackendProfile=function(e,t,n){var r=this;return P(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.patchBackendProfile=function(e,t,n){var r=this;return P(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.readBackendProfile=function(e,t,n){var r=this;return P(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return P(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},T.prototype.updateBackendProfile=function(e,t,n){var r=this;return P(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T);function T(){return null!==O&&O.apply(this,arguments)||this}function I(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createBucket.");return t=L.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteBucket:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readBucket:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateBucket:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateBucket.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function W(c){return{createBucket:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).createBucket(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).deleteBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).readBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBucket:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).searchBucket(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).updateBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var X,x=(X=e,H.__extends(E,X),E.prototype.createBucket=function(e,t){var n=this;return W(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.deleteBucket=function(e,t,n){var r=this;return W(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.readBucket=function(e,t,n){var r=this;return W(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return W(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},E.prototype.updateBucket=function(e,t,n){var r=this;return W(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E);function E(){return null!==X&&X.apply(this,arguments)||this}function j(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createCalendar.");return t=L.parse("/calendars",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteCalendar:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readCalendar:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/calendars",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),d),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),d.headers),[2,{url:L.format(t),options:r}]}})})},updateCalendar:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function G(c){return{createCalendar:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).createCalendar(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCalendar:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).deleteCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCalendar:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).readCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCalendar:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).searchCalendar(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchTimezones:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).searchTimezones(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCalendar:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,j(c).updateCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var B,M=(B=e,H.__extends(D,B),D.prototype.createCalendar=function(e,t){var n=this;return G(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},D.prototype.deleteCalendar=function(e,t,n){var r=this;return G(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D.prototype.readCalendar=function(e,t,n){var r=this;return G(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return G(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},D.prototype.searchTimezones=function(e,t,n,r){var i=this;return G(this.configuration).searchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},D.prototype.updateCalendar=function(e,t,n){var r=this;return G(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D);function D(){return null!==B&&B.apply(this,arguments)||this}function N(M){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return t=L.parse("/calls/history/aggregate",!0),M&&(n=M.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},blindTransferCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling blindTransferCall.");return t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},confirmPush:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling confirmPush.");return t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),l),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},createCall:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createCall.");return t=L.parse("/calls",!0),M&&(n=M.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},createCallAnnotation:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createCallAnnotation.");return t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteCallAnnotation:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},dtmfCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling dtmfCall.");return t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},eavesdropCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling eavesdropCall.");return t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},hangupCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling hangupCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling hangupCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},holdCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling holdCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling holdCall.");return t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readCall:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W,X,x,E,Q){return void 0===Q&&(Q={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/calls/active",!0),M&&(n=M.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),Q),i={},a={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.exists_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),O&&(a.direction=O),void 0!==k&&(a["answered_at.from"]=k),void 0!==T&&(a["answered_at.to"]=T),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.supervisor_id=x),E&&(a.state=E),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),Q.headers),[2,{url:L.format(t),options:r}]}})})},searchHistoryCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W,X,x,E,Q,U,j,G,B){return void 0===B&&(B={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/calls/history",!0),M&&(n=M.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),B),i={},a={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.has_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),void 0!==O&&(a.direction=O),void 0!==k&&(a["answered_at.from"]=k),void 0!==T&&(a["answered_at.to"]=T),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.id=x),E&&(a.transfer_from=E),Q&&(a.transfer_to=Q),U&&(a.dependency_id=U),j&&(a.tags=j),G&&(a.amd_result=G),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),B.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),B.headers),[2,{url:L.format(t),options:r}]}})})},unHoldCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling unHoldCall.");return t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},updateCallAnnotation:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),M&&(r=M.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},M&&M.apiKey?"function"!=typeof M.apiKey?[3,2]:[4,M.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,M.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function F(E){return{aggregateHistoryCall:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).aggregateHistoryCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},blindTransferCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).blindTransferCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},confirmPush:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).confirmPush(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCall:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).createCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCallAnnotation:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).createCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCallAnnotation:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).deleteCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},dtmfCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).dtmfCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},eavesdropCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).eavesdropCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},hangupCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).hangupCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},holdCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).holdCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).readCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchActiveCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).searchActiveCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchHistoryCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W,X,x){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).searchHistoryCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W,X,x)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},unHoldCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).unHoldCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCallAnnotation:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,N(E).updateCallAnnotation(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var J,z=(J=e,H.__extends(V,J),V.prototype.aggregateHistoryCall=function(e,t){var n=this;return F(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.blindTransferCall=function(e,t,n){var r=this;return F(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.confirmPush=function(e,t){var n=this;return F(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCall=function(e,t){var n=this;return F(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCallAnnotation=function(e,t,n){var r=this;return F(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return F(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.dtmfCall=function(e,t,n){var r=this;return F(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.eavesdropCall=function(e,t,n){var r=this;return F(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.hangupCall=function(e,t,n){var r=this;return F(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.holdCall=function(e,t,n){var r=this;return F(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.readCall=function(e,t,n){var r=this;return F(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.searchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O){var k=this;return F(this.configuration).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O).then(function(e){return e(k.axios,k.basePath)})},V.prototype.searchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W){var X=this;return F(this.configuration).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W).then(function(e){return e(X.axios,X.basePath)})},V.prototype.unHoldCall=function(e,t,n){var r=this;return F(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return F(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},V);function V(){return null!==J&&J.apply(this,arguments)||this}function $(g){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return t=L.parse("/storage/cognitive_profiles",!0),g&&(n=g.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteCognitiveProfile:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),g&&(r=g.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),l),a={},s={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},patchCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),g&&(r=g.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readCognitiveProfile:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),g&&(r=g.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),l),a={},s={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/storage/cognitive_profiles",!0),g&&(n=g.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.service=p),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),f.headers),[2,{url:L.format(t),options:r}]}})})},updateCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),g&&(r=g.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},g&&g.apiKey?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function Y(l){return{createCognitiveProfile:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).createCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCognitiveProfile:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).deleteCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchCognitiveProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).patchCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCognitiveProfile:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).readCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCognitiveProfile:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).searchCognitiveProfile(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCognitiveProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,$(l).updateCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Z,ee=(Z=e,H.__extends(te,Z),te.prototype.createCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.deleteCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te.prototype.readCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o){var u=this;return Y(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},te.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te);function te(){return null!==Z&&Z.apply(this,arguments)||this}function ne(f){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createCommunicationType.");return t=L.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteCommunicationType:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readCommunicationType:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateCommunicationType:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function re(c){return{createCommunicationType:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).createCommunicationType(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCommunicationType:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).deleteCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCommunicationType:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).readCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCommunicationType:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).searchCommunicationType(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCommunicationType:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).updateCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ie,ae=(ie=e,H.__extends(se,ie),se.prototype.createCommunicationType=function(e,t){var n=this;return re(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},se.prototype.deleteCommunicationType=function(e,t,n){var r=this;return re(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.readCommunicationType=function(e,t,n){var r=this;return re(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.searchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return re(this.configuration).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},se.prototype.updateCommunicationType=function(e,t,n){var r=this;return re(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se);function se(){return null!==ie&&ie.apply(this,arguments)||this}function oe(f){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createEmailProfile.");return t=L.parse("/email/profile",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteEmailProfile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readEmailProfile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchEmailProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/email/profile",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a.domain_id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateEmailProfile:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function ue(c){return{createEmailProfile:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,oe(c).createEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteEmailProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,oe(c).deleteEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readEmailProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,oe(c).readEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchEmailProfile:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,oe(c).searchEmailProfile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateEmailProfile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,oe(c).updateEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ce,le=(ce=e,H.__extends(de,ce),de.prototype.createEmailProfile=function(e,t){var n=this;return ue(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.deleteEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).deleteEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de.prototype.readEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).readEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de.prototype.searchEmailProfile=function(e,t,n,r,i,a,s){var o=this;return ue(this.configuration).searchEmailProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},de.prototype.updateEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de);function de(){return null!==ce&&ce.apply(this,arguments)||this}function _e(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling deleteFiles.");return t=L.parse("/storage/file",!0),d&&(n=d.baseOptions),r=H.__assign(H.__assign({method:"DELETE"},n),l),i={},a={},d&&d.apiKey?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})}}}function he(i){return{deleteFiles:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,_e(i).deleteFiles(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var pe,fe=(pe=e,H.__extends(ge,pe),ge.prototype.deleteFiles=function(e,t){var n=this;return he(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})},ge);function ge(){return null!==pe&&pe.apply(this,arguments)||this}function ve(v){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createList.");return t=L.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},createListCommunication:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteList:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},deleteListCommunication:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteListCommunication.");return t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},readList:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readListCommunication:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readListCommunication.");return t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},searchListCommunication:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},updateList:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateList.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},updateListCommunication:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateListCommunication.");return t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function ye(l){return{createList:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).createList(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createListCommunication:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).createListCommunication(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteList:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).deleteList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteListCommunication:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).deleteListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readList:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).readList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readListCommunication:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).readListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchList:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).searchList(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchListCommunication:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).searchListCommunication(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateList:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).updateList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateListCommunication:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ve(l).updateListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var be,we=(be=e,H.__extends(me,be),me.prototype.createList=function(e,t){var n=this;return ye(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},me.prototype.createListCommunication=function(e,t,n){var r=this;return ye(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},me.prototype.deleteList=function(e,t,n){var r=this;return ye(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},me.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return ye(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},me.prototype.readList=function(e,t,n){var r=this;return ye(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},me.prototype.readListCommunication=function(e,t,n,r){var i=this;return ye(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},me.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return ye(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},me.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o){var u=this;return ye(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},me.prototype.updateList=function(e,t,n){var r=this;return ye(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},me.prototype.updateListCommunication=function(e,t,n,r){var i=this;return ye(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},me);function me(){return null!==be&&be.apply(this,arguments)||this}function qe(f){var e=this;return{deleteMediaFile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readMediaFile:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/storage/media",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})}}}function Ae(c){return{deleteMediaFile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).deleteMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMediaFile:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).readMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMediaFile:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).searchMediaFile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Ce,Re=(Ce=e,H.__extends(Se,Ce),Se.prototype.deleteMediaFile=function(e,t,n){var r=this;return Ae(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se.prototype.readMediaFile=function(e,t,n){var r=this;return Ae(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return Ae(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Se);function Se(){return null!==Ce&&Ce.apply(this,arguments)||this}function Ke(q){var e=this;return{attemptCallback:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling attemptCallback.");return t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},attemptResult:function(l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==d)throw new C("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==_)throw new C("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==h)throw new C("body","Required parameter body was null or undefined when calling attemptResult.");return t="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{member_id}",encodeURIComponent(String(d))).replace("{attempt_id}",encodeURIComponent(String(_))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),p),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),p.headers),c="string"!=typeof h||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==h?h:{}):h||"",[2,{url:L.format(n),options:i}]}})})},attemptsRenewalResult:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");return t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},createAttempt:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==d)throw new C("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling createAttempt.");return t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(l))).replace("{member_id}",encodeURIComponent(String(d))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),h),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},createMember:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createMember.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},createMemberBulk:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createMemberBulk.");return t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteMember:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteMember.");return t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},deleteMembers:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling deleteMembers.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},patchMember:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling patchMember.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling patchMember.");return t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},readMember:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readMember.");return t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},resetMembers:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling resetMembers.");return t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},searchAttempts:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/queues/attempts/active",!0),q&&(n=q.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.id=_),h&&(a.queue_id=h),p&&(a.bucket_id=p),f&&(a.member_id=f),g&&(a.agent_id=g),void 0!==v&&(a.result=v),y&&(a.fields=y),void 0!==b&&(a.sort=b),void 0!==w&&(a.domain_id=w),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),m.headers),[2,{url:L.format(t),options:r}]}})})},searchAttemptsHistory:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/queues/attempts/history",!0),q&&(n=q.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.id=_),h&&(a.queue_id=h),p&&(a.bucket_id=p),f&&(a.member_id=f),g&&(a.agent_id=g),void 0!==v&&(a.result=v),y&&(a.fields=y),void 0!==b&&(a.sort=b),void 0!==w&&(a.domain_id=w),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),m.headers),[2,{url:L.format(t),options:r}]}})})},searchMemberAttempts:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==l)throw new C("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");return t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchMemberInQueue:function(c,l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),h),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.domain_id=_),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),[2,{url:L.format(n),options:i}]}})})},searchMembers:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/members",!0),q&&(n=q.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),f),i={},a={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.id=l),void 0!==d&&(a.queue_id=d),void 0!==_&&(a.bucket_id=_),void 0!==h&&(a.destination=h),void 0!==p&&(a.domain_id=p),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),f.headers),[2,{url:L.format(t),options:r}]}})})},updateMember:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateMember.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateMember.");return t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),q&&(r=q.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},q&&q.apiKey?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function Pe(g){return{attemptCallback:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).attemptCallback(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptResult:function(t,n,i,a,s){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).attemptResult(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptsRenewalResult:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).attemptsRenewalResult(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAttempt:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).createAttempt(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMember:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).createMember(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMemberBulk:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).createMemberBulk(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMember:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).deleteMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMembers:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).deleteMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchMember:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).patchMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMember:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).readMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},resetMembers:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).resetMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttempts:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).searchAttempts(t,n,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttemptsHistory:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).searchAttemptsHistory(t,n,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberAttempts:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).searchMemberAttempts(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberInQueue:function(t,n,i,a,s){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).searchMemberInQueue(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMembers:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).searchMembers(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateMember:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(g).updateMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Oe,ke=(Oe=e,H.__extends(Te,Oe),Te.prototype.attemptCallback=function(e,t,n){var r=this;return Pe(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.attemptResult=function(e,t,n,r,i){var a=this;return Pe(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},Te.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return Pe(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.createAttempt=function(e,t,n,r){var i=this;return Pe(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te.prototype.createMember=function(e,t,n){var r=this;return Pe(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.createMemberBulk=function(e,t,n){var r=this;return Pe(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.deleteMember=function(e,t,n,r){var i=this;return Pe(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te.prototype.deleteMembers=function(e,t,n){var r=this;return Pe(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.patchMember=function(e,t,n,r){var i=this;return Pe(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te.prototype.readMember=function(e,t,n,r){var i=this;return Pe(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te.prototype.resetMembers=function(e,t,n){var r=this;return Pe(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Te.prototype.searchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Pe(this.configuration).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},Te.prototype.searchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Pe(this.configuration).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},Te.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return Pe(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te.prototype.searchMemberInQueue=function(e,t,n,r,i){var a=this;return Pe(this.configuration).searchMemberInQueue(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},Te.prototype.searchMembers=function(e,t,n,r,i,a,s,o){var u=this;return Pe(this.configuration).searchMembers(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Te.prototype.updateMember=function(e,t,n,r){var i=this;return Pe(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Te);function Te(){return null!==Oe&&Oe.apply(this,arguments)||this}function Ie(v){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return t=L.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},createOutboundResourceInGroup:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");return t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},deleteOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");return t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},readOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");return t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");return t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},updateOutboundResourceGroup:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},updateOutboundResourceInGroup:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");return t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function We(l){return{createOutboundResourceGroup:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).createOutboundResourceGroup(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceInGroup:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).createOutboundResourceInGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceGroup:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).deleteOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceInGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).deleteOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceGroup:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).readOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceInGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).readOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceGroup:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).searchOutboundResourceGroup(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceInGroup:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).searchOutboundResourceInGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceGroup:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).updateOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceInGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(l).updateOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Xe,xe=(Xe=e,H.__extends(Ee,Xe),Ee.prototype.createOutboundResourceGroup=function(e,t){var n=this;return We(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},Ee.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return We(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return We(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return We(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ee.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return We(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return We(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ee.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return We(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ee.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return We(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Ee.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return We(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return We(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ee);function Ee(){return null!==Xe&&Xe.apply(this,arguments)||this}function Qe(v){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createOutboundResource.");return t=L.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},createOutboundResourceDisplay:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteOutboundResource:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},deleteOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},patchOutboundResource:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readOutboundResource:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},updateOutboundResource:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},updateOutboundResourceDisplay:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function Ue(l){return{createOutboundResource:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).createOutboundResource(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceDisplay:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).createOutboundResourceDisplay(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResource:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).deleteOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceDisplay:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).deleteOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchOutboundResource:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).patchOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResource:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).readOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceDisplay:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).readOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResource:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).searchOutboundResource(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceDisplay:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).searchOutboundResourceDisplay(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResource:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).updateOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceDisplay:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(l).updateOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var je,Ge=(je=e,H.__extends(Be,je),Be.prototype.createOutboundResource=function(e,t){var n=this;return Ue(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},Be.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return Ue(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.deleteOutboundResource=function(e,t,n){var r=this;return Ue(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return Ue(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.patchOutboundResource=function(e,t,n){var r=this;return Ue(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.readOutboundResource=function(e,t,n){var r=this;return Ue(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return Ue(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return Ue(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Be.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return Ue(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Be.prototype.updateOutboundResource=function(e,t,n){var r=this;return Ue(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return Ue(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be);function Be(){return null!==je&&je.apply(this,arguments)||this}function Me(v){var e=this;return{createQueueBucket:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteQueueBucket:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteQueueBucket.");return t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling patchQueueBucket.");return t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},readQueueBucket:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readQueueBucket.");return t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchQueueBucket:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},updateQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateQueueBucket.");return t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function He(l){return{createQueueBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).createQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).deleteQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueBucket:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).patchQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueBucket:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).readQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueBucket:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).searchQueueBucket(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueBucket:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).updateQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Le,De=(Le=e,H.__extends(Ne,Le),Ne.prototype.createQueueBucket=function(e,t,n){var r=this;return He(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ne.prototype.deleteQueueBucket=function(e,t,n){var r=this;return He(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ne.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return He(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ne.prototype.readQueueBucket=function(e,t,n){var r=this;return He(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ne.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return He(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Ne.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return He(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ne);function Ne(){return null!==Le&&Le.apply(this,arguments)||this}function Fe(b){var e=this;return{createQueueHook:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteQueueHook:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteQueueHook.");return t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchQueueHook:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling patchQueueHook.");return t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},readQueueHook:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readQueueHook.");return t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchQueueHook:function(c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),y),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.schema_id=g),v&&(s.event=v),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),y.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),y.headers),[2,{url:L.format(n),options:i}]}})})},updateQueueHook:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateQueueHook.");return t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function Je(_){return{createQueueHook:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).createQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueHook:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).deleteQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueHook:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).patchQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueHook:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).readQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueHook:function(t,n,i,a,s,o,u,c,l,d){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).searchQueueHook(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueHook:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(_).updateQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ze,Ve=(ze=e,H.__extends($e,ze),$e.prototype.createQueueHook=function(e,t,n){var r=this;return Je(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.deleteQueueHook=function(e,t,n){var r=this;return Je(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.patchQueueHook=function(e,t,n,r){var i=this;return Je(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e.prototype.readQueueHook=function(e,t,n){var r=this;return Je(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Je(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},$e.prototype.updateQueueHook=function(e,t,n,r){var i=this;return Je(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e);function $e(){return null!==ze&&ze.apply(this,arguments)||this}function Ye(v){var e=this;return{createQueueResourceGroup:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");return t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");return t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},readQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");return t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),[2,{url:L.format(n),options:i}]}})})},searchQueueResourceGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");return t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),g.headers),[2,{url:L.format(n),options:i}]}})})},updateQueueResourceGroup:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");return t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function Ze(l){return{createQueueResourceGroup:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).createQueueResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueResourceGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).deleteQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueResourceGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).readQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueResourceGroup:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).searchQueueResourceGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueResourceGroup:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).updateQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var et,tt=(et=e,H.__extends(nt,et),nt.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return Ze(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return Ze(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return Ze(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return Ze(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},nt.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return Ze(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt);function nt(){return null!==et&&et.apply(this,arguments)||this}function rt(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createQueue.");return t=L.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteQueue:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),w&&(r=w.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchQueue:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchQueue.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),w&&(r=w.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readQueue:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),w&&(r=w.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),f),i={},a={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.type=p),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),f.headers),[2,{url:L.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),b),i={},a={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),void 0!==_&&(a.domain_id=_),h&&(a.fields=h),void 0!==p&&(a.sort=p),void 0!==f&&(a.q=f),g&&(a.queue_id=g),v&&(a.team_id=v),y&&(a.type=y),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),b.headers),[2,{url:L.format(t),options:r}]}})})},updateQueue:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateQueue.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),w&&(r=w.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function it(p){return{createQueue:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).createQueue(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueue:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).deleteQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueue:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).patchQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueue:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).readQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueue:function(t,n,i,a,s,o,u,c){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).searchQueue(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueReportGeneral:function(t,n,i,a,s,o,u,c,l,d,_,h){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).searchQueueReportGeneral(t,n,i,a,s,o,u,c,l,d,_,h)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueue:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,rt(p).updateQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var at,st=(at=e,H.__extends(ot,at),ot.prototype.createQueue=function(e,t){var n=this;return it(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},ot.prototype.deleteQueue=function(e,t,n){var r=this;return it(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.patchQueue=function(e,t,n){var r=this;return it(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.readQueue=function(e,t,n){var r=this;return it(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return it(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ot.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return it(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},ot.prototype.updateQueue=function(e,t,n){var r=this;return it(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot);function ot(){return null!==at&&at.apply(this,arguments)||this}function ut(A){var e=this;return{createQueueSkill:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling createQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(l))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"POST"},r),_),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},deleteQueueSkill:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling deleteQueueSkill.");return t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling patchQueueSkill.");return t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},readQueueSkill:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==l)throw new C("id","Required parameter id was null or undefined when calling readQueueSkill.");return t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchQueueSkill:function(c,l,d,_,h,p,f,g,v,y,b,w,m,q){return void 0===q&&(q={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),q),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.skill_id=g),v&&(s.bucket_id=v),y&&(s.lvl=y),b&&(s.min_capacity=b),w&&(s.max_capacity=w),void 0!==m&&(s.enabled=m),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),q.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),q.headers),[2,{url:L.format(n),options:i}]}})})},updateQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==d)throw new C("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling updateQueueSkill.");return t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=L.parse(t,!0),A&&(r=A.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})}}}function ct(g){return{createQueueSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).createQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).deleteQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).patchQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).readQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueSkill:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).searchQueueSkill(t,n,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueSkill:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ut(g).updateQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var lt,dt=(lt=e,H.__extends(_t,lt),_t.prototype.createQueueSkill=function(e,t,n){var r=this;return ct(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_t.prototype.deleteQueueSkill=function(e,t,n){var r=this;return ct(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_t.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return ct(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t.prototype.readQueueSkill=function(e,t,n){var r=this;return ct(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_t.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return ct(this.configuration).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},_t.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return ct(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t);function _t(){return null!==lt&<.apply(this,arguments)||this}function ht(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createRegion.");return t=L.parse("/regions",!0),y&&(n=y.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteRegion:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},patchRegion:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchRegion.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readRegion:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/regions",!0),y&&(n=y.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.description=f),g&&(a.timezone_id=g),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),v.headers),[2,{url:L.format(t),options:r}]}})})},updateRegion:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateRegion.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function pt(_){return{createRegion:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).createRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRegion:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).deleteRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRegion:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).patchRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRegion:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).readRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRegion:function(t,n,i,a,s,o,u,c,l,d){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).searchRegion(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRegion:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,ht(_).updateRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ft,gt=(ft=e,H.__extends(vt,ft),vt.prototype.createRegion=function(e,t){var n=this;return pt(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},vt.prototype.deleteRegion=function(e,t){var n=this;return pt(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},vt.prototype.patchRegion=function(e,t,n){var r=this;return pt(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.readRegion=function(e,t){var n=this;return pt(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},vt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return pt(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},vt.prototype.updateRegion=function(e,t,n){var r=this;return pt(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt);function vt(){return null!==ft&&ft.apply(this,arguments)||this}function yt(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createChatPlan.");return t=L.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteChatPlan:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},patchChatPlan:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readChatPlan:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.enabled=f),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),g.headers),[2,{url:L.format(t),options:r}]}})})},updateChatPlan:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),v&&(r=v.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function bt(d){return{createChatPlan:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).createChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteChatPlan:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).deleteChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchChatPlan:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).patchChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readChatPlan:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).readChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchChatPlan:function(t,n,i,a,s,o,u,c,l){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).searchChatPlan(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateChatPlan:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,yt(d).updateChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var wt,mt=(wt=e,H.__extends(qt,wt),qt.prototype.createChatPlan=function(e,t){var n=this;return bt(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},qt.prototype.deleteChatPlan=function(e,t){var n=this;return bt(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},qt.prototype.patchChatPlan=function(e,t,n){var r=this;return bt(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.readChatPlan=function(e,t){var n=this;return bt(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},qt.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return bt(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},qt.prototype.updateChatPlan=function(e,t,n){var r=this;return bt(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt);function qt(){return null!==wt&&wt.apply(this,arguments)||this}function At(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return t=L.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},movePositionRoutingOutboundCall:function(l,d,_,h){return void 0===h&&(h={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new C("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==_)throw new C("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");return t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(l))).replace("{to_id}",encodeURIComponent(String(d))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:L.format(n),options:i}]}})})},patchRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.schema_id=f),void 0!==g&&(a.pattern=g),void 0!==v&&(a.description=v),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),y.headers),[2,{url:L.format(t),options:r}]}})})},updateRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),b&&(r=b.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function Ct(h){return{createRoutingOutboundCall:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).createRoutingOutboundCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingOutboundCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).deleteRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},movePositionRoutingOutboundCall:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).movePositionRoutingOutboundCall(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingOutboundCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).patchRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingOutboundCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).readRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingOutboundCall:function(t,n,i,a,s,o,u,c,l,d,_){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).searchRoutingOutboundCall(t,n,i,a,s,o,u,c,l,d,_)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingOutboundCall:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,At(h).updateRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Rt,St=(Rt=e,H.__extends(Kt,Rt),Kt.prototype.createRoutingOutboundCall=function(e,t){var n=this;return Ct(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return Ct(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return Ct(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Kt.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return Ct(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return Ct(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Ct(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Kt.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return Ct(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt);function Kt(){return null!==Rt&&Rt.apply(this,arguments)||this}function Pt(y){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createRoutingSchema.");return t=L.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteRoutingSchema:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},patchRoutingSchema:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})},readRoutingSchema:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),v.headers),[2,{url:L.format(t),options:r}]}})})},updateRoutingSchema:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),y&&(r=y.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function Ot(_){return{createRoutingSchema:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).createRoutingSchema(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingSchema:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).deleteRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingSchema:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).patchRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingSchema:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).readRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingSchema:function(t,n,i,a,s,o,u,c,l,d){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).searchRoutingSchema(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingSchema:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(_).updateRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var kt,Tt=(kt=e,H.__extends(It,kt),It.prototype.createRoutingSchema=function(e,t){var n=this;return Ot(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Ot(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Ot(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.readRoutingSchema=function(e,t,n){var r=this;return Ot(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ot(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},It.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Ot(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It);function It(){return null!==kt&&kt.apply(this,arguments)||this}function Wt(h){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createRoutingVariable.");return t=L.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteRoutingVariable:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),h&&(r=h.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readRoutingVariable:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),h&&(r=h.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),d),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.domain_id=l),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),d.headers),[2,{url:L.format(t),options:r}]}})})},updateRoutingVariable:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),h&&(r=h.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function Xt(s){return{createRoutingVariable:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(s).createRoutingVariable(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingVariable:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(s).deleteRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingVariable:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(s).readRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingVariable:function(t,n,i,a){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(s).searchRoutingVariable(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingVariable:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(s).updateRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var xt,Et=(xt=e,H.__extends(Qt,xt),Qt.prototype.createRoutingVariable=function(e,t){var n=this;return Xt(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Xt(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.readRoutingVariable=function(e,t,n){var r=this;return Xt(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Xt(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Qt.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Xt(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt);function Qt(){return null!==xt&&xt.apply(this,arguments)||this}function Ut(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("body","Required parameter body was null or undefined when calling createSkill.");return t=L.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=H.__assign(H.__assign(H.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:L.format(t),options:r}]}})})},deleteSkill:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling deleteSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},readSkill:function(c,l,d){return void 0===d&&(d={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("id","Required parameter id was null or undefined when calling readSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=H.__assign(H.__assign(H.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),d.headers),[2,{url:L.format(n),options:i}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return H.__generator(this,function(e){switch(e.label){case 0:return t=L.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=H.__assign(H.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=H.__assign(H.__assign(H.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=H.__assign(H.__assign(H.__assign({},i),o),p.headers),[2,{url:L.format(t),options:r}]}})})},updateSkill:function(l,d,_){return void 0===_&&(_={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new C("id","Required parameter id was null or undefined when calling updateSkill.");if(null==d)throw new C("body","Required parameter body was null or undefined when calling updateSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(l))),n=L.parse(t,!0),f&&(r=f.baseOptions),i=H.__assign(H.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=H.__assign(H.__assign(H.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:L.format(n),options:i}]}})})}}}function jt(c){return{createSkill:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(c).createSkill(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(c).deleteSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(c).readSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchSkill:function(t,n,i,a,s,o,u){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(c).searchSkill(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateSkill:function(t,n,i){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(c).updateSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Gt,Bt=(Gt=e,H.__extends(Mt,Gt),Mt.prototype.createSkill=function(e,t){var n=this;return jt(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.deleteSkill=function(e,t,n){var r=this;return jt(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.readSkill=function(e,t,n){var r=this;return jt(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return jt(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Mt.prototype.updateSkill=function(e,t,n){var r=this;return jt(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt);function Mt(){return null!==Gt&&Gt.apply(this,arguments)||this}function Ht(d){var e=this;return{defaultDeviceConfig:function(c,l){return void 0===l&&(l={}),H.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return H.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new C("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(c))),n=L.parse(t,!0),d&&(r=d.baseOptions),i=H.__assign(H.__assign({method:"GET"},r),l),a={},s={},d&&d.apiKey?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=H.__assign(H.__assign(H.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=H.__assign(H.__assign(H.__assign({},a),u),l.headers),[2,{url:L.format(n),options:i}]}})})}}}function Lt(i){return{defaultDeviceConfig:function(t,n){return H.__awaiter(this,void 0,void 0,function(){var r;return H.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(i).defaultDeviceConfig(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=Q),void 0===t&&(t=U);var n=H.__assign(H.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Dt,Nt=(Dt=e,H.__extends(Ft,Dt),Ft.prototype.defaultDeviceConfig=function(e,t){var n=this;return Lt(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Ft);function Ft(){return null!==Dt&&Dt.apply(this,arguments)||this}function Jt(e){void 0===e&&(e={}),this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}var zt=(Vt.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},Vt.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},Vt.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},Vt.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},Vt.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,H.__spreadArrays([t],n)):console[e](t)},Vt);function Vt(){}var $t=(Object.defineProperty(Yt.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),Yt.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},Yt.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},Yt.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})},Yt);function Yt(e){this.session=e.session,this.callId=e.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===e.session.direction,this.instanceId=e.request.getHeader("X-Webitel-Sock-Id")}var Zt,en,tn,nn=(Zt=i.EventEmitter,H.__extends(rn,Zt),rn.prototype.callOption=function(n){return void 0===n&&(n={}),H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.getUserCallStream(n)];case 1:return t=e.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}]}})})},rn.prototype.answer=function(r,i){return H.__awaiter(this,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:return this.sessionCache.has(r)?(t=this.sessionCache.get(r),[4,this.callOption(i)]):[3,2];case 1:return n=e.sent(),[2,t.answer(n)];case 2:return[2,!1]}})})},rn.prototype.call=function(i){return H.__awaiter(this,void 0,void 0,function(){var t,n,r;return H.__generator(this,function(e){switch(e.label){case 0:if(t={},n=null,i.params&&(t.audio=i.params.audio,t.video=i.params.video||!1,t.screen=i.params.screen||!1,t.disableStun=i.params.disableStun||!1),"string"!=typeof i.destination)throw new Error("bad destination type");return[4,this.callOption(t)];case 1:return r=e.sent(),i.params&&i.params.display&&(n={extraHeaders:["X-Webitel-Display: "+i.params.display]}),[4,this.ua.call(i.destination,H.__assign(H.__assign({},r),n))];case 2:return e.sent(),[2]}})})},rn.prototype.register=function(a){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i=this;return H.__generator(this,function(e){return t=new s.WebSocketInterface(a.server),n={realm:a.realm,uri:a.uri,authorization_user:a.authorization_user,ha1:a.ha1,user_agent:rn.userAgent,sockets:[t],session_timers:!0,display_name:a.display_name,register_expires:a.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(r=this.ua=new s.UA(n)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new $t(e);i.storeSession(n,r),t.on("connecting",function(){i.emit("localStreams",r,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",function(e){i.emit("peerStreams",r,new Array(e.stream))}),t.on("peerconnection",function(e){e.peerconnection.addEventListener("addstream",function(t){return H.__awaiter(i,void 0,void 0,function(){return H.__generator(this,function(e){return this.emit("peerStreams",r,new Array(t.stream)),[2]})})})}),t.on("ended",function(){i.removeSession(n,t.connection)}),t.on("failed",function(){i.removeSession(n,t.connection)}),t.on("accepted",function(){r.incoming||i.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",function(){}),i.emit("newSession",r)}),r.on("disconnected",function(e){i.emit("unregistered")}),r.on("unregistered",function(e){i.emit("unregistered")}),r.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),r.on("registered",function(e){i.emit("registered")}),r.start(),[2]})})},rn.prototype.unregister=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:e.sent(),delete this.ua,e.label=2;case 2:return[2]}})})},rn.prototype.sipSessionByCallId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.callId===e)return r}return null},rn.prototype.sipSessionBySipId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.id.startsWith(e))return r}return null},rn.prototype.removeSession=function(e,t){var n,r;return t&&(n=t.getLocalStreams(),r=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),r&&r.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})})),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},rn.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(rn.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),rn.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},rn.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},rn.prototype.hasSession=function(e){return this.sessionCache.has(e)},rn.prototype.getUserScreen=function(){return H.__awaiter(this,void 0,void 0,function(){var t=this;return H.__generator(this,function(e){return[2,new Promise(function(r,i){return H.__awaiter(t,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return t=e.sent(),r(t),[3,3];case 2:return n=e.sent(),i(n),[3,3];case 3:return[2]}})})})]})})},rn.prototype.getUserCallStream=function(r){return H.__awaiter(this,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:return!0!==r.screen?[3,2]:[4,this.getUserScreen()];case 1:t=e.sent(),e.label=2;case 2:return!1!==r.audio||r.video?[4,this.getUserMedia(r.audio,r.video)]:[3,4];case 3:n=e.sent(),t?n.getTracks().forEach(function(e){t.addTrack(e)}):t=n,e.label=4;case 4:if(!t)throw new Error("bad stream request");return[2,t]}})})},rn.prototype.getUserMedia=function(i,a){return H.__awaiter(this,void 0,void 0,function(){var t=this;return H.__generator(this,function(e){return[2,new Promise(function(n,r){return H.__awaiter(t,void 0,void 0,function(){var t;return H.__generator(this,function(e){return t={audio:!(!1===i),video:void 0},a&&(t.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),[2,function(r){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,new Promise(function(t,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(r).then(function(e){return t(e)}).catch(function(e){return n(e)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(r,function(e){return t(e)},function(e){return n(e)})})]})})}(t).then(n).catch(r)]})})})]})})},rn.userAgent="Webitel-Phone/0.0.1",rn);function rn(e,t){var n=Zt.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?s.debug.enable("*"):s.debug.disable(),n.log=new zt,n.on("unregistered",function(){n.sessionCache.clear()}),n}(tn=en=en||{}).Call="call",tn.Chat="chat",tn.Task="task";var an,sn,on,un=(Object.defineProperty(cn.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"allowAccept",{get:function(){return this.channel===en.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"allowClose",{get:function(){return this.channel===en.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),cn.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},cn.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},cn.prototype.setProcessing=function(e){this.state="processing",this.startProcessingAt||(this.startProcessingAt=Date.now()),e.sec&&!e.timeout&&(e.timeout=Date.now()+1e3*e.sec),this._processing=e},cn.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},Object.defineProperty(cn.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(cn.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),cn.prototype.accept=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},cn.prototype.close=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},cn.prototype.decline=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},cn.prototype.reporting=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",H.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},cn.prototype.renew=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},cn.prototype.formAction=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.form)throw new Error("not found active form");return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:t,fields:n})]})})},cn);function cn(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=t.status,this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=n.communication,this.history=[n]}(an=f.AgentStatus||(f.AgentStatus={})).Online="online",an.Offline="offline",an.Pause="pause",an.BreakOut="break_out",(sn=f.ChannelState||(f.ChannelState={})).Waiting="waiting",sn.Distribute="distribute",sn.Offering="offering",sn.Answered="answered",sn.Active="active",sn.Bridged="bridged",sn.Hold="hold",sn.Missed="missed",sn.WrapTime="wrap_time",sn.Processing="processing",sn.Transfer="transfer",sn.Form="form",(on=f.ChannelType||(f.ChannelType={})).Call="call",on.Email="email",on.Chat="chat";var ln,dn,_n,hn=(Object.defineProperty(pn.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(pn.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),pn.prototype.onChannelEvent=function(e){switch(e.status){case f.ChannelState.Distribute:var t=e;if(!t)throw new Error("bad event");if(i=new un(this.client,e,t.distribute),this.task.set(i.id,i),i.agentChannelId)switch(i.channel){case f.ChannelType.Call:var n=this.client.callById(i.agentChannelId);n&&!n.task&&(n.task=i);break;case f.ChannelType.Chat:var r=this.client.conversationById(i.agentChannelId);r&&!r.task&&(r.task=i)}break;case f.ChannelState.Offering:(i=this.task.get(e.attempt_id))&&(i.offeringAt=e.timestamp);break;case f.ChannelState.Bridged:var i,a=e;(i=this.task.get(a.attempt_id))&&i.setBridged(a);break;case f.ChannelState.Transfer:var s=e;(i=this.task.get(s.to_attempt_id))&&(this.task.delete(i.id),i.id=s.attempt_id,i.setTransferred(s.distribute),this.task.set(i.id,i));break;case f.ChannelState.Answered:(i=this.task.get(e.attempt_id))&&(i.answeredAt=e.timestamp);break;case f.ChannelState.Form:var o=e;return void((i=this.task.get(e.attempt_id))&&(i.form=o.form||null));case f.ChannelState.Missed:if(e.attempt_id&&(i=this.task.get(e.attempt_id))){i.stopAt=e.timestamp;var u=e;if(!u)throw new Error("bad event");return this.setChannelStateTimeout(e.channel,e,u.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i),i}break;case f.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");i=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i)}break;case f.ChannelState.Processing:if(e.attempt_id){var c=e;if(!c)throw new Error("bad event");if(i=this.task.get(e.attempt_id))return i.state=e.status,i.closedAt=e.timestamp,i.setProcessing(c.processing),this.setChannelStateTimeout(e.channel,e,c.processing.timeout||0),i}break;case f.ChannelState.Waiting:e.attempt_id&&(i=this.task.get(e.attempt_id))&&(i.stopAt=e.timestamp,this.task.delete(e.attempt_id),this.client.reportingChannelTask(i))}return this.setChannelState(e.channel,e),i?(i.state=e.status,i):void 0},pn.prototype.online=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},pn.prototype.waiting=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},pn.prototype.pause=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},pn.prototype.offline=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},pn.prototype.setStatus=function(e){e.status===f.AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this._channel=e.channels[0]),this.info.status=e.status,this.info.status_payload=e.status_payload?e.status_payload:null,this.lastStatusChange=Date.now()},pn.prototype.directMember=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},pn.prototype.offlineMembers=function(t,n,r){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:t,per_page:r})]})})},pn.prototype.hasTask=function(e){return this.task.has(e.id)},pn.prototype.setChannelState=function(e,t){this._channel.channel=e||null,this._channel.state=t.status,this._channel.joined_at=t.timestamp,this._channel.timeout=void 0},pn.prototype.setChannelStateTimeout=function(e,t,n){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=n,this._channel.joined_at=t.timestamp},pn);function pn(e,t){this.client=e,this.info=t,this.task=new Map,this._channel=t.channels[0],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(ln=f.CallReportingStatus||(f.CallReportingStatus={})).Abandoned="abandoned",ln.Cancel="cancel",ln.Success="success",(dn=f.CallActions||(f.CallActions={})).Ringing="ringing",dn.Active="active",dn.Bridge="bridge",dn.Hold="hold",dn.DTMF="dtmf",dn.Voice="voice",dn.Silence="silence",dn.Execute="execute",dn.Update="update",dn.Hangup="hangup",dn.Reporting="reporting",dn.PeerStream="peerStream",dn.LocalStream="localStream",dn.Destroy="destroy",(_n=f.CallDirection||(f.CallDirection={})).Inbound="inbound",_n.Outbound="outbound";var fn=(gn.prototype.setState=function(e){this.state=e.event},gn.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(gn.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===f.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),gn.prototype.getMember=function(e){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.isMember)throw new Error("call is not from outbound queue");return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})]})})},Object.defineProperty(gn.prototype,"isMember",{get:function(){return!(!this.task||!this.task.memberId)},enumerable:!0,configurable:!0}),gn.prototype.setActive=function(e){this.answeredAt||(this.direction===f.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)},gn.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===f.CallDirection.Inbound?this.from=t.to:this.to=t.to),this.bridgedId=t.bridged_id,t.payload&&(this.variables=t.payload),t.queue&&(this.queue=t.queue)},gn.prototype.setHold=function(e){this.setState(e)},gn.prototype.setInfo=function(e){this.parentId=e.parent_id,this.destination=e.destination,this.direction=e.direction,this.from=e.from,this.to=e.to,this.variables=e.payload,this.queue=e.queue||null,this.sipId=e.sip_id||null,this.params=e.params},gn.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},gn.prototype.setLocalStreams=function(e){this.localStreams=e||[]},gn.prototype.setVoice=function(){this.voice=!0},gn.prototype.setSilence=function(){this.voice=!1},gn.prototype.setExecute=function(e){this.applications.push(e.application)},gn.prototype.addDigit=function(e){this.digits.push(e.digit)},gn.prototype.setHangup=function(e){var t=e.data;this.hangupAt=+e.timestamp,this.hangupCause=t.cause,this.hangupSipCode=t.sip,this.voice=!1,this.peerStreams=[],+t.reporting_at&&(this.reportingAt=+t.reporting_at),this.setState(e)},Object.defineProperty(gn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"isHold",{get:function(){return this.state===f.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(gn.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),gn.prototype.answer=function(r){return H.__awaiter(this,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:if(!this.sip||!this.client.phone)return[3,6];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.client.phone.callOption(r)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return n=e.sent(),this.client.handleError(n),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},gn.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return H.__awaiter(n,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},gn.prototype.hangup=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===f.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},gn.prototype.eavesdrop=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},gn.prototype.toggleHold=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return this.state===f.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},gn.prototype.hold=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(this.state===f.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},gn.prototype.unHold=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(this.state!==f.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},gn.prototype.sendDTMF=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},gn.prototype.blindTransfer=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},gn.prototype.mute=function(n){return void 0===n&&(n=!1),H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return t=e.sent(),this._muted=n,[2,t]}})})},gn.prototype.bridgeTo=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:t.id,to_app_id:t.appId})]})})},gn.prototype.reporting=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.task)throw new Error("this call not in queue");return[2,this.task.reporting(t)]})})},gn.prototype.renew=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},gn.prototype.callToUser=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})},gn);function gn(e,t){this.client=e;var n=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],e.phone&&(n.sip_id?this.setSip(e.phone.sipSessionBySipId(n.sip_id)):this.setSip(e.phone.sipSessionByCallId(t.id))),this.params={},this.id=t.id,this.digits=[],this.applications=[],this.appId=t.app_id,this.setState(t),this.setInfo(n),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}var vn,yn;(vn=f.ChatActions||(f.ChatActions={})).Message="message",vn.UserInvite="user_invite",vn.Invite="invite_conversation",vn.Joined="join_conversation",vn.Close="close_conversation",vn.Leave="leave_conversation",vn.Decline="decline_invite",vn.Update="update_channel",vn.Destroy="destroy",(yn=f.ConversationState||(f.ConversationState={})).Init="init",yn.Invite="invite",yn.Active="active",yn.Pending="pending",yn.Closed="closed";var bn=(wn.prototype.setInvite=function(e,t){var n=this;this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(function(e){n.client.emit("error",e)})},wn.prototype.setAnswered=function(e,t,n){this.state=f.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=mn(n),this.inviteId=null},wn.prototype.setClosed=function(e){this.state=f.ConversationState.Closed,this.closedAt=e},Object.defineProperty(wn.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),wn.prototype.getMessages=function(){var n=this;return this._messages.map(function(e){var t={id:e.id,type:e.type,member:n.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file.url=n.client.fileUrlDownload(e.file.id),e.file.streamUrl=n.client.fileUrlStream(e.file.id),t.file=e.file),e.hasOwnProperty("text")&&(t.text=e.text),e.hasOwnProperty("contact")&&(t.contact=e.contact),t})},wn.prototype.next=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){throw new Error("TODO")})})},wn.prototype.pagination=function(e,t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){throw new Error("TODO")})})},wn.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(wn.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"allowLeave",{get:function(){return!!this.channelId&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(wn.prototype,"membersId",{get:function(){for(var e=[this.id],t=0,n=this.members;t<n.length;t++){var r=n[t];e.push(r.id)}return e},enumerable:!0,configurable:!0}),wn.prototype.decline=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("decline_chat",{invite_id:this.inviteId})]})})},wn.prototype.join=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("join_chat",{invite_id:this.inviteId})]})})},wn.prototype.close=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},wn.prototype.leave=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},wn.prototype.sendText=function(r){return H.__awaiter(this,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:if(!this.channelId)throw new Error("conversation not active");if(!r.length)throw new Error("empty message");t=function(e,t){for(var n=Math.ceil(e.length/t),r=new Array(n),i=0,a=0;a<n;a++)r[a]=e.substr(i,t),i+=t;return r}(r,4096),n=0,e.label=1;case 1:return n<t.length?n+1>=t.length?[2,this.sendMessageTextChunk(t[n])]:[4,this.sendMessageTextChunk(t[n])]:[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},wn.prototype.sendFile=function(r,i){return H.__awaiter(this,void 0,void 0,function(){var t,n;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[r],i)];case 1:return t=e.sent(),n=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:n.id,name:r.name,mime:n.mime,url:n.shared,size:n.size})]}})})},wn.prototype.send=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if("string"==typeof t)return[2,this.sendText(t)];if(t instanceof File)return[2,this.sendFile(t,n)];throw new Error("unknown send data")})})},wn.prototype.addToChat=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:t,title:n})]})})},wn.prototype.startChat=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},wn.prototype.updateChannel=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},wn.prototype.reporting=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.reporting(t)]})})},wn.prototype.renew=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},wn.prototype.transferToPlan=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},wn.prototype.transferToUser=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},wn.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},wn.prototype.messageMember=function(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(var t=0,n=this.members;t<n.length;t++){var r=n[t];if(r.id===e.channel_id)return r}return null},wn);function wn(e,t,n,r,i,a){for(var s in this.client=e,this.conversationId=t,this.title=n,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.members=(r||[]).map(mn),this._messages=i||[],this.state=f.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this._autoAnswer=!1,a)!s.startsWith("cc_")&&a.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswer="true"===a.wbt_auto_answer:this.variables[s]=a[s]);a&&a.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function mn(e){return e.messenger=e.type,e}var qn,An=(qn=Error,H.__extends(Cn,qn),Cn.id="device_not_found",Cn);function Cn(e){var t=qn.call(this,e)||this;return t.id=Cn.id,t}var Rn,Sn=(Rn=Error,H.__extends(Kn,Rn),Kn.id="device_not_allow",Kn);function Kn(e){var t=Rn.call(this,e)||this;return t.id=Kn.id,t}var Pn,On=(Pn=i.EventEmitter,H.__extends(kn,Pn),kn.prototype.connect=function(e){var t=this;this.socket=new WebSocket(this.host.replace(/^http/,"ws")+"/websocket"),this.socket.onclose=function(e){return t.onClose(e.code)},this.socket.onmessage=function(e){return t.onMessage(e.data)},this.socket.onopen=function(){return t.onOpen()}},kn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},kn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},kn.prototype.onOpen=function(){this.emit("open")},kn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},kn.prototype.onMessage=function(e){var t;"\0\0\0\0"!==e&&(t=JSON.parse(e),this.emit("message",t))},kn);function kn(e){var t=Pn.call(this)||this;return t.host=e,t}var Tn,In,Wn,Xn="call",xn="chat",En="user_state",Qn="agent_status";(In=Tn=Tn||{}).NotFoundError="NotFoundError",In.NotAllowedError="NotAllowedError",(Wn=f.Response||(f.Response={})).STATUS_FAIL="FAIL",Wn.STATUS_OK="OK";var Un,jn=(Un=i.EventEmitter,H.__extends(Gn,Un),Gn.prototype.connect=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},Gn.prototype.disconnect=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return this.socket.close(),[2]})})},Gn.prototype.subscribeCall=function(o,u){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",u)];case 1:if(t=e.sent(),this.eventHandler.on(Xn,o),t.items&&t.items.length)for(n=0,r=t.items;n<r.length;n++)(i=r[n]).hangup_at&&0<i.hangup_at&&!i.task||(a={cc_app_id:"",app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),data:{app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:i.parent_id,direction:i.direction,destination:i.destination,queue:i.queue,from:i.from,to:i.to,payload:i.variables}},(s=new fn(this,a)).createdAt=i.created_at,s.answeredAt=i.answered_at||0,s.bridgedAt=i.bridged_at||0,s.hangupAt=i.hangup_at||0,i.task&&(s.task=new un(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),s.queue.reporting="true",i.leaving_at&&i.task.processing_sec&&(s.task.startProcessingAt=i.leaving_at,s.task.setProcessing({sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0}))),this.callStore.set(s.id,s));return[2,t]}})})},Gn.prototype.subscribeChat=function(o,u){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",u)];case 1:if(t=e.sent(),this.eventHandler.on(xn,o),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(s=new bn(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,s.closedAt=i.closed_at,i.task&&(s.task=new un(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),i.leaving_at&&i.task.processing_sec&&(s.task.startProcessingAt=i.leaving_at,s.task.setProcessing({sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0}))),i.invite_id)s.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}s.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(s.id,s)}return[2,t]}})})},Gn.prototype.subscribeUsersStatus=function(n,r){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_users_status",r)];case 1:return t=e.sent(),this.eventHandler.on(En,n),[2,t]}})})},Gn.prototype.subscribeAgentsStatus=function(n,r){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("cc_agent_subscribe_status",r)];case 1:return t=e.sent(),this.eventHandler.on(Qn,n),[2,t]}})})},Gn.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},Gn.prototype.unSubscribe=function(t,e,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("un_subscribe_"+t,n)];case 1:return[2,e.sent()]}})})},Gn.prototype.destroy=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return e.sent(),this.phone?[4,this.phone.unregister()]:[3,3];case 2:e.sent(),this.phone.off("*"),delete this.phone,e.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},Gn.prototype.allCall=function(){return Array.from(this.callStore.values())},Gn.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},Gn.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},Gn.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},Gn.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},Gn.prototype.callBySipId=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sipId&&e.startsWith(r.sipId))return r}},Gn.prototype.reportingTask=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_reporting",H.__assign({attempt_id:t},n))]})})},Gn.prototype.agentActiveTasks=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},Gn.prototype.auth=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},Gn.prototype.ping=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},Gn.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(Gn.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(Gn.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),Gn.prototype.agentSession=function(){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return H.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("cc_agent_session")];case 1:return t=e.sent(),this.agent=new hn(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(n=e.sent(),r=0,i=n.items;r<i.length;r++)a=i[r],(s=new un(this,{status:a.status,timestamp:Date.now()-1e3*a.duration,channel:a.channel,attempt_id:a.attempt_id},a)).postProcessData={},s.state=a.state,a.bridged_at&&(s.bridgedAt=a.bridged_at,s.answeredAt=a.bridged_at),a.leaving_at&&(s.closedAt=a.leaving_at),this.agent.task.set(s.id,s);for(o=0,u=this.allCall();o<u.length;o++)(c=u[o]).task&&this.agent.task.set(c.task.id,c.task);return[2,this.agent]}})})},Gn.prototype.invite=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},Gn.prototype.call=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:if(!this.phone)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleError(t),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:e.sent(),e.label=7;case 7:return[2]}})})},Gn.prototype.callRecordId=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},Gn.prototype.eavesdrop=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},Gn.prototype.agentSetOnline=function(t,n,r){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},Gn.prototype.agentSetWaiting=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},Gn.prototype.agentSetPause=function(t,n){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},Gn.prototype.agentSetOffline=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},Gn.prototype.inviteToUser=function(e){return this.request("call_user",e)},Gn.prototype.answer=function(n,r){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},Gn.prototype.request=function(n,r){var i=this;return new Promise(function(e,t){i.queueRequest.set(++i.reqSeq,{resolve:e,reject:t}),i.socket.send({seq:i.reqSeq,action:n,data:r})})},Gn.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},Gn.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},Gn.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&!this.hasAgentTask(e.task)},Gn.prototype.reportingChannelTask=function(e){switch(e.channel){case en.Call:for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(this.callDestroyed(r))return void this.destroyCall(r)}break;case en.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},Gn.prototype.registerCallClient=function(i){return H.__awaiter(this,void 0,void 0,function(){var t,n,r=this;return H.__generator(this,function(e){switch(e.label){case 0:this.phone=i,this.phone.on("peerStreams",function(e,t){var n=r.callBySession(e);n&&!n.peerStreams.length&&(n.setPeerStreams(t),r.eventHandler.emit(Xn,f.CallActions.PeerStream,n))}),this.phone.on("localStreams",function(e,t){var n=r.callBySession(e);n&&!n.localStreams.length&&(n.setLocalStreams(t),r.eventHandler.emit(Xn,f.CallActions.LocalStream,n))}),this.phone.on("newSession",this.onNewCallSession.bind(this)),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return t=e.sent(),[4,this.phone.register(t)];case 3:return e.sent(),[3,5];case 4:return n=e.sent(),this.log.error(n),[3,5];case 5:return[2]}})})},Gn.prototype.deviceConfig=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},Gn.prototype.storeFile=function(d,_,h){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l;return H.__generator(this,function(e){switch(e.label){case 0:if(!_||_.length<1)throw new Error("no files");for(t=new FormData,n=0,r=_;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,Q.post(this.basePath+"/api/storage/file/"+d+"/upload",t,{headers:((l={})["X-Webitel-Access"]=this._config.token,l),onUploadProgress:h})];case 1:for(a=e.sent(),s=a.data,o=0,u=s;o<u.length;o++)(c=u[o]).shared=this.basePath+c.shared;return[2,s]}})})},Gn.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},Gn.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},Gn.prototype.handleError=function(e){if(e)switch(e.name){case Tn.NotFoundError:this.emit("error",new An(e.message));break;case Tn.NotAllowedError:this.emit("error",new Sn(e.message));break;default:this.emit("error",e)}},Gn.prototype.onMessage=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(e.label){case 0:return this.log.debug("receive message: ",n),0<n.seq_reply?(this.queueRequest.has(n.seq_reply)&&(t=this.queueRequest.get(n.seq_reply),this.queueRequest.delete(n.seq_reply),n.status===f.Response.STATUS_OK?t.resolve(n.data):t.reject(n.error)),[3,13]):[3,1];case 1:switch(n.event){case"hello":return[3,2];case Xn:return[3,4];case xn:return[3,6];case En:return[3,8];case"sip":return[3,9];case Qn:return[3,10];case"channel":return[3,11]}return[3,12];case 2:return[4,this.connected(n.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,13];case 4:return[4,this.handleCallEvents(n.data.call)];case 5:return e.sent(),[3,13];case 6:return[4,this.handleChatEvents(n.data)];case 7:return e.sent(),[3,13];case 8:return this.handleUserStateEvent(n.data.state),[3,13];case 9:return this.eventHandler.emit("sip",n.data),[3,13];case 10:return this.handleAgentStatus(n.data),[3,13];case 11:return this.handleChannelEvents(n.data),[3,13];case 12:this.log.error("event "+n.event+" not handler"),e.label=13;case 13:return[2]}})})},Gn.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Qn,e,this.agent)},Gn.prototype.handleChannelEvents=function(e){var t;this.agent&&(e.timestamp=Date.now(),t=this.agent.onChannelEvent(e)||void 0,this.eventHandler.emit("task",e.status,t))},Gn.prototype.pingServer=function(){return H.__awaiter(this,void 0,void 0,function(){var t,n=this;return H.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return H.__awaiter(n,void 0,void 0,function(){return H.__generator(this,function(e){return this.socket.close(3005),[2]})})},this.connectionInfo.ping_interval/2),[4,this.ping()]):[3,2];case 1:e.sent(),clearTimeout(t),e.label=2;case 2:return this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval)),[2]}})})},Gn.prototype.connected=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){switch(e.label){case 0:return(this.connectionInfo=t).ping_interval?[4,this.pingServer()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.useWebPhone()?[2,this.registerCallClient(new nn(this.instanceId,this._config.debug))]:[2]}})})},Gn.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip===e)return r}},Gn.prototype.onNewCallSession=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},Gn.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},300)},Gn.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new On(n._config.endpoint),n.socket.connect(n._config.token)}catch(e){return void t(e)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(e){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",e),n.eventHandler.off("*"),1e3!==e&&(n.emit("disconnected",e),t(new Error("close socket code: "+e)))}),n.socket.on("open",function(){e(null),n.emit("connected")})})},Gn.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(En,e)},Gn.prototype.handleCallEvents=function(n){return H.__awaiter(this,void 0,void 0,function(){var t;return H.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case f.CallActions.Ringing:t=new fn(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case f.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case f.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case f.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case f.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case f.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case f.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case f.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case f.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(Xn,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},Gn.prototype.handleChatEvents=function(p){return H.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_,h;return H.__generator(this,function(e){switch(n=Date.now(),p.action){case f.ChatActions.UserInvite:r=p.data,(t=new bn(this,r.conversation_id,r.title,r.members,r.messages,r.variables)).setInvite(r.invite_id,n),this.conversationStore.set(t.id,t);break;case f.ChatActions.Joined:i=p.data,(t=this.conversationById(i.member.id))&&t.setAnswered(i.member.id,n,i.member);break;case f.ChatActions.Message:for((a=p.data).timestamp=n,s=0,o=this.allConversations();s<o.length;s++)!(d=o[s]).closedAt&&-1<d.membersId.indexOf(a.channel_id)&&(t=d);t&&t.newMessage(a);break;case f.ChatActions.Close:for(u=p.data,c=0,l=this.allConversations();c<l.length;c++)!(d=l[c]).closedAt&&-1<d.membersId.indexOf(u.from_channel_id)&&(t=d);t&&t.setClosed(n);break;case f.ChatActions.Leave:_=p.data,(t=this.conversationById(_.leaved_channel_id))&&t.setClosed(n);break;case f.ChatActions.Decline:h=p.data,(t=this.conversationById(h.invite_id))&&t.setClosed(n)}return t&&(this.eventHandler.emit(xn,p.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},Gn.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},Gn.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(Xn,f.CallActions.Destroy,e)},Gn.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(xn,f.ChatActions.Destroy,e)},Gn);function Gn(e){var t,n,r=Un.call(this)||this;return r._config=e,r.reqSeq=0,r.queueRequest=new Map,r.log=new zt,r.eventHandler=new i.EventEmitter,r.callStore=new Map,r.conversationStore=new Map,r.pingTimer=null,r.basePath=""+(t=e.storageEndpoint||e.endpoint,(n=t.replace(/^ws/,"http")).endsWith("/")&&(n=n.slice(0,-1)),n.endsWith("/ws")&&(n=n.slice(0,-3)),n),r}var Bn,Mn=(Bn=i.EventEmitter,H.__extends(Hn,Bn),Hn);function Hn(){return null!==Bn&&Bn.apply(this,arguments)||this}var Ln="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Dn,Nn,Fn=(function(c){var e=Ln&&Ln.__generator||function(n,r){var i,a,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return o.label++,{value:t[1],done:!1};case 5:o.label++,a=t[1],t=[0];continue;case 7:t=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){o=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){o.label=t[1];break}if(6===t[0]&&o.label<s[1]){o.label=s[1],s=t;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(t);break}s[2]&&o.ops.pop(),o.trys.pop();continue}t=r.call(n,o)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener");var t=(n.count=function(e,t){var n=0,r=e[c.$listeners][t];if(r)for(var i=r.first;++n&&i.next;)i=i.next;return n},n.has=function(e,t){if("*"!=t)return void 0!==e[c.$listeners][t];for(t in e[c.$listeners])return!0;return!1},n.keys=function(e){return Object.keys(e[c.$listeners])},n.unhandle=function(n,r,i,e){return n.on(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!n[c.$listeners][r].first.next)return i.apply(void 0,e)},e)},n.prototype.on=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n):this[c.$addListener](e,void 0,t)},n.prototype.one=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n,!0):this[c.$addListener](e,void 0,t,!0)},n.prototype.off=function(e,t){if("*"==e){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var r in n)this._onEventUnhandled(r);return this}if("function"==typeof t){var i=this[c.$listeners][e];if(i&&function(e,t){for(var n=null,r=e.first;;)if(t(r))if(n){if(n.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return;e.first=r=r.next}else{if(!(n=r).next)break;r=r.next}return e.last=n,e}(i,function(e){return e.fn==t}))return this}return delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},n.prototype.emit=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=this.listeners(e);;){var a=i.next(),s=a.value;if(a.done)return t;var o=s.apply(void 0,n);void 0!==o&&(t=o)}},n.prototype.listeners=function(t){var n,r,i;return e(this,function(e){switch(e.label){case 0:if(!(n=this[c.$listeners][t]))return[2];r=null,i=n.first,e.label=1;case 1:return[4,i.fn];case 2:if(e.sent(),i.once){if(!r)return i.next?(n.first=i=i.next,[3,1]):(delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),[2]);r.next=i.next}else r=i;return i.next?(i=i.next,[3,1]):(n.last=i,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,e,r,i){var t,a,s=this;if(void 0===i&&(i=!1),"object"!=typeof n)return"function"==typeof e&&(t=n,a=l(this[c.$listeners],t,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(t,e)}}),e==a.first.fn&&this._onEventHandled&&this._onEventHandled(n)),e;var o,u=this;for(o in n)!function(){var e,t;"function"==typeof n[o]&&(e=n[o],t=l(u[c.$listeners],o,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(o,e)}}),e==t.first.fn&&u._onEventHandled&&u._onEventHandled(o))}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function l(e,t,n){var r=e[t];return r?(r.last.next=n,r.last=n):e[t]=r={first:n,last:n},r}c.EventEmitter=t}((Dn={exports:{}},Dn.exports)),Dn.exports);(Nn=Fn)&&Nn.__esModule&&Object.prototype.hasOwnProperty.call(Nn,"default")&&Nn.default;Fn.$listeners,Fn.$addListener;var Jn=Fn.EventEmitter,zn=(Object.defineProperty(Vn.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),Vn.prototype.getLocalMedia=function(){return[]},Vn.prototype.getPeerMedia=function(){return[]},Vn.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},Vn);function Vn(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}var $n,Yn=($n=Jn,H.__extends(Zn,$n),Zn.prototype.callOption=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2,t]})})},Zn.prototype.register=function(e){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2]})})},Zn.prototype.unregister=function(){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return[2]})})},Zn.prototype.call=function(t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},Zn.prototype.answer=function(e){this.exec(e,"answer")},Zn.prototype.sipSessionByCallId=function(e){return new zn(this,e)},Zn.prototype.sipSessionBySipId=function(e){return null},Zn.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(H.__assign({token:e},this.config))),"open")},Zn.prototype.exec=function(e,t){var n=""+this.schema+e;t&&(n+=" "+t);var r=document.createElement("a");r.download="File name",r.href=n,r.click()},Zn);function Zn(e){var t=$n.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}f.AgentPauseCauseServiceApiAxiosParamCreator=l,f.AgentPauseCauseServiceApiFp=d,f.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return d(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return d(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return d(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return d(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return d(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return d(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},f.AgentPauseCauseServiceApi=a,f.AgentServiceApiAxiosParamCreator=q,f.AgentServiceApiFp=A,f.AgentServiceApiFactory=function(b,w,m){return{agentSetState:function(e,t,n){return A(b).agentSetState(e,t,n).then(function(e){return e(m,w)})},agentStateHistory:function(e,t,n,r,i,a,s,o){return A(b).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(m,w)})},createAgent:function(e,t){return A(b).createAgent(e,t).then(function(e){return e(m,w)})},deleteAgent:function(e,t,n){return A(b).deleteAgent(e,t,n).then(function(e){return e(m,w)})},patchAgent:function(e,t,n){return A(b).patchAgent(e,t,n).then(function(e){return e(m,w)})},readAgent:function(e,t,n){return A(b).readAgent(e,t,n).then(function(e){return e(m,w)})},searchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return A(b).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(m,w)})},searchAgentInQueue:function(e,t,n,r,i,a,s){return A(b).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(m,w)})},searchAgentInQueueStatistics:function(e,t,n){return A(b).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(m,w)})},searchAgentInTeam:function(e,t,n,r,i,a){return A(b).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(m,w)})},searchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return A(b).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(m,w)})},searchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentStatusStatisticItem:function(e,t,n,r){return A(b).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(m,w)})},searchLookupUsersAgentNotExists:function(e,t,n,r,i){return A(b).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(m,w)})},searchPauseCauseForAgent:function(e,t,n){return A(b).searchPauseCauseForAgent(e,t,n).then(function(e){return e(m,w)})},updateAgent:function(e,t,n){return A(b).updateAgent(e,t,n).then(function(e){return e(m,w)})},updateAgentStatus:function(e,t,n){return A(b).updateAgentStatus(e,t,n).then(function(e){return e(m,w)})}}},f.AgentServiceApi=c,f.AgentSkillServiceApiAxiosParamCreator=h,f.AgentSkillServiceApiFp=p,f.AgentSkillServiceApiFactory=function(u,c,l){return{createAgentSkill:function(e,t,n){return p(u).createAgentSkill(e,t,n).then(function(e){return e(l,c)})},deleteAgentSkill:function(e,t,n,r){return p(u).deleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},patchAgentSkill:function(e,t,n,r){return p(u).patchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},readAgentSkill:function(e,t,n,r){return p(u).readAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},searchAgentSkill:function(e,t,n,r,i,a,s,o){return p(u).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},searchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return p(u).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},updateAgentSkill:function(e,t,n,r){return p(u).updateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},f.AgentSkillServiceApi=v,f.AgentTeamServiceApiAxiosParamCreator=b,f.AgentTeamServiceApiFp=w,f.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return w(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return w(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return w(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return w(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return w(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},f.AgentTeamServiceApi=R,f.BackendProfileServiceApiAxiosParamCreator=K,f.BackendProfileServiceApiFp=P,f.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return P(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return P(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return P(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return P(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return P(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return P(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},f.BackendProfileServiceApi=k,f.BucketServiceApiAxiosParamCreator=I,f.BucketServiceApiFp=W,f.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return W(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return W(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return W(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return W(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return W(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},f.BucketServiceApi=x,f.CalendarServiceApiAxiosParamCreator=j,f.CalendarServiceApiFp=G,f.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return G(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return G(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return G(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return G(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r){return G(o).searchTimezones(e,t,n,r).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return G(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},f.CalendarServiceApi=M,f.CallServiceApiAxiosParamCreator=N,f.CallServiceApiFp=F,f.CallServiceApiFactory=function(X,x,E){return{aggregateHistoryCall:function(e,t){return F(X).aggregateHistoryCall(e,t).then(function(e){return e(E,x)})},blindTransferCall:function(e,t,n){return F(X).blindTransferCall(e,t,n).then(function(e){return e(E,x)})},confirmPush:function(e,t){return F(X).confirmPush(e,t).then(function(e){return e(E,x)})},createCall:function(e,t){return F(X).createCall(e,t).then(function(e){return e(E,x)})},createCallAnnotation:function(e,t,n){return F(X).createCallAnnotation(e,t,n).then(function(e){return e(E,x)})},deleteCallAnnotation:function(e,t,n){return F(X).deleteCallAnnotation(e,t,n).then(function(e){return e(E,x)})},dtmfCall:function(e,t,n){return F(X).dtmfCall(e,t,n).then(function(e){return e(E,x)})},eavesdropCall:function(e,t,n){return F(X).eavesdropCall(e,t,n).then(function(e){return e(E,x)})},hangupCall:function(e,t,n){return F(X).hangupCall(e,t,n).then(function(e){return e(E,x)})},holdCall:function(e,t,n){return F(X).holdCall(e,t,n).then(function(e){return e(E,x)})},readCall:function(e,t,n){return F(X).readCall(e,t,n).then(function(e){return e(E,x)})},searchActiveCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O){return F(X).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O).then(function(e){return e(E,x)})},searchHistoryCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W){return F(X).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,k,T,I,W).then(function(e){return e(E,x)})},unHoldCall:function(e,t,n){return F(X).unHoldCall(e,t,n).then(function(e){return e(E,x)})},updateCallAnnotation:function(e,t,n,r){return F(X).updateCallAnnotation(e,t,n,r).then(function(e){return e(E,x)})}}},f.CallServiceApi=z,f.CognitiveProfileServiceApiAxiosParamCreator=$,f.CognitiveProfileServiceApiFp=Y,f.CognitiveProfileServiceApiFactory=function(u,c,l){return{createCognitiveProfile:function(e,t){return Y(u).createCognitiveProfile(e,t).then(function(e){return e(l,c)})},deleteCognitiveProfile:function(e,t){return Y(u).deleteCognitiveProfile(e,t).then(function(e){return e(l,c)})},patchCognitiveProfile:function(e,t,n){return Y(u).patchCognitiveProfile(e,t,n).then(function(e){return e(l,c)})},readCognitiveProfile:function(e,t){return Y(u).readCognitiveProfile(e,t).then(function(e){return e(l,c)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o){return Y(u).searchCognitiveProfile(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateCognitiveProfile:function(e,t,n){return Y(u).updateCognitiveProfile(e,t,n).then(function(e){return e(l,c)})}}},f.CognitiveProfileServiceApi=ee,f.CommunicationTypeServiceApiAxiosParamCreator=ne,f.CommunicationTypeServiceApiFp=re,f.CommunicationTypeServiceApiFactory=function(o,u,c){return{createCommunicationType:function(e,t){return re(o).createCommunicationType(e,t).then(function(e){return e(c,u)})},deleteCommunicationType:function(e,t,n){return re(o).deleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},readCommunicationType:function(e,t,n){return re(o).readCommunicationType(e,t,n).then(function(e){return e(c,u)})},searchCommunicationType:function(e,t,n,r,i,a,s){return re(o).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCommunicationType:function(e,t,n){return re(o).updateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},f.CommunicationTypeServiceApi=ae,f.EmailProfileServiceApiAxiosParamCreator=oe,f.EmailProfileServiceApiFp=ue,f.EmailProfileServiceApiFactory=function(o,u,c){return{createEmailProfile:function(e,t){return ue(o).createEmailProfile(e,t).then(function(e){return e(c,u)})},deleteEmailProfile:function(e,t,n){return ue(o).deleteEmailProfile(e,t,n).then(function(e){return e(c,u)})},readEmailProfile:function(e,t,n){return ue(o).readEmailProfile(e,t,n).then(function(e){return e(c,u)})},searchEmailProfile:function(e,t,n,r,i,a,s){return ue(o).searchEmailProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateEmailProfile:function(e,t,n){return ue(o).updateEmailProfile(e,t,n).then(function(e){return e(c,u)})}}},f.EmailProfileServiceApi=le,f.FileServiceApiAxiosParamCreator=_e,f.FileServiceApiFp=he,f.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return he(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},f.FileServiceApi=fe,f.ListServiceApiAxiosParamCreator=ve,f.ListServiceApiFp=ye,f.ListServiceApiFactory=function(u,c,l){return{createList:function(e,t){return ye(u).createList(e,t).then(function(e){return e(l,c)})},createListCommunication:function(e,t,n){return ye(u).createListCommunication(e,t,n).then(function(e){return e(l,c)})},deleteList:function(e,t,n){return ye(u).deleteList(e,t,n).then(function(e){return e(l,c)})},deleteListCommunication:function(e,t,n,r){return ye(u).deleteListCommunication(e,t,n,r).then(function(e){return e(l,c)})},readList:function(e,t,n){return ye(u).readList(e,t,n).then(function(e){return e(l,c)})},readListCommunication:function(e,t,n,r){return ye(u).readListCommunication(e,t,n,r).then(function(e){return e(l,c)})},searchList:function(e,t,n,r,i,a,s){return ye(u).searchList(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchListCommunication:function(e,t,n,r,i,a,s,o){return ye(u).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateList:function(e,t,n){return ye(u).updateList(e,t,n).then(function(e){return e(l,c)})},updateListCommunication:function(e,t,n,r){return ye(u).updateListCommunication(e,t,n,r).then(function(e){return e(l,c)})}}},f.ListServiceApi=we,f.MediaFileServiceApiAxiosParamCreator=qe,f.MediaFileServiceApiFp=Ae,f.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return Ae(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return Ae(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return Ae(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},f.MediaFileServiceApi=Re,f.MemberServiceApiAxiosParamCreator=Ke,f.MemberServiceApiFp=Pe,f.MemberServiceApiFactory=function(p,f,g){return{attemptCallback:function(e,t,n){return Pe(p).attemptCallback(e,t,n).then(function(e){return e(g,f)})},attemptResult:function(e,t,n,r,i){return Pe(p).attemptResult(e,t,n,r,i).then(function(e){return e(g,f)})},attemptsRenewalResult:function(e,t,n){return Pe(p).attemptsRenewalResult(e,t,n).then(function(e){return e(g,f)})},createAttempt:function(e,t,n,r){return Pe(p).createAttempt(e,t,n,r).then(function(e){return e(g,f)})},createMember:function(e,t,n){return Pe(p).createMember(e,t,n).then(function(e){return e(g,f)})},createMemberBulk:function(e,t,n){return Pe(p).createMemberBulk(e,t,n).then(function(e){return e(g,f)})},deleteMember:function(e,t,n,r){return Pe(p).deleteMember(e,t,n,r).then(function(e){return e(g,f)})},deleteMembers:function(e,t,n){return Pe(p).deleteMembers(e,t,n).then(function(e){return e(g,f)})},patchMember:function(e,t,n,r){return Pe(p).patchMember(e,t,n,r).then(function(e){return e(g,f)})},readMember:function(e,t,n,r){return Pe(p).readMember(e,t,n,r).then(function(e){return e(g,f)})},resetMembers:function(e,t,n){return Pe(p).resetMembers(e,t,n).then(function(e){return e(g,f)})},searchAttempts:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return Pe(p).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},searchAttemptsHistory:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return Pe(p).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},searchMemberAttempts:function(e,t,n,r){return Pe(p).searchMemberAttempts(e,t,n,r).then(function(e){return e(g,f)})},searchMemberInQueue:function(e,t,n,r,i){return Pe(p).searchMemberInQueue(e,t,n,r,i).then(function(e){return e(g,f)})},searchMembers:function(e,t,n,r,i,a,s,o){return Pe(p).searchMembers(e,t,n,r,i,a,s,o).then(function(e){return e(g,f)})},updateMember:function(e,t,n,r){return Pe(p).updateMember(e,t,n,r).then(function(e){return e(g,f)})}}},f.MemberServiceApi=ke,f.OutboundResourceGroupServiceApiAxiosParamCreator=Ie,f.OutboundResourceGroupServiceApiFp=We,f.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return We(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return We(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return We(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return We(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return We(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return We(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return We(u).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceInGroup:function(e,t,n,r,i,a,s,o){return We(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return We(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return We(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceGroupServiceApi=xe,f.OutboundResourceServiceApiAxiosParamCreator=Qe,f.OutboundResourceServiceApiFp=Ue,f.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return Ue(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return Ue(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return Ue(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return Ue(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return Ue(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return Ue(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return Ue(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return Ue(u).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceDisplay:function(e,t,n,r,i,a,s,o){return Ue(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return Ue(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return Ue(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceServiceApi=Ge,f.QueueBucketServiceApiAxiosParamCreator=Me,f.QueueBucketServiceApiFp=He,f.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return He(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return He(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return He(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return He(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return He(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return He(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueBucketServiceApi=De,f.QueueHookServiceApiAxiosParamCreator=Fe,f.QueueHookServiceApiFp=Je,f.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return Je(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return Je(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return Je(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return Je(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return Je(l).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateQueueHook:function(e,t,n,r){return Je(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},f.QueueHookServiceApi=Ve,f.QueueResourcesServiceApiAxiosParamCreator=Ye,f.QueueResourcesServiceApiFp=Ze,f.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return Ze(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return Ze(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return Ze(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return Ze(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return Ze(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueResourcesServiceApi=tt,f.QueueServiceApiAxiosParamCreator=rt,f.QueueServiceApiFp=it,f.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return it(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return it(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return it(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return it(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return it(_).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(p,h)})},searchQueueReportGeneral:function(e,t,n,r,i,a,s,o,u,c,l,d){return it(_).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(p,h)})},updateQueue:function(e,t,n){return it(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},f.QueueServiceApi=st,f.QueueSkillServiceApiAxiosParamCreator=ut,f.QueueSkillServiceApiFp=ct,f.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return ct(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return ct(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return ct(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return ct(p).readQueueSkill(e,t,n).then(function(e){return e(g,f)})},searchQueueSkill:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return ct(p).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},updateQueueSkill:function(e,t,n,r){return ct(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},f.QueueSkillServiceApi=dt,f.RegionServiceApiAxiosParamCreator=ht,f.RegionServiceApiFp=pt,f.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return pt(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return pt(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return pt(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return pt(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return pt(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return pt(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},f.RegionServiceApi=gt,f.RoutingChatPlanServiceApiAxiosParamCreator=yt,f.RoutingChatPlanServiceApiFp=bt,f.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return bt(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return bt(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return bt(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return bt(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return bt(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return bt(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},f.RoutingChatPlanServiceApi=mt,f.RoutingOutboundCallServiceApiAxiosParamCreator=At,f.RoutingOutboundCallServiceApiFp=Ct,f.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return Ct(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return Ct(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return Ct(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return Ct(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return Ct(d).readRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},searchRoutingOutboundCall:function(e,t,n,r,i,a,s,o,u,c,l){return Ct(d).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},updateRoutingOutboundCall:function(e,t,n){return Ct(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},f.RoutingOutboundCallServiceApi=St,f.RoutingSchemaServiceApiAxiosParamCreator=Pt,f.RoutingSchemaServiceApiFp=Ot,f.RoutingSchemaServiceApiFactory=function(l,d,_){return{createRoutingSchema:function(e,t){return Ot(l).createRoutingSchema(e,t).then(function(e){return e(_,d)})},deleteRoutingSchema:function(e,t,n){return Ot(l).deleteRoutingSchema(e,t,n).then(function(e){return e(_,d)})},patchRoutingSchema:function(e,t,n){return Ot(l).patchRoutingSchema(e,t,n).then(function(e){return e(_,d)})},readRoutingSchema:function(e,t,n){return Ot(l).readRoutingSchema(e,t,n).then(function(e){return e(_,d)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c){return Ot(l).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRoutingSchema:function(e,t,n){return Ot(l).updateRoutingSchema(e,t,n).then(function(e){return e(_,d)})}}},f.RoutingSchemaServiceApi=Tt,f.RoutingVariableServiceApiAxiosParamCreator=Wt,f.RoutingVariableServiceApiFp=Xt,f.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Xt(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Xt(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Xt(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Xt(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Xt(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},f.RoutingVariableServiceApi=Et,f.SkillServiceApiAxiosParamCreator=Ut,f.SkillServiceApiFp=jt,f.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return jt(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return jt(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return jt(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return jt(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return jt(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},f.SkillServiceApi=Bt,f.UserHelperServiceApiAxiosParamCreator=Ht,f.UserHelperServiceApiFp=Lt,f.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return Lt(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},f.UserHelperServiceApi=Nt,f.Configuration=Jt,f.Client=jn,f.Call=fn,f.Agent=hn,f.Conversation=bn,f.DeviceNotFoundError=An,f.DeviceNotAllowPermissionError=Sn,f.SipClient=Mn,f.ExternalClient=Yn,f.SipPhone=nn,f.Log=zt,Object.defineProperty(f,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("tslib"),require("axios"),require("ee-ts"),require("jssip")):"function"==typeof define&&define.amd?define(["exports","tslib","axios","ee-ts","jssip"],e):e((t=t||self).WebitelSdk={},t.tslib,t.Axios,t.eeTs,t.JsSip)}(this,function(_,g,f,r,s){"use strict";var t,e;f=f&&f.hasOwnProperty("default")?f.default:f,(_.ProtobufNullValue||(_.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(_.StorageProviderType||(_.StorageProviderType={})).Microsoft="Microsoft",(t=_.StorageServiceType||(_.StorageServiceType={})).STT="STT",t.TTS="TTS",(e=_.StorageUploadStatusCode||(_.StorageUploadStatusCode={})).Unknown="Unknown",e.Ok="Ok",e.Failed="Failed";function n(t){void 0===t&&(t={}),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.baseOptions=t.baseOptions}var o=(i.prototype.debug=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.emitLogMessage("debug",t,e)},i.prototype.info=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.emitLogMessage("info",t,e)},i.prototype.warn=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.emitLogMessage("warn",t,e)},i.prototype.error=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.emitLogMessage("error",t,e)},i.prototype.emitLogMessage=function(t,e,n){0<n.length?console[t].apply(console,g.__spreadArrays([e],n)):console[t](e)},i);function i(){}var a=(Object.defineProperty(u.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),u.prototype.getLocalMedia=function(){if(this.session.connection){var t=this.session.connection.getLocalStreams();if(t.length)return t}return[]},u.prototype.getPeerMedia=function(){if(this.session.connection){var t=this.session.connection.getRemoteStreams();if(t.length)return t}return[]},u.prototype.answer=function(t){var e=this;return new Promise(function(){e.session.answer(t)})},u);function u(t){this.session=t.session,this.callId=t.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===t.session.direction,this.instanceId=t.request.getHeader("X-Webitel-Sock-Id")}var c,h,l,d=(c=r.EventEmitter,g.__extends(p,c),p.prototype.callOption=function(n){return void 0===n&&(n={}),g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.getUserCallStream(n)];case 1:return e=t.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:e}]}})})},p.prototype.answer=function(i,r){return g.__awaiter(this,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:return this.sessionCache.has(i)?(e=this.sessionCache.get(i),[4,this.callOption(r)]):[3,2];case 1:return n=t.sent(),[2,e.answer(n)];case 2:return[2,!1]}})})},p.prototype.call=function(r){return g.__awaiter(this,void 0,void 0,function(){var e,n,i;return g.__generator(this,function(t){switch(t.label){case 0:if(e={},n=null,r.params&&(e.audio=r.params.audio,e.video=r.params.video||!1,e.screen=r.params.screen||!1,e.disableStun=r.params.disableStun||!1),"string"!=typeof r.destination)throw new Error("bad destination type");return[4,this.callOption(e)];case 1:return i=t.sent(),r.params&&r.params.display&&(n={extraHeaders:["X-Webitel-Display: "+r.params.display]}),[4,this.ua.call(r.destination,g.__assign(g.__assign({},i),n))];case 2:return t.sent(),[2]}})})},p.prototype.register=function(o){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r=this;return g.__generator(this,function(t){return e=new s.WebSocketInterface(o.server),n={realm:o.realm,uri:o.uri,authorization_user:o.authorization_user,ha1:o.ha1,user_agent:p.userAgent,sockets:[e],session_timers:!0,display_name:o.display_name,register_expires:o.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(i=this.ua=new s.UA(n)).on("newRTCSession",function(t){var e=t.session,n=e.id,i=new a(t);r.storeSession(n,i),e.on("connecting",function(){r.emit("localStreams",i,e.connection.getLocalStreams())}),e.connection&&e.connection.addEventListener("addstream",function(t){r.emit("peerStreams",i,new Array(t.stream))}),e.on("peerconnection",function(t){t.peerconnection.addEventListener("addstream",function(e){return g.__awaiter(r,void 0,void 0,function(){return g.__generator(this,function(t){return this.emit("peerStreams",i,new Array(e.stream)),[2]})})})}),e.on("ended",function(){r.removeSession(n,e.connection)}),e.on("failed",function(){r.removeSession(n,e.connection)}),e.on("accepted",function(){i.incoming||r.emit("peerStreams",i,e.connection.getRemoteStreams())}),e.on("confirmed",function(){}),r.emit("newSession",i)}),i.on("disconnected",function(t){r.emit("unregistered")}),i.on("unregistered",function(t){r.emit("unregistered")}),i.on("registrationFailed",function(t){r.log.error("registrationFailed",t)}),i.on("registered",function(t){r.emit("registered")}),i.start(),[2]})})},p.prototype.unregister=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:t.sent(),delete this.ua,t.label=2;case 2:return[2]}})})},p.prototype.sipSessionByCallId=function(t){for(var e=0,n=this.allSession;e<n.length;e++){var i=n[e];if(i.callId===t)return i}return null},p.prototype.sipSessionBySipId=function(t){for(var e=0,n=this.allSession;e<n.length;e++){var i=n[e];if(i.id.startsWith(t))return i}return null},p.prototype.removeSession=function(t,e){var n,i;return e&&(n=e.getLocalStreams(),i=e.getRemoteStreams(),n&&n.forEach(function(t){t.getTracks().forEach(function(t){t.stop()})}),i&&i.forEach(function(t){t.getTracks().forEach(function(t){t.stop()})})),!!this.sessionCache.has(t)&&(this.sessionCache.delete(t),!0)},p.prototype.storeSession=function(t,e){if(this.sessionCache.has(t))throw new Error("Session already store");this.sessionCache.set(t,e)},Object.defineProperty(p.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),p.prototype.getMediaConstraints=function(t){return t.screen?{video:!1,audio:!1,screen:!0}:{video:t.video||!1,audio:!0}},p.prototype.getSession=function(t){return this.sessionCache.has(t)?this.sessionCache.get(t):null},p.prototype.hasSession=function(t){return this.sessionCache.has(t)},p.prototype.getUserScreen=function(){return g.__awaiter(this,void 0,void 0,function(){var e=this;return g.__generator(this,function(t){return[2,new Promise(function(i,r){return g.__awaiter(e,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return e=t.sent(),i(e),[3,3];case 2:return n=t.sent(),r(n),[3,3];case 3:return[2]}})})})]})})},p.prototype.getUserCallStream=function(i){return g.__awaiter(this,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:return!0!==i.screen?[3,2]:[4,this.getUserScreen()];case 1:e=t.sent(),t.label=2;case 2:return!1!==i.audio||i.video?[4,this.getUserMedia(i.audio,i.video)]:[3,4];case 3:n=t.sent(),e?n.getTracks().forEach(function(t){e.addTrack(t)}):e=n,t.label=4;case 4:if(!e)throw new Error("bad stream request");return[2,e]}})})},p.prototype.getUserMedia=function(r,o){return g.__awaiter(this,void 0,void 0,function(){var e=this;return g.__generator(this,function(t){return[2,new Promise(function(n,i){return g.__awaiter(e,void 0,void 0,function(){var e;return g.__generator(this,function(t){return e={audio:!(!1===r),video:void 0},o&&(e.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),[2,function(i){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,new Promise(function(e,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(i).then(function(t){return e(t)}).catch(function(t){return n(t)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(i,function(t){return e(t)},function(t){return n(t)})})]})})}(e).then(n).catch(i)]})})})]})})},p.userAgent="Webitel-Phone/0.0.1",p);function p(t,e){var n=c.call(this)||this;return n.instanceId=t,n.type="webrtc",n.sessionCache=new Map,e?s.debug.enable("*"):s.debug.disable(),n.log=new o,n.on("unregistered",function(){n.sessionCache.clear()}),n}(l=h=h||{}).Call="call",l.Chat="chat",l.Task="task";var v,m,b,y=(Object.defineProperty(w.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"allowAccept",{get:function(){return this.channel===h.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"allowClose",{get:function(){return this.channel===h.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),w.prototype.setAnswered=function(t){this.answeredAt=t,this.lastStatusChange=Date.now()},w.prototype.setBridged=function(t){this.bridgedAt=t.timestamp,this.lastStatusChange=Date.now(),t.form&&(this.form=t.form)},w.prototype.setProcessing=function(t){this.state="processing",this.startProcessingAt||(this.startProcessingAt=Date.now()),t.sec&&!t.timeout&&(t.timeout=Date.now()+1e3*t.sec),this._processing=t},w.prototype.setTransferred=function(t){this.distribute=t,this.history.push(t)},Object.defineProperty(w.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),w.prototype.accept=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},w.prototype.close=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},w.prototype.decline=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},w.prototype.reporting=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.client.request("cc_reporting",g.__assign({attempt_id:this.id},n))];case 1:return e=t.sent(),this.reportedAt=Date.now(),[2,e]}})})},w.prototype.renew=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:e||this.processingSec})]})})},w.prototype.formAction=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.form)throw new Error("not found active form");return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:e,fields:n})]})})},w);function w(t,e,n){this.client=t,this.distribute=n,this.id=e.attempt_id,this.state=e.status,this.lastStatusChange=e.timestamp,this.createdAt=e.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=n.communication,this.history=[n]}(v=_.AgentStatus||(_.AgentStatus={})).Online="online",v.Offline="offline",v.Pause="pause",v.BreakOut="break_out",(m=_.ChannelState||(_.ChannelState={})).Waiting="waiting",m.Distribute="distribute",m.Offering="offering",m.Answered="answered",m.Active="active",m.Bridged="bridged",m.Hold="hold",m.Missed="missed",m.WrapTime="wrap_time",m.Processing="processing",m.Transfer="transfer",m.Form="form",(b=_.ChannelType||(_.ChannelType={})).Call="call",b.Email="email",b.Chat="chat";var S,k,A,C=(Object.defineProperty(I.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),I.prototype.onChannelEvent=function(t){switch(t.status){case _.ChannelState.Distribute:var e=t;if(!e)throw new Error("bad event");if(r=new y(this.client,t,e.distribute),this.task.set(r.id,r),r.agentChannelId)switch(r.channel){case _.ChannelType.Call:var n=this.client.callById(r.agentChannelId);n&&!n.task&&(n.task=r);break;case _.ChannelType.Chat:var i=this.client.conversationById(r.agentChannelId);i&&!i.task&&(i.task=r)}break;case _.ChannelState.Offering:(r=this.task.get(t.attempt_id))&&(r.offeringAt=t.timestamp);break;case _.ChannelState.Bridged:var r,o=t;(r=this.task.get(o.attempt_id))&&r.setBridged(o);break;case _.ChannelState.Transfer:var s=t;(r=this.task.get(s.to_attempt_id))&&(this.task.delete(r.id),r.id=s.attempt_id,r.setTransferred(s.distribute),this.task.set(r.id,r));break;case _.ChannelState.Answered:(r=this.task.get(t.attempt_id))&&(r.answeredAt=t.timestamp);break;case _.ChannelState.Form:var a=t;return void((r=this.task.get(t.attempt_id))&&(r.form=a.form||null));case _.ChannelState.Missed:if(t.attempt_id&&(r=this.task.get(t.attempt_id))){r.stopAt=t.timestamp;var u=t;if(!u)throw new Error("bad event");return this.setChannelStateTimeout(t.channel,t,u.missed.timeout),this.task.delete(t.attempt_id),this.client.reportingChannelTask(r),r}break;case _.ChannelState.WrapTime:if(t.attempt_id){if(!t)throw new Error("bad event");r=this.task.get(t.attempt_id),this.task.delete(t.attempt_id),this.client.reportingChannelTask(r)}break;case _.ChannelState.Processing:if(t.attempt_id){var c=t;if(!c)throw new Error("bad event");if(r=this.task.get(t.attempt_id))return r.state=t.status,r.closedAt=t.timestamp,r.setProcessing(c.processing),this.setChannelStateTimeout(t.channel,t,c.processing.timeout||0),r}break;case _.ChannelState.Waiting:t.attempt_id&&(r=this.task.get(t.attempt_id))&&(r.stopAt=t.timestamp,this.task.delete(t.attempt_id),this.client.reportingChannelTask(r))}return this.setChannelState(t.channel,t),r?(r.state=t.status,r):void 0},I.prototype.online=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.agentSetOnline(this.agentId,e,n)]})})},I.prototype.waiting=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.agentSetWaiting(this.agentId,e)]})})},I.prototype.pause=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.agentSetPause(this.agentId,e)]})})},I.prototype.offline=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.agentSetOffline(this.agentId)]})})},I.prototype.setStatus=function(t){t.status===_.AgentStatus.Online&&(this.info.on_demand=t.on_demand||!1,this._channel=t.channels[0]),this.info.status=t.status,this.info.status_payload=t.status_payload?t.status_payload:null,this.lastStatusChange=Date.now()},I.prototype.directMember=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:e,communication_id:n})]})})},I.prototype.offlineMembers=function(e,n,i){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:e,per_page:i})]})})},I.prototype.hasTask=function(t){return this.task.has(t.id)},I.prototype.setChannelState=function(t,e){this._channel.channel=t||null,this._channel.state=e.status,this._channel.joined_at=e.timestamp,this._channel.timeout=void 0},I.prototype.setChannelStateTimeout=function(t,e,n){this._channel.channel=t||null,this._channel.state=e.status,this._channel.timeout=n,this._channel.joined_at=e.timestamp},I);function I(t,e){this.client=t,this.info=e,this.task=new Map,this._channel=e.channels[0],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(S=_.CallReportingStatus||(_.CallReportingStatus={})).Abandoned="abandoned",S.Cancel="cancel",S.Success="success",(k=_.CallActions||(_.CallActions={})).Ringing="ringing",k.Active="active",k.Bridge="bridge",k.Hold="hold",k.DTMF="dtmf",k.Voice="voice",k.Silence="silence",k.Execute="execute",k.Update="update",k.Hangup="hangup",k.Reporting="reporting",k.PeerStream="peerStream",k.LocalStream="localStream",k.Destroy="destroy",(A=_.CallDirection||(_.CallDirection={})).Inbound="inbound",A.Outbound="outbound";var P=(O.prototype.setState=function(t){this.state=t.event},O.prototype.setSip=function(t){t&&!this.sip&&(this.sip=t,this.localStreams=t.getLocalMedia(),this.peerStreams=t.getPeerMedia())},Object.defineProperty(O.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===_.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),O.prototype.getMember=function(t){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.isMember)throw new Error("call is not from outbound queue");return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})]})})},Object.defineProperty(O.prototype,"isMember",{get:function(){return!(!this.task||!this.task.memberId)},enumerable:!0,configurable:!0}),O.prototype.setActive=function(t){this.answeredAt||(this.direction===_.CallDirection.Inbound&&(this.bridgedAt=+t.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+t.timestamp),this.setState(t)},O.prototype.setBridged=function(t){var e=t.data;this.bridgedAt||(this.bridgedAt=+t.timestamp),this.bridgedId=e.bridged_id,e.to&&(this.direction===_.CallDirection.Inbound?this.from=e.to:this.to=e.to),this.bridgedId=e.bridged_id,e.payload&&(this.variables=e.payload),e.queue&&(this.queue=e.queue)},O.prototype.setHold=function(t){this.setState(t)},O.prototype.setInfo=function(t){this.parentId=t.parent_id,this.destination=t.destination,this.direction=t.direction,this.from=t.from,this.to=t.to,this.variables=t.payload,this.queue=t.queue||null,this.sipId=t.sip_id||null,this.params=t.params},O.prototype.setPeerStreams=function(t){this.peerStreams=t||[]},O.prototype.setLocalStreams=function(t){this.localStreams=t||[]},O.prototype.setVoice=function(){this.voice=!0},O.prototype.setSilence=function(){this.voice=!1},O.prototype.setExecute=function(t){this.applications.push(t.application)},O.prototype.addDigit=function(t){this.digits.push(t.digit)},O.prototype.setHangup=function(t){var e=t.data;this.hangupAt=+t.timestamp,this.hangupCause=e.cause,this.hangupSipCode=e.sip,this.voice=!1,this.peerStreams=[],+e.reporting_at&&(this.reportingAt=+e.reporting_at),this.setState(t)},Object.defineProperty(O.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"isHold",{get:function(){return this.state===_.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),O.prototype.answer=function(i){return g.__awaiter(this,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:if(!this.sip||!this.client.phone)return[3,6];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.client.phone.callOption(i)];case 2:return e=t.sent(),[4,this.sip.answer(e)];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),this.client.handleError(n),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},O.prototype.answerDelay=function(e,t){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return g.__awaiter(n,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.answer(e)];case 1:return t.sent(),[2]}})})},t))},O.prototype.hangup=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){return e=n,0!==this.answeredAt||n||(e=this.direction===_.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:e})]})})},O.prototype.eavesdrop=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return e.id=this.id,[2,this.client.request("call_eavesdrop",e)]})})},O.prototype.toggleHold=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return this.state===_.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},O.prototype.hold=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(this.state===_.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},O.prototype.unHold=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(this.state!==_.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},O.prototype.sendDTMF=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:e})]})})},O.prototype.blindTransfer=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:e})]})})},O.prototype.mute=function(n){return void 0===n&&(n=!1),g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return e=t.sent(),this._muted=n,[2,e]}})})},O.prototype.bridgeTo=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:e.id,to_app_id:e.appId})]})})},O.prototype.reporting=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.task)throw new Error("this call not in queue");return[2,this.task.reporting(e)]})})},O.prototype.renew=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(e)]})})},O.prototype.callToUser=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return e.nodeId=this.appId,e.parentCallId=this.id||null,e.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(e)]})})},O);function O(t,e){this.client=t;var n=e.data;this._muted=!1,this.voice=!0,this.createdAt=+e.timestamp,this.task=null,this.data=null,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],t.phone&&(n.sip_id?this.setSip(t.phone.sipSessionBySipId(n.sip_id)):this.setSip(t.phone.sipSessionByCallId(e.id))),this.params={},this.id=e.id,this.digits=[],this.applications=[],this.appId=e.app_id,this.setState(e),this.setInfo(n),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}var q,E;(q=_.ChatActions||(_.ChatActions={})).Message="message",q.UserInvite="user_invite",q.Invite="invite_conversation",q.Joined="join_conversation",q.Close="close_conversation",q.Leave="leave_conversation",q.Decline="decline_invite",q.Update="update_channel",q.Destroy="destroy",(E=_.ConversationState||(_.ConversationState={})).Init="init",E.Invite="invite",E.Active="active",E.Pending="pending",E.Closed="closed";var T=(j.prototype.setInvite=function(t,e){var n=this;this.inviteId=t,this.invitedAt=e,this._autoAnswer&&this.join().catch(function(t){n.client.emit("error",t)})},j.prototype.setAnswered=function(t,e,n){this.state=_.ConversationState.Active,this.answeredAt=e,this.channelId=t,this.member=x(n),this.inviteId=null},j.prototype.setClosed=function(t){this.state=_.ConversationState.Closed,this.closedAt=t},Object.defineProperty(j.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),j.prototype.getMessages=function(){var n=this;return this._messages.map(function(t){var e={id:t.id,type:t.type,member:n.messageMember(t),channelId:t.channel_id,createdAt:t.created_at,updatedAt:t.updated_at,contact:null};return t.hasOwnProperty("file")&&(t.file.url=n.client.fileUrlDownload(t.file.id),t.file.streamUrl=n.client.fileUrlStream(t.file.id),e.file=t.file),t.hasOwnProperty("text")&&(e.text=t.text),t.hasOwnProperty("contact")&&(e.contact=t.contact),e})},j.prototype.next=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){throw new Error("TODO")})})},j.prototype.pagination=function(t,e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){throw new Error("TODO")})})},j.prototype.newMessage=function(t){this._messages.push(t)},Object.defineProperty(j.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"allowLeave",{get:function(){return!!this.channelId&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"membersId",{get:function(){for(var t=[this.id],e=0,n=this.members;e<n.length;e++){var i=n[e];t.push(i.id)}return t},enumerable:!0,configurable:!0}),j.prototype.decline=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("decline_chat",{invite_id:this.inviteId})]})})},j.prototype.join=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("join_chat",{invite_id:this.inviteId})]})})},j.prototype.close=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})]})})},j.prototype.leave=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})]})})},j.prototype.sendText=function(i){return g.__awaiter(this,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:if(!this.channelId)throw new Error("conversation not active");if(!i.length)throw new Error("empty message");e=function(t,e){for(var n=Math.ceil(t.length/e),i=new Array(n),r=0,o=0;o<n;o++)i[o]=t.substr(r,e),r+=e;return i}(i,4096),n=0,t.label=1;case 1:return n<e.length?n+1>=e.length?[2,this.sendMessageTextChunk(e[n])]:[4,this.sendMessageTextChunk(e[n])]:[3,4];case 2:t.sent(),t.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},j.prototype.sendFile=function(i,r){return g.__awaiter(this,void 0,void 0,function(){var e,n;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.client.storeFile(this.conversationId,[i],r)];case 1:return e=t.sent(),n=e[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:n.id,name:i.name,mime:n.mime,url:n.shared,size:n.size})]}})})},j.prototype.send=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if("string"==typeof e)return[2,this.sendText(e)];if(e instanceof File)return[2,this.sendFile(e,n)];throw new Error("unknown send data")})})},j.prototype.addToChat=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:e,title:n})]})})},j.prototype.startChat=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("start_chat",{user_id:e})]})})},j.prototype.updateChannel=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},j.prototype.reporting=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.reporting(e)]})})},j.prototype.renew=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(e)]})})},j.prototype.transferToPlan=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:e})]})})},j.prototype.transferToUser=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:e})]})})},j.prototype.sendMessageTextChunk=function(t){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:t})},j.prototype.messageMember=function(t){if(this.member&&t.channel_id===this.channelId)return{self:!0};for(var e=0,n=this.members;e<n.length;e++){var i=n[e];if(i.id===t.channel_id)return i}return null},j);function j(t,e,n,i,r,o){for(var s in this.client=t,this.conversationId=e,this.title=n,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.members=(i||[]).map(x),this._messages=r||[],this.state=_.ConversationState.Invite,this.variables={},this._hasReporting=!(!o||"true"!==o.cc_reporting),this._autoAnswer=!1,o)!s.startsWith("cc_")&&o.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswer="true"===o.wbt_auto_answer:this.variables[s]=o[s]);o&&o.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+o.cc_attempt_id)||null)}function x(t){return t.messenger=t.type,t}var D,M=(D=Error,g.__extends(U,D),U.id="device_not_found",U);function U(t){var e=D.call(this,t)||this;return e.id=U.id,e}var H,B=(H=Error,g.__extends(L,H),L.id="device_not_allow",L);function L(t){var e=H.call(this,t)||this;return e.id=L.id,e}var R,$=(R=r.EventEmitter,g.__extends(N,R),N.prototype.connect=function(t){var e=this;this.socket=new WebSocket(this.host.replace(/^http/,"ws")+"/websocket"),this.socket.onclose=function(t){return e.onClose(t.code)},this.socket.onmessage=function(t){return e.onMessage(t.data)},this.socket.onopen=function(){return e.onOpen()}},N.prototype.send=function(t){return this.socket.send(JSON.stringify(t)),null},N.prototype.close=function(t){this.socket.close(t||1e3),delete this.socket},N.prototype.onOpen=function(){this.emit("open")},N.prototype.onClose=function(t){this.emit("close",t),this.off("*")},N.prototype.onMessage=function(t){var e;"\0\0\0\0"!==t&&(e=JSON.parse(t),this.emit("message",e))},N);function N(t){var e=R.call(this)||this;return e.host=t,e}var F,W,V,J="call",z="chat",G="user_state",K="agent_status",X="task";(W=F=F||{}).NotFoundError="NotFoundError",W.NotAllowedError="NotAllowedError",(V=_.Response||(_.Response={})).STATUS_FAIL="FAIL",V.STATUS_OK="OK";var Y,Q=(Y=r.EventEmitter,g.__extends(Z,Y),Z.prototype.connect=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.connectToSocket()];case 1:return t.sent(),[2]}})})},Z.prototype.disconnect=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return this.socket.close(),[2]})})},Z.prototype.subscribeCall=function(a,u){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r,o,s;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("subscribe_call",u)];case 1:if(e=t.sent(),this.eventHandler.on(J,a),e.items&&e.items.length)for(n=0,i=e.items;n<i.length;n++)(r=i[n]).hangup_at&&0<r.hangup_at&&!r.task||(o={cc_app_id:"",app_id:r.app_id,event:r.state,id:r.id,timestamp:Date.now(),data:{app_id:r.app_id,event:r.state,id:r.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:r.parent_id,direction:r.direction,destination:r.destination,queue:r.queue,from:r.from,to:r.to,payload:r.variables}},(s=new P(this,o)).createdAt=r.created_at,s.answeredAt=r.answered_at||0,s.bridgedAt=r.bridged_at||0,s.hangupAt=r.hangup_at||0,r.task&&(s.task=new y(this,{attempt_id:r.task.attempt_id,channel:r.task.channel,status:r.task.status,timestamp:Date.now()},r.task),s.queue.reporting="true",s.task.form=r.task.form||null,r.leaving_at&&r.task.processing_sec&&(s.task.startProcessingAt=r.leaving_at,s.task.setProcessing({sec:r.task.processing_sec||0,timeout:r.task.processing_timeout_at||null,renewal_sec:r.task.processing_renewal_sec||0}))),this.callStore.set(s.id,s));return[2,e]}})})},Z.prototype.subscribeChat=function(a,u){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r,o,s;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("subscribe_chat",u)];case 1:if(e=t.sent(),this.eventHandler.on(z,a),e&&e.items)for(n=0,i=e.items;n<i.length;n++){if(r=i[n],o=r.messages.reverse(),(s=new T(this,r.id,r.title,r.members,o,r.variables)).createdAt=r.created_at,s.closedAt=r.closed_at,r.task&&(s.task=new y(this,{attempt_id:r.task.attempt_id,channel:r.task.channel,status:r.task.status,timestamp:Date.now()},r.task),r.leaving_at&&r.task.processing_sec&&(s.task.startProcessingAt=r.leaving_at,s.task.setProcessing({sec:r.task.processing_sec||0,timeout:r.task.processing_timeout_at||null,renewal_sec:r.task.processing_renewal_sec||0})),s.task.form=r.task.form||null),r.invite_id)s.setInvite(r.invite_id,r.created_at);else{if(!r.channel_id){this.log.error("conversation "+r.id+" not valid");continue}s.setAnswered(r.channel_id,r.joined_at,{id:r.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(s.id,s)}return[2,e]}})})},Z.prototype.subscribeUsersStatus=function(n,i){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("subscribe_users_status",i)];case 1:return e=t.sent(),this.eventHandler.on(G,n),[2,e]}})})},Z.prototype.subscribeAgentsStatus=function(n,i){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("cc_agent_subscribe_status",i)];case 1:return e=t.sent(),this.eventHandler.on(K,n),[2,e]}})})},Z.prototype.subscribeTask=function(t){this.eventHandler.on(X,t)},Z.prototype.unSubscribe=function(e,t,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("un_subscribe_"+e,n)];case 1:return[2,t.sent()]}})})},Z.prototype.destroy=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.disconnect()];case 1:return t.sent(),this.phone?[4,this.phone.unregister()]:[3,3];case 2:t.sent(),this.phone.off("*"),delete this.phone,t.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},Z.prototype.allCall=function(){return Array.from(this.callStore.values())},Z.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},Z.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},Z.prototype.callById=function(t){if(this.callStore.has(t))return this.callStore.get(t)},Z.prototype.conversationById=function(t){if(this.conversationStore.has(t))return this.conversationStore.get(t)},Z.prototype.callBySipId=function(t){for(var e=0,n=this.allCall();e<n.length;e++){var i=n[e];if(i.sipId&&t.startsWith(i.sipId))return i}},Z.prototype.reportingTask=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_reporting",g.__assign({attempt_id:e},n))]})})},Z.prototype.agentActiveTasks=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_agent_tasks",{agent_id:e})]})})},Z.prototype.auth=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},Z.prototype.ping=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("ping",{ping:1})]})})},Z.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(Z.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(Z.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),Z.prototype.agentSession=function(){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r,o,s,a,u,c;return g.__generator(this,function(t){switch(t.label){case 0:return[4,this.request("cc_agent_session")];case 1:return e=t.sent(),this.agent=new C(this,e),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(n=t.sent(),i=0,r=n.items;i<r.length;i++)o=r[i],(s=new y(this,{status:o.status,timestamp:Date.now()-1e3*o.duration,channel:o.channel,attempt_id:o.attempt_id},o)).postProcessData={},s.state=o.state,o.bridged_at&&(s.bridgedAt=o.bridged_at,s.answeredAt=o.bridged_at),o.leaving_at&&(s.closedAt=o.leaving_at),this.agent.task.set(s.id,s);for(a=0,u=this.allCall();a<u.length;a++)(c=u[a]).task&&this.agent.task.set(c.task.id,c.task);return[2,this.agent]}})})},Z.prototype.invite=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("call_invite",e)]})})},Z.prototype.call=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:if(!this.phone)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.handleError(e),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:t.sent(),t.label=7;case 7:return[2]}})})},Z.prototype.callRecordId=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("call_recordings",{id:e})]})})},Z.prototype.eavesdrop=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("call_eavesdrop",e)]})})},Z.prototype.agentSetOnline=function(e,n,i){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_agent_online",{agent_id:e,channels:n,on_demand:i})]})})},Z.prototype.agentSetWaiting=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_agent_waiting",{agent_id:e,channel:n})]})})},Z.prototype.agentSetPause=function(e,n){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_agent_pause",{agent_id:e,payload:n})]})})},Z.prototype.agentSetOffline=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("cc_agent_offline",{agent_id:e})]})})},Z.prototype.inviteToUser=function(t){return this.request("call_user",t)},Z.prototype.answer=function(n,i){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){return(e=this.callById(n))?[2,e.answer(i)]:[2]})})},Z.prototype.request=function(n,i){var r=this;return new Promise(function(t,e){r.queueRequest.set(++r.reqSeq,{resolve:t,reject:e}),r.socket.send({seq:r.reqSeq,action:n,data:i})})},Z.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},Z.prototype.callDestroyed=function(t){return 0<t.hangupAt&&!this.hasAgentTask(t.task)},Z.prototype.conversationDestroyed=function(t){return 0<t.closedAt&&!this.hasAgentTask(t.task)},Z.prototype.reportingChannelTask=function(t){switch(t.channel){case h.Call:for(var e=0,n=this.allCall();e<n.length;e++){var i=n[e];if(this.callDestroyed(i))return void this.destroyCall(i)}break;case h.Chat:if(t.agentChannelId){var r=this.conversationById(t.agentChannelId);if(r&&this.conversationDestroyed(r))return void this.destroyConversation(r)}}},Z.prototype.registerCallClient=function(r){return g.__awaiter(this,void 0,void 0,function(){var e,n,i=this;return g.__generator(this,function(t){switch(t.label){case 0:this.phone=r,this.phone.on("peerStreams",function(t,e){var n=i.callBySession(t);n&&!n.peerStreams.length&&(n.setPeerStreams(e),i.eventHandler.emit(J,_.CallActions.PeerStream,n))}),this.phone.on("localStreams",function(t,e){var n=i.callBySession(t);n&&!n.localStreams.length&&(n.setLocalStreams(e),i.eventHandler.emit(J,_.CallActions.LocalStream,n))}),this.phone.on("newSession",this.onNewCallSession.bind(this)),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return e=t.sent(),[4,this.phone.register(e)];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),this.log.error(n),[3,5];case 5:return[2]}})})},Z.prototype.deviceConfig=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,this.request("user_default_device",{name:e})]})})},Z.prototype.storeFile=function(l,d,p){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r,o,s,a,u,c,h;return g.__generator(this,function(t){switch(t.label){case 0:if(!d||d.length<1)throw new Error("no files");for(e=new FormData,n=0,i=d;n<i.length;n++)r=i[n],e.append(r.name,r);return[4,f.post(this.basePath+"/api/storage/file/"+l+"/upload",e,{headers:((h={})["X-Webitel-Access"]=this._config.token,h),onUploadProgress:p})];case 1:for(o=t.sent(),s=o.data,a=0,u=s;a<u.length;a++)(c=u[a]).shared=this.basePath+c.shared;return[2,s]}})})},Z.prototype.fileUrlDownload=function(t){return this.basePath+"/api/storage/file/"+t+"/download?access_token="+this._config.token},Z.prototype.fileUrlStream=function(t){return this.basePath+"/api/storage/file/"+t+"/stream?access_token="+this._config.token},Z.prototype.handleError=function(t){if(t)switch(t.name){case F.NotFoundError:this.emit("error",new M(t.message));break;case F.NotAllowedError:this.emit("error",new B(t.message));break;default:this.emit("error",t)}},Z.prototype.onMessage=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(t.label){case 0:return this.log.debug("receive message: ",n),0<n.seq_reply?(this.queueRequest.has(n.seq_reply)&&(e=this.queueRequest.get(n.seq_reply),this.queueRequest.delete(n.seq_reply),n.status===_.Response.STATUS_OK?e.resolve(n.data):e.reject(n.error)),[3,13]):[3,1];case 1:switch(n.event){case"hello":return[3,2];case J:return[3,4];case z:return[3,6];case G:return[3,8];case"sip":return[3,9];case K:return[3,10];case"channel":return[3,11]}return[3,12];case 2:return[4,this.connected(n.data)];case 3:return t.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,13];case 4:return[4,this.handleCallEvents(n.data.call)];case 5:return t.sent(),[3,13];case 6:return[4,this.handleChatEvents(n.data)];case 7:return t.sent(),[3,13];case 8:return this.handleUserStateEvent(n.data.state),[3,13];case 9:return this.eventHandler.emit("sip",n.data),[3,13];case 10:return this.handleAgentStatus(n.data),[3,13];case 11:return this.handleChannelEvents(n.data),[3,13];case 12:this.log.error("event "+n.event+" not handler"),t.label=13;case 13:return[2]}})})},Z.prototype.handleAgentStatus=function(t){this.agent&&t.agent_id===this.agent.agentId&&this.agent.setStatus(t),this.eventHandler.emit(K,t,this.agent)},Z.prototype.handleChannelEvents=function(t){var e;this.agent&&(t.timestamp=Date.now(),e=this.agent.onChannelEvent(t)||void 0,this.eventHandler.emit(X,t.status,e))},Z.prototype.pingServer=function(){return g.__awaiter(this,void 0,void 0,function(){var e,n=this;return g.__generator(this,function(t){switch(t.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(e=setTimeout(function(){return g.__awaiter(n,void 0,void 0,function(){return g.__generator(this,function(t){return this.socket.close(3005),[2]})})},this.connectionInfo.ping_interval/2),[4,this.ping()]):[3,2];case 1:t.sent(),clearTimeout(e),t.label=2;case 2:return this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval)),[2]}})})},Z.prototype.connected=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){switch(t.label){case 0:return(this.connectionInfo=e).ping_interval?[4,this.pingServer()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.useWebPhone()?[2,this.registerCallClient(new d(this.instanceId,this._config.debug))]:[2]}})})},Z.prototype.callBySession=function(t){for(var e=0,n=this.allCall();e<n.length;e++){var i=n[e];if(i.sip===t)return i}},Z.prototype.onNewCallSession=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){return(e=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(e.setSip(n),this.checkAutoAnswer(e)),[2]})})},Z.prototype.checkAutoAnswer=function(t){t.autoAnswer&&t.answerDelay({video:t.params.video,screen:t.params.screen,disableStun:t.params.disableStun},300)},Z.prototype.connectToSocket=function(){var n=this;return new Promise(function(t,e){try{n.socket=new $(n._config.endpoint),n.socket.connect(n._config.token)}catch(t){return void e(t)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(t){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",t),n.eventHandler.off("*"),1e3!==t&&(n.emit("disconnected",t),e(new Error("close socket code: "+t)))}),n.socket.on("open",function(){t(null),n.emit("connected")})})},Z.prototype.handleUserStateEvent=function(t){this.eventHandler.emit(G,t)},Z.prototype.handleCallEvents=function(n){return g.__awaiter(this,void 0,void 0,function(){var e;return g.__generator(this,function(t){switch(n.timestamp=Date.now(),n.event){case _.CallActions.Ringing:e=new P(this,n),this.callStore.set(e.id,e),this.checkAutoAnswer(e);break;case _.CallActions.Active:(e=this.callById(n.id))&&e.setActive(n);break;case _.CallActions.Bridge:(e=this.callById(n.id))&&e.setBridged(n);break;case _.CallActions.Execute:(e=this.callById(n.id))&&e.setExecute(n.data);break;case _.CallActions.DTMF:(e=this.callById(n.id))&&e.addDigit(n.data);break;case _.CallActions.Voice:(e=this.callById(n.id))&&e.setVoice();break;case _.CallActions.Silence:(e=this.callById(n.id))&&e.setSilence();break;case _.CallActions.Hold:(e=this.callById(n.id))&&e.setHold(n);break;case _.CallActions.Hangup:(e=this.callById(n.id))&&e.setHangup(n);break;default:throw new Error("Unhandled action")}return e&&(this.eventHandler.emit(J,n.event,e),this.callDestroyed(e)&&this.destroyCall(e)),[2]})})},Z.prototype.handleChatEvents=function(f){return g.__awaiter(this,void 0,void 0,function(){var e,n,i,r,o,s,a,u,c,h,l,d,p;return g.__generator(this,function(t){switch(n=Date.now(),f.action){case _.ChatActions.UserInvite:i=f.data,(e=new T(this,i.conversation_id,i.title,i.members,i.messages,i.variables)).setInvite(i.invite_id,n),this.conversationStore.set(e.id,e);break;case _.ChatActions.Joined:r=f.data,(e=this.conversationById(r.member.id))&&e.setAnswered(r.member.id,n,r.member);break;case _.ChatActions.Message:for((o=f.data).timestamp=n,s=0,a=this.allConversations();s<a.length;s++)!(l=a[s]).closedAt&&-1<l.membersId.indexOf(o.channel_id)&&(e=l);e&&e.newMessage(o);break;case _.ChatActions.Close:for(u=f.data,c=0,h=this.allConversations();c<h.length;c++)!(l=h[c]).closedAt&&-1<l.membersId.indexOf(u.from_channel_id)&&(e=l);e&&e.setClosed(n);break;case _.ChatActions.Leave:d=f.data,(e=this.conversationById(d.leaved_channel_id))&&e.setClosed(n);break;case _.ChatActions.Decline:p=f.data,(e=this.conversationById(p.invite_id))&&e.setClosed(n)}return e&&(this.eventHandler.emit(z,f.action,e),this.conversationDestroyed(e)&&this.destroyConversation(e)),[2]})})},Z.prototype.hasAgentTask=function(t){return!(!this.agent||!t)&&this.agent.hasTask(t)},Z.prototype.destroyCall=function(t){this.callStore.delete(t.id),this.eventHandler.emit(J,_.CallActions.Destroy,t)},Z.prototype.destroyConversation=function(t){this.conversationStore.delete(t.id),this.eventHandler.emit(z,_.ChatActions.Destroy,t)},Z);function Z(t){var e,n,i=Y.call(this)||this;return i._config=t,i.reqSeq=0,i.queueRequest=new Map,i.log=new o,i.eventHandler=new r.EventEmitter,i.callStore=new Map,i.conversationStore=new Map,i.pingTimer=null,i.basePath=""+(e=t.storageEndpoint||t.endpoint,(n=e.replace(/^ws/,"http")).endsWith("/")&&(n=n.slice(0,-1)),n.endsWith("/ws")&&(n=n.slice(0,-3)),n),i}var tt,et=(tt=r.EventEmitter,g.__extends(nt,tt),nt);function nt(){return null!==tt&&tt.apply(this,arguments)||this}var it="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var rt,ot,st=(function(c){var t=it&&it.__generator||function(n,i){var r,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(n,a)}catch(t){e=[6,t],o=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}};Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener");var e=(n.count=function(t,e){var n=0,i=t[c.$listeners][e];if(i)for(var r=i.first;++n&&r.next;)r=r.next;return n},n.has=function(t,e){if("*"!=e)return void 0!==t[c.$listeners][e];for(e in t[c.$listeners])return!0;return!1},n.keys=function(t){return Object.keys(t[c.$listeners])},n.unhandle=function(n,i,r,t){return n.on(i,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!n[c.$listeners][i].first.next)return r.apply(void 0,t)},t)},n.prototype.on=function(t,e,n){return"function"==typeof e?this[c.$addListener](t,e,n):this[c.$addListener](t,void 0,e)},n.prototype.one=function(t,e,n){return"function"==typeof e?this[c.$addListener](t,e,n,!0):this[c.$addListener](t,void 0,e,!0)},n.prototype.off=function(t,e){if("*"==t){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var i in n)this._onEventUnhandled(i);return this}if("function"==typeof e){var r=this[c.$listeners][t];if(r&&function(t,e){for(var n=null,i=t.first;;)if(e(i))if(n){if(n.next=i.next,!i.next)break;i=i.next}else{if(!i.next)return;t.first=i=i.next}else{if(!(n=i).next)break;i=i.next}return t.last=n,t}(r,function(t){return t.fn==e}))return this}return delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),this},n.prototype.emit=function(t){for(var e,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];for(var r=this.listeners(t);;){var o=r.next(),s=o.value;if(o.done)return e;var a=s.apply(void 0,n);void 0!==a&&(e=a)}},n.prototype.listeners=function(e){var n,i,r;return t(this,function(t){switch(t.label){case 0:if(!(n=this[c.$listeners][e]))return[2];i=null,r=n.first,t.label=1;case 1:return[4,r.fn];case 2:if(t.sent(),r.once){if(!i)return r.next?(n.first=r=r.next,[3,1]):(delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),[2]);i.next=r.next}else i=r;return r.next?(r=r.next,[3,1]):(n.last=r,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,t,i,r){var e,o,s=this;if(void 0===r&&(r=!1),"object"!=typeof n)return"function"==typeof t&&(e=n,o=h(this[c.$listeners],e,{fn:t,once:r,next:null}),i&&i.push({dispose:function(){return s.off(e,t)}}),t==o.first.fn&&this._onEventHandled&&this._onEventHandled(n)),t;var a,u=this;for(a in n)!function(){var t,e;"function"==typeof n[a]&&(t=n[a],e=h(u[c.$listeners],a,{fn:t,once:r,next:null}),i&&i.push({dispose:function(){return s.off(a,t)}}),t==e.first.fn&&u._onEventHandled&&u._onEventHandled(a))}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function h(t,e,n){var i=t[e];return i?(i.last.next=n,i.last=n):t[e]=i={first:n,last:n},i}c.EventEmitter=e}((rt={exports:{}},rt.exports)),rt.exports);(ot=st)&&ot.__esModule&&Object.prototype.hasOwnProperty.call(ot,"default")&&ot.default;st.$listeners,st.$addListener;var at=st.EventEmitter,ut=(Object.defineProperty(ct.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),ct.prototype.getLocalMedia=function(){return[]},ct.prototype.getPeerMedia=function(){return[]},ct.prototype.answer=function(t){var e=this;return new Promise(function(t){e.client.answer(e.id),t()})},ct);function ct(t,e){this.client=t,this.callId=e,this.incoming=!1,this.instanceId="fixme"}var ht,lt=(ht=at,g.__extends(dt,ht),dt.prototype.callOption=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2,e]})})},dt.prototype.register=function(t){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2]})})},dt.prototype.unregister=function(){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return[2]})})},dt.prototype.call=function(e){return g.__awaiter(this,void 0,void 0,function(){return g.__generator(this,function(t){return e.destination&&this.exec(e.destination),[2]})})},dt.prototype.answer=function(t){this.exec(t,"answer")},dt.prototype.sipSessionByCallId=function(t){return new ut(this,t)},dt.prototype.sipSessionBySipId=function(t){return null},dt.prototype.open=function(t){this.exec(encodeURIComponent(JSON.stringify(g.__assign({token:t},this.config))),"open")},dt.prototype.exec=function(t,e){var n=""+this.schema+t;e&&(n+=" "+e);var i=document.createElement("a");i.download="File name",i.href=n,i.click()},dt);function dt(t){var e=ht.call(this)||this;return e.config=t,e.type="external",e.schema="wtel://",e}_.Configuration=n,_.Client=Q,_.Call=P,_.Agent=C,_.Conversation=T,_.DeviceNotFoundError=M,_.DeviceNotAllowPermissionError=B,_.SipClient=et,_.ExternalClient=lt,_.SipPhone=d,_.Log=o,Object.defineProperty(_,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=index.umd.min.js.map
|