@wildix/stream-client 0.0.1 → 0.0.4

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.
@@ -75,6 +75,131 @@ export declare class ValidationException extends __BaseException {
75
75
  */
76
76
  constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
77
77
  }
78
+ /**
79
+ * @public
80
+ */
81
+ export interface TemplateParameter {
82
+ name: string;
83
+ value: string;
84
+ }
85
+ /**
86
+ * @public
87
+ */
88
+ export interface TemplateWithParameters {
89
+ name: string;
90
+ parameters?: (TemplateParameter)[] | undefined;
91
+ }
92
+ /**
93
+ * @public
94
+ */
95
+ export interface ButtonActionHandler {
96
+ /**
97
+ * A unique ID of the action within the message.
98
+ * @public
99
+ */
100
+ id: string;
101
+ }
102
+ /**
103
+ * @public
104
+ */
105
+ export interface ButtonLinkHandler {
106
+ url: string;
107
+ }
108
+ /**
109
+ * @public
110
+ */
111
+ export interface ButtonReplyHandler {
112
+ text?: string | undefined;
113
+ }
114
+ /**
115
+ * @public
116
+ */
117
+ export type ButtonHandler = ButtonHandler.ActionMember | ButtonHandler.LinkMember | ButtonHandler.ReplyMember | ButtonHandler.$UnknownMember;
118
+ /**
119
+ * @public
120
+ */
121
+ export declare namespace ButtonHandler {
122
+ interface LinkMember {
123
+ link: ButtonLinkHandler;
124
+ reply?: never;
125
+ action?: never;
126
+ $unknown?: never;
127
+ }
128
+ interface ReplyMember {
129
+ link?: never;
130
+ reply: ButtonReplyHandler;
131
+ action?: never;
132
+ $unknown?: never;
133
+ }
134
+ interface ActionMember {
135
+ link?: never;
136
+ reply?: never;
137
+ action: ButtonActionHandler;
138
+ $unknown?: never;
139
+ }
140
+ /**
141
+ * @public
142
+ */
143
+ interface $UnknownMember {
144
+ link?: never;
145
+ reply?: never;
146
+ action?: never;
147
+ $unknown: [string, any];
148
+ }
149
+ interface Visitor<T> {
150
+ link: (value: ButtonLinkHandler) => T;
151
+ reply: (value: ButtonReplyHandler) => T;
152
+ action: (value: ButtonActionHandler) => T;
153
+ _: (name: string, value: any) => T;
154
+ }
155
+ const visit: <T>(value: ButtonHandler, visitor: Visitor<T>) => T;
156
+ }
157
+ /**
158
+ * @public
159
+ * @enum
160
+ */
161
+ export declare const ButtonVariant: {
162
+ readonly CONTAINED: "contained";
163
+ readonly OUTLINED: "outlined";
164
+ };
165
+ /**
166
+ * @public
167
+ */
168
+ export type ButtonVariant = typeof ButtonVariant[keyof typeof ButtonVariant];
169
+ /**
170
+ * @public
171
+ */
172
+ export interface ButtonElement {
173
+ text: string;
174
+ handler: ButtonHandler;
175
+ variant?: ButtonVariant | undefined;
176
+ disabled?: boolean | undefined;
177
+ }
178
+ /**
179
+ * @public
180
+ */
181
+ export type ActionElement = ActionElement.ButtonMember | ActionElement.$UnknownMember;
182
+ /**
183
+ * @public
184
+ */
185
+ export declare namespace ActionElement {
186
+ interface ButtonMember {
187
+ button: ButtonElement;
188
+ $unknown?: never;
189
+ }
190
+ /**
191
+ * @public
192
+ */
193
+ interface $UnknownMember {
194
+ button?: never;
195
+ $unknown: [string, any];
196
+ }
197
+ interface Visitor<T> {
198
+ button: (value: ButtonElement) => T;
199
+ _: (name: string, value: any) => T;
200
+ }
201
+ const visit: <T>(value: ActionElement, visitor: Visitor<T>) => T;
202
+ }
78
203
  /**
79
204
  * @public
80
205
  */
@@ -143,6 +268,45 @@ export interface MessageAttachment {
143
268
  */
144
269
  id: string;
145
270
  }
