@epilot/message-client 1.1.4 → 1.1.5
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/definition.js +1 -1
- package/dist/openapi.d.ts +59 -0
- package/dist/openapi.json +60 -0
- package/package.json +2 -2
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,s){for(var t in s)e[t]=s[t];s.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,s,t){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var r=a(t(279));s.default=r.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"Message API","version":"1.0.0","description":"Send and receive email messages via your epilot organization\\n"},"security":[{"EpilotAuth":[]},{"EpilotOrg":[]}],"tags":[{"name":"Messages"},{"name":"Threads"},{"name":"Drafts"}],"paths":{"/v1/message/messages":{"post":{"operationId":"sendMessage","summary":"sendMessage","description":"Send an email message","tags":["Messages"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequestParams"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}},"put":{"operationId":"updateMessage","summary":"updateMessage","description":"Update message metadata","tags":["Messages"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}":{"get":{"operationId":"getMessage","summary":"getMessage","description":"Get an email message by id","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}},"delete":{"operationId":"deleteMessage","summary":"deleteMessage","description":"Immediately and permanently delete a message. This operation cannot be undone.","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/trash":{"post":{"operationId":"trashMessage","summary":"trashMessage","description":"Move a message to the trash","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/untrash":{"post":{"operationId":"untrashMessage","summary":"untrashMessage","description":"Restore a trashed message","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/read":{"post":{"operationId":"markReadMessage","summary":"markReadMessage","description":"Mark message as read","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","summary":"markUnreadMessage","description":"Mark message as unread","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","summary":"searchThreads","description":"Search for threads of email messages.\\n\\nMessages with no replies yet are treated as threads with single message.\\n\\nLucene syntax supported.\\n","tags":["Threads"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchParams"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["hits","results"],"properties":{"hits":{"type":"number","description":"Total of matched threads","example":14},"results":{"type":"array","description":"Matched threads","items":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Thread"}]}}}}}}},"403":{"description":"Forbidden"}}}},"/v1/message/threads":{"put":{"operationId":"updateThread","summary":"updateThread","description":"Modify thread metadata","tags":["Threads"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Thread"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}":{"delete":{"operationId":"deleteThread","summary":"deleteThread","description":"Immediately and permanently delete a thread. This operation cannot be undone.","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/trash":{"post":{"operationId":"trashThread","summary":"trashThread","description":"Move a thread to trash","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/untrash":{"post":{"operationId":"untrashThread","summary":"untrashThread","description":"Restore a trashed thread","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/read":{"post":{"operationId":"markReadThread","summary":"markReadThread","description":"Mark thread as read","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","summary":"markUnreadThread","description":"Mark thread as unread","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/drafts":{"post":{"operationId":"createDraft","summary":"createDraft","description":"Create a new draft","tags":["Drafts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequestParams"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/drafts:send":{"post":{"operationId":"sendDraft","summary":"sendDraft","description":"Send the existing draft to the recipients","tags":["Drafts"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"EpilotOrg":{"description":"Overrides the target organization to allow shared tenant access","name":"x-epilot-org-id","in":"header","type":"apiKey"}},"schemas":{"BaseEntity":{"type":"object","required":["_id","_title","_org","_schema","_created_at","_updated_at"],"properties":{"_id":{"type":"string","description":"Entity ID","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"_title":{"type":"string","description":"Entity title"},"_org":{"type":"string","description":"Ivy Organization ID the entity belongs to","example":"206801"},"_schema":{"type":"string","description":"URL-friendly identifier for the entity schema","example":"message"},"_tags":{"type":"array","description":"Entity tags","items":{"type":"string"},"example":["pricing","INBOX"]},"_created_at":{"type":"string","description":"Created date","format":"date-time","example":"2021-02-09T12:41:43.662Z"},"_updated_at":{"type":"string","description":"Updated date","format":"date-time","example":"2021-02-10T09:14:31.990Z"}}},"Thread":{"description":"Thread properties depend on API caller as it\'s not pre-defined. We do recommend having at least `topic` property for categorizing.","required":["topic"],"properties":{"topic":{"type":"string","description":"Message topic (e.g. which service sends the message or message category)","example":"CUSTOMER_MESSAGE"},"assigned_to":{"type":"array","description":"Ivy User ID of who the message is assigned to. Default is the user who sends message.","items":{"type":"string","example":["206801","200109"]}},"org_read_message":{"type":"array","description":"Ivy Organization ID of organization read the message.","items":{"type":"string","example":["789372","210291"]}},"latest_message":{"type":"object","description":"Latest message of thread","$ref":"#/components/schemas/Message"},"latest_trash_message":{"type":"object","description":"Latest trash message of thread","$ref":"#/components/schemas/Message"}}},"Message":{"type":"object","required":["subject","from"],"properties":{"message_id":{"type":"string","description":"Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.","example":"<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"},"sender":{"type":"string","description":"Ivy User ID of user sends the message.","example":"206801"},"subject":{"type":"string","description":"Subject","example":"Request for solar panel price"},"html":{"type":"string","description":"HTML body","example":"<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"},"text":{"type":"string","description":"Text body","example":"We at ABC GmbH would like to request a price quote for the solar panel."},"from":{"$ref":"#/components/schemas/Address"},"reply_to":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","description":"To email addresses","items":{"$ref":"#/components/schemas/Address"}},"cc":{"type":"array","description":"Cc email addresses","items":{"$ref":"#/components/schemas/Address"}},"bcc":{"type":"array","description":"Bcc email addresses","items":{"$ref":"#/components/schemas/Address"}},"file":{"$ref":"#/components/schemas/AttachmentsRelation"},"references":{"type":"string","description":"References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\\\\\\nThe last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\\\\\\nThe basic idea is that sender should copy `references` from the parent and append the parent\'s `message_id` when replying.\\n","example":"<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"},"in_reply_to":{"type":"string","description":"In-Reply-To header. Value is the `message_id` of parent message.\\n","example":"<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"},"user_read_message":{"type":"array","description":"Ivy User ID of user read the message.","items":{"type":"string","example":["206801","200109"]}},"org_read_message":{"type":"array","description":"Ivy Organization ID of organization read the message.","items":{"type":"string","example":["789372","210291"]}},"send_status":{"type":"array","description":"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`\\\\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\\n","items":{"type":"string","enum":["SEND","DELIVERY","REJECT","COMPLAINT","BOUNCE","ERROR"]}},"type":{"type":"string","description":"Message type","enum":["SENT","RECEIVED"]}}},"Address":{"type":"object","required":["address"],"properties":{"name":{"type":"string","description":"Email address alias","example":"epilot"},"address":{"type":"string","description":"Email address","example":"messaging@epilot.cloud"},"send_status":{"type":"string","description":"Sent message status regarding to this recipient.\\\\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\\n","enum":["SEND","DELIVERY","REJECT","COMPLAINT","BOUNCE","ERROR"]},"send_error":{"type":"object","description":"Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\\\\\\nJSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>\\n"}}},"AttachmentsRelation":{"type":"object","description":"Message attachments","properties":{"$relation":{"type":"array","description":"It\'s normal entity relation with some additional properties for sending message attachment.","items":{"$ref":"#/components/schemas/File"}}}},"File":{"type":"object","required":["entity_id"],"properties":{"entity_id":{"type":"string","description":"File entity ID","example":"f820ce3b-07b0-45ae-bcc6-babb2f53f79f"},"filename":{"type":"string","description":"File name","example":"Produktinformationen_epilot360_Double_Opt_in.pdf"},"is_message_attachment":{"type":"boolean","description":"To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation."},"cid":{"type":"string","description":"Content ID (for inline)","example":"fb222496-a1a5-4639-94f2-07b5e35e4068"},"inline":{"type":"boolean","description":"If true then this attachment should not be offered for download (at least not in the main attachments list).\\\\\\nThe usecase is CID embedded image (aka inline image).\\n","default":false},"send_as_link":{"type":"boolean","description":"If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\\\\\\nIn this case, service doesn\'t process this attachment.\\n","default":false}}},"MessageRequestParams":{"required":["subject","from"],"properties":{"thread":{"type":"object","required":["topic"],"description":"Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\\\\\\nThread properties depend on API caller as it\'s not pre-defined. We do recommend having at least `topic` property for categorizing.\\\\\\n`thread` or `parent_id` must be provided either.\\n","properties":{"topic":{"type":"string","description":"Message topic (e.g. which service sends the message or message category)"},"assigned_to":{"type":"array","description":"Ivy User ID of who the message is assigned to. Default is the user who sends message.","items":{"type":"string"}}},"example":{"topic":"CUSTOMER_MESSAGE","assigned_to":["206801","200109"],"opportunity_id":829072}},"parent_id":{"type":"string","description":"Entity ID of parent message which this message replies to or forwards from.\\\\\\nIf both `parent_id` and `thread` are provided, `thread` is discarded.\\n","example":"44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"},"subject":{"type":"string","description":"Subject","example":"Request for solar panel price"},"html":{"type":"string","description":"HTML body","example":"<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"},"text":{"type":"string","description":"Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text)","example":"We at ABC GmbH would like to request a price quote for the solar panel."},"from":{"$ref":"#/components/schemas/Address"},"reply_to":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","description":"To email addresses","items":{"$ref":"#/components/schemas/Address"}},"cc":{"type":"array","description":"Cc email addresses","items":{"$ref":"#/components/schemas/Address"}},"bcc":{"type":"array","description":"Bcc email addresses","items":{"$ref":"#/components/schemas/Address"}},"file":{"$ref":"#/components/schemas/AttachmentsRelation"}}},"SearchParams":{"type":"object","required":["q"],"properties":{"q":{"description":"Lucene query syntax supported with ElasticSearch","type":"string","example":"subject:\\"Request for solar panel price\\" AND _tags:INBOX"},"from":{"type":"integer","minimum":0,"default":0},"size":{"type":"integer","minimum":1,"default":10}}}}},"servers":[{"url":"https://message.sls.epilot.io"},{"url":"https://message.sls.epilot.io"}]}')}},s={};return function t(a){if(s[a])return s[a].exports;var r=s[a]={exports:{}};return e[a].call(r.exports,r,r.exports,t),r.exports}(914)})());
|
|
1
|
+
!function(e,s){for(var t in s)e[t]=s[t];s.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,s,t){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var r=a(t(279));s.default=r.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"Message API","version":"1.0.0","description":"Send and receive email messages via your epilot organization\\n"},"security":[{"EpilotAuth":[]},{"EpilotOrg":[]}],"tags":[{"name":"Messages"},{"name":"Threads"},{"name":"Drafts"}],"paths":{"/v1/message/messages":{"post":{"operationId":"sendMessage","summary":"sendMessage","description":"Send an email message","tags":["Messages"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequestParams"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}},"put":{"operationId":"updateMessage","summary":"updateMessage","description":"Update message metadata","tags":["Messages"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}":{"get":{"operationId":"getMessage","summary":"getMessage","description":"Get an email message by id","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}},"delete":{"operationId":"deleteMessage","summary":"deleteMessage","description":"Immediately and permanently delete a message. This operation cannot be undone.","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/trash":{"post":{"operationId":"trashMessage","summary":"trashMessage","description":"Move a message to the trash","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/untrash":{"post":{"operationId":"untrashMessage","summary":"untrashMessage","description":"Restore a trashed message","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/read":{"post":{"operationId":"markReadMessage","summary":"markReadMessage","description":"Mark message as read","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","summary":"markUnreadMessage","description":"Mark message as unread","tags":["Messages"],"parameters":[{"name":"id","description":"Message ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","summary":"searchThreads","description":"Search for threads of email messages.\\n\\nMessages with no replies yet are treated as threads with single message.\\n\\nLucene syntax supported.\\n","tags":["Threads"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchParams"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["hits","results"],"properties":{"hits":{"type":"number","description":"Total of matched threads","example":14},"results":{"type":"array","description":"Matched threads","items":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Thread"}]}}}}}}},"403":{"description":"Forbidden"}}}},"/v1/message/threads":{"put":{"operationId":"updateThread","summary":"updateThread","description":"Modify thread metadata","tags":["Threads"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Thread"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}":{"delete":{"operationId":"deleteThread","summary":"deleteThread","description":"Immediately and permanently delete a thread. This operation cannot be undone.","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/trash":{"post":{"operationId":"trashThread","summary":"trashThread","description":"Move a thread to trash","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/untrash":{"post":{"operationId":"untrashThread","summary":"untrashThread","description":"Restore a trashed thread","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/read":{"post":{"operationId":"markReadThread","summary":"markReadThread","description":"Mark thread as read","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","summary":"markUnreadThread","description":"Mark thread as unread","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/threads/{id}/assign":{"post":{"operationId":"assignThread","summary":"assignThread","description":"Assign thread to entities","tags":["Threads"],"parameters":[{"name":"id","description":"Thread ID","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Entities which thread is assigned to","type":"array","items":{"type":"object","properties":{"slug":{"description":"Entity slug","type":"string","example":"contact"},"entity_id":{"description":"Entity ID","type":"string","example":"3f34ce73-089c-4d45-a5ee-c161234e41c3"},"is_main_entity":{"description":"To indicate this is main entity","type":"boolean","example":true}}}}}}},"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"}}}},"/v1/message/drafts":{"post":{"operationId":"createDraft","summary":"createDraft","description":"Create a new draft","tags":["Drafts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequestParams"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}},"/v1/message/drafts:send":{"post":{"operationId":"sendDraft","summary":"sendDraft","description":"Send the existing draft to the recipients","tags":["Drafts"],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Message"}]}}}},"403":{"description":"Forbidden"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"EpilotOrg":{"description":"Overrides the target organization to allow shared tenant access","name":"x-epilot-org-id","in":"header","type":"apiKey"}},"schemas":{"BaseEntity":{"type":"object","required":["_id","_title","_org","_schema","_created_at","_updated_at"],"properties":{"_id":{"type":"string","description":"Entity ID","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"_title":{"type":"string","description":"Entity title"},"_org":{"type":"string","description":"Ivy Organization ID the entity belongs to","example":"206801"},"_schema":{"type":"string","description":"URL-friendly identifier for the entity schema","example":"message"},"_tags":{"type":"array","description":"Entity tags","items":{"type":"string"},"example":["pricing","INBOX"]},"_created_at":{"type":"string","description":"Created date","format":"date-time","example":"2021-02-09T12:41:43.662Z"},"_updated_at":{"type":"string","description":"Updated date","format":"date-time","example":"2021-02-10T09:14:31.990Z"}}},"Thread":{"description":"Thread properties depend on API caller as it\'s not pre-defined. We do recommend having at least `topic` property for categorizing.","required":["topic"],"properties":{"topic":{"type":"string","description":"Message topic (e.g. which service sends the message or message category)","example":"CUSTOMER_MESSAGE"},"assigned_to":{"type":"array","description":"Ivy User ID of who the message is assigned to. Default is the user who sends message.","items":{"type":"string","example":["206801","200109"]}},"org_read_message":{"type":"array","description":"Ivy Organization ID of organization read the message.","items":{"type":"string","example":["789372","210291"]}},"latest_message":{"type":"object","description":"Latest message of thread","$ref":"#/components/schemas/Message"},"latest_trash_message":{"type":"object","description":"Latest trash message of thread","$ref":"#/components/schemas/Message"}}},"Message":{"type":"object","required":["subject","from"],"properties":{"message_id":{"type":"string","description":"Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.","example":"<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"},"sender":{"type":"string","description":"Ivy User ID of user sends the message.","example":"206801"},"subject":{"type":"string","description":"Subject","example":"Request for solar panel price"},"html":{"type":"string","description":"HTML body","example":"<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"},"text":{"type":"string","description":"Text body","example":"We at ABC GmbH would like to request a price quote for the solar panel."},"from":{"$ref":"#/components/schemas/Address"},"reply_to":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","description":"To email addresses","items":{"$ref":"#/components/schemas/Address"}},"cc":{"type":"array","description":"Cc email addresses","items":{"$ref":"#/components/schemas/Address"}},"bcc":{"type":"array","description":"Bcc email addresses","items":{"$ref":"#/components/schemas/Address"}},"file":{"$ref":"#/components/schemas/AttachmentsRelation"},"references":{"type":"string","description":"References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\\\\\\nThe last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\\\\\\nThe basic idea is that sender should copy `references` from the parent and append the parent\'s `message_id` when replying.\\n","example":"<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"},"in_reply_to":{"type":"string","description":"In-Reply-To header. Value is the `message_id` of parent message.\\n","example":"<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"},"user_read_message":{"type":"array","description":"Ivy User ID of user read the message.","items":{"type":"string","example":["206801","200109"]}},"org_read_message":{"type":"array","description":"Ivy Organization ID of organization read the message.","items":{"type":"string","example":["789372","210291"]}},"send_status":{"type":"array","description":"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`\\\\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\\n","items":{"type":"string","enum":["SEND","DELIVERY","REJECT","COMPLAINT","BOUNCE","ERROR"]}},"type":{"type":"string","description":"Message type","enum":["SENT","RECEIVED"]}}},"Address":{"type":"object","required":["address"],"properties":{"name":{"type":"string","description":"Email address alias","example":"epilot"},"address":{"type":"string","description":"Email address","example":"messaging@epilot.cloud"},"send_status":{"type":"string","description":"Sent message status regarding to this recipient.\\\\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\\n","enum":["SEND","DELIVERY","REJECT","COMPLAINT","BOUNCE","ERROR"]},"send_error":{"type":"object","description":"Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\\\\\\nJSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>\\n"}}},"AttachmentsRelation":{"type":"object","description":"Message attachments","properties":{"$relation":{"type":"array","description":"It\'s normal entity relation with some additional properties for sending message attachment.","items":{"$ref":"#/components/schemas/File"}}}},"File":{"type":"object","required":["entity_id"],"properties":{"entity_id":{"type":"string","description":"File entity ID","example":"f820ce3b-07b0-45ae-bcc6-babb2f53f79f"},"filename":{"type":"string","description":"File name","example":"Produktinformationen_epilot360_Double_Opt_in.pdf"},"is_message_attachment":{"type":"boolean","description":"To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation."},"cid":{"type":"string","description":"Content ID (for inline)","example":"fb222496-a1a5-4639-94f2-07b5e35e4068"},"inline":{"type":"boolean","description":"If true then this attachment should not be offered for download (at least not in the main attachments list).\\\\\\nThe usecase is CID embedded image (aka inline image).\\n","default":false},"send_as_link":{"type":"boolean","description":"If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\\\\\\nIn this case, service doesn\'t process this attachment.\\n","default":false}}},"MessageRequestParams":{"required":["subject","from"],"properties":{"thread":{"type":"object","required":["topic"],"description":"Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\\\\\\nThread properties depend on API caller as it\'s not pre-defined. We do recommend having at least `topic` property for categorizing.\\\\\\n`thread` or `parent_id` must be provided either.\\n","properties":{"topic":{"type":"string","description":"Message topic (e.g. which service sends the message or message category)"},"assigned_to":{"type":"array","description":"Ivy User ID of who the message is assigned to. Default is the user who sends message.","items":{"type":"string"}}},"example":{"topic":"CUSTOMER_MESSAGE","assigned_to":["206801","200109"],"opportunity_id":829072}},"parent_id":{"type":"string","description":"Entity ID of parent message which this message replies to or forwards from.\\\\\\nIf both `parent_id` and `thread` are provided, `thread` is discarded.\\n","example":"44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"},"subject":{"type":"string","description":"Subject","example":"Request for solar panel price"},"html":{"type":"string","description":"HTML body","example":"<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"},"text":{"type":"string","description":"Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text)","example":"We at ABC GmbH would like to request a price quote for the solar panel."},"from":{"$ref":"#/components/schemas/Address"},"reply_to":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","description":"To email addresses","items":{"$ref":"#/components/schemas/Address"}},"cc":{"type":"array","description":"Cc email addresses","items":{"$ref":"#/components/schemas/Address"}},"bcc":{"type":"array","description":"Bcc email addresses","items":{"$ref":"#/components/schemas/Address"}},"file":{"$ref":"#/components/schemas/AttachmentsRelation"}}},"SearchParams":{"type":"object","required":["q"],"properties":{"q":{"description":"Lucene query syntax supported with ElasticSearch","type":"string","example":"subject:\\"Request for solar panel price\\" AND _tags:INBOX"},"from":{"type":"integer","minimum":0,"default":0},"size":{"type":"integer","minimum":1,"default":10}}}}},"servers":[{"url":"https://message.sls.epilot.io"},{"url":"https://message.sls.epilot.io"}]}')}},s={};return function t(a){if(s[a])return s[a].exports;var r=s[a]={exports:{}};return e[a].call(r.exports,r,r.exports,t),r.exports}(914)})());
|
package/dist/openapi.d.ts
CHANGED
|
@@ -316,6 +316,43 @@ declare namespace Components {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
declare namespace Paths {
|
|
319
|
+
namespace AssignThread {
|
|
320
|
+
namespace Parameters {
|
|
321
|
+
export type Id = string;
|
|
322
|
+
}
|
|
323
|
+
export interface PathParameters {
|
|
324
|
+
id: Parameters.Id;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Entities which thread is assigned to
|
|
328
|
+
*/
|
|
329
|
+
export type RequestBody = {
|
|
330
|
+
/**
|
|
331
|
+
* Entity slug
|
|
332
|
+
* example:
|
|
333
|
+
* contact
|
|
334
|
+
*/
|
|
335
|
+
slug?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Entity ID
|
|
338
|
+
* example:
|
|
339
|
+
* 3f34ce73-089c-4d45-a5ee-c161234e41c3
|
|
340
|
+
*/
|
|
341
|
+
entity_id?: string;
|
|
342
|
+
/**
|
|
343
|
+
* To indicate this is main entity
|
|
344
|
+
* example:
|
|
345
|
+
* true
|
|
346
|
+
*/
|
|
347
|
+
is_main_entity?: boolean;
|
|
348
|
+
}[];
|
|
349
|
+
namespace Responses {
|
|
350
|
+
export interface $204 {
|
|
351
|
+
}
|
|
352
|
+
export interface $403 {
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
319
356
|
namespace CreateDraft {
|
|
320
357
|
export type RequestBody = Components.Schemas.MessageRequestParams;
|
|
321
358
|
namespace Responses {
|
|
@@ -1421,6 +1458,16 @@ export interface OperationMethods {
|
|
|
1421
1458
|
data?: any,
|
|
1422
1459
|
config?: AxiosRequestConfig
|
|
1423
1460
|
): OperationResponse<Paths.MarkUnreadThread.Responses.$204>
|
|
1461
|
+
/**
|
|
1462
|
+
* assignThread - assignThread
|
|
1463
|
+
*
|
|
1464
|
+
* Assign thread to entities
|
|
1465
|
+
*/
|
|
1466
|
+
'assignThread'(
|
|
1467
|
+
parameters?: Parameters<Paths.AssignThread.PathParameters> | null,
|
|
1468
|
+
data?: Paths.AssignThread.RequestBody,
|
|
1469
|
+
config?: AxiosRequestConfig
|
|
1470
|
+
): OperationResponse<Paths.AssignThread.Responses.$204>
|
|
1424
1471
|
/**
|
|
1425
1472
|
* createDraft - createDraft
|
|
1426
1473
|
*
|
|
@@ -1625,6 +1672,18 @@ export interface PathsDictionary {
|
|
|
1625
1672
|
config?: AxiosRequestConfig
|
|
1626
1673
|
): OperationResponse<Paths.MarkUnreadThread.Responses.$204>
|
|
1627
1674
|
}
|
|
1675
|
+
['/v1/message/threads/{id}/assign']: {
|
|
1676
|
+
/**
|
|
1677
|
+
* assignThread - assignThread
|
|
1678
|
+
*
|
|
1679
|
+
* Assign thread to entities
|
|
1680
|
+
*/
|
|
1681
|
+
'post'(
|
|
1682
|
+
parameters?: Parameters<Paths.AssignThread.PathParameters> | null,
|
|
1683
|
+
data?: Paths.AssignThread.RequestBody,
|
|
1684
|
+
config?: AxiosRequestConfig
|
|
1685
|
+
): OperationResponse<Paths.AssignThread.Responses.$204>
|
|
1686
|
+
}
|
|
1628
1687
|
['/v1/message/drafts']: {
|
|
1629
1688
|
/**
|
|
1630
1689
|
* createDraft - createDraft
|
package/dist/openapi.json
CHANGED
|
@@ -518,6 +518,66 @@
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
},
|
|
521
|
+
"/v1/message/threads/{id}/assign": {
|
|
522
|
+
"post": {
|
|
523
|
+
"operationId": "assignThread",
|
|
524
|
+
"summary": "assignThread",
|
|
525
|
+
"description": "Assign thread to entities",
|
|
526
|
+
"tags": [
|
|
527
|
+
"Threads"
|
|
528
|
+
],
|
|
529
|
+
"parameters": [
|
|
530
|
+
{
|
|
531
|
+
"name": "id",
|
|
532
|
+
"description": "Thread ID",
|
|
533
|
+
"in": "path",
|
|
534
|
+
"required": true,
|
|
535
|
+
"schema": {
|
|
536
|
+
"type": "string"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"requestBody": {
|
|
541
|
+
"required": true,
|
|
542
|
+
"content": {
|
|
543
|
+
"application/json": {
|
|
544
|
+
"schema": {
|
|
545
|
+
"description": "Entities which thread is assigned to",
|
|
546
|
+
"type": "array",
|
|
547
|
+
"items": {
|
|
548
|
+
"type": "object",
|
|
549
|
+
"properties": {
|
|
550
|
+
"slug": {
|
|
551
|
+
"description": "Entity slug",
|
|
552
|
+
"type": "string",
|
|
553
|
+
"example": "contact"
|
|
554
|
+
},
|
|
555
|
+
"entity_id": {
|
|
556
|
+
"description": "Entity ID",
|
|
557
|
+
"type": "string",
|
|
558
|
+
"example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
|
|
559
|
+
},
|
|
560
|
+
"is_main_entity": {
|
|
561
|
+
"description": "To indicate this is main entity",
|
|
562
|
+
"type": "boolean",
|
|
563
|
+
"example": true
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
"responses": {
|
|
572
|
+
"204": {
|
|
573
|
+
"description": "Success"
|
|
574
|
+
},
|
|
575
|
+
"403": {
|
|
576
|
+
"description": "Forbidden"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
},
|
|
521
581
|
"/v1/message/drafts": {
|
|
522
582
|
"post": {
|
|
523
583
|
"operationId": "createDraft",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/message-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "API Client for epilot Message API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"webpack": "~5.18.0",
|
|
72
72
|
"webpack-cli": "^4.4.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "4c9e28ec90fe5737c30b2c0d559a8eef72f9372a"
|
|
75
75
|
}
|