webitel-sdk 0.1.99 → 0.1.103
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 +32 -3
- 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 +46 -9
- 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/socket/client.js +13 -1
- package/esm2015/socket/client.js.map +1 -1
- package/esm2015/socket/conversation.js +13 -1
- package/esm2015/socket/conversation.js.map +1 -1
- package/esm2015/socket/errors.js +6 -0
- package/esm2015/socket/errors.js.map +1 -0
- package/esm2015/socket/index.js +1 -0
- package/esm2015/socket/index.js.map +1 -1
- package/esm5/socket/client.js +24 -8
- package/esm5/socket/client.js.map +1 -1
- package/esm5/socket/conversation.js +14 -1
- package/esm5/socket/conversation.js.map +1 -1
- package/esm5/socket/errors.js +10 -0
- package/esm5/socket/errors.js.map +1 -0
- package/esm5/socket/index.js +1 -0
- package/esm5/socket/index.js.map +1 -1
- package/package.json +1 -1
- package/types/socket/client.d.ts +1 -0
- package/types/socket/client.d.ts.map +1 -1
- package/types/socket/conversation.d.ts +2 -0
- package/types/socket/conversation.d.ts.map +1 -1
- package/types/socket/errors.d.ts +4 -0
- package/types/socket/errors.d.ts.map +1 -0
- package/types/socket/index.d.ts +1 -0
- package/types/socket/index.d.ts.map +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -23989,9 +23989,15 @@ class Conversation {
|
|
|
23989
23989
|
this.state = ConversationState.Invite;
|
|
23990
23990
|
this.variables = {};
|
|
23991
23991
|
this._hasReporting = !!(variables && variables.cc_reporting === 'true');
|
|
23992
|
+
this._autoAnswer = false;
|
|
23992
23993
|
for (const k in variables) {
|
|
23993
23994
|
if (!k.startsWith('cc_') && variables.hasOwnProperty(k)) {
|
|
23994
|
-
|
|
23995
|
+
if (k === 'wbt_auto_answer') {
|
|
23996
|
+
this._autoAnswer = variables.wbt_auto_answer === 'true';
|
|
23997
|
+
}
|
|
23998
|
+
else {
|
|
23999
|
+
this.variables[k] = variables[k];
|
|
24000
|
+
}
|
|
23995
24001
|
}
|
|
23996
24002
|
}
|
|
23997
24003
|
if (variables &&
|
|
@@ -24003,6 +24009,11 @@ class Conversation {
|
|
|
24003
24009
|
setInvite(inviteId, timestamp) {
|
|
24004
24010
|
this.inviteId = inviteId;
|
|
24005
24011
|
this.invitedAt = timestamp;
|
|
24012
|
+
if (this._autoAnswer) {
|
|
24013
|
+
this.join().catch((e) => {
|
|
24014
|
+
this.client.emit('error', e);
|
|
24015
|
+
});
|
|
24016
|
+
}
|
|
24006
24017
|
}
|
|
24007
24018
|
setAnswered(channelId, timestamp, member) {
|
|
24008
24019
|
this.state = ConversationState.Active;
|
|
@@ -24034,6 +24045,7 @@ class Conversation {
|
|
|
24034
24045
|
};
|
|
24035
24046
|
if (i.hasOwnProperty('file')) {
|
|
24036
24047
|
i.file.url = this.client.fileUrlDownload(i.file.id);
|
|
24048
|
+
i.file.streamUrl = this.client.fileUrlStream(i.file.id);
|
|
24037
24049
|
msg.file = i.file;
|
|
24038
24050
|
}
|
|
24039
24051
|
if (i.hasOwnProperty('text')) {
|
|
@@ -24222,6 +24234,12 @@ function wrapChannelMember(m) {
|
|
|
24222
24234
|
return m;
|
|
24223
24235
|
}
|
|
24224
24236
|
|
|
24237
|
+
class DeviceNotFoundError extends Error {
|
|
24238
|
+
constructor(msg) {
|
|
24239
|
+
super(msg);
|
|
24240
|
+
}
|
|
24241
|
+
}
|
|
24242
|
+
|
|
24225
24243
|
const SOCKET_URL_SUFFIX = 'websocket';
|
|
24226
24244
|
const spamData = `\u0000\u0000\u0000\u0000`;
|
|
24227
24245
|
class Socket extends EventEmitter {
|
|
@@ -24531,7 +24549,18 @@ class Client extends EventEmitter {
|
|
|
24531
24549
|
}
|
|
24532
24550
|
async call(req) {
|
|
24533
24551
|
if (this.phone) {
|
|
24534
|
-
|
|
24552
|
+
try {
|
|
24553
|
+
await this.phone.call(req);
|
|
24554
|
+
}
|
|
24555
|
+
catch (e) {
|
|
24556
|
+
switch (e.name) {
|
|
24557
|
+
case 'NotFoundError':
|
|
24558
|
+
this.emit('error', new DeviceNotFoundError(e));
|
|
24559
|
+
break;
|
|
24560
|
+
default:
|
|
24561
|
+
this.emit('error', e);
|
|
24562
|
+
}
|
|
24563
|
+
}
|
|
24535
24564
|
}
|
|
24536
24565
|
else {
|
|
24537
24566
|
await this.invite(req);
|
|
@@ -25349,5 +25378,5 @@ class ExternalClient extends ee_3 {
|
|
|
25349
25378
|
|
|
25350
25379
|
// tslint:disable
|
|
25351
25380
|
|
|
25352
|
-
export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingChatPlanServiceApiAxiosParamCreator, RoutingChatPlanServiceApiFp, RoutingChatPlanServiceApiFactory, RoutingChatPlanServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, SipClient, ExternalClient, SipPhone, Log };
|
|
25381
|
+
export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingChatPlanServiceApiAxiosParamCreator, RoutingChatPlanServiceApiFp, RoutingChatPlanServiceApiFactory, RoutingChatPlanServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, DeviceNotFoundError, SipClient, ExternalClient, SipPhone, Log };
|
|
25353
25382
|
//# sourceMappingURL=index.esm.js.map
|