@vonage/client-sdk 0.2.1-beta.2 → 0.3.0-alpha.2

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.
@@ -1,8 +1,8 @@
1
1
  import './kotlin/clientsdk-clientcore_js';
2
2
  declare module './kotlin/clientsdk-clientcore_js' {
3
3
  namespace vonage {
4
- interface VoiceCallJS {
5
- say(params: Partial<CallSayParams> & {
4
+ interface CombinedClientJS {
5
+ say(callId: string, params: Partial<CallSayParams> & {
6
6
  text: string;
7
7
  }): Promise<unknown>;
8
8
  }
@@ -3,17 +3,18 @@ declare const __doNotImplementIt: unique symbol
3
3
  type __doNotImplementIt = typeof __doNotImplementIt
4
4
  export namespace vonage {
5
5
  interface CombinedEvents extends vonage.VoiceEvents, vonage.ChatEvents {
6
- callInvite(callId: string, invite: vonage.VoiceInviteJS): void;
6
+ callInvite(callId: string, from: string, channelType: string): void;
7
7
  callInviteCancel(callId: string, reason: vonage.CancelReasonJS): void;
8
8
  callTransfer(callId: string, conversationId: string): void;
9
9
  mute(callId: string, legId: string, isMuted: boolean): void;
10
10
  earmuff(callId: string, legId: string, earmuffStatus: boolean): void;
11
11
  dtmf(callId: string, legId: string, digits: string): void;
12
- callHangup(callId: string, callQuality: vonage.RTCQualityJS): void;
12
+ callHangup(callId: string, callQuality: vonage.RTCQualityJS, isRemote: boolean): void;
13
13
  legStatusUpdate(callId: string, legId: string, status: string): void;
14
14
  reconnecting(): void;
15
15
  reconnection(): void;
16
16
  sessionError(reason: vonage.SessionErrorReasonJS): void;
17
+ conversationEvent(event: vonage.ConversationEventJS): void;
17
18
  }
18
19
  }
19
20
  export namespace vonage {
@@ -30,6 +31,9 @@ export namespace vonage {
30
31
  deleteConversation(cid: string): Promise<any>;
31
32
  getConversations(order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.ConversationsPageJS>;
32
33
  getConversationMembers(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.MembersPageJS>;
34
+ getConversationEvents(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.EventsPageJS>;
35
+ getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
36
+ sendTextMessage(cid: string, text: string): Promise<string>;
33
37
  setConfig(config: vonage.CoreClientConfigJS): void;
34
38
  createSession(token: string, sessionId: Nullable<string>): Promise<string>;
35
39
  deleteSession(): Promise<any>;
@@ -37,12 +41,122 @@ export namespace vonage {
37
41
  getConversation(conversationId: string): Promise<vonage.ConversationJS>;
38
42
  getUser(userIdOrName: string): Promise<vonage.UserJS>;
39
43
  getPeerConnection(id: string): any;
40
- serverCall(context: Nullable<Json>): Promise<vonage.VoiceCallJS>;
41
- reconnectCall(legId: string): Promise<vonage.VoiceCallJS>;
44
+ serverCall(context: Nullable<Json>): Promise<string>;
45
+ reconnectCall(legId: string): Promise<any>;
42
46
  getLeg(legId: string): Promise<vonage.LegJS>;
47
+ answerCall(callId: string): Promise<any>;
48
+ rejectCall(callId: string): Promise<any>;
49
+ hangup(callId: string, reasonText: Nullable<string>, reasonCode: Nullable<string>): Promise<any>;
50
+ hangup$default(callId: string, reasonText: Nullable<string>, reasonCode: Nullable<string>, $mask0: number, $handler: Nullable<any>): Promise<any>;
51
+ say(callId: string, params: vonage.CallSayParams): Promise<any>;
52
+ mute(callId: string): Promise<any>;
53
+ unmute(callId: string): Promise<any>;
54
+ enableEarmuff(callId: string): Promise<any>;
55
+ disableEarmuff(callId: string): Promise<any>;
56
+ sendDTMF(callId: string, digits: string): Promise<any>;
43
57
  readonly __doNotUseIt: __doNotImplementIt;
44
58
  }
45
59
  }
60
+ export namespace vonage {
61
+ class EventsPageJS {
62
+ private constructor();
63
+ get events(): Array<vonage.ConversationEventJS>;
64
+ get previousCursor(): Nullable<string>;
65
+ get nextCursor(): Nullable<string>;
66
+ }
67
+ interface ConversationEventJS {
68
+ readonly timestamp: string;
69
+ readonly conversationId: string;
70
+ readonly from: string;
71
+ readonly __doNotUseIt: __doNotImplementIt;
72
+ }
73
+ class MemberInvitedEventJS implements vonage.ConversationEventJS {
74
+ private constructor();
75
+ get id(): number;
76
+ get timestamp(): string;
77
+ get conversationId(): string;
78
+ get from(): string;
79
+ get body(): vonage.MemberInvitedEventJS.Body;
80
+ readonly __doNotUseIt: __doNotImplementIt;
81
+ }
82
+ namespace MemberInvitedEventJS {
83
+ class Body {
84
+ private constructor();
85
+ get invitee(): string;
86
+ get invitedBy(): Nullable<string>;
87
+ }
88
+ }
89
+ class MemberJoinedEventJS implements vonage.ConversationEventJS {
90
+ private constructor();
91
+ get id(): number;
92
+ get timestamp(): string;
93
+ get conversationId(): string;
94
+ get from(): string;
95
+ get body(): vonage.MemberJoinedEventJS.Body;
96
+ readonly __doNotUseIt: __doNotImplementIt;
97
+ }
98
+ namespace MemberJoinedEventJS {
99
+ class Body {
100
+ private constructor();
101
+ get username(): string;
102
+ }
103
+ }
104
+ class MemberLeftEventJS implements vonage.ConversationEventJS {
105
+ private constructor();
106
+ get id(): number;
107
+ get timestamp(): string;
108
+ get conversationId(): string;
109
+ get from(): string;
110
+ get body(): vonage.MemberLeftEventJS.Body;
111
+ readonly __doNotUseIt: __doNotImplementIt;
112
+ }
113
+ namespace MemberLeftEventJS {
114
+ class Body {
115
+ private constructor();
116
+ get username(): string;
117
+ }
118
+ }
119
+ class UnknownEventJS implements vonage.ConversationEventJS {
120
+ private constructor();
121
+ get type(): string;
122
+ get id(): Nullable<number>;
123
+ get timestamp(): string;
124
+ get conversationId(): string;
125
+ get from(): string;
126
+ readonly __doNotUseIt: __doNotImplementIt;
127
+ }
128
+ }
129
+ export namespace vonage {
130
+ interface MessageEventJS extends vonage.ConversationEventJS {
131
+ readonly id: number;
132
+ readonly body: vonage.MessageEventBodyJS;
133
+ readonly timestamp: string;
134
+ readonly conversationId: string;
135
+ readonly from: string;
136
+ readonly __doNotUseIt: __doNotImplementIt;
137
+ }
138
+ interface MessageEventBodyJS {
139
+ readonly sender: string;
140
+ readonly __doNotUseIt: __doNotImplementIt;
141
+ }
142
+ class TextMessageEventJS implements vonage.MessageEventJS {
143
+ private constructor();
144
+ get id(): number;
145
+ get timestamp(): string;
146
+ get conversationId(): string;
147
+ get from(): string;
148
+ get body(): vonage.TextMessageEventJS.Body;
149
+ readonly __doNotUseIt: __doNotImplementIt;
150
+ }
151
+ namespace TextMessageEventJS {
152
+ class Body implements vonage.MessageEventBodyJS {
153
+ private constructor();
154
+ get sender(): string;
155
+ get text(): string;
156
+ readonly __doNotUseIt: __doNotImplementIt;
157
+ }
158
+ }
159
+ }
46
160
  export namespace vonage {
47
161
  abstract class PresentingOrderJS {
48
162
  private constructor();
@@ -324,6 +438,7 @@ export namespace vonage {
324
438
  }
325
439
  export namespace vonage {
326
440
  interface ChatEvents extends vonage.CoreClientEvents {
441
+ conversationEvent(event: vonage.ConversationEventJS): void;
327
442
  reconnecting(): void;
328
443
  reconnection(): void;
329
444
  sessionError(reason: vonage.SessionErrorReasonJS): void;
@@ -339,6 +454,9 @@ export namespace vonage {
339
454
  deleteConversation(cid: string): Promise<any>;
340
455
  getConversations(order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.ConversationsPageJS>;
341
456
  getConversationMembers(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.MembersPageJS>;
457
+ getConversationEvents(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.EventsPageJS>;
458
+ getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
459
+ sendTextMessage(cid: string, text: string): Promise<string>;
342
460
  setConfig(config: vonage.CoreClientConfigJS): void;
343
461
  createSession(token: string, sessionId: Nullable<string>): Promise<string>;
344
462
  deleteSession(): Promise<any>;
@@ -455,13 +573,13 @@ export namespace vonage {
455
573
  }
456
574
  export namespace vonage {
457
575
  interface VoiceEvents extends vonage.CoreClientEvents {
458
- callInvite(callId: string, invite: vonage.VoiceInviteJS): void;
576
+ callInvite(callId: string, from: string, channelType: string): void;
459
577
  callInviteCancel(callId: string, reason: vonage.CancelReasonJS): void;
460
578
  callTransfer(callId: string, conversationId: string): void;
461
579
  mute(callId: string, legId: string, isMuted: boolean): void;
462
580
  earmuff(callId: string, legId: string, earmuffStatus: boolean): void;
463
581
  dtmf(callId: string, legId: string, digits: string): void;
464
- callHangup(callId: string, callQuality: vonage.RTCQualityJS): void;
582
+ callHangup(callId: string, callQuality: vonage.RTCQualityJS, isRemote: boolean): void;
465
583
  legStatusUpdate(callId: string, legId: string, status: string): void;
466
584
  reconnecting(): void;
467
585
  reconnection(): void;
@@ -481,9 +599,18 @@ export namespace vonage {
481
599
  readonly media: vonage.MediaClientJS;
482
600
  readonly core: any/* com.vonage.clientcore.core.CoreClientWithMedia */;
483
601
  getPeerConnection(id: string): any;
484
- serverCall(context: Nullable<Json>): Promise<vonage.VoiceCallJS>;
485
- reconnectCall(legId: string): Promise<vonage.VoiceCallJS>;
602
+ serverCall(context: Nullable<Json>): Promise<string>;
603
+ reconnectCall(legId: string): Promise<any>;
486
604
  getLeg(legId: string): Promise<vonage.LegJS>;
605
+ answerCall(callId: string): Promise<any>;
606
+ rejectCall(callId: string): Promise<any>;
607
+ hangup(callId: string, reasonText?: Nullable<string>, reasonCode?: Nullable<string>): Promise<any>;
608
+ say(callId: string, params: vonage.CallSayParams): Promise<any>;
609
+ mute(callId: string): Promise<any>;
610
+ unmute(callId: string): Promise<any>;
611
+ enableEarmuff(callId: string): Promise<any>;
612
+ disableEarmuff(callId: string): Promise<any>;
613
+ sendDTMF(callId: string, digits: string): Promise<any>;
487
614
  setConfig(config: vonage.CoreClientConfigJS): void;
488
615
  createSession(token: string, sessionId: Nullable<string>): Promise<string>;
489
616
  deleteSession(): Promise<any>;
@@ -492,17 +619,6 @@ export namespace vonage {
492
619
  getUser(userIdOrName: string): Promise<vonage.UserJS>;
493
620
  readonly __doNotUseIt: __doNotImplementIt;
494
621
  }
495
- class VoiceCallJS {
496
- private constructor();
497
- get id(): string;
498
- hangup(reasonText?: Nullable<string>, reasonCode?: Nullable<string>): Promise<any>;
499
- say(params: vonage.CallSayParams): Promise<any>;
500
- mute(): Promise<any>;
501
- unmute(): Promise<any>;
502
- enableEarmuff(): Promise<any>;
503
- disableEarmuff(): Promise<any>;
504
- sendDTMF(digits: string): Promise<any>;
505
- }
506
622
  class VoiceInviteFromInfoJS {
507
623
  constructor(id: Nullable<string>, type: string);
508
624
  get id(): Nullable<string>;
@@ -514,13 +630,6 @@ export namespace vonage {
514
630
  hashCode(): number;
515
631
  equals(other: Nullable<any>): boolean;
516
632
  }
517
- class VoiceInviteJS {
518
- private constructor();
519
- get from(): string;
520
- get type(): string;
521
- answerCall(): Promise<vonage.VoiceCallJS>;
522
- rejectCall(): Promise<any>;
523
- }
524
633
  }
525
634
  export namespace vonage {
526
635
  interface HttpClientJS {
@@ -0,0 +1,11 @@
1
+ import vonage from '../utils/vonage';
2
+ export type EventsPage = vonage.EventsPageJS;
3
+ export type ConversationEvent = vonage.ConversationEventJS;
4
+ export type MemberInvitedEvent = vonage.MemberInvitedEventJS;
5
+ export declare const MemberInvitedEvent: typeof vonage.MemberInvitedEventJS;
6
+ export type MemberJoinedEvent = vonage.MemberJoinedEventJS;
7
+ export declare const MemberJoinedEvent: typeof vonage.MemberJoinedEventJS;
8
+ export type MemberLeftEvent = vonage.MemberLeftEventJS;
9
+ export declare const MemberLeftEvent: typeof vonage.MemberLeftEventJS;
10
+ export type UnknownEvent = vonage.UnknownEventJS;
11
+ export declare const UnknownEvent: typeof vonage.UnknownEventJS;
@@ -0,0 +1,3 @@
1
+ import vonage from '../utils/vonage';
2
+ export type TextMessageEvent = vonage.TextMessageEventJS;
3
+ export declare const TextMessageEvent: typeof vonage.TextMessageEventJS;
@@ -1,4 +1,6 @@
1
1
  export { ClientConfig, ConfigRegion } from './ClientConfig';
2
2
  export { LoggingLevel } from './logging';
3
3
  export * from './ConversationModels';
4
+ export * from './ConversationEventModels';
5
+ export * from './ConversationMessageModels';
4
6
  export * from './ErrorModels';