@epilot/message-client 0.0.2 → 1.0.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/dist/openapi.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable */
2
2
  import {
3
3
  OpenAPIClient,
4
4
  Parameters,
@@ -27,98 +27,15 @@ declare namespace Components {
27
27
  * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
28
28
  *
29
29
  */
30
- send_status?: "SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE";
30
+ send_status?: "SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR";
31
31
  /**
32
- * Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT or BOUNCE.\
32
+ * Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\
33
33
  * JSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>
34
34
  *
35
35
  */
36
36
  send_error?: {
37
37
  };
38
38
  }
39
- export interface Attachment {
40
- /**
41
- * Attachment ID
42
- * example:
43
- * f820ce3b-07b0-45ae-bcc6-babb2f53f79f
44
- */
45
- cid?: string;
46
- /**
47
- * File name
48
- * example:
49
- * Produktinformationen_epilot360_Double_Opt_in.pdf
50
- */
51
- filename: string;
52
- /**
53
- * File size in bytes
54
- * example:
55
- * 451349
56
- */
57
- size: number;
58
- /**
59
- * Content type
60
- * example:
61
- * application/pdf
62
- */
63
- content_type: string;
64
- /**
65
- * URL to download the attachment.
66
- * example:
67
- * https://go.epilot.cloud/attachments/3e7c616a-3e89-4f92-b4c5-ea5ab140e3dd/Produktinformationen_epilot360_Double_Opt_in.pdf
68
- */
69
- url: string;
70
- /**
71
- * S3 bucket where file is stored
72
- * example:
73
- * 893487340562-message-attachment
74
- */
75
- bucket: string;
76
- /**
77
- * S3 object apiKey
78
- * example:
79
- * attachments/3e7c616a-3e89-4f92-b4c5-ea5ab140e3dd/Produktinformationen_epilot360_Double_Opt_in.pdf
80
- */
81
- object_key: string;
82
- /**
83
- * If true then this attachment should not be offered for download (at least not in the main attachments list).\
84
- * The usecase is CID embedded image (aka inline image).
85
- *
86
- */
87
- inline?: boolean;
88
- /**
89
- * If true then this attachment is sent via link. The link is already inserted to email body by API caller. In this case, service doesn't process this attachment.
90
- */
91
- send_as_link?: boolean;
92
- /**
93
- * If true then this attachment is copied to the message and replaces corresponding one. The new attachment has different `cid`, `url`, `object_key`. This property supports for forwarding message.\
94
- * If both `send_as_link` and `copy_to_message` are provided, `copy_to_message` is discarded.
95
- *
96
- */
97
- copy_to_message?: boolean;
98
- }
99
- export interface AttachmentUploadUrl {
100
- /**
101
- * URL to download the attachment. This URL is not accessible until attachment is uploaded successfully.
102
- * example:
103
- * https://go.epilot.cloud/attachments/3e7c616a-3e89-4f92-b4c5-ea5ab140e3dd/Produktinformationen_epilot360_Double_Opt_in.pdf
104
- */
105
- download_url: string;
106
- upload_url: {
107
- /**
108
- * URL to upload the attachment
109
- * example:
110
- * https://s3.eu-central-1.amazonaws.com/893487340562-message-attachment
111
- */
112
- url: number;
113
- /**
114
- * Fields are provided by AWS to authenticate and validate the request. All fields should be included in form-data when performing upload request.
115
- * example:
116
- * {}
117
- */
118
- fields: {
119
- };
120
- };
121
- }
122
39
  export interface BaseEntity {
123
40
  /**
124
41
  * Entity ID
@@ -164,19 +81,49 @@ declare namespace Components {
164
81
  */
165
82
  _updated_at: string; // date-time
166
83
  }
167
- export interface CreateAttachmentUploadUrlParams {
168
- /**
169
- * File name
170
- * example:
171
- * Produktinformationen_epilot360_Double_Opt_in.pdf
172
- */
173
- filename: string;
84
+ /**
85
+ * Message attachments
86
+ */
87
+ export interface File {
174
88
  /**
175
- * Content type
176
- * example:
177
- * application/pdf
89
+ * It's normal entity relation with some additional properties for sending message attachment.
178
90
  */
179
- content_type: string;
91
+ $relation?: {
92
+ /**
93
+ * File entity ID
94
+ * example:
95
+ * f820ce3b-07b0-45ae-bcc6-babb2f53f79f
96
+ */
97
+ entity_id: string;
98
+ /**
99
+ * File name
100
+ * example:
101
+ * Produktinformationen_epilot360_Double_Opt_in.pdf
102
+ */
103
+ filename?: string;
104
+ /**
105
+ * To indicate this file relation is message attachment. If false then this file will not be sent.
106
+ */
107
+ is_message_attachment?: boolean;
108
+ /**
109
+ * Content ID
110
+ * example:
111
+ * fb222496-a1a5-4639-94f2-07b5e35e4068
112
+ */
113
+ cid?: string;
114
+ /**
115
+ * If true then this attachment should not be offered for download (at least not in the main attachments list).\
116
+ * The usecase is CID embedded image (aka inline image).
117
+ *
118
+ */
119
+ inline?: boolean;
120
+ /**
121
+ * If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\
122
+ * In this case, service doesn't process this attachment.
123
+ *
124
+ */
125
+ send_as_link?: boolean;
126
+ }[];
180
127
  }
181
128
  export interface Message {
182
129
  /**
@@ -223,10 +170,7 @@ declare namespace Components {
223
170
  * Bcc email addresses
224
171
  */
225
172
  bcc?: Address[];
226
- /**
227
- * Message attachments
228
- */
229
- attachments?: Attachment[];
173
+ file?: File;
230
174
  /**
231
175
  * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
232
176
  * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
@@ -247,12 +191,16 @@ declare namespace Components {
247
191
  * Ivy User ID of user read the message.
248
192
  */
249
193
  user_read_message?: string[];
194
+ /**
195
+ * Ivy Organization ID of organization read the message.
196
+ */
197
+ org_read_message?: string[];
250
198
  /**
251
199
  * Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
252
200
  * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
253
201
  *
254
202
  */
255
- send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE")[];
203
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
256
204
  /**
257
205
  * Message type
258
206
  */
@@ -305,7 +253,7 @@ declare namespace Components {
305
253
  */
306
254
  html?: string;
307
255
  /**
308
- * Text body
256
+ * Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text)
309
257
  * example:
310
258
  * We at ABC GmbH would like to request a price quote for the solar panel.
311
259
  */
@@ -324,14 +272,11 @@ declare namespace Components {
324
272
  * Bcc email addresses
325
273
  */
326
274
  bcc?: Address[];
327
- /**
328
- * Message attachments
329
- */
330
- attachments?: Attachment[];
275
+ file?: File;
331
276
  }
332
277
  export interface SearchParams {
333
278
  /**
334
- * Lucene queries supported with ElasticSearch
279
+ * Lucene query syntax supported with ElasticSearch
335
280
  * example:
336
281
  * subject:"Request for solar panel price" AND _tags:INBOX
337
282
  */
@@ -353,6 +298,10 @@ declare namespace Components {
353
298
  * Ivy User ID of who the message is assigned to. Default is the user who sends message.
354
299
  */
355
300
  assigned_to?: string[];
301
+ /**
302
+ * Ivy Organization ID of organization read the message.
303
+ */
304
+ org_read_message?: string[];
356
305
  /**
357
306
  * Latest message of thread
358
307
  */
@@ -365,10 +314,133 @@ declare namespace Components {
365
314
  }
366
315
  }
367
316
  declare namespace Paths {
368
- namespace CreateAttachmentUploadUrl {
369
- export type RequestBody = Components.Schemas.CreateAttachmentUploadUrlParams;
317
+ namespace CreateDraft {
318
+ export type RequestBody = Components.Schemas.MessageRequestParams;
370
319
  namespace Responses {
371
- export type $200 = Components.Schemas.AttachmentUploadUrl;
320
+ export interface $201 {
321
+ /**
322
+ * Entity ID
323
+ * example:
324
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
325
+ */
326
+ _id: string;
327
+ /**
328
+ * Entity title
329
+ */
330
+ _title: string;
331
+ /**
332
+ * Ivy Organization ID the entity belongs to
333
+ * example:
334
+ * 206801
335
+ */
336
+ _org: string;
337
+ /**
338
+ * URL-friendly identifier for the entity schema
339
+ * example:
340
+ * message
341
+ */
342
+ _schema: string;
343
+ /**
344
+ * Entity tags
345
+ * example:
346
+ * [
347
+ * "pricing",
348
+ * "INBOX"
349
+ * ]
350
+ */
351
+ _tags?: string[];
352
+ /**
353
+ * Created date
354
+ * example:
355
+ * "2021-02-09T12:41:43.662Z"
356
+ */
357
+ _created_at: string; // date-time
358
+ /**
359
+ * Updated date
360
+ * example:
361
+ * "2021-02-10T09:14:31.990Z"
362
+ */
363
+ _updated_at: string; // date-time
364
+ /**
365
+ * Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.
366
+ * example:
367
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>
368
+ */
369
+ message_id?: string;
370
+ /**
371
+ * Ivy User ID of user sends the message.
372
+ * example:
373
+ * 206801
374
+ */
375
+ sender?: string;
376
+ /**
377
+ * Subject
378
+ * example:
379
+ * Request for solar panel price
380
+ */
381
+ subject: string;
382
+ /**
383
+ * HTML body
384
+ * example:
385
+ * <div>We at ABC GmbH would like to request a price quote for the solar panel.</div>
386
+ */
387
+ html?: string;
388
+ /**
389
+ * Text body
390
+ * example:
391
+ * We at ABC GmbH would like to request a price quote for the solar panel.
392
+ */
393
+ text?: string;
394
+ from: Components.Schemas.Address;
395
+ reply_to?: Components.Schemas.Address;
396
+ /**
397
+ * To email addresses
398
+ */
399
+ to?: Components.Schemas.Address[];
400
+ /**
401
+ * Cc email addresses
402
+ */
403
+ cc?: Components.Schemas.Address[];
404
+ /**
405
+ * Bcc email addresses
406
+ */
407
+ bcc?: Components.Schemas.Address[];
408
+ file?: Components.Schemas.File;
409
+ /**
410
+ * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
411
+ * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
412
+ * The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
413
+ *
414
+ * example:
415
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
416
+ */
417
+ references?: string;
418
+ /**
419
+ * In-Reply-To header. Value is the `message_id` of parent message.
420
+ *
421
+ * example:
422
+ * <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
423
+ */
424
+ in_reply_to?: string;
425
+ /**
426
+ * Ivy User ID of user read the message.
427
+ */
428
+ user_read_message?: string[];
429
+ /**
430
+ * Ivy Organization ID of organization read the message.
431
+ */
432
+ org_read_message?: string[];
433
+ /**
434
+ * Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
435
+ * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
436
+ *
437
+ */
438
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
439
+ /**
440
+ * Message type
441
+ */
442
+ type?: "SENT" | "RECEIVED";
443
+ }
372
444
  }
373
445
  }
374
446
  namespace DeleteMessage {
@@ -387,6 +459,38 @@ declare namespace Paths {
387
459
  id: Parameters.Id;
388
460
  }
389
461
  }
462
+ namespace MarkReadMessage {
463
+ namespace Parameters {
464
+ export type Id = string;
465
+ }
466
+ export interface PathParameters {
467
+ id: Parameters.Id;
468
+ }
469
+ }
470
+ namespace MarkReadThread {
471
+ namespace Parameters {
472
+ export type Id = string;
473
+ }
474
+ export interface PathParameters {
475
+ id: Parameters.Id;
476
+ }
477
+ }
478
+ namespace MarkUnreadMessage {
479
+ namespace Parameters {
480
+ export type Id = string;
481
+ }
482
+ export interface PathParameters {
483
+ id: Parameters.Id;
484
+ }
485
+ }
486
+ namespace MarkUnreadThread {
487
+ namespace Parameters {
488
+ export type Id = string;
489
+ }
490
+ export interface PathParameters {
491
+ id: Parameters.Id;
492
+ }
493
+ }
390
494
  namespace SearchThreads {
391
495
  export type RequestBody = Components.Schemas.SearchParams;
392
496
  namespace Responses {
@@ -454,6 +558,10 @@ declare namespace Paths {
454
558
  * Ivy User ID of who the message is assigned to. Default is the user who sends message.
455
559
  */
456
560
  assigned_to?: string[];
561
+ /**
562
+ * Ivy Organization ID of organization read the message.
563
+ */
564
+ org_read_message?: string[];
457
565
  /**
458
566
  * Latest message of thread
459
567
  */
@@ -466,8 +574,7 @@ declare namespace Paths {
466
574
  }
467
575
  }
468
576
  }
469
- namespace SendMessage {
470
- export type RequestBody = Components.Schemas.MessageRequestParams;
577
+ namespace SendDraft {
471
578
  namespace Responses {
472
579
  export interface $201 {
473
580
  /**
@@ -557,10 +664,7 @@ declare namespace Paths {
557
664
  * Bcc email addresses
558
665
  */
559
666
  bcc?: Components.Schemas.Address[];
560
- /**
561
- * Message attachments
562
- */
563
- attachments?: Components.Schemas.Attachment[];
667
+ file?: Components.Schemas.File;
564
668
  /**
565
669
  * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
566
670
  * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
@@ -581,12 +685,16 @@ declare namespace Paths {
581
685
  * Ivy User ID of user read the message.
582
686
  */
583
687
  user_read_message?: string[];
688
+ /**
689
+ * Ivy Organization ID of organization read the message.
690
+ */
691
+ org_read_message?: string[];
584
692
  /**
585
693
  * Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
586
694
  * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
587
695
  *
588
696
  */
589
- send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE")[];
697
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
590
698
  /**
591
699
  * Message type
592
700
  */
@@ -594,34 +702,388 @@ declare namespace Paths {
594
702
  }
595
703
  }
596
704
  }
597
- namespace TrashMessage {
598
- namespace Parameters {
599
- export type Id = string;
600
- }
601
- export interface PathParameters {
602
- id: Parameters.Id;
603
- }
604
- }
605
- namespace UntrashMessage {
606
- namespace Parameters {
607
- export type Id = string;
608
- }
609
- export interface PathParameters {
610
- id: Parameters.Id;
611
- }
612
- }
613
- namespace UpdateThread {
614
- export type RequestBody = Components.Schemas.Thread;
615
- }
616
- }
617
-
618
- export interface OperationMethods {
619
- /**
620
- * sendMessage - sendMessage
621
- *
622
- * Send the specified message to the recipients.
623
- */
624
- 'sendMessage'(
705
+ namespace SendMessage {
706
+ export type RequestBody = Components.Schemas.MessageRequestParams;
707
+ namespace Responses {
708
+ export interface $201 {
709
+ /**
710
+ * Entity ID
711
+ * example:
712
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
713
+ */
714
+ _id: string;
715
+ /**
716
+ * Entity title
717
+ */
718
+ _title: string;
719
+ /**
720
+ * Ivy Organization ID the entity belongs to
721
+ * example:
722
+ * 206801
723
+ */
724
+ _org: string;
725
+ /**
726
+ * URL-friendly identifier for the entity schema
727
+ * example:
728
+ * message
729
+ */
730
+ _schema: string;
731
+ /**
732
+ * Entity tags
733
+ * example:
734
+ * [
735
+ * "pricing",
736
+ * "INBOX"
737
+ * ]
738
+ */
739
+ _tags?: string[];
740
+ /**
741
+ * Created date
742
+ * example:
743
+ * "2021-02-09T12:41:43.662Z"
744
+ */
745
+ _created_at: string; // date-time
746
+ /**
747
+ * Updated date
748
+ * example:
749
+ * "2021-02-10T09:14:31.990Z"
750
+ */
751
+ _updated_at: string; // date-time
752
+ /**
753
+ * Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.
754
+ * example:
755
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>
756
+ */
757
+ message_id?: string;
758
+ /**
759
+ * Ivy User ID of user sends the message.
760
+ * example:
761
+ * 206801
762
+ */
763
+ sender?: string;
764
+ /**
765
+ * Subject
766
+ * example:
767
+ * Request for solar panel price
768
+ */
769
+ subject: string;
770
+ /**
771
+ * HTML body
772
+ * example:
773
+ * <div>We at ABC GmbH would like to request a price quote for the solar panel.</div>
774
+ */
775
+ html?: string;
776
+ /**
777
+ * Text body
778
+ * example:
779
+ * We at ABC GmbH would like to request a price quote for the solar panel.
780
+ */
781
+ text?: string;
782
+ from: Components.Schemas.Address;
783
+ reply_to?: Components.Schemas.Address;
784
+ /**
785
+ * To email addresses
786
+ */
787
+ to?: Components.Schemas.Address[];
788
+ /**
789
+ * Cc email addresses
790
+ */
791
+ cc?: Components.Schemas.Address[];
792
+ /**
793
+ * Bcc email addresses
794
+ */
795
+ bcc?: Components.Schemas.Address[];
796
+ file?: Components.Schemas.File;
797
+ /**
798
+ * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
799
+ * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
800
+ * The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
801
+ *
802
+ * example:
803
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
804
+ */
805
+ references?: string;
806
+ /**
807
+ * In-Reply-To header. Value is the `message_id` of parent message.
808
+ *
809
+ * example:
810
+ * <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
811
+ */
812
+ in_reply_to?: string;
813
+ /**
814
+ * Ivy User ID of user read the message.
815
+ */
816
+ user_read_message?: string[];
817
+ /**
818
+ * Ivy Organization ID of organization read the message.
819
+ */
820
+ org_read_message?: string[];
821
+ /**
822
+ * Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
823
+ * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
824
+ *
825
+ */
826
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
827
+ /**
828
+ * Message type
829
+ */
830
+ type?: "SENT" | "RECEIVED";
831
+ }
832
+ }
833
+ }
834
+ namespace TrashMessage {
835
+ namespace Parameters {
836
+ export type Id = string;
837
+ }
838
+ export interface PathParameters {
839
+ id: Parameters.Id;
840
+ }
841
+ }
842
+ namespace TrashThread {
843
+ namespace Parameters {
844
+ export type Id = string;
845
+ }
846
+ export interface PathParameters {
847
+ id: Parameters.Id;
848
+ }
849
+ }
850
+ namespace UntrashMessage {
851
+ namespace Parameters {
852
+ export type Id = string;
853
+ }
854
+ export interface PathParameters {
855
+ id: Parameters.Id;
856
+ }
857
+ }
858
+ namespace UntrashThread {
859
+ namespace Parameters {
860
+ export type Id = string;
861
+ }
862
+ export interface PathParameters {
863
+ id: Parameters.Id;
864
+ }
865
+ }
866
+ namespace UpdateMessage {
867
+ namespace Responses {
868
+ export interface $201 {
869
+ /**
870
+ * Entity ID
871
+ * example:
872
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
873
+ */
874
+ _id: string;
875
+ /**
876
+ * Entity title
877
+ */
878
+ _title: string;
879
+ /**
880
+ * Ivy Organization ID the entity belongs to
881
+ * example:
882
+ * 206801
883
+ */
884
+ _org: string;
885
+ /**
886
+ * URL-friendly identifier for the entity schema
887
+ * example:
888
+ * message
889
+ */
890
+ _schema: string;
891
+ /**
892
+ * Entity tags
893
+ * example:
894
+ * [
895
+ * "pricing",
896
+ * "INBOX"
897
+ * ]
898
+ */
899
+ _tags?: string[];
900
+ /**
901
+ * Created date
902
+ * example:
903
+ * "2021-02-09T12:41:43.662Z"
904
+ */
905
+ _created_at: string; // date-time
906
+ /**
907
+ * Updated date
908
+ * example:
909
+ * "2021-02-10T09:14:31.990Z"
910
+ */
911
+ _updated_at: string; // date-time
912
+ /**
913
+ * Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.
914
+ * example:
915
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>
916
+ */
917
+ message_id?: string;
918
+ /**
919
+ * Ivy User ID of user sends the message.
920
+ * example:
921
+ * 206801
922
+ */
923
+ sender?: string;
924
+ /**
925
+ * Subject
926
+ * example:
927
+ * Request for solar panel price
928
+ */
929
+ subject: string;
930
+ /**
931
+ * HTML body
932
+ * example:
933
+ * <div>We at ABC GmbH would like to request a price quote for the solar panel.</div>
934
+ */
935
+ html?: string;
936
+ /**
937
+ * Text body
938
+ * example:
939
+ * We at ABC GmbH would like to request a price quote for the solar panel.
940
+ */
941
+ text?: string;
942
+ from: Components.Schemas.Address;
943
+ reply_to?: Components.Schemas.Address;
944
+ /**
945
+ * To email addresses
946
+ */
947
+ to?: Components.Schemas.Address[];
948
+ /**
949
+ * Cc email addresses
950
+ */
951
+ cc?: Components.Schemas.Address[];
952
+ /**
953
+ * Bcc email addresses
954
+ */
955
+ bcc?: Components.Schemas.Address[];
956
+ file?: Components.Schemas.File;
957
+ /**
958
+ * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
959
+ * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
960
+ * The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
961
+ *
962
+ * example:
963
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
964
+ */
965
+ references?: string;
966
+ /**
967
+ * In-Reply-To header. Value is the `message_id` of parent message.
968
+ *
969
+ * example:
970
+ * <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
971
+ */
972
+ in_reply_to?: string;
973
+ /**
974
+ * Ivy User ID of user read the message.
975
+ */
976
+ user_read_message?: string[];
977
+ /**
978
+ * Ivy Organization ID of organization read the message.
979
+ */
980
+ org_read_message?: string[];
981
+ /**
982
+ * Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
983
+ * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
984
+ *
985
+ */
986
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
987
+ /**
988
+ * Message type
989
+ */
990
+ type?: "SENT" | "RECEIVED";
991
+ }
992
+ }
993
+ }
994
+ namespace UpdateThread {
995
+ namespace Responses {
996
+ /**
997
+ * Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.
998
+ */
999
+ export interface $201 {
1000
+ /**
1001
+ * Entity ID
1002
+ * example:
1003
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
1004
+ */
1005
+ _id: string;
1006
+ /**
1007
+ * Entity title
1008
+ */
1009
+ _title: string;
1010
+ /**
1011
+ * Ivy Organization ID the entity belongs to
1012
+ * example:
1013
+ * 206801
1014
+ */
1015
+ _org: string;
1016
+ /**
1017
+ * URL-friendly identifier for the entity schema
1018
+ * example:
1019
+ * message
1020
+ */
1021
+ _schema: string;
1022
+ /**
1023
+ * Entity tags
1024
+ * example:
1025
+ * [
1026
+ * "pricing",
1027
+ * "INBOX"
1028
+ * ]
1029
+ */
1030
+ _tags?: string[];
1031
+ /**
1032
+ * Created date
1033
+ * example:
1034
+ * "2021-02-09T12:41:43.662Z"
1035
+ */
1036
+ _created_at: string; // date-time
1037
+ /**
1038
+ * Updated date
1039
+ * example:
1040
+ * "2021-02-10T09:14:31.990Z"
1041
+ */
1042
+ _updated_at: string; // date-time
1043
+ /**
1044
+ * Message topic (e.g. which service sends the message or message category)
1045
+ * example:
1046
+ * CUSTOMER_MESSAGE
1047
+ */
1048
+ topic: string;
1049
+ /**
1050
+ * Ivy User ID of who the message is assigned to. Default is the user who sends message.
1051
+ */
1052
+ assigned_to?: string[];
1053
+ /**
1054
+ * Ivy Organization ID of organization read the message.
1055
+ */
1056
+ org_read_message?: string[];
1057
+ /**
1058
+ * Latest message of thread
1059
+ */
1060
+ latest_message?: Components.Schemas.Message;
1061
+ /**
1062
+ * Latest trash message of thread
1063
+ */
1064
+ latest_trash_message?: Components.Schemas.Message;
1065
+ }
1066
+ }
1067
+ }
1068
+ }
1069
+
1070
+ export interface OperationMethods {
1071
+ /**
1072
+ * updateMessage - updateMessage
1073
+ *
1074
+ * Update message metadata
1075
+ */
1076
+ 'updateMessage'(
1077
+ parameters?: Parameters<UnknownParamsObject> | null,
1078
+ data?: any,
1079
+ config?: AxiosRequestConfig
1080
+ ): OperationResponse<Paths.UpdateMessage.Responses.$201>
1081
+ /**
1082
+ * sendMessage - sendMessage
1083
+ *
1084
+ * Send an email message
1085
+ */
1086
+ 'sendMessage'(
625
1087
  parameters?: Parameters<UnknownParamsObject> | null,
626
1088
  data?: Paths.SendMessage.RequestBody,
627
1089
  config?: AxiosRequestConfig
@@ -629,7 +1091,7 @@ export interface OperationMethods {
629
1091
  /**
630
1092
  * deleteMessage - deleteMessage
631
1093
  *
632
- * Immediately and permanently deletes the specified message. This operation cannot be undone.
1094
+ * Immediately and permanently delete a message. This operation cannot be undone.
633
1095
  */
634
1096
  'deleteMessage'(
635
1097
  parameters?: Parameters<Paths.DeleteMessage.PathParameters> | null,
@@ -639,7 +1101,7 @@ export interface OperationMethods {
639
1101
  /**
640
1102
  * trashMessage - trashMessage
641
1103
  *
642
- * Moves the specified message to the trash.
1104
+ * Move a message to the trash
643
1105
  */
644
1106
  'trashMessage'(
645
1107
  parameters?: Parameters<Paths.TrashMessage.PathParameters> | null,
@@ -649,18 +1111,41 @@ export interface OperationMethods {
649
1111
  /**
650
1112
  * untrashMessage - untrashMessage
651
1113
  *
652
- * Removes the specified message from the trash.
1114
+ * Restore a trashed message
653
1115
  */
654
1116
  'untrashMessage'(
655
1117
  parameters?: Parameters<Paths.UntrashMessage.PathParameters> | null,
656
1118
  data?: any,
657
1119
  config?: AxiosRequestConfig
658
1120
  ): OperationResponse<any>
1121
+ /**
1122
+ * markReadMessage - markReadMessage
1123
+ *
1124
+ * Mark message as read
1125
+ */
1126
+ 'markReadMessage'(
1127
+ parameters?: Parameters<Paths.MarkReadMessage.PathParameters> | null,
1128
+ data?: any,
1129
+ config?: AxiosRequestConfig
1130
+ ): OperationResponse<any>
1131
+ /**
1132
+ * markUnreadMessage - markUnreadMessage
1133
+ *
1134
+ * Mark message as unread
1135
+ */
1136
+ 'markUnreadMessage'(
1137
+ parameters?: Parameters<Paths.MarkUnreadMessage.PathParameters> | null,
1138
+ data?: any,
1139
+ config?: AxiosRequestConfig
1140
+ ): OperationResponse<any>
659
1141
  /**
660
1142
  * searchThreads - searchThreads
661
1143
  *
662
- * Search for message entity and return threads which contain matched message. If message doesn't have any reply yet, evaluate it as a thread with single message.\
663
- * Supports pagination. Lucene query syntax supported for complex querying.
1144
+ * Search for threads of email messages.
1145
+ *
1146
+ * Messages with no replies yet are treated as threads with single message.
1147
+ *
1148
+ * Lucene syntax supported.
664
1149
  *
665
1150
  */
666
1151
  'searchThreads'(
@@ -671,17 +1156,17 @@ export interface OperationMethods {
671
1156
  /**
672
1157
  * updateThread - updateThread
673
1158
  *
674
- * Modify the thread.
1159
+ * Modify thread metadata
675
1160
  */
676
1161
  'updateThread'(
677
1162
  parameters?: Parameters<UnknownParamsObject> | null,
678
- data?: Paths.UpdateThread.RequestBody,
1163
+ data?: any,
679
1164
  config?: AxiosRequestConfig
680
- ): OperationResponse<any>
1165
+ ): OperationResponse<Paths.UpdateThread.Responses.$201>
681
1166
  /**
682
1167
  * deleteThread - deleteThread
683
1168
  *
684
- * Immediately and permanently deletes the specified thread. This operation cannot be undone.
1169
+ * Immediately and permanently delete a thread. This operation cannot be undone.
685
1170
  */
686
1171
  'deleteThread'(
687
1172
  parameters?: Parameters<Paths.DeleteThread.PathParameters> | null,
@@ -689,35 +1174,95 @@ export interface OperationMethods {
689
1174
  config?: AxiosRequestConfig
690
1175
  ): OperationResponse<any>
691
1176
  /**
692
- * createAttachmentUploadUrl - createAttachmentUploadUrl
1177
+ * trashThread - trashThread
693
1178
  *
694
- * Create S3 POST presigned URL to upload attachment. The URL is valid in 30 minutes. Maximum file size is 100MB.
1179
+ * Move a thread to trash
695
1180
  */
696
- 'createAttachmentUploadUrl'(
1181
+ 'trashThread'(
1182
+ parameters?: Parameters<Paths.TrashThread.PathParameters> | null,
1183
+ data?: any,
1184
+ config?: AxiosRequestConfig
1185
+ ): OperationResponse<any>
1186
+ /**
1187
+ * untrashThread - untrashThread
1188
+ *
1189
+ * Restore a trashed thread
1190
+ */
1191
+ 'untrashThread'(
1192
+ parameters?: Parameters<Paths.UntrashThread.PathParameters> | null,
1193
+ data?: any,
1194
+ config?: AxiosRequestConfig
1195
+ ): OperationResponse<any>
1196
+ /**
1197
+ * markReadThread - markReadThread
1198
+ *
1199
+ * Mark thread as read
1200
+ */
1201
+ 'markReadThread'(
1202
+ parameters?: Parameters<Paths.MarkReadThread.PathParameters> | null,
1203
+ data?: any,
1204
+ config?: AxiosRequestConfig
1205
+ ): OperationResponse<any>
1206
+ /**
1207
+ * markUnreadThread - markUnreadThread
1208
+ *
1209
+ * Mark thread as unread
1210
+ */
1211
+ 'markUnreadThread'(
1212
+ parameters?: Parameters<Paths.MarkUnreadThread.PathParameters> | null,
1213
+ data?: any,
1214
+ config?: AxiosRequestConfig
1215
+ ): OperationResponse<any>
1216
+ /**
1217
+ * createDraft - createDraft
1218
+ *
1219
+ * Create a new draft
1220
+ */
1221
+ 'createDraft'(
697
1222
  parameters?: Parameters<UnknownParamsObject> | null,
698
- data?: Paths.CreateAttachmentUploadUrl.RequestBody,
1223
+ data?: Paths.CreateDraft.RequestBody,
699
1224
  config?: AxiosRequestConfig
700
- ): OperationResponse<Paths.CreateAttachmentUploadUrl.Responses.$200>
1225
+ ): OperationResponse<Paths.CreateDraft.Responses.$201>
1226
+ /**
1227
+ * sendDraft - sendDraft
1228
+ *
1229
+ * Send the existing draft to the recipients
1230
+ */
1231
+ 'sendDraft'(
1232
+ parameters?: Parameters<UnknownParamsObject> | null,
1233
+ data?: any,
1234
+ config?: AxiosRequestConfig
1235
+ ): OperationResponse<Paths.SendDraft.Responses.$201>
701
1236
  }
702
1237
 
703
1238
  export interface PathsDictionary {
704
- ['/messages']: {
1239
+ ['/v1/message/messages']: {
705
1240
  /**
706
1241
  * sendMessage - sendMessage
707
1242
  *
708
- * Send the specified message to the recipients.
1243
+ * Send an email message
709
1244
  */
710
1245
  'post'(
711
1246
  parameters?: Parameters<UnknownParamsObject> | null,
712
1247
  data?: Paths.SendMessage.RequestBody,
713
1248
  config?: AxiosRequestConfig
714
1249
  ): OperationResponse<Paths.SendMessage.Responses.$201>
1250
+ /**
1251
+ * updateMessage - updateMessage
1252
+ *
1253
+ * Update message metadata
1254
+ */
1255
+ 'put'(
1256
+ parameters?: Parameters<UnknownParamsObject> | null,
1257
+ data?: any,
1258
+ config?: AxiosRequestConfig
1259
+ ): OperationResponse<Paths.UpdateMessage.Responses.$201>
715
1260
  }
716
- ['/messages/{id}']: {
1261
+ ['/v1/message/messages/{id}']: {
717
1262
  /**
718
1263
  * deleteMessage - deleteMessage
719
1264
  *
720
- * Immediately and permanently deletes the specified message. This operation cannot be undone.
1265
+ * Immediately and permanently delete a message. This operation cannot be undone.
721
1266
  */
722
1267
  'delete'(
723
1268
  parameters?: Parameters<Paths.DeleteMessage.PathParameters> | null,
@@ -725,11 +1270,11 @@ export interface PathsDictionary {
725
1270
  config?: AxiosRequestConfig
726
1271
  ): OperationResponse<any>
727
1272
  }
728
- ['/messages/{id}/trash']: {
1273
+ ['/v1/message/messages/{id}/trash']: {
729
1274
  /**
730
1275
  * trashMessage - trashMessage
731
1276
  *
732
- * Moves the specified message to the trash.
1277
+ * Move a message to the trash
733
1278
  */
734
1279
  'post'(
735
1280
  parameters?: Parameters<Paths.TrashMessage.PathParameters> | null,
@@ -737,11 +1282,11 @@ export interface PathsDictionary {
737
1282
  config?: AxiosRequestConfig
738
1283
  ): OperationResponse<any>
739
1284
  }
740
- ['/messages/{id}/untrash']: {
1285
+ ['/v1/message/messages/{id}/untrash']: {
741
1286
  /**
742
1287
  * untrashMessage - untrashMessage
743
1288
  *
744
- * Removes the specified message from the trash.
1289
+ * Restore a trashed message
745
1290
  */
746
1291
  'post'(
747
1292
  parameters?: Parameters<Paths.UntrashMessage.PathParameters> | null,
@@ -749,12 +1294,39 @@ export interface PathsDictionary {
749
1294
  config?: AxiosRequestConfig
750
1295
  ): OperationResponse<any>
751
1296
  }
752
- ['/threads:search']: {
1297
+ ['/v1/message/messages/{id}/read']: {
1298
+ /**
1299
+ * markReadMessage - markReadMessage
1300
+ *
1301
+ * Mark message as read
1302
+ */
1303
+ 'post'(
1304
+ parameters?: Parameters<Paths.MarkReadMessage.PathParameters> | null,
1305
+ data?: any,
1306
+ config?: AxiosRequestConfig
1307
+ ): OperationResponse<any>
1308
+ }
1309
+ ['/v1/message/messages/{id}/unread']: {
1310
+ /**
1311
+ * markUnreadMessage - markUnreadMessage
1312
+ *
1313
+ * Mark message as unread
1314
+ */
1315
+ 'post'(
1316
+ parameters?: Parameters<Paths.MarkUnreadMessage.PathParameters> | null,
1317
+ data?: any,
1318
+ config?: AxiosRequestConfig
1319
+ ): OperationResponse<any>
1320
+ }
1321
+ ['/v1/message/threads:search']: {
753
1322
  /**
754
1323
  * searchThreads - searchThreads
755
1324
  *
756
- * Search for message entity and return threads which contain matched message. If message doesn't have any reply yet, evaluate it as a thread with single message.\
757
- * Supports pagination. Lucene query syntax supported for complex querying.
1325
+ * Search for threads of email messages.
1326
+ *
1327
+ * Messages with no replies yet are treated as threads with single message.
1328
+ *
1329
+ * Lucene syntax supported.
758
1330
  *
759
1331
  */
760
1332
  'post'(
@@ -763,23 +1335,23 @@ export interface PathsDictionary {
763
1335
  config?: AxiosRequestConfig
764
1336
  ): OperationResponse<Paths.SearchThreads.Responses.$200>
765
1337
  }
766
- ['/threads']: {
1338
+ ['/v1/message/threads']: {
767
1339
  /**
768
1340
  * updateThread - updateThread
769
1341
  *
770
- * Modify the thread.
1342
+ * Modify thread metadata
771
1343
  */
772
1344
  'put'(
773
1345
  parameters?: Parameters<UnknownParamsObject> | null,
774
- data?: Paths.UpdateThread.RequestBody,
1346
+ data?: any,
775
1347
  config?: AxiosRequestConfig
776
- ): OperationResponse<any>
1348
+ ): OperationResponse<Paths.UpdateThread.Responses.$201>
777
1349
  }
778
- ['/threads/{id}']: {
1350
+ ['/v1/message/threads/{id}']: {
779
1351
  /**
780
1352
  * deleteThread - deleteThread
781
1353
  *
782
- * Immediately and permanently deletes the specified thread. This operation cannot be undone.
1354
+ * Immediately and permanently delete a thread. This operation cannot be undone.
783
1355
  */
784
1356
  'delete'(
785
1357
  parameters?: Parameters<Paths.DeleteThread.PathParameters> | null,
@@ -787,17 +1359,77 @@ export interface PathsDictionary {
787
1359
  config?: AxiosRequestConfig
788
1360
  ): OperationResponse<any>
789
1361
  }
790
- ['/attachments/upload-url']: {
1362
+ ['/v1/message/threads/{id}/trash']: {
1363
+ /**
1364
+ * trashThread - trashThread
1365
+ *
1366
+ * Move a thread to trash
1367
+ */
1368
+ 'post'(
1369
+ parameters?: Parameters<Paths.TrashThread.PathParameters> | null,
1370
+ data?: any,
1371
+ config?: AxiosRequestConfig
1372
+ ): OperationResponse<any>
1373
+ }
1374
+ ['/v1/message/threads/{id}/untrash']: {
1375
+ /**
1376
+ * untrashThread - untrashThread
1377
+ *
1378
+ * Restore a trashed thread
1379
+ */
1380
+ 'post'(
1381
+ parameters?: Parameters<Paths.UntrashThread.PathParameters> | null,
1382
+ data?: any,
1383
+ config?: AxiosRequestConfig
1384
+ ): OperationResponse<any>
1385
+ }
1386
+ ['/v1/message/threads/{id}/read']: {
791
1387
  /**
792
- * createAttachmentUploadUrl - createAttachmentUploadUrl
1388
+ * markReadThread - markReadThread
793
1389
  *
794
- * Create S3 POST presigned URL to upload attachment. The URL is valid in 30 minutes. Maximum file size is 100MB.
1390
+ * Mark thread as read
1391
+ */
1392
+ 'post'(
1393
+ parameters?: Parameters<Paths.MarkReadThread.PathParameters> | null,
1394
+ data?: any,
1395
+ config?: AxiosRequestConfig
1396
+ ): OperationResponse<any>
1397
+ }
1398
+ ['/v1/message/threads/{id}/unread']: {
1399
+ /**
1400
+ * markUnreadThread - markUnreadThread
1401
+ *
1402
+ * Mark thread as unread
1403
+ */
1404
+ 'post'(
1405
+ parameters?: Parameters<Paths.MarkUnreadThread.PathParameters> | null,
1406
+ data?: any,
1407
+ config?: AxiosRequestConfig
1408
+ ): OperationResponse<any>
1409
+ }
1410
+ ['/v1/message/drafts']: {
1411
+ /**
1412
+ * createDraft - createDraft
1413
+ *
1414
+ * Create a new draft
1415
+ */
1416
+ 'post'(
1417
+ parameters?: Parameters<UnknownParamsObject> | null,
1418
+ data?: Paths.CreateDraft.RequestBody,
1419
+ config?: AxiosRequestConfig
1420
+ ): OperationResponse<Paths.CreateDraft.Responses.$201>
1421
+ }
1422
+ ['/v1/message/drafts:send']: {
1423
+ /**
1424
+ * sendDraft - sendDraft
1425
+ *
1426
+ * Send the existing draft to the recipients
795
1427
  */
796
1428
  'post'(
797
1429
  parameters?: Parameters<UnknownParamsObject> | null,
798
- data?: Paths.CreateAttachmentUploadUrl.RequestBody,
1430
+ data?: any,
799
1431
  config?: AxiosRequestConfig
800
- ): OperationResponse<Paths.CreateAttachmentUploadUrl.Responses.$200>
1432
+ ): OperationResponse<Paths.SendDraft.Responses.$201>
801
1433
  }
802
1434
  }
803
1435