@vonage/client-sdk 1.4.0-rc.0 → 1.4.0-rc.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/VonageClient.html +4 -4
- package/api_docs/ts/enums/OrderBy.html +2 -0
- package/api_docs/ts/enums/PresentingOrder.html +8 -0
- package/api_docs/ts/interfaces/ConversationProperties.html +3 -3
- package/api_docs/ts/interfaces/CustomConversationEvent.html +3 -3
- package/api_docs/ts/interfaces/GetCallLegsParameters.html +2 -2
- package/api_docs/ts/interfaces/GetConversationEventsParameters.html +2 -2
- package/api_docs/ts/interfaces/GetConversationMembersParameters.html +2 -2
- package/api_docs/ts/interfaces/GetConversationsParameters.html +3 -3
- package/api_docs/ts/interfaces/MessageCustomEventBody.html +2 -2
- package/api_docs/ts/interfaces/User.html +3 -3
- package/api_docs/ts/modules.html +3 -3
- package/dist/client/index.cjs +97 -21
- package/dist/client/index.mjs +97 -21
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +4 -4
- package/dist/utils/RequestParameterModels.d.ts +31 -8
- package/dist/utils/jsEnumToVonageObject.d.ts +10 -0
- package/dist/vonageClientSDK.js +97 -21
- package/dist/vonageClientSDK.min.js +1 -1
- package/dist/vonageClientSDK.min.mjs +1 -1
- package/dist/vonageClientSDK.mjs +97 -21
- package/package.json +1 -1
- package/api_docs/ts/types/OrderBy.html +0 -2
- package/api_docs/ts/types/PresentingOrder.html +0 -2
package/dist/client/index.mjs
CHANGED
|
@@ -20424,7 +20424,7 @@ function requireClientsdkClientcore () {
|
|
|
20424
20424
|
//endregion
|
|
20425
20425
|
function BuildKonfig() {
|
|
20426
20426
|
BuildKonfig_instance = this;
|
|
20427
|
-
this.t17_1 = '1.4.0-rc.
|
|
20427
|
+
this.t17_1 = '1.4.0-rc.1';
|
|
20428
20428
|
}
|
|
20429
20429
|
var BuildKonfig_instance;
|
|
20430
20430
|
function BuildKonfig_getInstance() {
|
|
@@ -61592,7 +61592,7 @@ function requireClientsdkClientcore () {
|
|
|
61592
61592
|
this.conversationId = event.d2s_1;
|
|
61593
61593
|
this.from = map(event.e2s_1);
|
|
61594
61594
|
this.eventType = event.g2s_1;
|
|
61595
|
-
this.body = event.f2s_1;
|
|
61595
|
+
this.body = parseCustomJson(event.f2s_1);
|
|
61596
61596
|
}
|
|
61597
61597
|
protoOf(CustomConversationEventJS).lf = function () {
|
|
61598
61598
|
return this.kind;
|
|
@@ -61791,7 +61791,7 @@ function requireClientsdkClientcore () {
|
|
|
61791
61791
|
return this.body;
|
|
61792
61792
|
};
|
|
61793
61793
|
function MessageCustomEventBody(body) {
|
|
61794
|
-
this.customData = body.g2u_1;
|
|
61794
|
+
this.customData = parseCustomJson(body.g2u_1);
|
|
61795
61795
|
this.deleted = body.h2u_1;
|
|
61796
61796
|
}
|
|
61797
61797
|
protoOf(MessageCustomEventBody).s3g = function () {
|
|
@@ -62233,7 +62233,17 @@ function requireClientsdkClientcore () {
|
|
|
62233
62233
|
var tmp_0 = this;
|
|
62234
62234
|
tmp_0.customSortKey = properties == null ? null : properties.m2q_1;
|
|
62235
62235
|
var tmp_1 = this;
|
|
62236
|
-
|
|
62236
|
+
var tmp1_safe_receiver = properties == null ? null : properties.n2q_1;
|
|
62237
|
+
var tmp_2;
|
|
62238
|
+
if (tmp1_safe_receiver == null) {
|
|
62239
|
+
tmp_2 = null;
|
|
62240
|
+
} else {
|
|
62241
|
+
// Inline function 'kotlin.let' call
|
|
62242
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
62243
|
+
// Inline function 'vonage.Properties.customData.<anonymous>' call
|
|
62244
|
+
tmp_2 = parseCustomJson(tmp1_safe_receiver);
|
|
62245
|
+
}
|
|
62246
|
+
tmp_1.customData = tmp_2;
|
|
62237
62247
|
}
|
|
62238
62248
|
protoOf(Properties).o3h = function () {
|
|
62239
62249
|
return this.ttl;
|
|
@@ -62528,7 +62538,18 @@ function requireClientsdkClientcore () {
|
|
|
62528
62538
|
}
|
|
62529
62539
|
tmp_1.timestamp = tmp_2;
|
|
62530
62540
|
this.imageUrl = user.v2w_1;
|
|
62531
|
-
|
|
62541
|
+
var tmp_3 = this;
|
|
62542
|
+
var tmp0_safe_receiver_1 = user.w2w_1;
|
|
62543
|
+
var tmp_4;
|
|
62544
|
+
if (tmp0_safe_receiver_1 == null) {
|
|
62545
|
+
tmp_4 = null;
|
|
62546
|
+
} else {
|
|
62547
|
+
// Inline function 'kotlin.let' call
|
|
62548
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
62549
|
+
// Inline function 'vonage.UserJS.customData.<anonymous>' call
|
|
62550
|
+
tmp_4 = parseCustomJson(tmp0_safe_receiver_1);
|
|
62551
|
+
}
|
|
62552
|
+
tmp_3.customData = tmp_4;
|
|
62532
62553
|
}
|
|
62533
62554
|
protoOf(UserJS).h20 = function () {
|
|
62534
62555
|
return this.id;
|
|
@@ -67275,6 +67296,10 @@ function requireClientsdkClientcore () {
|
|
|
67275
67296
|
tmp$ret$9 = copyToArray(tmp0_mapTo);
|
|
67276
67297
|
return json(tmp$ret$9.slice());
|
|
67277
67298
|
}
|
|
67299
|
+
function parseCustomJson(value) {
|
|
67300
|
+
var tmp = JSON.parse;
|
|
67301
|
+
return ((!(tmp == null) ? typeof tmp === 'function' : false) ? tmp : THROW_CCE())(value);
|
|
67302
|
+
}
|
|
67278
67303
|
function None() {
|
|
67279
67304
|
OptionJS.call(this);
|
|
67280
67305
|
}
|
|
@@ -68307,8 +68332,28 @@ const VonageErrorType = clientsdkClientcore_jsExports.vonage.VonageErrorTypeJS;
|
|
|
68307
68332
|
const CSErrorCodes = clientsdkClientcore_jsExports.vonage.CSErrorCodesJS;
|
|
68308
68333
|
const SessionErrorCodes = clientsdkClientcore_jsExports.vonage.SessionErrorCodesJS;
|
|
68309
68334
|
|
|
68310
|
-
|
|
68311
|
-
|
|
68335
|
+
/**
|
|
68336
|
+
* The order in which paginated objects are presented.
|
|
68337
|
+
* @beta
|
|
68338
|
+
* @group Chat
|
|
68339
|
+
* @enum
|
|
68340
|
+
* @property ASC Ascending order
|
|
68341
|
+
* @property DESC Descending order
|
|
68342
|
+
*/
|
|
68343
|
+
const PresentingOrder = {
|
|
68344
|
+
ASC: 'asc',
|
|
68345
|
+
DESC: 'desc'
|
|
68346
|
+
};
|
|
68347
|
+
/**
|
|
68348
|
+
* The sorting strategy used for paginated objects.
|
|
68349
|
+
* @beta
|
|
68350
|
+
* @group Chat
|
|
68351
|
+
* @enum
|
|
68352
|
+
*/
|
|
68353
|
+
const OrderBy = {
|
|
68354
|
+
CREATED: 'created',
|
|
68355
|
+
CUSTOM_SORT_KEY: 'custom_sort_key'
|
|
68356
|
+
};
|
|
68312
68357
|
|
|
68313
68358
|
const Option = clientsdkClientcore_jsExports.vonage.utils.OptionJS;
|
|
68314
68359
|
const mapOption = (value) => {
|
|
@@ -68329,6 +68374,19 @@ const some = (value) => new Option.Some(value);
|
|
|
68329
68374
|
*/
|
|
68330
68375
|
const none = () => new Option.None();
|
|
68331
68376
|
|
|
68377
|
+
const isKotlinType = (type, value) => value instanceof type;
|
|
68378
|
+
// converts a js enum value to a kotlin enum value
|
|
68379
|
+
// e.g. jsEnumToVonageObject(vonage.PresentingOrderJS, 'asc') => vonage.PresentingOrderJS.Asc
|
|
68380
|
+
const jsEnumToVonageObject = (kotlinType, value) => {
|
|
68381
|
+
if (isKotlinType(kotlinType, value))
|
|
68382
|
+
return value;
|
|
68383
|
+
const enumVal = kotlinType[value.toUpperCase()];
|
|
68384
|
+
if (!enumVal) {
|
|
68385
|
+
console.warn(`Invalid parameter ${value}`);
|
|
68386
|
+
}
|
|
68387
|
+
return enumVal;
|
|
68388
|
+
};
|
|
68389
|
+
|
|
68332
68390
|
const CancelReason = clientsdkClientcore_jsExports.vonage.CancelReasonJS;
|
|
68333
68391
|
const HangupReason = clientsdkClientcore_jsExports.vonage.HangupReasonJS;
|
|
68334
68392
|
const SessionErrorReason = clientsdkClientcore_jsExports.vonage.SessionErrorReasonJS;
|
|
@@ -68521,7 +68579,12 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68521
68579
|
* @param legId - The Leg Id
|
|
68522
68580
|
*/
|
|
68523
68581
|
getLeg(legId) {
|
|
68524
|
-
|
|
68582
|
+
const _super = Object.create(null, {
|
|
68583
|
+
getLeg: { get: () => super.getLeg }
|
|
68584
|
+
});
|
|
68585
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68586
|
+
return _super.getLeg.call(this, legId);
|
|
68587
|
+
});
|
|
68525
68588
|
}
|
|
68526
68589
|
/**
|
|
68527
68590
|
* Get a Call's Legs
|
|
@@ -68536,7 +68599,16 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68536
68599
|
* @returns a `LegsPage` containing the legs
|
|
68537
68600
|
*/
|
|
68538
68601
|
getCallLegs(callId, parameters) {
|
|
68539
|
-
|
|
68602
|
+
const _super = Object.create(null, {
|
|
68603
|
+
getCallLegs: { get: () => super.getCallLegs }
|
|
68604
|
+
});
|
|
68605
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68606
|
+
if ((parameters && typeof (parameters === null || parameters === void 0 ? void 0 : parameters.order) === 'string') ||
|
|
68607
|
+
(parameters === null || parameters === void 0 ? void 0 : parameters.order) instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS) {
|
|
68608
|
+
return _super.getCallLegs.call(this, callId, Object.assign(Object.assign({}, parameters), { order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, parameters.order), pageSize: parameters.pageSize, cursor: parameters.cursor }));
|
|
68609
|
+
}
|
|
68610
|
+
return (yield _super.getCallLegs.call(this, callId, parameters));
|
|
68611
|
+
});
|
|
68540
68612
|
}
|
|
68541
68613
|
/**
|
|
68542
68614
|
* Make a server call to the Vonage API.
|
|
@@ -68597,20 +68669,20 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68597
68669
|
getConversations: { get: () => super.getConversations }
|
|
68598
68670
|
});
|
|
68599
68671
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68600
|
-
if (orderOrParams &&
|
|
68672
|
+
if (orderOrParams &&
|
|
68673
|
+
(typeof orderOrParams === 'string' ||
|
|
68674
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
68601
68675
|
// Handle the case where individual parameters are provided
|
|
68602
68676
|
return (yield _super.getConversations.call(this, {
|
|
68603
|
-
order: orderOrParams,
|
|
68677
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
68604
68678
|
pageSize,
|
|
68605
68679
|
cursor,
|
|
68606
68680
|
includeCustomData,
|
|
68607
|
-
orderBy
|
|
68681
|
+
orderBy: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.OrderByJS, orderBy)
|
|
68608
68682
|
}));
|
|
68609
68683
|
}
|
|
68610
|
-
|
|
68611
|
-
|
|
68612
|
-
return (yield _super.getConversations.call(this, orderOrParams));
|
|
68613
|
-
}
|
|
68684
|
+
// Handle the case where GetConversationsParameters object is provided
|
|
68685
|
+
return (yield _super.getConversations.call(this, orderOrParams));
|
|
68614
68686
|
});
|
|
68615
68687
|
}
|
|
68616
68688
|
getConversationEvents(id, orderOrParams, pageSize, cursor, eventFilter, includeDeletedEvents = false, startId) {
|
|
@@ -68618,10 +68690,12 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68618
68690
|
getConversationEvents: { get: () => super.getConversationEvents }
|
|
68619
68691
|
});
|
|
68620
68692
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68621
|
-
if (orderOrParams &&
|
|
68693
|
+
if (orderOrParams &&
|
|
68694
|
+
(typeof orderOrParams === 'string' ||
|
|
68695
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
68622
68696
|
// Handle the case where individual parameters are provided
|
|
68623
68697
|
return (yield _super.getConversationEvents.call(this, id, {
|
|
68624
|
-
order: orderOrParams,
|
|
68698
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
68625
68699
|
pageSize,
|
|
68626
68700
|
cursor,
|
|
68627
68701
|
eventFilter,
|
|
@@ -68631,7 +68705,7 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68631
68705
|
}
|
|
68632
68706
|
else {
|
|
68633
68707
|
// Handle the case where GetConversationEventsParameters object is provided
|
|
68634
|
-
return (yield _super.getConversationEvents.call(this, id, orderOrParams));
|
|
68708
|
+
return (yield _super.getConversationEvents.call(this, id, Object.assign(Object.assign({}, orderOrParams), { order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams === null || orderOrParams === void 0 ? void 0 : orderOrParams.order) })));
|
|
68635
68709
|
}
|
|
68636
68710
|
});
|
|
68637
68711
|
}
|
|
@@ -68640,10 +68714,12 @@ class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS
|
|
|
68640
68714
|
getConversationMembers: { get: () => super.getConversationMembers }
|
|
68641
68715
|
});
|
|
68642
68716
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68643
|
-
if (orderOrParams &&
|
|
68717
|
+
if (orderOrParams &&
|
|
68718
|
+
(typeof orderOrParams === 'string' ||
|
|
68719
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
68644
68720
|
// Handle the case where individual parameters are provided
|
|
68645
68721
|
return (yield _super.getConversationMembers.call(this, id, {
|
|
68646
|
-
order: orderOrParams,
|
|
68722
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
68647
68723
|
pageSize,
|
|
68648
68724
|
cursor
|
|
68649
68725
|
}));
|
|
@@ -141,7 +141,7 @@ export declare namespace vonage {
|
|
|
141
141
|
get conversationId(): string;
|
|
142
142
|
get from(): vonage.FromJS;
|
|
143
143
|
get eventType(): Nullable<string>;
|
|
144
|
-
get body():
|
|
144
|
+
get body(): any;
|
|
145
145
|
}
|
|
146
146
|
class EphemeralConversationEventJS implements vonage.NonPersistentConversationEventJS, vonage.JSONBodyEventJS {
|
|
147
147
|
private constructor();
|
|
@@ -210,7 +210,7 @@ export declare namespace vonage {
|
|
|
210
210
|
namespace MessageCustomEventJS {
|
|
211
211
|
class MessageCustomEventBody implements vonage.MessageEventBodyJS {
|
|
212
212
|
private constructor();
|
|
213
|
-
get customData():
|
|
213
|
+
get customData(): any;
|
|
214
214
|
get deleted(): Nullable<string>;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -400,7 +400,7 @@ export declare namespace vonage {
|
|
|
400
400
|
private constructor();
|
|
401
401
|
get ttl(): Nullable<number>;
|
|
402
402
|
get customSortKey(): Nullable<string>;
|
|
403
|
-
get customData():
|
|
403
|
+
get customData(): any;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
const ConversationStateJS: {
|
|
@@ -460,7 +460,7 @@ export declare namespace vonage {
|
|
|
460
460
|
get channels(): Nullable<vonage.UserChannelsJS>;
|
|
461
461
|
get timestamp(): Nullable<vonage.UserTimestampJS>;
|
|
462
462
|
get imageUrl(): Nullable<string>;
|
|
463
|
-
get customData():
|
|
463
|
+
get customData(): any;
|
|
464
464
|
}
|
|
465
465
|
class UserTimestampJS {
|
|
466
466
|
private constructor();
|
|
@@ -32,8 +32,10 @@ export type CreateConversationParameters = Omit<vonage.CreateConversationParamet
|
|
|
32
32
|
* @interface
|
|
33
33
|
* @group Chat
|
|
34
34
|
*/
|
|
35
|
-
export type GetConversationsParameters = Omit<vonage.GetConversationsParametersJS, 'pageSize'> & {
|
|
35
|
+
export type GetConversationsParameters = Omit<vonage.GetConversationsParametersJS, 'pageSize' | 'order' | 'orderBy'> & {
|
|
36
36
|
pageSize?: Nullable<number>;
|
|
37
|
+
order?: Nullable<PresentingOrder>;
|
|
38
|
+
orderBy?: Nullable<OrderBy>;
|
|
37
39
|
};
|
|
38
40
|
/**
|
|
39
41
|
* Parameters object for {@link VonageClient.getConversationEvents}
|
|
@@ -48,9 +50,10 @@ export type GetConversationsParameters = Omit<vonage.GetConversationsParametersJ
|
|
|
48
50
|
* @interface
|
|
49
51
|
* @group Chat
|
|
50
52
|
*/
|
|
51
|
-
export type GetConversationEventsParameters = Omit<vonage.GetConversationEventsParametersJS, 'pageSize' | 'startId'> & {
|
|
53
|
+
export type GetConversationEventsParameters = Omit<vonage.GetConversationEventsParametersJS, 'pageSize' | 'startId' | 'order'> & {
|
|
52
54
|
pageSize?: Nullable<number>;
|
|
53
55
|
startId?: Nullable<number>;
|
|
56
|
+
order?: Nullable<PresentingOrder>;
|
|
54
57
|
};
|
|
55
58
|
/**
|
|
56
59
|
* Parameters object for {@link VonageClient.getConversationMembers}
|
|
@@ -62,8 +65,9 @@ export type GetConversationEventsParameters = Omit<vonage.GetConversationEventsP
|
|
|
62
65
|
* @interface
|
|
63
66
|
* @group Chat
|
|
64
67
|
*/
|
|
65
|
-
export type GetConversationMembersParameters = Omit<vonage.GetConversationMembersParametersJS, 'pageSize'> & {
|
|
68
|
+
export type GetConversationMembersParameters = Omit<vonage.GetConversationMembersParametersJS, 'pageSize' | 'order'> & {
|
|
66
69
|
pageSize?: Nullable<number>;
|
|
70
|
+
order?: Nullable<PresentingOrder>;
|
|
67
71
|
};
|
|
68
72
|
/**
|
|
69
73
|
* Parameters object for {@link VonageClient.getCallLegs}
|
|
@@ -75,7 +79,8 @@ export type GetConversationMembersParameters = Omit<vonage.GetConversationMember
|
|
|
75
79
|
* @interface
|
|
76
80
|
* @group Voice
|
|
77
81
|
*/
|
|
78
|
-
export type GetCallLegsParameters = Omit<vonage.GetCallLegsParametersJS, 'pageSize'> & {
|
|
82
|
+
export type GetCallLegsParameters = Omit<vonage.GetCallLegsParametersJS, 'pageSize' | 'order'> & {
|
|
83
|
+
order?: Nullable<PresentingOrder>;
|
|
79
84
|
pageSize?: Nullable<number>;
|
|
80
85
|
};
|
|
81
86
|
/**
|
|
@@ -109,13 +114,31 @@ export interface UpdateConversationParameters {
|
|
|
109
114
|
* @beta
|
|
110
115
|
* @group Chat
|
|
111
116
|
*/
|
|
112
|
-
export type PresentingOrder = vonage.PresentingOrderJS;
|
|
113
|
-
|
|
117
|
+
export type PresentingOrder = Lowercase<typeof vonage.PresentingOrderJS.prototype.name> | vonage.PresentingOrderJS;
|
|
118
|
+
/**
|
|
119
|
+
* The order in which paginated objects are presented.
|
|
120
|
+
* @beta
|
|
121
|
+
* @group Chat
|
|
122
|
+
* @enum
|
|
123
|
+
* @property ASC Ascending order
|
|
124
|
+
* @property DESC Descending order
|
|
125
|
+
*/
|
|
126
|
+
export declare const PresentingOrder: {
|
|
127
|
+
[prop in typeof vonage.PresentingOrderJS.prototype.name]: Lowercase<prop>;
|
|
128
|
+
};
|
|
114
129
|
/**
|
|
115
130
|
* The sorting strategy used for paginated objects.
|
|
116
131
|
*
|
|
117
132
|
* @beta
|
|
118
133
|
* @group Chat
|
|
119
134
|
*/
|
|
120
|
-
export type OrderBy = vonage.OrderByJS;
|
|
121
|
-
|
|
135
|
+
export type OrderBy = Lowercase<typeof vonage.OrderByJS.prototype.name> | vonage.OrderByJS;
|
|
136
|
+
/**
|
|
137
|
+
* The sorting strategy used for paginated objects.
|
|
138
|
+
* @beta
|
|
139
|
+
* @group Chat
|
|
140
|
+
* @enum
|
|
141
|
+
*/
|
|
142
|
+
export declare const OrderBy: {
|
|
143
|
+
[prop in typeof vonage.OrderByJS.prototype.name]: Lowercase<prop>;
|
|
144
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type KotlinClass = Function & {
|
|
2
|
+
prototype: {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export type KotlinEnum<T extends KotlinClass> = Lowercase<T['prototype']['name']> | {
|
|
7
|
+
[K in keyof T]: T[K extends T['prototype']['name'] ? K : never];
|
|
8
|
+
}[keyof T];
|
|
9
|
+
export type KotlinEnumValue<T extends KotlinClass, V extends KotlinEnum<T> = KotlinEnum<T>> = V extends Lowercase<T['prototype']['name']> ? T[keyof T extends string ? Uppercase<V> : never] : V;
|
|
10
|
+
export declare const jsEnumToVonageObject: <K extends KotlinClass, T extends KotlinEnum<K>, R extends KotlinEnumValue<K, T>>(kotlinType: K, value: T) => R;
|
package/dist/vonageClientSDK.js
CHANGED
|
@@ -19960,7 +19960,7 @@
|
|
|
19960
19960
|
//endregion
|
|
19961
19961
|
function BuildKonfig() {
|
|
19962
19962
|
BuildKonfig_instance = this;
|
|
19963
|
-
this.t17_1 = '1.4.0-rc.
|
|
19963
|
+
this.t17_1 = '1.4.0-rc.1';
|
|
19964
19964
|
}
|
|
19965
19965
|
var BuildKonfig_instance;
|
|
19966
19966
|
function BuildKonfig_getInstance() {
|
|
@@ -60394,7 +60394,7 @@
|
|
|
60394
60394
|
this.conversationId = event.d2s_1;
|
|
60395
60395
|
this.from = map(event.e2s_1);
|
|
60396
60396
|
this.eventType = event.g2s_1;
|
|
60397
|
-
this.body = event.f2s_1;
|
|
60397
|
+
this.body = parseCustomJson(event.f2s_1);
|
|
60398
60398
|
}
|
|
60399
60399
|
protoOf(CustomConversationEventJS).lf = function () {
|
|
60400
60400
|
return this.kind;
|
|
@@ -60593,7 +60593,7 @@
|
|
|
60593
60593
|
return this.body;
|
|
60594
60594
|
};
|
|
60595
60595
|
function MessageCustomEventBody(body) {
|
|
60596
|
-
this.customData = body.g2u_1;
|
|
60596
|
+
this.customData = parseCustomJson(body.g2u_1);
|
|
60597
60597
|
this.deleted = body.h2u_1;
|
|
60598
60598
|
}
|
|
60599
60599
|
protoOf(MessageCustomEventBody).s3g = function () {
|
|
@@ -61035,7 +61035,17 @@
|
|
|
61035
61035
|
var tmp_0 = this;
|
|
61036
61036
|
tmp_0.customSortKey = properties == null ? null : properties.m2q_1;
|
|
61037
61037
|
var tmp_1 = this;
|
|
61038
|
-
|
|
61038
|
+
var tmp1_safe_receiver = properties == null ? null : properties.n2q_1;
|
|
61039
|
+
var tmp_2;
|
|
61040
|
+
if (tmp1_safe_receiver == null) {
|
|
61041
|
+
tmp_2 = null;
|
|
61042
|
+
} else {
|
|
61043
|
+
// Inline function 'kotlin.let' call
|
|
61044
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
61045
|
+
// Inline function 'vonage.Properties.customData.<anonymous>' call
|
|
61046
|
+
tmp_2 = parseCustomJson(tmp1_safe_receiver);
|
|
61047
|
+
}
|
|
61048
|
+
tmp_1.customData = tmp_2;
|
|
61039
61049
|
}
|
|
61040
61050
|
protoOf(Properties).o3h = function () {
|
|
61041
61051
|
return this.ttl;
|
|
@@ -61330,7 +61340,18 @@
|
|
|
61330
61340
|
}
|
|
61331
61341
|
tmp_1.timestamp = tmp_2;
|
|
61332
61342
|
this.imageUrl = user.v2w_1;
|
|
61333
|
-
|
|
61343
|
+
var tmp_3 = this;
|
|
61344
|
+
var tmp0_safe_receiver_1 = user.w2w_1;
|
|
61345
|
+
var tmp_4;
|
|
61346
|
+
if (tmp0_safe_receiver_1 == null) {
|
|
61347
|
+
tmp_4 = null;
|
|
61348
|
+
} else {
|
|
61349
|
+
// Inline function 'kotlin.let' call
|
|
61350
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
61351
|
+
// Inline function 'vonage.UserJS.customData.<anonymous>' call
|
|
61352
|
+
tmp_4 = parseCustomJson(tmp0_safe_receiver_1);
|
|
61353
|
+
}
|
|
61354
|
+
tmp_3.customData = tmp_4;
|
|
61334
61355
|
}
|
|
61335
61356
|
protoOf(UserJS).h20 = function () {
|
|
61336
61357
|
return this.id;
|
|
@@ -65926,6 +65947,10 @@
|
|
|
65926
65947
|
tmp$ret$9 = copyToArray(tmp0_mapTo);
|
|
65927
65948
|
return json(tmp$ret$9.slice());
|
|
65928
65949
|
}
|
|
65950
|
+
function parseCustomJson(value) {
|
|
65951
|
+
var tmp = JSON.parse;
|
|
65952
|
+
return ((!(tmp == null) ? typeof tmp === 'function' : false) ? tmp : THROW_CCE())(value);
|
|
65953
|
+
}
|
|
65929
65954
|
function None() {
|
|
65930
65955
|
OptionJS.call(this);
|
|
65931
65956
|
}
|
|
@@ -78214,8 +78239,28 @@
|
|
|
78214
78239
|
const CSErrorCodes = clientsdkClientcore_jsExports.vonage.CSErrorCodesJS;
|
|
78215
78240
|
const SessionErrorCodes = clientsdkClientcore_jsExports.vonage.SessionErrorCodesJS;
|
|
78216
78241
|
|
|
78217
|
-
|
|
78218
|
-
|
|
78242
|
+
/**
|
|
78243
|
+
* The order in which paginated objects are presented.
|
|
78244
|
+
* @beta
|
|
78245
|
+
* @group Chat
|
|
78246
|
+
* @enum
|
|
78247
|
+
* @property ASC Ascending order
|
|
78248
|
+
* @property DESC Descending order
|
|
78249
|
+
*/
|
|
78250
|
+
const PresentingOrder = {
|
|
78251
|
+
ASC: 'asc',
|
|
78252
|
+
DESC: 'desc'
|
|
78253
|
+
};
|
|
78254
|
+
/**
|
|
78255
|
+
* The sorting strategy used for paginated objects.
|
|
78256
|
+
* @beta
|
|
78257
|
+
* @group Chat
|
|
78258
|
+
* @enum
|
|
78259
|
+
*/
|
|
78260
|
+
const OrderBy = {
|
|
78261
|
+
CREATED: 'created',
|
|
78262
|
+
CUSTOM_SORT_KEY: 'custom_sort_key'
|
|
78263
|
+
};
|
|
78219
78264
|
|
|
78220
78265
|
const Option = clientsdkClientcore_jsExports.vonage.utils.OptionJS;
|
|
78221
78266
|
const mapOption = (value) => {
|
|
@@ -78236,6 +78281,19 @@
|
|
|
78236
78281
|
*/
|
|
78237
78282
|
const none = () => new Option.None();
|
|
78238
78283
|
|
|
78284
|
+
const isKotlinType = (type, value) => value instanceof type;
|
|
78285
|
+
// converts a js enum value to a kotlin enum value
|
|
78286
|
+
// e.g. jsEnumToVonageObject(vonage.PresentingOrderJS, 'asc') => vonage.PresentingOrderJS.Asc
|
|
78287
|
+
const jsEnumToVonageObject = (kotlinType, value) => {
|
|
78288
|
+
if (isKotlinType(kotlinType, value))
|
|
78289
|
+
return value;
|
|
78290
|
+
const enumVal = kotlinType[value.toUpperCase()];
|
|
78291
|
+
if (!enumVal) {
|
|
78292
|
+
console.warn(`Invalid parameter ${value}`);
|
|
78293
|
+
}
|
|
78294
|
+
return enumVal;
|
|
78295
|
+
};
|
|
78296
|
+
|
|
78239
78297
|
const CancelReason = clientsdkClientcore_jsExports.vonage.CancelReasonJS;
|
|
78240
78298
|
const HangupReason = clientsdkClientcore_jsExports.vonage.HangupReasonJS;
|
|
78241
78299
|
const SessionErrorReason = clientsdkClientcore_jsExports.vonage.SessionErrorReasonJS;
|
|
@@ -78428,7 +78486,12 @@
|
|
|
78428
78486
|
* @param legId - The Leg Id
|
|
78429
78487
|
*/
|
|
78430
78488
|
getLeg(legId) {
|
|
78431
|
-
|
|
78489
|
+
const _super = Object.create(null, {
|
|
78490
|
+
getLeg: { get: () => super.getLeg }
|
|
78491
|
+
});
|
|
78492
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78493
|
+
return _super.getLeg.call(this, legId);
|
|
78494
|
+
});
|
|
78432
78495
|
}
|
|
78433
78496
|
/**
|
|
78434
78497
|
* Get a Call's Legs
|
|
@@ -78443,7 +78506,16 @@
|
|
|
78443
78506
|
* @returns a `LegsPage` containing the legs
|
|
78444
78507
|
*/
|
|
78445
78508
|
getCallLegs(callId, parameters) {
|
|
78446
|
-
|
|
78509
|
+
const _super = Object.create(null, {
|
|
78510
|
+
getCallLegs: { get: () => super.getCallLegs }
|
|
78511
|
+
});
|
|
78512
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78513
|
+
if ((parameters && typeof (parameters === null || parameters === void 0 ? void 0 : parameters.order) === 'string') ||
|
|
78514
|
+
(parameters === null || parameters === void 0 ? void 0 : parameters.order) instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS) {
|
|
78515
|
+
return _super.getCallLegs.call(this, callId, Object.assign(Object.assign({}, parameters), { order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, parameters.order), pageSize: parameters.pageSize, cursor: parameters.cursor }));
|
|
78516
|
+
}
|
|
78517
|
+
return (yield _super.getCallLegs.call(this, callId, parameters));
|
|
78518
|
+
});
|
|
78447
78519
|
}
|
|
78448
78520
|
/**
|
|
78449
78521
|
* Make a server call to the Vonage API.
|
|
@@ -78504,20 +78576,20 @@
|
|
|
78504
78576
|
getConversations: { get: () => super.getConversations }
|
|
78505
78577
|
});
|
|
78506
78578
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78507
|
-
if (orderOrParams &&
|
|
78579
|
+
if (orderOrParams &&
|
|
78580
|
+
(typeof orderOrParams === 'string' ||
|
|
78581
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
78508
78582
|
// Handle the case where individual parameters are provided
|
|
78509
78583
|
return (yield _super.getConversations.call(this, {
|
|
78510
|
-
order: orderOrParams,
|
|
78584
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
78511
78585
|
pageSize,
|
|
78512
78586
|
cursor,
|
|
78513
78587
|
includeCustomData,
|
|
78514
|
-
orderBy
|
|
78588
|
+
orderBy: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.OrderByJS, orderBy)
|
|
78515
78589
|
}));
|
|
78516
78590
|
}
|
|
78517
|
-
|
|
78518
|
-
|
|
78519
|
-
return (yield _super.getConversations.call(this, orderOrParams));
|
|
78520
|
-
}
|
|
78591
|
+
// Handle the case where GetConversationsParameters object is provided
|
|
78592
|
+
return (yield _super.getConversations.call(this, orderOrParams));
|
|
78521
78593
|
});
|
|
78522
78594
|
}
|
|
78523
78595
|
getConversationEvents(id, orderOrParams, pageSize, cursor, eventFilter, includeDeletedEvents = false, startId) {
|
|
@@ -78525,10 +78597,12 @@
|
|
|
78525
78597
|
getConversationEvents: { get: () => super.getConversationEvents }
|
|
78526
78598
|
});
|
|
78527
78599
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78528
|
-
if (orderOrParams &&
|
|
78600
|
+
if (orderOrParams &&
|
|
78601
|
+
(typeof orderOrParams === 'string' ||
|
|
78602
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
78529
78603
|
// Handle the case where individual parameters are provided
|
|
78530
78604
|
return (yield _super.getConversationEvents.call(this, id, {
|
|
78531
|
-
order: orderOrParams,
|
|
78605
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
78532
78606
|
pageSize,
|
|
78533
78607
|
cursor,
|
|
78534
78608
|
eventFilter,
|
|
@@ -78538,7 +78612,7 @@
|
|
|
78538
78612
|
}
|
|
78539
78613
|
else {
|
|
78540
78614
|
// Handle the case where GetConversationEventsParameters object is provided
|
|
78541
|
-
return (yield _super.getConversationEvents.call(this, id, orderOrParams));
|
|
78615
|
+
return (yield _super.getConversationEvents.call(this, id, Object.assign(Object.assign({}, orderOrParams), { order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams === null || orderOrParams === void 0 ? void 0 : orderOrParams.order) })));
|
|
78542
78616
|
}
|
|
78543
78617
|
});
|
|
78544
78618
|
}
|
|
@@ -78547,10 +78621,12 @@
|
|
|
78547
78621
|
getConversationMembers: { get: () => super.getConversationMembers }
|
|
78548
78622
|
});
|
|
78549
78623
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78550
|
-
if (orderOrParams &&
|
|
78624
|
+
if (orderOrParams &&
|
|
78625
|
+
(typeof orderOrParams === 'string' ||
|
|
78626
|
+
orderOrParams instanceof clientsdkClientcore_jsExports.vonage.PresentingOrderJS)) {
|
|
78551
78627
|
// Handle the case where individual parameters are provided
|
|
78552
78628
|
return (yield _super.getConversationMembers.call(this, id, {
|
|
78553
|
-
order: orderOrParams,
|
|
78629
|
+
order: jsEnumToVonageObject(clientsdkClientcore_jsExports.vonage.PresentingOrderJS, orderOrParams),
|
|
78554
78630
|
pageSize,
|
|
78555
78631
|
cursor
|
|
78556
78632
|
}));
|