271
+ /**
272
+ * @public
273
+ */
274
+ export interface MessageTemplateConfig {
275
+ whatsapp?: TemplateWithParameters | undefined;
276
+ }
277
+ /**
278
+ * @public
279
+ */
280
+ export type Element = Element.ActionsMember | Element.TemplateMember | Element.$UnknownMember;
281
+ /**
282
+ * @public
283
+ */
284
+ export declare namespace Element {
285
+ interface TemplateMember {
286
+ template: MessageTemplateConfig;
287
+ actions?: never;
288
+ $unknown?: never;
289
+ }
290
+ interface ActionsMember {
291
+ template?: never;
292
+ actions: (ActionElement)[];
293
+ $unknown?: never;
294
+ }
295
+ /**
296
+ * @public
297
+ */
298
+ interface $UnknownMember {
299
+ template?: never;
300
+ actions?: never;
301
+ $unknown: [string, any];
302
+ }
303
+ interface Visitor<T> {
304
+ template: (value: MessageTemplateConfig) => T;
305
+ actions: (value: (ActionElement)[]) => T;
306
+ _: (name: string, value: any) => T;
307
+ }
308
+ const visit: <T>(value: Element, visitor: Visitor<T>) => T;
309
+ }
146
310
  /**
147
311
  * Reference to the original forwarded message.
148
312
  * @public
@@ -161,6 +325,25 @@ export interface MessageForward {
161
325
  */
162
326
  forwardedAt: string;
163
327
  }
328
+ /**
329
+ * @public
330
+ */
331
+ export interface MessageGiphy {
332
+ id: string;
333
+ size: string;
334
+ url: string;
335
+ height: string;
336
+ width: string;
337
+ }
338
+ /**
339
+ * @public
340
+ */
341
+ export interface Reaction {
342
+ type?: string | undefined;
343
+ userId?: string | undefined;
344
+ messageId?: string | undefined;
345
+ user?: string | undefined;
346
+ }
164
347
  /**
165
348
  * @public
166
349
  * @enum
@@ -196,6 +379,34 @@ export interface MessageQuote {
196
379
  */
197
380
  createdAt: string;
198
381
  }
382
+ /**
383
+ * @public
384
+ * @enum
385
+ */
386
+ export declare const MessageSmsStatus: {
387
+ readonly DELIVERED: "delivered";
388
+ readonly ERROR: "error";
389
+ readonly SENT: "sent";
390
+ readonly TRYING: "trying";
391
+ };
392
+ /**
393
+ * @public
394
+ */
395
+ export type MessageSmsStatus = typeof MessageSmsStatus[keyof typeof MessageSmsStatus];
396
+ /**
397
+ * @public
398
+ * @enum
399
+ */
400
+ export declare const MessageWhatsAppStatus: {
401
+ readonly DELIVERED: "delivered";
402
+ readonly ERROR: "error";
403
+ readonly SENT: "sent";
404
+ readonly TRYING: "trying";
405
+ };
406
+ /**
407
+ * @public
408
+ */
409
+ export type MessageWhatsAppStatus = typeof MessageWhatsAppStatus[keyof typeof MessageWhatsAppStatus];
199
410
  /**
200
411
  * Message row returned by listing and lookup endpoints. Deleted messages keep their position with `deletedAt` set and empty body.
201
412
  * @public
@@ -242,6 +453,7 @@ export interface Message {
242
453
  * @public
243
454
  */
244
455
  reactionCounts: Record<string, number>;
456
+ latestReactions?: (Reaction)[] | undefined;
245
457
  /**
246
458
  * True when the message is currently pinned at channel scope.
247
459
  * @public
@@ -297,6 +509,15 @@ export interface Message {
297
509
  * @public
298
510
  */
299
511
  deletedAt?: string | undefined;
512
+ elements?: (Element)[] | undefined;
513
+ whatsapp?: boolean | undefined;
514
+ whatsappStatus?: MessageWhatsAppStatus | undefined;
515
+ sms?: boolean | undefined;
516
+ smsStatus?: MessageSmsStatus | undefined;
517
+ markdown?: boolean | undefined;
518
+ giphy?: MessageGiphy | undefined;
519
+ silent?: boolean | undefined;
520
+ event?: string | undefined;
300
521
  }
301
522
  /**
302
523
  * @public
@@ -330,6 +551,81 @@ export declare class MessageNotFoundException extends __BaseException {
330
551
  */
331
552
  constructor(opts: __ExceptionOptionType<MessageNotFoundException, __BaseException>);
332
553
  }
