@vonage/client-sdk 2.6.1 → 2.6.2-snapshot.20260820113314
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/hierarchy.js +1 -0
- package/api_docs/ts/assets/highlight.css +1 -1
- package/api_docs/ts/assets/icons.js +17 -14
- package/api_docs/ts/assets/icons.svg +1 -1
- package/api_docs/ts/assets/main.js +5 -4
- package/api_docs/ts/assets/navigation.js +1 -1
- package/api_docs/ts/assets/search.js +1 -1
- package/api_docs/ts/assets/style.css +1460 -1224
- package/api_docs/ts/classes/ClientConfig.html +207 -16
- package/api_docs/ts/classes/ClientInitConfig.html +130 -14
- package/api_docs/ts/classes/VonageClient.html +1697 -335
- package/api_docs/ts/enums/CallDisconnectReason.html +54 -3
- package/api_docs/ts/enums/CancelReason.html +66 -6
- package/api_docs/ts/enums/HangupReason.html +70 -7
- package/api_docs/ts/enums/LegStatus.html +62 -5
- package/api_docs/ts/enums/LoggingLevel.html +74 -8
- package/api_docs/ts/enums/MemberChannelType.html +94 -13
- package/api_docs/ts/enums/OrderBy.html +58 -2
- package/api_docs/ts/enums/PresentingOrder.html +62 -8
- package/api_docs/ts/enums/SessionErrorReason.html +62 -5
- package/api_docs/ts/enums/VoiceChannelType.html +66 -6
- package/api_docs/ts/enums/VonageErrorType.html +70 -7
- package/api_docs/ts/functions/none.html +42 -2
- package/api_docs/ts/functions/some.html +48 -3
- package/api_docs/ts/hierarchy.html +30 -0
- package/api_docs/ts/index.html +102 -26
- package/api_docs/ts/interfaces/CallSayParams.html +75 -8
- package/api_docs/ts/interfaces/Channel.html +67 -6
- package/api_docs/ts/interfaces/Conversation.html +127 -20
- package/api_docs/ts/interfaces/ConversationProperties.html +75 -8
- package/api_docs/ts/interfaces/ConversationTimestamp.html +75 -5
- package/api_docs/ts/interfaces/ConversationsPage.html +81 -8
- package/api_docs/ts/interfaces/CreateConversationParameters.html +88 -15
- package/api_docs/ts/interfaces/EmergencyCallData.html +67 -6
- package/api_docs/ts/interfaces/EmergencyCallOptions.html +57 -4
- package/api_docs/ts/interfaces/EphemeralConversationEvent.html +81 -12
- package/api_docs/ts/interfaces/EventsPage.html +81 -8
- package/api_docs/ts/interfaces/GetCallLegsParameters.html +69 -8
- package/api_docs/ts/interfaces/GetConversationEventsParameters.html +87 -14
- package/api_docs/ts/interfaces/GetConversationMembersParameters.html +69 -8
- package/api_docs/ts/interfaces/GetConversationsParameters.html +81 -12
- package/api_docs/ts/interfaces/Leg.html +131 -21
- package/api_docs/ts/interfaces/LegChannel.html +75 -8
- package/api_docs/ts/interfaces/LegsPage.html +81 -8
- package/api_docs/ts/interfaces/Location.html +67 -6
- package/api_docs/ts/interfaces/Member.html +81 -12
- package/api_docs/ts/interfaces/MemberChannel.html +69 -8
- package/api_docs/ts/interfaces/MemberEventBody.html +75 -7
- package/api_docs/ts/interfaces/MemberTimestamp.html +75 -5
- package/api_docs/ts/interfaces/MembersPage.html +81 -8
- package/api_docs/ts/interfaces/MessageAudioEventBody.html +67 -5
- package/api_docs/ts/interfaces/MessageCustomEventBody.html +67 -5
- package/api_docs/ts/interfaces/MessageFileEventBody.html +67 -6
- package/api_docs/ts/interfaces/MessageImageEventBody.html +67 -6
- package/api_docs/ts/interfaces/MessageLocationEventBody.html +67 -6
- package/api_docs/ts/interfaces/MessageTemplateEventBody.html +93 -9
- package/api_docs/ts/interfaces/MessageTextEventBody.html +67 -6
- package/api_docs/ts/interfaces/MessageVCardEventBody.html +67 -6
- package/api_docs/ts/interfaces/MessageVideoEventBody.html +67 -6
- package/api_docs/ts/interfaces/RTCQuality.html +123 -11
- package/api_docs/ts/interfaces/RtcStats.html +179 -18
- package/api_docs/ts/interfaces/Template.html +59 -4
- package/api_docs/ts/interfaces/UpdateConversationParameters.html +87 -14
- package/api_docs/ts/interfaces/User.html +107 -16
- package/api_docs/ts/interfaces/UserChannels.html +139 -13
- package/api_docs/ts/interfaces/UserTimestamp.html +75 -5
- package/api_docs/ts/interfaces/VonageError.html +89 -12
- package/api_docs/ts/interfaces/VonageEvent.html +131 -22
- package/api_docs/ts/interfaces/Whatsapp.html +59 -4
- package/api_docs/ts/modules.html +69 -74
- package/api_docs/ts/types/ClientConfigObject.html +52 -5
- package/api_docs/ts/types/ClientInitConfigObject.html +59 -4
- package/api_docs/ts/types/ConfigRegion.html +34 -2
- package/api_docs/ts/types/ConversationEvent.html +34 -2
- package/api_docs/ts/types/CustomData.html +34 -2
- package/api_docs/ts/types/Json.html +34 -2
- package/api_docs/ts/types/JsonValue.html +34 -2
- package/api_docs/ts/types/MemberStatus.html +34 -2
- package/api_docs/ts/types/Option.html +38 -2
- package/api_docs/ts/types/PersistentConversationEvent.html +34 -2
- package/api_docs/ts/types/Topics.html +34 -2
- package/api_docs/ts/types/VonageLogger.html +59 -4
- package/api_docs/ts/variables/Topics.html +34 -0
- package/api_docs/ts/variables/VonageError.html +38 -0
- package/dist/client/VonageClient.d.ts +704 -704
- package/dist/client/index.cjs +45072 -36319
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.mjs +44700 -35947
- package/dist/coreExtend.d.ts +107 -107
- package/dist/kotlin/JsUnions.d.ts +443 -443
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +724 -145
- package/dist/utils/ClientConfig.d.ts +104 -104
- package/dist/utils/ConversationEventBodies.d.ts +125 -125
- package/dist/utils/ConversationModels.d.ts +170 -170
- package/dist/utils/Enums.d.ts +56 -56
- package/dist/utils/ErrorModels.d.ts +23 -23
- package/dist/utils/JsonUtils.d.ts +15 -15
- package/dist/utils/Option.d.ts +19 -19
- package/dist/utils/RequestParameterModels.d.ts +134 -134
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/jsEnumToVonageObject.d.ts +10 -10
- package/dist/utils/logging.d.ts +53 -53
- package/dist/utils/vonage.d.ts +2 -2
- package/dist/vonageClientSDK.js +44299 -35558
- package/dist/vonageClientSDK.min.js +25 -25
- package/dist/vonageClientSDK.min.mjs +26 -26
- package/dist/vonageClientSDK.mjs +44299 -35558
- package/package.json +6 -6
- package/typedoc.json +3 -0
- package/api_docs/ts/variables/Topics-1.html +0 -2
- package/api_docs/ts/variables/VonageError-1.html +0 -3
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
import vonage from '../utils/vonage';
|
|
2
|
-
import { ConversationChannelType, ConversationState, MemberState, PersistentConversationEvent } from '../kotlin/JsUnions';
|
|
3
|
-
import { toEnum, unionOfValues } from './Enums';
|
|
4
|
-
import { Leg } from '../client';
|
|
5
|
-
/**
|
|
6
|
-
* Represents a conversation
|
|
7
|
-
*
|
|
8
|
-
* @property id The conversation id
|
|
9
|
-
* @property name The conversation name
|
|
10
|
-
* @property timestamp The conversation timestamp
|
|
11
|
-
* @property memberId The user member id in the conversation
|
|
12
|
-
* @property memberState The user member state in the conversation
|
|
13
|
-
* @property displayName The conversation display name
|
|
14
|
-
* @property imageUrl The conversation image url
|
|
15
|
-
* @property state The conversation state
|
|
16
|
-
* @property properties The conversation properties
|
|
17
|
-
* @interface
|
|
18
|
-
*/
|
|
19
|
-
export type Conversation = vonage.ConversationJS & {
|
|
20
|
-
memberState?: MemberState;
|
|
21
|
-
state?: ConversationState;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Represents a {@link Conversation} timestamps
|
|
25
|
-
*
|
|
26
|
-
* @interface
|
|
27
|
-
*/
|
|
28
|
-
export type ConversationTimestamp = vonage.ConversationTimestampJS;
|
|
29
|
-
/**
|
|
30
|
-
* Represents the properties for a {@link Conversation}
|
|
31
|
-
*
|
|
32
|
-
* @property ttl The time-to-live (TTL) for the conversation in seconds.
|
|
33
|
-
* @property customSortKey A string according to which Conversations will be ordered
|
|
34
|
-
* @property customData The Conversation custom data
|
|
35
|
-
* @interface
|
|
36
|
-
*/
|
|
37
|
-
export type ConversationProperties = vonage.ConversationJS.Properties;
|
|
38
|
-
/**
|
|
39
|
-
* Represents a page of conversations
|
|
40
|
-
*
|
|
41
|
-
* @property conversations The conversations in the page
|
|
42
|
-
* @property previousCursor The cursor to fetch the previous page
|
|
43
|
-
* @property nextCursor The cursor to fetch the next page
|
|
44
|
-
* @interface
|
|
45
|
-
* @group Chat
|
|
46
|
-
*/
|
|
47
|
-
export type ConversationsPage = vonage.ConversationsPageJS & {
|
|
48
|
-
conversations: Conversation[];
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Represents a page of legs
|
|
52
|
-
*
|
|
53
|
-
* @property legs The legs in the page
|
|
54
|
-
* @property previousCursor The cursor to fetch the previous page
|
|
55
|
-
* @property nextCursor The cursor to fetch the next page
|
|
56
|
-
* @interface
|
|
57
|
-
* @group Voice
|
|
58
|
-
*/
|
|
59
|
-
export type LegsPage = vonage.LegsPageJS & {
|
|
60
|
-
legs: Leg[];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Represents a page of conversation events
|
|
64
|
-
*
|
|
65
|
-
* @property events The events in the page
|
|
66
|
-
* @property previousCursor The cursor to fetch the previous page
|
|
67
|
-
* @property nextCursor The cursor to fetch the next page
|
|
68
|
-
* @interface
|
|
69
|
-
* @group Chat
|
|
70
|
-
*/
|
|
71
|
-
export type EventsPage = vonage.EventsPageJS & {
|
|
72
|
-
events: PersistentConversationEvent[];
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Represents the membership of a user in a conversation
|
|
76
|
-
*
|
|
77
|
-
* @property id The member id
|
|
78
|
-
* @property state The member state
|
|
79
|
-
* @property user The user associated to the member
|
|
80
|
-
* @property channel The member channel
|
|
81
|
-
* @property timestamp The member timestamp
|
|
82
|
-
* @interface
|
|
83
|
-
*/
|
|
84
|
-
export type Member = Omit<vonage.MemberJS, 'state' | 'channel'> & {
|
|
85
|
-
state?: MemberState;
|
|
86
|
-
channel?: MemberChannel;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Represents a {@link Member} timestamps
|
|
90
|
-
*
|
|
91
|
-
* @interface
|
|
92
|
-
*/
|
|
93
|
-
export type MemberTimestamp = vonage.MemberTimestampJS;
|
|
94
|
-
/**
|
|
95
|
-
* Represents a page of conversation members
|
|
96
|
-
*
|
|
97
|
-
* @property members The members in the page
|
|
98
|
-
* @property previousCursor The cursor to fetch the previous page
|
|
99
|
-
* @property nextCursor The cursor to fetch the next page
|
|
100
|
-
* @interface
|
|
101
|
-
* @group Chat
|
|
102
|
-
*/
|
|
103
|
-
export type MembersPage = vonage.MembersPageJS & {
|
|
104
|
-
members: Member[];
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Represents an SDK user
|
|
108
|
-
*
|
|
109
|
-
* @property id The user id
|
|
110
|
-
* @property name The user name
|
|
111
|
-
* @property displayName The user display name
|
|
112
|
-
* @property channels The user channels
|
|
113
|
-
* @property timestamp The user timestamp
|
|
114
|
-
* @property imageUrl The user image url
|
|
115
|
-
* @property customData The user custom data
|
|
116
|
-
* @interface
|
|
117
|
-
*/
|
|
118
|
-
export type User = vonage.UserJS;
|
|
119
|
-
/**
|
|
120
|
-
* Represents an {@link User} timestamps
|
|
121
|
-
*
|
|
122
|
-
* @interface
|
|
123
|
-
*/
|
|
124
|
-
export type UserTimestamp = vonage.UserTimestampJS;
|
|
125
|
-
/**
|
|
126
|
-
* The type of a {@link MemberChannel}
|
|
127
|
-
*
|
|
128
|
-
* @enum
|
|
129
|
-
*/
|
|
130
|
-
export declare const MemberChannelType: toEnum<ConversationChannelType>;
|
|
131
|
-
export type MemberChannelType = unionOfValues<typeof MemberChannelType>;
|
|
132
|
-
/**
|
|
133
|
-
* Represents a Member Channel
|
|
134
|
-
*
|
|
135
|
-
* @property type The {@link MemberChannelType}
|
|
136
|
-
* @property from The from {@link Channel}
|
|
137
|
-
* @property to The to {@link Channel}
|
|
138
|
-
* @interface
|
|
139
|
-
*/
|
|
140
|
-
export type MemberChannel = Omit<vonage.MemberChannelJS, 'type'> & {
|
|
141
|
-
type: MemberChannelType;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Represents a Channel.
|
|
145
|
-
* It will hold either an id or a number, depending on the Channel,
|
|
146
|
-
* but never both of them.
|
|
147
|
-
*
|
|
148
|
-
* @property id The Channel id
|
|
149
|
-
* @property number The Channel number
|
|
150
|
-
* @interface
|
|
151
|
-
*/
|
|
152
|
-
export type Channel = vonage.ChannelJS;
|
|
153
|
-
/**
|
|
154
|
-
* Represents all the Channels of a certain {@link User}.
|
|
155
|
-
* For each type of Channel, it will hold an array of {@link Channel}
|
|
156
|
-
*
|
|
157
|
-
* @property app
|
|
158
|
-
* @property phone
|
|
159
|
-
* @property pstn
|
|
160
|
-
* @property sip
|
|
161
|
-
* @property vbc
|
|
162
|
-
* @property websocket
|
|
163
|
-
* @property sms
|
|
164
|
-
* @property mms
|
|
165
|
-
* @property whatsapp
|
|
166
|
-
* @property viber
|
|
167
|
-
* @property messenger
|
|
168
|
-
* @interface
|
|
169
|
-
*/
|
|
170
|
-
export type UserChannels = vonage.UserChannelsJS;
|
|
1
|
+
import vonage from '../utils/vonage';
|
|
2
|
+
import { ConversationChannelType, ConversationState, MemberState, PersistentConversationEvent } from '../kotlin/JsUnions';
|
|
3
|
+
import { toEnum, unionOfValues } from './Enums';
|
|
4
|
+
import { Leg } from '../client';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a conversation
|
|
7
|
+
*
|
|
8
|
+
* @property id The conversation id
|
|
9
|
+
* @property name The conversation name
|
|
10
|
+
* @property timestamp The conversation timestamp
|
|
11
|
+
* @property memberId The user member id in the conversation
|
|
12
|
+
* @property memberState The user member state in the conversation
|
|
13
|
+
* @property displayName The conversation display name
|
|
14
|
+
* @property imageUrl The conversation image url
|
|
15
|
+
* @property state The conversation state
|
|
16
|
+
* @property properties The conversation properties
|
|
17
|
+
* @interface
|
|
18
|
+
*/
|
|
19
|
+
export type Conversation = vonage.ConversationJS & {
|
|
20
|
+
memberState?: MemberState;
|
|
21
|
+
state?: ConversationState;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Represents a {@link Conversation} timestamps
|
|
25
|
+
*
|
|
26
|
+
* @interface
|
|
27
|
+
*/
|
|
28
|
+
export type ConversationTimestamp = vonage.ConversationTimestampJS;
|
|
29
|
+
/**
|
|
30
|
+
* Represents the properties for a {@link Conversation}
|
|
31
|
+
*
|
|
32
|
+
* @property ttl The time-to-live (TTL) for the conversation in seconds.
|
|
33
|
+
* @property customSortKey A string according to which Conversations will be ordered
|
|
34
|
+
* @property customData The Conversation custom data
|
|
35
|
+
* @interface
|
|
36
|
+
*/
|
|
37
|
+
export type ConversationProperties = vonage.ConversationJS.Properties;
|
|
38
|
+
/**
|
|
39
|
+
* Represents a page of conversations
|
|
40
|
+
*
|
|
41
|
+
* @property conversations The conversations in the page
|
|
42
|
+
* @property previousCursor The cursor to fetch the previous page
|
|
43
|
+
* @property nextCursor The cursor to fetch the next page
|
|
44
|
+
* @interface
|
|
45
|
+
* @group Chat
|
|
46
|
+
*/
|
|
47
|
+
export type ConversationsPage = vonage.ConversationsPageJS & {
|
|
48
|
+
conversations: Conversation[];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Represents a page of legs
|
|
52
|
+
*
|
|
53
|
+
* @property legs The legs in the page
|
|
54
|
+
* @property previousCursor The cursor to fetch the previous page
|
|
55
|
+
* @property nextCursor The cursor to fetch the next page
|
|
56
|
+
* @interface
|
|
57
|
+
* @group Voice
|
|
58
|
+
*/
|
|
59
|
+
export type LegsPage = vonage.LegsPageJS & {
|
|
60
|
+
legs: Leg[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Represents a page of conversation events
|
|
64
|
+
*
|
|
65
|
+
* @property events The events in the page
|
|
66
|
+
* @property previousCursor The cursor to fetch the previous page
|
|
67
|
+
* @property nextCursor The cursor to fetch the next page
|
|
68
|
+
* @interface
|
|
69
|
+
* @group Chat
|
|
70
|
+
*/
|
|
71
|
+
export type EventsPage = vonage.EventsPageJS & {
|
|
72
|
+
events: PersistentConversationEvent[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Represents the membership of a user in a conversation
|
|
76
|
+
*
|
|
77
|
+
* @property id The member id
|
|
78
|
+
* @property state The member state
|
|
79
|
+
* @property user The user associated to the member
|
|
80
|
+
* @property channel The member channel
|
|
81
|
+
* @property timestamp The member timestamp
|
|
82
|
+
* @interface
|
|
83
|
+
*/
|
|
84
|
+
export type Member = Omit<vonage.MemberJS, 'state' | 'channel'> & {
|
|
85
|
+
state?: MemberState;
|
|
86
|
+
channel?: MemberChannel;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Represents a {@link Member} timestamps
|
|
90
|
+
*
|
|
91
|
+
* @interface
|
|
92
|
+
*/
|
|
93
|
+
export type MemberTimestamp = vonage.MemberTimestampJS;
|
|
94
|
+
/**
|
|
95
|
+
* Represents a page of conversation members
|
|
96
|
+
*
|
|
97
|
+
* @property members The members in the page
|
|
98
|
+
* @property previousCursor The cursor to fetch the previous page
|
|
99
|
+
* @property nextCursor The cursor to fetch the next page
|
|
100
|
+
* @interface
|
|
101
|
+
* @group Chat
|
|
102
|
+
*/
|
|
103
|
+
export type MembersPage = vonage.MembersPageJS & {
|
|
104
|
+
members: Member[];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Represents an SDK user
|
|
108
|
+
*
|
|
109
|
+
* @property id The user id
|
|
110
|
+
* @property name The user name
|
|
111
|
+
* @property displayName The user display name
|
|
112
|
+
* @property channels The user channels
|
|
113
|
+
* @property timestamp The user timestamp
|
|
114
|
+
* @property imageUrl The user image url
|
|
115
|
+
* @property customData The user custom data
|
|
116
|
+
* @interface
|
|
117
|
+
*/
|
|
118
|
+
export type User = vonage.UserJS;
|
|
119
|
+
/**
|
|
120
|
+
* Represents an {@link User} timestamps
|
|
121
|
+
*
|
|
122
|
+
* @interface
|
|
123
|
+
*/
|
|
124
|
+
export type UserTimestamp = vonage.UserTimestampJS;
|
|
125
|
+
/**
|
|
126
|
+
* The type of a {@link MemberChannel}
|
|
127
|
+
*
|
|
128
|
+
* @enum
|
|
129
|
+
*/
|
|
130
|
+
export declare const MemberChannelType: toEnum<ConversationChannelType>;
|
|
131
|
+
export type MemberChannelType = unionOfValues<typeof MemberChannelType>;
|
|
132
|
+
/**
|
|
133
|
+
* Represents a Member Channel
|
|
134
|
+
*
|
|
135
|
+
* @property type The {@link MemberChannelType}
|
|
136
|
+
* @property from The from {@link Channel}
|
|
137
|
+
* @property to The to {@link Channel}
|
|
138
|
+
* @interface
|
|
139
|
+
*/
|
|
140
|
+
export type MemberChannel = Omit<vonage.MemberChannelJS, 'type'> & {
|
|
141
|
+
type: MemberChannelType;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Represents a Channel.
|
|
145
|
+
* It will hold either an id or a number, depending on the Channel,
|
|
146
|
+
* but never both of them.
|
|
147
|
+
*
|
|
148
|
+
* @property id The Channel id
|
|
149
|
+
* @property number The Channel number
|
|
150
|
+
* @interface
|
|
151
|
+
*/
|
|
152
|
+
export type Channel = vonage.ChannelJS;
|
|
153
|
+
/**
|
|
154
|
+
* Represents all the Channels of a certain {@link User}.
|
|
155
|
+
* For each type of Channel, it will hold an array of {@link Channel}
|
|
156
|
+
*
|
|
157
|
+
* @property app
|
|
158
|
+
* @property phone
|
|
159
|
+
* @property pstn
|
|
160
|
+
* @property sip
|
|
161
|
+
* @property vbc
|
|
162
|
+
* @property websocket
|
|
163
|
+
* @property sms
|
|
164
|
+
* @property mms
|
|
165
|
+
* @property whatsapp
|
|
166
|
+
* @property viber
|
|
167
|
+
* @property messenger
|
|
168
|
+
* @interface
|
|
169
|
+
*/
|
|
170
|
+
export type UserChannels = vonage.UserChannelsJS;
|
package/dist/utils/Enums.d.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
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];
|
|
8
|
-
/**
|
|
9
|
-
* Hangup reasons for a call
|
|
10
|
-
* @enum
|
|
11
|
-
*/
|
|
12
|
-
export declare const HangupReason: toEnum<HangupReasonJS>;
|
|
13
|
-
export type HangupReason = unionOfValues<typeof HangupReason>;
|
|
14
|
-
/**
|
|
15
|
-
* Leg status for a call
|
|
16
|
-
* @enum
|
|
17
|
-
*/
|
|
18
|
-
export declare const LegStatus: toEnum<LegStatusJS>;
|
|
19
|
-
export type LegStatus = unionOfValues<typeof LegStatus>;
|
|
20
|
-
/**
|
|
21
|
-
* Call disconnect reasons
|
|
22
|
-
* @enum
|
|
23
|
-
*/
|
|
24
|
-
export declare const CallDisconnectReason: toEnum<CallDisconnectReasonJS>;
|
|
25
|
-
export type CallDisconnectReason = unionOfValues<typeof CallDisconnectReason>;
|
|
26
|
-
/**
|
|
27
|
-
* Call Invite cancel reasons
|
|
28
|
-
* @enum
|
|
29
|
-
*/
|
|
30
|
-
export declare const CancelReason: toEnum<CancelReasonJS>;
|
|
31
|
-
export type CancelReason = unionOfValues<typeof CancelReason>;
|
|
32
|
-
/**
|
|
33
|
-
* Voice Channel Types
|
|
34
|
-
* @enum
|
|
35
|
-
*/
|
|
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
|
+
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];
|
|
8
|
+
/**
|
|
9
|
+
* Hangup reasons for a call
|
|
10
|
+
* @enum
|
|
11
|
+
*/
|
|
12
|
+
export declare const HangupReason: toEnum<HangupReasonJS>;
|
|
13
|
+
export type HangupReason = unionOfValues<typeof HangupReason>;
|
|
14
|
+
/**
|
|
15
|
+
* Leg status for a call
|
|
16
|
+
* @enum
|
|
17
|
+
*/
|
|
18
|
+
export declare const LegStatus: toEnum<LegStatusJS>;
|
|
19
|
+
export type LegStatus = unionOfValues<typeof LegStatus>;
|
|
20
|
+
/**
|
|
21
|
+
* Call disconnect reasons
|
|
22
|
+
* @enum
|
|
23
|
+
*/
|
|
24
|
+
export declare const CallDisconnectReason: toEnum<CallDisconnectReasonJS>;
|
|
25
|
+
export type CallDisconnectReason = unionOfValues<typeof CallDisconnectReason>;
|
|
26
|
+
/**
|
|
27
|
+
* Call Invite cancel reasons
|
|
28
|
+
* @enum
|
|
29
|
+
*/
|
|
30
|
+
export declare const CancelReason: toEnum<CancelReasonJS>;
|
|
31
|
+
export type CancelReason = unionOfValues<typeof CancelReason>;
|
|
32
|
+
/**
|
|
33
|
+
* Voice Channel Types
|
|
34
|
+
* @enum
|
|
35
|
+
*/
|
|
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,23 +1,23 @@
|
|
|
1
|
-
import { type VonageErrorType } from './Enums';
|
|
2
|
-
import vonage from '../utils/vonage';
|
|
3
|
-
type VonageErrorJS = {
|
|
4
|
-
[key in keyof Omit<vonage.VonageErrorJS, 'type'>]: vonage.VonageErrorJS[key];
|
|
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 {};
|
|
1
|
+
import { type VonageErrorType } from './Enums';
|
|
2
|
+
import vonage from '../utils/vonage';
|
|
3
|
+
type VonageErrorJS = {
|
|
4
|
+
[key in keyof Omit<vonage.VonageErrorJS, 'type'>]: vonage.VonageErrorJS[key];
|
|
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 {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A valid Json property value
|
|
3
|
-
*/
|
|
4
|
-
export type JsonValue = object | null | boolean | string | number;
|
|
5
|
-
/**
|
|
6
|
-
* A Json Object or an array of Json object
|
|
7
|
-
*/
|
|
8
|
-
export type Json = {
|
|
9
|
-
[property: string]: Json | JsonValue;
|
|
10
|
-
} | Json[];
|
|
11
|
-
/**
|
|
12
|
-
* Represents custom data, which can be a JSON object or a JSON-formatted string.
|
|
13
|
-
* There is a 2MB limit on the size of the custom data object.
|
|
14
|
-
*/
|
|
15
|
-
export type CustomData = Json | string;
|
|
1
|
+
/**
|
|
2
|
+
* A valid Json property value
|
|
3
|
+
*/
|
|
4
|
+
export type JsonValue = object | null | boolean | string | number;
|
|
5
|
+
/**
|
|
6
|
+
* A Json Object or an array of Json object
|
|
7
|
+
*/
|
|
8
|
+
export type Json = {
|
|
9
|
+
[property: string]: Json | JsonValue;
|
|
10
|
+
} | Json[];
|
|
11
|
+
/**
|
|
12
|
+
* Represents custom data, which can be a JSON object or a JSON-formatted string.
|
|
13
|
+
* There is a 2MB limit on the size of the custom data object.
|
|
14
|
+
*/
|
|
15
|
+
export type CustomData = Json | string;
|
package/dist/utils/Option.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import vonage from './vonage';
|
|
2
|
-
/**
|
|
3
|
-
* Represents an Either monad for optional properties.
|
|
4
|
-
*
|
|
5
|
-
* It can be also set via the helper functions {@link some} and {@link none}.
|
|
6
|
-
*/
|
|
7
|
-
export type Option<T> = vonage.utils.OptionJS<T>;
|
|
8
|
-
export declare const Option: typeof vonage.utils.OptionJS;
|
|
9
|
-
export declare const mapOption: <T>(value?: T
|
|
10
|
-
/**
|
|
11
|
-
* @param value The wrapped value
|
|
12
|
-
* @returns An {@link Option.Some}
|
|
13
|
-
*/
|
|
14
|
-
export declare const some: <T>(value: T) => Option<T>;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @returns An {@link Option.None}
|
|
18
|
-
*/
|
|
19
|
-
export declare const none: <T>() => Option<T>;
|
|
1
|
+
import vonage from './vonage';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an Either monad for optional properties.
|
|
4
|
+
*
|
|
5
|
+
* It can be also set via the helper functions {@link some} and {@link none}.
|
|
6
|
+
*/
|
|
7
|
+
export type Option<T> = vonage.utils.OptionJS<T>;
|
|
8
|
+
export declare const Option: typeof vonage.utils.OptionJS;
|
|
9
|
+
export declare const mapOption: <T>(value?: T) => Option<T | null>;
|
|
10
|
+
/**
|
|
11
|
+
* @param value The wrapped value
|
|
12
|
+
* @returns An {@link Option.Some}
|
|
13
|
+
*/
|
|
14
|
+
export declare const some: <T>(value: T) => Option<T>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @returns An {@link Option.None}
|
|
18
|
+
*/
|
|
19
|
+
export declare const none: <T>() => Option<T>;
|