@epilot/message-client 0.0.2 → 1.0.0

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/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './client';
2
- export type { Client, Components, Paths, PathsDictionary, OperationMethods } from './openapi';
3
- export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
1
+ export * from './client';
2
+ export type { Client, Components, Paths, PathsDictionary, OperationMethods } from './openapi';
3
+ export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./client"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./client"), exports);
14
14
  //# sourceMappingURL=index.js.map
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,9 +27,9 @@ 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
  */
@@ -90,7 +90,7 @@ declare namespace Components {
90
90
  */
91
91
  send_as_link?: boolean;
92
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.\
93
+ * If true then this attachment is copied to the message and replaces corresponding one. The new attachment has different `url`, `object_key`. This property supports for forwarding message and copying attachments from email template.\
94
94
  * If both `send_as_link` and `copy_to_message` are provided, `copy_to_message` is discarded.
95
95
  *
96
96
  */
@@ -252,7 +252,7 @@ declare namespace Components {
252
252
  * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
253
253
  *
254
254
  */
255
- send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE")[];
255
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
256
256
  /**
257
257
  * Message type
258
258
  */
@@ -305,7 +305,7 @@ declare namespace Components {
305
305
  */
306
306
  html?: string;
307
307
  /**
308
- * Text body
308
+ * 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
309
  * example:
310
310
  * We at ABC GmbH would like to request a price quote for the solar panel.
311
311
  */
@@ -331,7 +331,7 @@ declare namespace Components {
331
331
  }
332
332
  export interface SearchParams {
333
333
  /**
334
- * Lucene queries supported with ElasticSearch
334
+ * Lucene query syntax supported with ElasticSearch
335
335
  * example:
336
336
  * subject:"Request for solar panel price" AND _tags:INBOX
337
337
  */
@@ -586,7 +586,7 @@ declare namespace Paths {
586
586
  * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
587
587
  *
588
588
  */
589
- send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE")[];
589
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
590
590
  /**
591
591
  * Message type
592
592
  */
@@ -602,6 +602,14 @@ declare namespace Paths {
602
602
  id: Parameters.Id;
603
603
  }
604
604
  }
605
+ namespace TrashThread {
606
+ namespace Parameters {
607
+ export type Id = string;
608
+ }
609
+ export interface PathParameters {
610
+ id: Parameters.Id;
611
+ }
612
+ }
605
613
  namespace UntrashMessage {
606
614
  namespace Parameters {
607
615
  export type Id = string;
@@ -610,16 +618,229 @@ declare namespace Paths {
610
618
  id: Parameters.Id;
611
619
  }
612
620
  }
621
+ namespace UntrashThread {
622
+ namespace Parameters {
623
+ export type Id = string;
624
+ }
625
+ export interface PathParameters {
626
+ id: Parameters.Id;
627
+ }
628
+ }
629
+ namespace UpdateMessage {
630
+ export type RequestBody = Components.Schemas.Message;
631
+ namespace Responses {
632
+ export interface $201 {
633
+ /**
634
+ * Entity ID
635
+ * example:
636
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
637
+ */
638
+ _id: string;
639
+ /**
640
+ * Entity title
641
+ */
642
+ _title: string;
643
+ /**
644
+ * Ivy Organization ID the entity belongs to
645
+ * example:
646
+ * 206801
647
+ */
648
+ _org: string;
649
+ /**
650
+ * URL-friendly identifier for the entity schema
651
+ * example:
652
+ * message
653
+ */
654
+ _schema: string;
655
+ /**
656
+ * Entity tags
657
+ * example:
658
+ * [
659
+ * "pricing",
660
+ * "INBOX"
661
+ * ]
662
+ */
663
+ _tags?: string[];
664
+ /**
665
+ * Created date
666
+ * example:
667
+ * "2021-02-09T12:41:43.662Z"
668
+ */
669
+ _created_at: string; // date-time
670
+ /**
671
+ * Updated date
672
+ * example:
673
+ * "2021-02-10T09:14:31.990Z"
674
+ */
675
+ _updated_at: string; // date-time
676
+ /**
677
+ * Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.
678
+ * example:
679
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>
680
+ */
681
+ message_id?: string;
682
+ /**
683
+ * Ivy User ID of user sends the message.
684
+ * example:
685
+ * 206801
686
+ */
687
+ sender?: string;
688
+ /**
689
+ * Subject
690
+ * example:
691
+ * Request for solar panel price
692
+ */
693
+ subject: string;
694
+ /**
695
+ * HTML body
696
+ * example:
697
+ * <div>We at ABC GmbH would like to request a price quote for the solar panel.</div>
698
+ */
699
+ html?: string;
700
+ /**
701
+ * Text body
702
+ * example:
703
+ * We at ABC GmbH would like to request a price quote for the solar panel.
704
+ */
705
+ text?: string;
706
+ from: Components.Schemas.Address;
707
+ reply_to?: Components.Schemas.Address;
708
+ /**
709
+ * To email addresses
710
+ */
711
+ to?: Components.Schemas.Address[];
712
+ /**
713
+ * Cc email addresses
714
+ */
715
+ cc?: Components.Schemas.Address[];
716
+ /**
717
+ * Bcc email addresses
718
+ */
719
+ bcc?: Components.Schemas.Address[];
720
+ /**
721
+ * Message attachments
722
+ */
723
+ attachments?: Components.Schemas.Attachment[];
724
+ /**
725
+ * References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
726
+ * The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
727
+ * The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
728
+ *
729
+ * example:
730
+ * <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
731
+ */
732
+ references?: string;
733
+ /**
734
+ * In-Reply-To header. Value is the `message_id` of parent message.
735
+ *
736
+ * example:
737
+ * <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>
738
+ */
739
+ in_reply_to?: string;
740
+ /**
741
+ * Ivy User ID of user read the message.
742
+ */
743
+ user_read_message?: string[];
744
+ /**
745
+ * 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`\
746
+ * Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>
747
+ *
748
+ */
749
+ send_status?: ("SEND" | "DELIVERY" | "REJECT" | "COMPLAINT" | "BOUNCE" | "ERROR")[];
750
+ /**
751
+ * Message type
752
+ */
753
+ type?: "SENT" | "RECEIVED";
754
+ }
755
+ }
756
+ }
613
757
  namespace UpdateThread {
614
- export type RequestBody = Components.Schemas.Thread;
758
+ namespace Responses {
759
+ /**
760
+ * Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.
761
+ */
762
+ export interface $201 {
763
+ /**
764
+ * Entity ID
765
+ * example:
766
+ * 3fa85f64-5717-4562-b3fc-2c963f66afa6
767
+ */
768
+ _id: string;
769
+ /**
770
+ * Entity title
771
+ */
772
+ _title: string;
773
+ /**
774
+ * Ivy Organization ID the entity belongs to
775
+ * example:
776
+ * 206801
777
+ */
778
+ _org: string;
779
+ /**
780
+ * URL-friendly identifier for the entity schema
781
+ * example:
782
+ * message
783
+ */
784
+ _schema: string;
785
+ /**
786
+ * Entity tags
787
+ * example:
788
+ * [
789
+ * "pricing",
790
+ * "INBOX"
791
+ * ]
792
+ */
793
+ _tags?: string[];
794
+ /**
795
+ * Created date
796
+ * example:
797
+ * "2021-02-09T12:41:43.662Z"
798
+ */
799
+ _created_at: string; // date-time
800
+ /**
801
+ * Updated date
802
+ * example:
803
+ * "2021-02-10T09:14:31.990Z"
804
+ */
805
+ _updated_at: string; // date-time
806
+ /**
807
+ * Message topic (e.g. which service sends the message or message category)
808
+ * example:
809
+ * CUSTOMER_MESSAGE
810
+ */
811
+ topic: string;
812
+ /**
813
+ * Ivy User ID of who the message is assigned to. Default is the user who sends message.
814
+ */
815
+ assigned_to?: string[];
816
+ /**
817
+ * Latest message of thread
818
+ */
819
+ latest_message?: Components.Schemas.Message;
820
+ /**
821
+ * Latest trash message of thread
822
+ */
823
+ latest_trash_message?: Components.Schemas.Message;
824
+ }
825
+ }
615
826
  }
616
827
  }
617
828
 
618
829
  export interface OperationMethods {
830
+ /**
831
+ * updateMessage - updateMessage
832
+ *
833
+ * Update message metadata
834
+ */
835
+ 'updateMessage'(
836
+ parameters?: Parameters<UnknownParamsObject> | null,
837
+ data?: Paths.UpdateMessage.RequestBody,
838
+ config?: AxiosRequestConfig
839
+ ): OperationResponse<Paths.UpdateMessage.Responses.$201>
619
840
  /**
620
841
  * sendMessage - sendMessage
621
842
  *
622
- * Send the specified message to the recipients.
843
+ * Send an email message
623
844
  */
624
845
  'sendMessage'(
625
846
  parameters?: Parameters<UnknownParamsObject> | null,
@@ -629,7 +850,7 @@ export interface OperationMethods {
629
850
  /**
630
851
  * deleteMessage - deleteMessage
631
852
  *
632
- * Immediately and permanently deletes the specified message. This operation cannot be undone.
853
+ * Immediately and permanently delete a message. This operation cannot be undone.
633
854
  */
634
855
  'deleteMessage'(
635
856
  parameters?: Parameters<Paths.DeleteMessage.PathParameters> | null,
@@ -639,7 +860,7 @@ export interface OperationMethods {
639
860
  /**
640
861
  * trashMessage - trashMessage
641
862
  *
642
- * Moves the specified message to the trash.
863
+ * Move a message to the trash
643
864
  */
644
865
  'trashMessage'(
645
866
  parameters?: Parameters<Paths.TrashMessage.PathParameters> | null,
@@ -649,7 +870,7 @@ export interface OperationMethods {
649
870
  /**
650
871
  * untrashMessage - untrashMessage
651
872
  *
652
- * Removes the specified message from the trash.
873
+ * Restore a trashed message
653
874
  */
654
875
  'untrashMessage'(
655
876
  parameters?: Parameters<Paths.UntrashMessage.PathParameters> | null,
@@ -659,8 +880,11 @@ export interface OperationMethods {
659
880
  /**
660
881
  * searchThreads - searchThreads
661
882
  *
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.
883
+ * Search for threads of email messages.
884
+ *
885
+ * Messages with no replies yet are treated as threads with single message.
886
+ *
887
+ * Lucene syntax supported.
664
888
  *
665
889
  */
666
890
  'searchThreads'(
@@ -671,23 +895,43 @@ export interface OperationMethods {
671
895
  /**
672
896
  * updateThread - updateThread
673
897
  *
674
- * Modify the thread.
898
+ * Modify thread metadata
675
899
  */
676
900
  'updateThread'(
677
901
  parameters?: Parameters<UnknownParamsObject> | null,
678
- data?: Paths.UpdateThread.RequestBody,
902
+ data?: any,
679
903
  config?: AxiosRequestConfig
680
- ): OperationResponse<any>
904
+ ): OperationResponse<Paths.UpdateThread.Responses.$201>
681
905
  /**
682
906
  * deleteThread - deleteThread
683
907
  *
684
- * Immediately and permanently deletes the specified thread. This operation cannot be undone.
908
+ * Immediately and permanently delete a thread. This operation cannot be undone.
685
909
  */
686
910
  'deleteThread'(
687
911
  parameters?: Parameters<Paths.DeleteThread.PathParameters> | null,
688
912
  data?: any,
689
913
  config?: AxiosRequestConfig
690
914
  ): OperationResponse<any>
915
+ /**
916
+ * trashThread - trashThread
917
+ *
918
+ * Move a thread to trash
919
+ */
920
+ 'trashThread'(
921
+ parameters?: Parameters<Paths.TrashThread.PathParameters> | null,
922
+ data?: any,
923
+ config?: AxiosRequestConfig
924
+ ): OperationResponse<any>
925
+ /**
926
+ * untrashThread - untrashThread
927
+ *
928
+ * Restore a trashed thread
929
+ */
930
+ 'untrashThread'(
931
+ parameters?: Parameters<Paths.UntrashThread.PathParameters> | null,
932
+ data?: any,
933
+ config?: AxiosRequestConfig
934
+ ): OperationResponse<any>
691
935
  /**
692
936
  * createAttachmentUploadUrl - createAttachmentUploadUrl
693
937
  *
@@ -701,23 +945,33 @@ export interface OperationMethods {
701
945
  }
702
946
 
703
947
  export interface PathsDictionary {
704
- ['/messages']: {
948
+ ['/v1/message/messages']: {
705
949
  /**
706
950
  * sendMessage - sendMessage
707
951
  *
708
- * Send the specified message to the recipients.
952
+ * Send an email message
709
953
  */
710
954
  'post'(
711
955
  parameters?: Parameters<UnknownParamsObject> | null,
712
956
  data?: Paths.SendMessage.RequestBody,
713
957
  config?: AxiosRequestConfig
714
958
  ): OperationResponse<Paths.SendMessage.Responses.$201>
959
+ /**
960
+ * updateMessage - updateMessage
961
+ *
962
+ * Update message metadata
963
+ */
964
+ 'put'(
965
+ parameters?: Parameters<UnknownParamsObject> | null,
966
+ data?: Paths.UpdateMessage.RequestBody,
967
+ config?: AxiosRequestConfig
968
+ ): OperationResponse<Paths.UpdateMessage.Responses.$201>
715
969
  }
716
- ['/messages/{id}']: {
970
+ ['/v1/message/messages/{id}']: {
717
971
  /**
718
972
  * deleteMessage - deleteMessage
719
973
  *
720
- * Immediately and permanently deletes the specified message. This operation cannot be undone.
974
+ * Immediately and permanently delete a message. This operation cannot be undone.
721
975
  */
722
976
  'delete'(
723
977
  parameters?: Parameters<Paths.DeleteMessage.PathParameters> | null,
@@ -725,11 +979,11 @@ export interface PathsDictionary {
725
979
  config?: AxiosRequestConfig
726
980
  ): OperationResponse<any>
727
981
  }
728
- ['/messages/{id}/trash']: {
982
+ ['/v1/message/messages/{id}/trash']: {
729
983
  /**
730
984
  * trashMessage - trashMessage
731
985
  *
732
- * Moves the specified message to the trash.
986
+ * Move a message to the trash
733
987
  */
734
988
  'post'(
735
989
  parameters?: Parameters<Paths.TrashMessage.PathParameters> | null,
@@ -737,11 +991,11 @@ export interface PathsDictionary {
737
991
  config?: AxiosRequestConfig
738
992
  ): OperationResponse<any>
739
993
  }
740
- ['/messages/{id}/untrash']: {
994
+ ['/v1/message/messages/{id}/untrash']: {
741
995
  /**
742
996
  * untrashMessage - untrashMessage
743
997
  *
744
- * Removes the specified message from the trash.
998
+ * Restore a trashed message
745
999
  */
746
1000
  'post'(
747
1001
  parameters?: Parameters<Paths.UntrashMessage.PathParameters> | null,
@@ -749,12 +1003,15 @@ export interface PathsDictionary {
749
1003
  config?: AxiosRequestConfig
750
1004
  ): OperationResponse<any>
751
1005
  }
752
- ['/threads:search']: {
1006
+ ['/v1/message/threads:search']: {
753
1007
  /**
754
1008
  * searchThreads - searchThreads
755
1009
  *
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.
1010
+ * Search for threads of email messages.
1011
+ *
1012
+ * Messages with no replies yet are treated as threads with single message.
1013
+ *
1014
+ * Lucene syntax supported.
758
1015
  *
759
1016
  */
760
1017
  'post'(
@@ -763,23 +1020,23 @@ export interface PathsDictionary {
763
1020
  config?: AxiosRequestConfig
764
1021
  ): OperationResponse<Paths.SearchThreads.Responses.$200>
765
1022
  }
766
- ['/threads']: {
1023
+ ['/v1/message/threads']: {
767
1024
  /**
768
1025
  * updateThread - updateThread
769
1026
  *
770
- * Modify the thread.
1027
+ * Modify thread metadata
771
1028
  */
772
1029
  'put'(
773
1030
  parameters?: Parameters<UnknownParamsObject> | null,
774
- data?: Paths.UpdateThread.RequestBody,
1031
+ data?: any,
775
1032
  config?: AxiosRequestConfig
776
- ): OperationResponse<any>
1033
+ ): OperationResponse<Paths.UpdateThread.Responses.$201>
777
1034
  }
778
- ['/threads/{id}']: {
1035
+ ['/v1/message/threads/{id}']: {
779
1036
  /**
780
1037
  * deleteThread - deleteThread
781
1038
  *
782
- * Immediately and permanently deletes the specified thread. This operation cannot be undone.
1039
+ * Immediately and permanently delete a thread. This operation cannot be undone.
783
1040
  */
784
1041
  'delete'(
785
1042
  parameters?: Parameters<Paths.DeleteThread.PathParameters> | null,
@@ -787,7 +1044,31 @@ export interface PathsDictionary {
787
1044
  config?: AxiosRequestConfig
788
1045
  ): OperationResponse<any>
789
1046
  }
790
- ['/attachments/upload-url']: {
1047
+ ['/v1/message/threads/{id}/trash']: {
1048
+ /**
1049
+ * trashThread - trashThread
1050
+ *
1051
+ * Move a thread to trash
1052
+ */
1053
+ 'post'(
1054
+ parameters?: Parameters<Paths.TrashThread.PathParameters> | null,
1055
+ data?: any,
1056
+ config?: AxiosRequestConfig
1057
+ ): OperationResponse<any>
1058
+ }
1059
+ ['/v1/message/threads/{id}/untrash']: {
1060
+ /**
1061
+ * untrashThread - untrashThread
1062
+ *
1063
+ * Restore a trashed thread
1064
+ */
1065
+ 'post'(
1066
+ parameters?: Parameters<Paths.UntrashThread.PathParameters> | null,
1067
+ data?: any,
1068
+ config?: AxiosRequestConfig
1069
+ ): OperationResponse<any>
1070
+ }
1071
+ ['/v1/message/attachments/upload-url']: {
791
1072
  /**
792
1073
  * createAttachmentUploadUrl - createAttachmentUploadUrl
793
1074
  *