554
+ /**
555
+ * @public
556
+ * @enum
557
+ */
558
+ export declare const ChannelAccess: {
559
+ readonly PRIVATE: "private";
560
+ readonly PUBLIC: "public";
561
+ };
562
+ /**
563
+ * @public
564
+ */
565
+ export type ChannelAccess = typeof ChannelAccess[keyof typeof ChannelAccess];
566
+ /**
567
+ * @public
568
+ * @enum
569
+ */
570
+ export declare const ChannelContextEventAttendeeStatus: {
571
+ readonly ACCEPTED: "accepted";
572
+ readonly DECLINED: "declined";
573
+ readonly NONE: "none";
574
+ readonly TENTATIVE: "tentative";
575
+ };
576
+ /**
577
+ * @public
578
+ */
579
+ export type ChannelContextEventAttendeeStatus = typeof ChannelContextEventAttendeeStatus[keyof typeof ChannelContextEventAttendeeStatus];
580
+ /**
581
+ * @public
582
+ */
583
+ export interface ChannelContextEventAttendee {
584
+ email: string;
585
+ name?: string | undefined;
586
+ status: ChannelContextEventAttendeeStatus;
587
+ }
588
+ /**
589
+ * @public
590
+ */
591
+ export interface ChannelContextEvent {
592
+ id?: string | undefined;
593
+ owner?: string | undefined;
594
+ start?: string | undefined;
595
+ end?: string | undefined;
596
+ summary?: string | undefined;
597
+ attendees?: (ChannelContextEventAttendee)[] | undefined;
598
+ }
599
+ /**
600
+ * @public
601
+ */
602
+ export interface ChannelContextPushToTalk {
603
+ /**
604
+ * A unique identifier of x-hoppers broadcast conference. If present x-hoppers application will use broadcast and push-to-talk functionality for the channel.
605
+ * @public
606
+ */
607
+ broadcastId?: string | undefined;
608
+ }
609
+ /**
610
+ * @public
611
+ * @enum
612
+ */
613
+ export declare const ChannelContextSource: {
614
+ readonly KITE: "kite";
615
+ };
616
+ /**
617
+ * @public
618
+ */
619
+ export type ChannelContextSource = typeof ChannelContextSource[keyof typeof ChannelContextSource];
620
+ /**
621
+ * @public
622
+ */
623
+ export interface ChannelContext {
624
+ source?: ChannelContextSource | undefined;
625
+ target?: string | undefined;
626
+ events?: (ChannelContextEvent)[] | undefined;
627
+ ptt?: ChannelContextPushToTalk | undefined;
628
+ }
333
629
  /**
334
630
  * @public
335
631
  * @enum
@@ -361,6 +657,17 @@ export declare const ChannelType: {
361
657
  * @public
362
658
  */
363
659
  export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
660
+ /**
661
+ * @public
662
+ * @enum
663
+ */
664
+ export declare const ChannelWhatsAppStatus: {
665
+ readonly CHANNEL_CLOSED: "24h_channel_closed";
666
+ };
667
+ /**
668
+ * @public
669
+ */
670
+ export type ChannelWhatsAppStatus = typeof ChannelWhatsAppStatus[keyof typeof ChannelWhatsAppStatus];
364
671
  /**
365
672
  * @public
366
673
  */
@@ -571,10 +878,20 @@ export interface InboxChannel {
571
878
  */
572
879
  subject?: string | undefined;
573
880
  /**
574
- * Channel picture URL.
881
+ * Channel description.
882
+ * @public
883
+ */
884
+ description?: string | undefined;
885
+ /**
886
+ * Picture URL
575
887
  * @public
576
888
  */
577
889
  picture?: string | undefined;
890
+ /**
891
+ * Picture dominant color represented by a hex value.
892
+ * @public
893
+ */
894
+ pictureColor?: string | undefined;
578
895
  /**
579
896
  * Current number of members.
580
897
  * @public
@@ -594,7 +911,7 @@ export interface InboxChannel {
594
911
  * Timestamp of the last channel mutation.
595
912
  * @public
596
913
  */
597
- updatedAt: string;
914
+ updatedAt?: string | undefined;
598
915
  /**
599
916
  * Channel version. Increments on every channel mutation.
600
917
  * @public
@@ -615,6 +932,29 @@ export interface InboxChannel {
615
932
  * @public
616
933
  */
617
934
  inbox: InboxState;
935
+ access?: ChannelAccess | undefined;
936
+ company?: string | undefined;
937
+ context?: ChannelContext | undefined;
938
+ kite?: boolean | undefined;
939
+ kiteTarget?: string | undefined;
940
+ kiteVariant?: string | undefined;
941
+ kiteAssign?: string | undefined;
942
+ kiteServiceName?: string | undefined;
943
+ kiteDefaultSubject?: string | undefined;
944
+ service?: string | undefined;
945
+ serviceTitle?: string | undefined;
946
+ serviceRecipient?: string | undefined;
947
+ assignee?: string | undefined;
948
+ telephony?: boolean | undefined;
949
+ sms?: boolean | undefined;
950
+ mms?: boolean | undefined;
951
+ whatsapp?: boolean | undefined;
952
+ whatsappStatus?: ChannelWhatsAppStatus | undefined;
953
+ broadcast?: boolean | undefined;
954
+ external?: boolean | undefined;
955
+ autoRecord?: boolean | undefined;
956
+ transcriptionLanguage?: string | undefined;
957
+ wizyGuestViewOnly?: boolean | undefined;
618
958
  }
619
959
  /**
620
960
  * @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/stream-client",
3
3
  "description": "@wildix/stream-client client",
4
- "version": "0.0.1",
4
+ "version": "0.0.4",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",