@vonage/client-sdk 1.7.2 → 2.0.0-alpha.1
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/api_docs/ts/assets/navigation.js +1 -1
- package/api_docs/ts/assets/search.js +1 -1
- package/api_docs/ts/classes/ClientConfig.html +1 -1
- package/api_docs/ts/classes/ClientInitConfig.html +1 -1
- package/api_docs/ts/classes/VonageClient.html +6 -36
- package/api_docs/ts/enums/CallDisconnectReason.html +2 -2
- package/api_docs/ts/enums/CancelReason.html +1 -1
- package/api_docs/ts/enums/HangupReason.html +6 -6
- package/api_docs/ts/enums/LegStatus.html +4 -4
- package/api_docs/ts/enums/LoggingLevel.html +1 -1
- package/api_docs/ts/enums/MemberChannelType.html +13 -0
- package/api_docs/ts/enums/OrderBy.html +1 -1
- package/api_docs/ts/enums/PresentingOrder.html +1 -1
- package/api_docs/ts/enums/SessionErrorReason.html +5 -0
- package/api_docs/ts/enums/VoiceChannelType.html +5 -5
- package/api_docs/ts/enums/VonageErrorType.html +7 -0
- package/api_docs/ts/functions/none.html +1 -1
- package/api_docs/ts/functions/some.html +1 -1
- package/api_docs/ts/index.html +1 -1
- package/api_docs/ts/interfaces/CallSayParams.html +1 -1
- package/api_docs/ts/interfaces/Channel.html +1 -1
- package/api_docs/ts/interfaces/Conversation.html +1 -1
- package/api_docs/ts/interfaces/ConversationProperties.html +1 -1
- package/api_docs/ts/interfaces/ConversationTimestamp.html +1 -1
- package/api_docs/ts/interfaces/ConversationsPage.html +1 -1
- package/api_docs/ts/interfaces/CreateConversationParameters.html +1 -1
- package/api_docs/ts/interfaces/EphemeralConversationEvent.html +1 -1
- package/api_docs/ts/interfaces/EventsPage.html +1 -1
- package/api_docs/ts/interfaces/GetCallLegsParameters.html +1 -1
- package/api_docs/ts/interfaces/GetConversationEventsParameters.html +1 -1
- package/api_docs/ts/interfaces/GetConversationMembersParameters.html +1 -1
- package/api_docs/ts/interfaces/GetConversationsParameters.html +1 -1
- package/api_docs/ts/interfaces/Leg.html +1 -1
- package/api_docs/ts/interfaces/LegChannel.html +1 -1
- package/api_docs/ts/interfaces/LegsPage.html +1 -1
- package/api_docs/ts/interfaces/Location.html +1 -1
- package/api_docs/ts/interfaces/Member.html +1 -1
- package/api_docs/ts/interfaces/MemberChannel.html +3 -3
- package/api_docs/ts/interfaces/MemberEventBody.html +1 -1
- package/api_docs/ts/interfaces/MemberTimestamp.html +1 -1
- package/api_docs/ts/interfaces/MembersPage.html +1 -1
- package/api_docs/ts/interfaces/MessageAudioEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageCustomEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageFileEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageImageEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageLocationEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageTemplateEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageTextEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageVCardEventBody.html +1 -1
- package/api_docs/ts/interfaces/MessageVideoEventBody.html +1 -1
- package/api_docs/ts/interfaces/RTCQuality.html +1 -1
- package/api_docs/ts/interfaces/RtcStats.html +1 -1
- package/api_docs/ts/interfaces/Template.html +1 -1
- package/api_docs/ts/interfaces/UpdateConversationParameters.html +1 -1
- package/api_docs/ts/interfaces/User.html +1 -1
- package/api_docs/ts/interfaces/UserChannels.html +1 -1
- package/api_docs/ts/interfaces/UserTimestamp.html +1 -1
- package/api_docs/ts/interfaces/VonageError.html +9 -0
- package/api_docs/ts/interfaces/VonageEvent.html +19 -0
- package/api_docs/ts/interfaces/Whatsapp.html +1 -1
- package/api_docs/ts/modules.html +7 -5
- package/api_docs/ts/types/ClientConfigObject.html +1 -1
- package/api_docs/ts/types/ClientInitConfigObject.html +1 -1
- package/api_docs/ts/types/ConfigRegion.html +1 -1
- package/api_docs/ts/types/ConversationEvent.html +1 -1
- package/api_docs/ts/types/CustomData.html +1 -1
- package/api_docs/ts/types/Json.html +1 -1
- package/api_docs/ts/types/JsonValue.html +1 -1
- package/api_docs/ts/types/MemberStatus.html +1 -1
- package/api_docs/ts/types/Option.html +1 -1
- package/api_docs/ts/types/PersistentConversationEvent.html +1 -1
- package/api_docs/ts/types/Topics.html +1 -1
- package/api_docs/ts/types/VonageLogger.html +1 -1
- package/api_docs/ts/variables/Topics-1.html +1 -1
- package/api_docs/ts/variables/VonageError-1.html +3 -0
- package/dist/client/VonageClient.d.ts +26 -64
- package/dist/client/index.cjs +27105 -27724
- package/dist/client/index.mjs +27105 -27722
- package/dist/kotlin/JsUnions.d.ts +16 -0
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +36 -108
- package/dist/utils/ConversationModels.d.ts +5 -16
- package/dist/utils/Enums.d.ts +36 -33
- package/dist/utils/ErrorModels.d.ts +21 -33
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/logging.d.ts +0 -10
- package/dist/vonageClientSDK.js +26768 -27339
- package/dist/vonageClientSDK.min.js +22 -22
- package/dist/vonageClientSDK.min.mjs +23 -23
- package/dist/vonageClientSDK.mjs +26768 -27337
- package/package.json +1 -1
- package/api_docs/ts/enums/ChannelType.html +0 -13
- package/api_docs/ts/functions/setDefaultLoggingLevel.html +0 -3
- package/api_docs/ts/functions/setVonageClientLoggingLevel.html +0 -3
- package/api_docs/ts/types/VonageEvent.html +0 -2
|
@@ -409,6 +409,22 @@ export type MemberState = 'INVITED' | 'JOINED' | 'LEFT' | 'UNKNOWN';
|
|
|
409
409
|
* A ConversationChannelType is a union of 'APP', 'PHONE', 'PSTN', 'sip', 'VBC', 'WEBSOCKET', 'SMS', 'MMS', 'WHATSAPP', 'VIBER', 'MESSENGER'
|
|
410
410
|
*/
|
|
411
411
|
export type ConversationChannelType = 'APP' | 'PHONE' | 'PSTN' | 'sip' | 'VBC' | 'WEBSOCKET' | 'SMS' | 'MMS' | 'WHATSAPP' | 'VIBER' | 'MESSENGER';
|
|
412
|
+
/**
|
|
413
|
+
* A CSErrorCodesJS is a union of 'CONVERSATION_DUPLICATE_NAME', 'MEMBER_ALREADY_JOINED', 'MEMBER_ALREADY_INVITED', 'CONVERSATION_NOT_FOUND', 'MEMBER_NOT_FOUND', 'USER_NOT_FOUND', 'INVALID_CURSOR', 'VALIDATION_FAIL', 'CONVERSATION_MAX_NUMBER_OF_MEMBERS', 'CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED'
|
|
414
|
+
*/
|
|
415
|
+
export type CSErrorCodesJS = 'CONVERSATION_DUPLICATE_NAME' | 'MEMBER_ALREADY_JOINED' | 'MEMBER_ALREADY_INVITED' | 'CONVERSATION_NOT_FOUND' | 'MEMBER_NOT_FOUND' | 'USER_NOT_FOUND' | 'INVALID_CURSOR' | 'VALIDATION_FAIL' | 'CONVERSATION_MAX_NUMBER_OF_MEMBERS' | 'CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED';
|
|
416
|
+
/**
|
|
417
|
+
* A SessionErrorCodesJS is a union of 'EMPTY_TOKEN', 'FORCED_DISCONNECT', 'TIMEOUT', 'INTERNAL_FAILURE', 'NO_ACTIVE_SESSION', 'ALREADY_ACTIVE_SESSION', 'INVALID_TOKEN', 'EXPIRED_TOKEN', 'INVALID_USER', 'AUTHORIZATION_ERROR', 'INVALID_SESSION', 'MAX_OPEN_SESSIONS', 'INVALID_SOCKET_TRANSPORT', 'CLIENT_DISCONNECT', 'PING_TIMEOUT_DISCONNECT', 'TRANSPORT_CLOSED_DISCONNECT'
|
|
418
|
+
*/
|
|
419
|
+
export type SessionErrorCodesJS = 'EMPTY_TOKEN' | 'FORCED_DISCONNECT' | 'TIMEOUT' | 'INTERNAL_FAILURE' | 'NO_ACTIVE_SESSION' | 'ALREADY_ACTIVE_SESSION' | 'INVALID_TOKEN' | 'EXPIRED_TOKEN' | 'INVALID_USER' | 'AUTHORIZATION_ERROR' | 'INVALID_SESSION' | 'MAX_OPEN_SESSIONS' | 'INVALID_SOCKET_TRANSPORT' | 'CLIENT_DISCONNECT' | 'PING_TIMEOUT_DISCONNECT' | 'TRANSPORT_CLOSED_DISCONNECT';
|
|
420
|
+
/**
|
|
421
|
+
* A VonageErrorTypeJS is a union of 'CS_ERROR', 'NETWORK_ERROR', 'SESSION_ERROR', 'INTERNAL_ERROR', 'UNKNOWN_ERROR'
|
|
422
|
+
*/
|
|
423
|
+
export type VonageErrorTypeJS = 'CS_ERROR' | 'NETWORK_ERROR' | 'SESSION_ERROR' | 'INTERNAL_ERROR' | 'UNKNOWN_ERROR';
|
|
424
|
+
/**
|
|
425
|
+
* A SessionErrorReasonJS is a union of 'EXPIRED_TOKEN', 'TRANSPORT_CLOSED', 'PING_TIMEOUT'
|
|
426
|
+
*/
|
|
427
|
+
export type SessionErrorReasonJS = 'EXPIRED_TOKEN' | 'TRANSPORT_CLOSED' | 'PING_TIMEOUT';
|
|
412
428
|
/**
|
|
413
429
|
* A LegStatusJS is a union of 'RINGING', 'ANSWERED', 'COMPLETED'
|
|
414
430
|
*/
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
type Nullable<T> = T | null | undefined
|
|
2
2
|
export declare namespace vonage {
|
|
3
3
|
interface CombinedEvents extends vonage.VoiceEvents, vonage.ChatEvents {
|
|
4
|
-
callInvite(callId: string, from: string, channelType: string): void;
|
|
5
|
-
callInviteCancel(callId: string, reason: string): void;
|
|
6
|
-
callTransfer(callId: string, conversationId: string): void;
|
|
7
|
-
mute(callId: string, legId: string, isMuted: boolean): void;
|
|
8
|
-
earmuff(callId: string, legId: string, earmuffStatus: boolean): void;
|
|
9
|
-
dtmf(callId: string, legId: string, digits: string): void;
|
|
10
|
-
callHangup(callId: string, callQuality: vonage.RTCQualityJS, reason: string): void;
|
|
11
|
-
legStatusUpdate(callId: string, legId: string, status: string): void;
|
|
12
|
-
callMediaReconnecting(callId: string): void;
|
|
13
|
-
callMediaReconnection(callId: string): void;
|
|
14
|
-
callMediaDisconnect(callId: string, reason: string): void;
|
|
15
|
-
rtcStatsUpdate(rtcStats: vonage.RTCStatsJS, legId: string): void;
|
|
16
|
-
callMediaError(callId: string, error: vonage.VonageErrorJS): void;
|
|
17
|
-
reconnecting(): void;
|
|
18
|
-
reconnection(): void;
|
|
19
|
-
sessionError(reason: vonage.SessionErrorReasonJS): void;
|
|
20
|
-
conversationEvent(event: vonage.ConversationEventJS): void;
|
|
21
4
|
}
|
|
22
5
|
}
|
|
23
6
|
export declare namespace vonage {
|
|
@@ -109,10 +92,10 @@ export declare namespace vonage {
|
|
|
109
92
|
get name(): "NONE";
|
|
110
93
|
get ordinal(): 5;
|
|
111
94
|
};
|
|
112
|
-
static values(): Array<vonage.EventStateTypeJS>;
|
|
113
|
-
static valueOf(value: string): vonage.EventStateTypeJS;
|
|
114
95
|
get name(): "SEEN" | "DELIVERED" | "SUBMITTED" | "REJECTED" | "UNDELIVERABLE" | "NONE";
|
|
115
96
|
get ordinal(): 0 | 1 | 2 | 3 | 4 | 5;
|
|
97
|
+
static values(): Array<vonage.EventStateTypeJS>;
|
|
98
|
+
static valueOf(value: string): vonage.EventStateTypeJS;
|
|
116
99
|
}
|
|
117
100
|
class EventStateJS {
|
|
118
101
|
private constructor();
|
|
@@ -464,7 +447,6 @@ export declare namespace vonage {
|
|
|
464
447
|
export declare namespace vonage {
|
|
465
448
|
abstract class PresentingOrderJS {
|
|
466
449
|
private constructor();
|
|
467
|
-
get corePresentingOrder(): any/* com.vonage.clientcore.core.api.models.PresentingOrder */;
|
|
468
450
|
static get ASC(): vonage.PresentingOrderJS & {
|
|
469
451
|
get name(): "ASC";
|
|
470
452
|
get ordinal(): 0;
|
|
@@ -473,14 +455,14 @@ export declare namespace vonage {
|
|
|
473
455
|
get name(): "DESC";
|
|
474
456
|
get ordinal(): 1;
|
|
475
457
|
};
|
|
476
|
-
static values(): Array<vonage.PresentingOrderJS>;
|
|
477
|
-
static valueOf(value: string): vonage.PresentingOrderJS;
|
|
478
458
|
get name(): "ASC" | "DESC";
|
|
479
459
|
get ordinal(): 0 | 1;
|
|
460
|
+
get corePresentingOrder(): any/* com.vonage.clientcore.core.api.models.PresentingOrder */;
|
|
461
|
+
static values(): Array<vonage.PresentingOrderJS>;
|
|
462
|
+
static valueOf(value: string): vonage.PresentingOrderJS;
|
|
480
463
|
}
|
|
481
464
|
abstract class OrderByJS {
|
|
482
465
|
private constructor();
|
|
483
|
-
get coreOrderBy(): any/* com.vonage.clientcore.core.api.models.OrderBy */;
|
|
484
466
|
static get CREATED(): vonage.OrderByJS & {
|
|
485
467
|
get name(): "CREATED";
|
|
486
468
|
get ordinal(): 0;
|
|
@@ -489,10 +471,11 @@ export declare namespace vonage {
|
|
|
489
471
|
get name(): "CUSTOM_SORT_KEY";
|
|
490
472
|
get ordinal(): 1;
|
|
491
473
|
};
|
|
492
|
-
static values(): Array<vonage.OrderByJS>;
|
|
493
|
-
static valueOf(value: string): vonage.OrderByJS;
|
|
494
474
|
get name(): "CREATED" | "CUSTOM_SORT_KEY";
|
|
495
475
|
get ordinal(): 0 | 1;
|
|
476
|
+
get coreOrderBy(): any/* com.vonage.clientcore.core.api.models.OrderBy */;
|
|
477
|
+
static values(): Array<vonage.OrderByJS>;
|
|
478
|
+
static valueOf(value: string): vonage.OrderByJS;
|
|
496
479
|
}
|
|
497
480
|
class ConversationJS {
|
|
498
481
|
private constructor();
|
|
@@ -690,37 +673,20 @@ export declare namespace vonage {
|
|
|
690
673
|
export declare namespace vonage {
|
|
691
674
|
class VonageErrorJS extends Error {
|
|
692
675
|
private constructor();
|
|
693
|
-
get type():
|
|
676
|
+
get type(): string;
|
|
694
677
|
get code(): Nullable<string>;
|
|
695
678
|
get kmpCause(): Nullable<Error>;
|
|
696
679
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
static get SESSION_ERROR(): vonage.VonageErrorTypeJS & {
|
|
708
|
-
get name(): "SESSION_ERROR";
|
|
709
|
-
get ordinal(): 2;
|
|
710
|
-
};
|
|
711
|
-
static get INTERNAL_ERROR(): vonage.VonageErrorTypeJS & {
|
|
712
|
-
get name(): "INTERNAL_ERROR";
|
|
713
|
-
get ordinal(): 3;
|
|
714
|
-
};
|
|
715
|
-
static get UNKNOWN_ERROR(): vonage.VonageErrorTypeJS & {
|
|
716
|
-
get name(): "UNKNOWN_ERROR";
|
|
717
|
-
get ordinal(): 4;
|
|
718
|
-
};
|
|
719
|
-
static values(): Array<vonage.VonageErrorTypeJS>;
|
|
720
|
-
static valueOf(value: string): vonage.VonageErrorTypeJS;
|
|
721
|
-
get name(): "CS_ERROR" | "NETWORK_ERROR" | "SESSION_ERROR" | "INTERNAL_ERROR" | "UNKNOWN_ERROR";
|
|
722
|
-
get ordinal(): 0 | 1 | 2 | 3 | 4;
|
|
723
|
-
}
|
|
680
|
+
const VonageErrorTypeJsObject: {
|
|
681
|
+
get CS_ERROR(): string;
|
|
682
|
+
get NETWORK_ERROR(): string;
|
|
683
|
+
get SESSION_ERROR(): string;
|
|
684
|
+
get INTERNAL_ERROR(): string;
|
|
685
|
+
get UNKNOWN_ERROR(): string;
|
|
686
|
+
toString(): string;
|
|
687
|
+
hashCode(): number;
|
|
688
|
+
equals(other: Nullable<any>): boolean;
|
|
689
|
+
};
|
|
724
690
|
abstract class MediaClientErrorJS {
|
|
725
691
|
protected constructor();
|
|
726
692
|
}
|
|
@@ -769,9 +735,6 @@ export declare namespace vonage {
|
|
|
769
735
|
export declare namespace vonage {
|
|
770
736
|
interface ChatEvents extends vonage.CoreClientEvents {
|
|
771
737
|
conversationEvent(event: vonage.ConversationEventJS): void;
|
|
772
|
-
reconnecting(): void;
|
|
773
|
-
reconnection(): void;
|
|
774
|
-
sessionError(reason: vonage.SessionErrorReasonJS): void;
|
|
775
738
|
}
|
|
776
739
|
}
|
|
777
740
|
export declare namespace vonage {
|
|
@@ -800,19 +763,13 @@ export declare namespace vonage {
|
|
|
800
763
|
deleteEvent(id: number, conversationId: string): Promise<any>;
|
|
801
764
|
sendMessageSeenEvent(id: number, conversationId: string): Promise<any>;
|
|
802
765
|
updateConversation(conversationId: string, parameters: vonage.UpdateConversationParametersJS): Promise<any>;
|
|
803
|
-
setConfig(config: vonage.ConfigObjectJS): void;
|
|
804
|
-
createSession(token: string, sessionId: Nullable<string>): Promise<string>;
|
|
805
|
-
deleteSession(): Promise<any>;
|
|
806
|
-
refreshSession(token: string): Promise<any>;
|
|
807
|
-
getConversation(conversationIdOrName: string): Promise<vonage.ConversationJS>;
|
|
808
|
-
getUser(userIdOrName: string): Promise<vonage.UserJS>;
|
|
809
766
|
}
|
|
810
767
|
}
|
|
811
768
|
export declare namespace vonage {
|
|
812
769
|
interface CoreClientEvents {
|
|
813
770
|
reconnecting(): void;
|
|
814
771
|
reconnection(): void;
|
|
815
|
-
sessionError(reason:
|
|
772
|
+
sessionError(reason: string): void;
|
|
816
773
|
}
|
|
817
774
|
interface VonageLoggerJS {
|
|
818
775
|
readonly name: string;
|
|
@@ -833,20 +790,13 @@ export declare namespace vonage {
|
|
|
833
790
|
readonly loggingLevel?: Nullable<vonage.LoggingLevelJS>;
|
|
834
791
|
readonly customLoggers?: Nullable<Array<vonage.VonageLoggerJS>>;
|
|
835
792
|
readonly disableInternalLogger?: Nullable<boolean>;
|
|
836
|
-
readonly region?: Nullable<vonage.CoreClientConfigRegionJS>;
|
|
837
|
-
readonly apiUrl?: Nullable<string>;
|
|
838
|
-
readonly websocketUrl?: Nullable<string>;
|
|
839
|
-
readonly websocketPath?: Nullable<string>;
|
|
840
|
-
readonly rtcStatsTelemetry?: Nullable<boolean>;
|
|
841
|
-
readonly autoReconnectMedia?: Nullable<boolean>;
|
|
842
|
-
readonly noiseSuppression?: Nullable<boolean>;
|
|
843
793
|
}
|
|
844
794
|
}
|
|
845
795
|
export declare namespace vonage {
|
|
846
796
|
const DEFAULT_REGION: vonage.CoreClientConfigRegionJS;
|
|
797
|
+
const DEFAULT_LOGGING_LEVEL: vonage.LoggingLevelJS;
|
|
847
798
|
abstract class CoreClientConfigRegionJS {
|
|
848
799
|
private constructor();
|
|
849
|
-
get coreRegion(): any/* com.vonage.clientcore.core.api.ClientConfigRegion */;
|
|
850
800
|
static get AP(): vonage.CoreClientConfigRegionJS & {
|
|
851
801
|
get name(): "AP";
|
|
852
802
|
get ordinal(): 0;
|
|
@@ -859,10 +809,11 @@ export declare namespace vonage {
|
|
|
859
809
|
get name(): "US";
|
|
860
810
|
get ordinal(): 2;
|
|
861
811
|
};
|
|
862
|
-
static values(): Array<vonage.CoreClientConfigRegionJS>;
|
|
863
|
-
static valueOf(value: string): vonage.CoreClientConfigRegionJS;
|
|
864
812
|
get name(): "AP" | "EU" | "US";
|
|
865
813
|
get ordinal(): 0 | 1 | 2;
|
|
814
|
+
get coreRegion(): any/* com.vonage.clientcore.core.api.ClientConfigRegion */;
|
|
815
|
+
static values(): Array<vonage.CoreClientConfigRegionJS>;
|
|
816
|
+
static valueOf(value: string): vonage.CoreClientConfigRegionJS;
|
|
866
817
|
}
|
|
867
818
|
class CoreClientConfigJS implements vonage.ConfigObjectJS {
|
|
868
819
|
constructor(region?: vonage.CoreClientConfigRegionJS);
|
|
@@ -918,10 +869,10 @@ export declare namespace vonage {
|
|
|
918
869
|
get name(): "DEFAULT";
|
|
919
870
|
get ordinal(): 6;
|
|
920
871
|
};
|
|
921
|
-
static values(): Array<vonage.Topics>;
|
|
922
|
-
static valueOf(value: string): vonage.Topics;
|
|
923
872
|
get name(): "HTTP" | "WS" | "MEDIA" | "API" | "STORE" | "REDUCER" | "DEFAULT";
|
|
924
873
|
get ordinal(): 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
874
|
+
static values(): Array<vonage.Topics>;
|
|
875
|
+
static valueOf(value: string): vonage.Topics;
|
|
925
876
|
}
|
|
926
877
|
function createVonageLoggerJS(name: string, minLogLevel: vonage.LoggingLevelJS | undefined, topics: Array<vonage.Topics> | undefined, onLog: (p0: string, p1: vonage.TopicJS, p2: string) => void): vonage.VonageLoggerJS;
|
|
927
878
|
abstract class LoggingLevelJS {
|
|
@@ -950,33 +901,19 @@ export declare namespace vonage {
|
|
|
950
901
|
get name(): "Assert";
|
|
951
902
|
get ordinal(): 5;
|
|
952
903
|
};
|
|
953
|
-
static values(): Array<vonage.LoggingLevelJS>;
|
|
954
|
-
static valueOf(value: string): vonage.LoggingLevelJS;
|
|
955
904
|
get name(): "Verbose" | "Debug" | "Info" | "Warn" | "Error" | "Assert";
|
|
956
905
|
get ordinal(): 0 | 1 | 2 | 3 | 4 | 5;
|
|
906
|
+
static values(): Array<vonage.LoggingLevelJS>;
|
|
907
|
+
static valueOf(value: string): vonage.LoggingLevelJS;
|
|
957
908
|
}
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
};
|
|
967
|
-
static get TRANSPORT_CLOSED(): vonage.SessionErrorReasonJS & {
|
|
968
|
-
get name(): "TRANSPORT_CLOSED";
|
|
969
|
-
get ordinal(): 1;
|
|
970
|
-
};
|
|
971
|
-
static get PING_TIMEOUT(): vonage.SessionErrorReasonJS & {
|
|
972
|
-
get name(): "PING_TIMEOUT";
|
|
973
|
-
get ordinal(): 2;
|
|
974
|
-
};
|
|
975
|
-
static values(): Array<vonage.SessionErrorReasonJS>;
|
|
976
|
-
static valueOf(value: string): vonage.SessionErrorReasonJS;
|
|
977
|
-
get name(): "EXPIRED_TOKEN" | "TRANSPORT_CLOSED" | "PING_TIMEOUT";
|
|
978
|
-
get ordinal(): 0 | 1 | 2;
|
|
979
|
-
}
|
|
909
|
+
const SessionErrorReasonJsObject: {
|
|
910
|
+
get EXPIRED_TOKEN(): string;
|
|
911
|
+
get TRANSPORT_CLOSED(): string;
|
|
912
|
+
get PING_TIMEOUT(): string;
|
|
913
|
+
toString(): string;
|
|
914
|
+
hashCode(): number;
|
|
915
|
+
equals(other: Nullable<any>): boolean;
|
|
916
|
+
};
|
|
980
917
|
interface ICoreClientJS {
|
|
981
918
|
readonly core: any/* com.vonage.clientcore.core.CoreClient */;
|
|
982
919
|
setConfig(config: vonage.ConfigObjectJS): void;
|
|
@@ -1002,9 +939,6 @@ export declare namespace vonage {
|
|
|
1002
939
|
callMediaDisconnect(callId: string, reason: string): void;
|
|
1003
940
|
rtcStatsUpdate(rtcStats: vonage.RTCStatsJS, legId: string): void;
|
|
1004
941
|
callMediaError(callId: string, error: vonage.VonageErrorJS): void;
|
|
1005
|
-
reconnecting(): void;
|
|
1006
|
-
reconnection(): void;
|
|
1007
|
-
sessionError(reason: vonage.SessionErrorReasonJS): void;
|
|
1008
942
|
}
|
|
1009
943
|
interface CallSayParams {
|
|
1010
944
|
readonly text: string;
|
|
@@ -1058,12 +992,6 @@ export declare namespace vonage {
|
|
|
1058
992
|
enableEarmuff(callId: string): Promise<any>;
|
|
1059
993
|
disableEarmuff(callId: string): Promise<any>;
|
|
1060
994
|
sendDTMF(callId: string, digits: string): Promise<any>;
|
|
1061
|
-
setConfig(config: vonage.ConfigObjectJS): void;
|
|
1062
|
-
createSession(token: string, sessionId: Nullable<string>): Promise<string>;
|
|
1063
|
-
deleteSession(): Promise<any>;
|
|
1064
|
-
refreshSession(token: string): Promise<any>;
|
|
1065
|
-
getConversation(conversationIdOrName: string): Promise<vonage.ConversationJS>;
|
|
1066
|
-
getUser(userIdOrName: string): Promise<vonage.UserJS>;
|
|
1067
995
|
}
|
|
1068
996
|
class VoiceInviteFromInfoJS {
|
|
1069
997
|
constructor(id: Nullable<string>, type: string);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import vonage from '../utils/vonage';
|
|
2
2
|
import { ConversationChannelType, ConversationState, MemberState, PersistentConversationEvent } from '../kotlin/JsUnions';
|
|
3
|
+
import { toEnum, unionOfValues } from './Enums';
|
|
3
4
|
import { Leg } from '../client';
|
|
4
5
|
/**
|
|
5
6
|
* Represents a conversation
|
|
@@ -126,30 +127,18 @@ export type UserTimestamp = vonage.UserTimestampJS;
|
|
|
126
127
|
*
|
|
127
128
|
* @enum
|
|
128
129
|
*/
|
|
129
|
-
export declare const
|
|
130
|
-
|
|
131
|
-
readonly PHONE: "PHONE";
|
|
132
|
-
readonly PSTN: "PSTN";
|
|
133
|
-
readonly sip: "sip";
|
|
134
|
-
readonly VBC: "VBC";
|
|
135
|
-
readonly WEBSOCKET: "WEBSOCKET";
|
|
136
|
-
readonly SMS: "SMS";
|
|
137
|
-
readonly MMS: "MMS";
|
|
138
|
-
readonly WHATSAPP: "WHATSAPP";
|
|
139
|
-
readonly VIBER: "VIBER";
|
|
140
|
-
readonly MESSENGER: "MESSENGER";
|
|
141
|
-
};
|
|
142
|
-
export type ChannelType = ConversationChannelType;
|
|
130
|
+
export declare const MemberChannelType: toEnum<ConversationChannelType>;
|
|
131
|
+
export type MemberChannelType = unionOfValues<typeof MemberChannelType>;
|
|
143
132
|
/**
|
|
144
133
|
* Represents a Member Channel
|
|
145
134
|
*
|
|
146
|
-
* @property type The {@link
|
|
135
|
+
* @property type The {@link MemberChannelType}
|
|
147
136
|
* @property from The from {@link Channel}
|
|
148
137
|
* @property to The to {@link Channel}
|
|
149
138
|
* @interface
|
|
150
139
|
*/
|
|
151
140
|
export type MemberChannel = Omit<vonage.MemberChannelJS, 'type'> & {
|
|
152
|
-
type:
|
|
141
|
+
type: MemberChannelType;
|
|
153
142
|
};
|
|
154
143
|
/**
|
|
155
144
|
* Represents a Channel.
|
package/dist/utils/Enums.d.ts
CHANGED
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
import { HangupReasonJS, LegStatusJS, CallDisconnectReasonJS, CancelReasonJS, VoiceChannelTypeJS } from '../kotlin/JsUnions';
|
|
1
|
+
import { HangupReasonJS, LegStatusJS, CallDisconnectReasonJS, CancelReasonJS, VoiceChannelTypeJS, SessionErrorReasonJS, VonageErrorTypeJS, CSErrorCodesJS, SessionErrorCodesJS } from '../kotlin/JsUnions';
|
|
2
|
+
export type CamelCase<S extends string, Sep extends string = '-' | '_' | ' ' | '.'> = S extends `${infer F}${Sep}${infer R}` ? `${Lowercase<F>}${CamelCase<Capitalize<R>, Sep>}` : Lowercase<S>;
|
|
3
|
+
export type PascalCase<S extends string, Sep extends string = '-' | '_' | ' ' | '.'> = S extends `${infer F}${Sep}${infer R}` ? `${Capitalize<Lowercase<F>>}${PascalCase<Capitalize<R>, Sep>}` : S extends Uppercase<S> ? Capitalize<Lowercase<S>> : Capitalize<S>;
|
|
4
|
+
export type toEnum<T extends string> = {
|
|
5
|
+
[key in T as PascalCase<key>]: key;
|
|
6
|
+
};
|
|
7
|
+
export type unionOfValues<T> = T[keyof T];
|
|
2
8
|
/**
|
|
3
9
|
* Hangup reasons for a call
|
|
4
10
|
* @enum
|
|
5
11
|
*/
|
|
6
|
-
export declare const HangupReason:
|
|
7
|
-
|
|
8
|
-
readonly REMOTE_REJECT: "REMOTE_REJECT";
|
|
9
|
-
readonly REMOTE_NO_ANSWER_TIMEOUT: "REMOTE_NO_ANSWER_TIMEOUT";
|
|
10
|
-
readonly LOCAL_HANGUP: "LOCAL_HANGUP";
|
|
11
|
-
readonly MEDIA_TIMEOUT: "MEDIA_TIMEOUT";
|
|
12
|
-
};
|
|
13
|
-
export type HangupReason = HangupReasonJS;
|
|
12
|
+
export declare const HangupReason: toEnum<HangupReasonJS>;
|
|
13
|
+
export type HangupReason = unionOfValues<typeof HangupReason>;
|
|
14
14
|
/**
|
|
15
15
|
* Leg status for a call
|
|
16
16
|
* @enum
|
|
17
17
|
*/
|
|
18
|
-
export declare const LegStatus:
|
|
19
|
-
|
|
20
|
-
readonly ANSWERED: "ANSWERED";
|
|
21
|
-
readonly COMPLETED: "COMPLETED";
|
|
22
|
-
};
|
|
23
|
-
export type LegStatus = LegStatusJS;
|
|
18
|
+
export declare const LegStatus: toEnum<LegStatusJS>;
|
|
19
|
+
export type LegStatus = unionOfValues<typeof LegStatus>;
|
|
24
20
|
/**
|
|
25
21
|
* Call disconnect reasons
|
|
26
22
|
* @enum
|
|
27
23
|
*/
|
|
28
|
-
export declare const CallDisconnectReason:
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
export type CallDisconnectReason = CallDisconnectReasonJS;
|
|
24
|
+
export declare const CallDisconnectReason: toEnum<CallDisconnectReasonJS>;
|
|
25
|
+
export type CallDisconnectReason = unionOfValues<typeof CallDisconnectReason>;
|
|
32
26
|
/**
|
|
33
27
|
* Call Invite cancel reasons
|
|
34
28
|
* @enum
|
|
35
29
|
*/
|
|
36
|
-
export declare const CancelReason:
|
|
37
|
-
|
|
38
|
-
readonly RejectedElsewhere: "RejectedElsewhere";
|
|
39
|
-
readonly RemoteTimeout: "RemoteTimeout";
|
|
40
|
-
readonly AnsweredElsewhere: "AnsweredElsewhere";
|
|
41
|
-
};
|
|
42
|
-
export type CancelReason = CancelReasonJS;
|
|
30
|
+
export declare const CancelReason: toEnum<CancelReasonJS>;
|
|
31
|
+
export type CancelReason = unionOfValues<typeof CancelReason>;
|
|
43
32
|
/**
|
|
44
33
|
* Voice Channel Types
|
|
45
34
|
* @enum
|
|
46
35
|
*/
|
|
47
|
-
export declare const VoiceChannelType:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export
|
|
36
|
+
export declare const VoiceChannelType: toEnum<VoiceChannelTypeJS>;
|
|
37
|
+
export type VoiceChannelType = unionOfValues<typeof VoiceChannelType>;
|
|
38
|
+
/**
|
|
39
|
+
* Session Error Reasons
|
|
40
|
+
* @enum
|
|
41
|
+
*/
|
|
42
|
+
export declare const SessionErrorReason: toEnum<SessionErrorReasonJS>;
|
|
43
|
+
export type SessionErrorReason = unionOfValues<typeof SessionErrorReason>;
|
|
44
|
+
/**
|
|
45
|
+
* Vonage Error Types
|
|
46
|
+
* @enum
|
|
47
|
+
*/
|
|
48
|
+
export declare const VonageErrorType: toEnum<VonageErrorTypeJS>;
|
|
49
|
+
/**
|
|
50
|
+
* Vonage Error Values
|
|
51
|
+
*/
|
|
52
|
+
export type VonageErrorType = unionOfValues<typeof VonageErrorType>;
|
|
53
|
+
export declare const CSErrorCodes: toEnum<CSErrorCodesJS>;
|
|
54
|
+
export type CSErrorCodes = unionOfValues<typeof CSErrorCodes>;
|
|
55
|
+
export declare const SessionErrorCodes: toEnum<SessionErrorCodesJS>;
|
|
56
|
+
export type SessionErrorCodes = unionOfValues<typeof SessionErrorCodes>;
|
|
@@ -1,35 +1,23 @@
|
|
|
1
|
+
import { type VonageErrorType } from './Enums';
|
|
1
2
|
import vonage from '../utils/vonage';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type VonageErrorType = vonage.VonageErrorTypeJS;
|
|
5
|
-
export declare const VonageErrorType: typeof vonage.VonageErrorTypeJS;
|
|
6
|
-
export declare const CSErrorCodes: {
|
|
7
|
-
readonly CONVERSATION_DUPLICATE_NAME: string;
|
|
8
|
-
readonly MEMBER_ALREADY_JOINED: string;
|
|
9
|
-
readonly MEMBER_ALREADY_INVITED: string;
|
|
10
|
-
readonly CONVERSATION_NOT_FOUND: string;
|
|
11
|
-
readonly MEMBER_NOT_FOUND: string;
|
|
12
|
-
readonly USER_NOT_FOUND: string;
|
|
13
|
-
readonly INVALID_CURSOR: string;
|
|
14
|
-
readonly VALIDATION_FAIL: string;
|
|
15
|
-
readonly CONVERSATION_MAX_NUMBER_OF_MEMBERS: string;
|
|
16
|
-
readonly CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const SessionErrorCodes: {
|
|
19
|
-
readonly EMPTY_TOKEN: string;
|
|
20
|
-
readonly FORCED_DISCONNECT: string;
|
|
21
|
-
readonly TIMEOUT: string;
|
|
22
|
-
readonly INTERNAL_FAILURE: string;
|
|
23
|
-
readonly NO_ACTIVE_SESSION: string;
|
|
24
|
-
readonly ALREADY_ACTIVE_SESSION: string;
|
|
25
|
-
readonly INVALID_TOKEN: string;
|
|
26
|
-
readonly EXPIRED_TOKEN: string;
|
|
27
|
-
readonly INVALID_USER: string;
|
|
28
|
-
readonly AUTHORIZATION_ERROR: string;
|
|
29
|
-
readonly INVALID_SESSION: string;
|
|
30
|
-
readonly MAX_OPEN_SESSIONS: string;
|
|
31
|
-
readonly INVALID_SOCKET_TRANSPORT: string;
|
|
32
|
-
readonly CLIENT_DISCONNECT: string;
|
|
33
|
-
readonly PING_TIMEOUT_DISCONNECT: string;
|
|
34
|
-
readonly TRANSPORT_CLOSED_DISCONNECT: string;
|
|
3
|
+
type VonageErrorJS = {
|
|
4
|
+
[key in keyof Omit<vonage.VonageErrorJS, 'type'>]: vonage.VonageErrorJS[key];
|
|
35
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Vonage Error
|
|
8
|
+
*
|
|
9
|
+
* @interface
|
|
10
|
+
*/
|
|
11
|
+
export type VonageError = {
|
|
12
|
+
/**
|
|
13
|
+
* Type of the error
|
|
14
|
+
*/
|
|
15
|
+
type: VonageErrorType;
|
|
16
|
+
} & VonageErrorJS;
|
|
17
|
+
/**
|
|
18
|
+
* Vonage Error
|
|
19
|
+
*
|
|
20
|
+
* @implements {@link VonageError}
|
|
21
|
+
*/
|
|
22
|
+
export declare const VonageError: typeof vonage.VonageErrorJS;
|
|
23
|
+
export {};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ClientConfig, ClientInitConfig, ClientConfigObject, ClientInitConfigObject, ConfigRegion, convertInitConfig } from './ClientConfig';
|
|
2
|
-
export { type Topic, type VonageLogger, LoggingLevel, Topics, createVonageLogger
|
|
2
|
+
export { type Topic, type VonageLogger, LoggingLevel, Topics, createVonageLogger } from './logging';
|
|
3
3
|
export * from './JsonUtils';
|
|
4
4
|
export * from './ConversationModels';
|
|
5
5
|
export * from './ErrorModels';
|
package/dist/utils/logging.d.ts
CHANGED
|
@@ -28,16 +28,6 @@ export declare const LoggingLevel: {
|
|
|
28
28
|
readonly Assert: "Assert";
|
|
29
29
|
};
|
|
30
30
|
export type LoggingLevel = vonage.LoggingLevelJS | LoggingLevelName;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use {@link ClientInitConfigObject.loggingLevel} instead.
|
|
33
|
-
* @param level - The logging level to set.
|
|
34
|
-
*/
|
|
35
|
-
export declare const setDefaultLoggingLevel: (level: LoggingLevel) => void;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use {@link ClientInitConfigObject.loggingLevel} instead.
|
|
38
|
-
* @param level - The logging level to set.
|
|
39
|
-
*/
|
|
40
|
-
export declare const setVonageClientLoggingLevel: (level: LoggingLevel) => void;
|
|
41
31
|
/**
|
|
42
32
|
* An interface representing a client logger to be set via {@link ClientInitConfigObject.customLoggers}
|
|
43
33
|
*
|