@epilot/message-client 1.20.0 → 1.23.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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={390:function(e,s,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var t=a(r(466));s.default=t.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"","version":""},"paths":{"/v1/message/messages":{"post":{"operationId":"sendMessage","parameters":[{"in":"query","name":"do_not_create_entities"}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"put":{"operationId":"updateMessage","responses":{}}},"/v1/message/messages/{id}":{"get":{"operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages:search":{"post":{"operationId":"searchMessages","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/messages/{id}/trash":{"post":{"operationId":"trashMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/{id}/untrash":{"post":{"operationId":"untrashMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/{id}/read":{"post":{"operationId":"markReadMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/messages/{id}/read":{"post":{"operationId":"markReadMessageV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/unread/{actor}":{"get":{"operationId":"getUnread","parameters":[{"name":"actor","in":"path","required":true},{"in":"query","name":"email_filter"}],"responses":{}}},"/v2/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessageV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/message/threads:search":{"post":{"operationId":"searchThreadsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads:searchIds":{"post":{"operationId":"searchIds","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads":{"put":{"operationId":"updateThread","responses":{}}},"/v1/message/threads/{id}":{"delete":{"operationId":"deleteThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}:move":{"post":{"operationId":"moveThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}:markAsDone":{"post":{"operationId":"markThreadAsDone","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}:markAsOpen":{"post":{"operationId":"markThreadAsOpen","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/timeline":{"get":{"operationId":"getThreadTimeline","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/trash":{"post":{"operationId":"trashThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/untrash":{"post":{"operationId":"untrashThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/bulk:read":{"post":{"operationId":"threadBulkActionsRead","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:unread":{"post":{"operationId":"threadBulkActionsUnread","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:favorite":{"post":{"operationId":"threadBulkActionsFavorite","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:unfavorite":{"post":{"operationId":"threadBulkActionsUnfavorite","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:trash":{"post":{"operationId":"threadBulkActionsTrash","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:untrash":{"post":{"operationId":"threadBulkActionsUntrash","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:delete":{"post":{"operationId":"threadBulkActionsDelete","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:done":{"post":{"operationId":"threadBulkActionsDone","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:open":{"post":{"operationId":"threadBulkActionsOpen","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/read":{"post":{"operationId":"markReadThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/threads/{id}/read":{"post":{"operationId":"markReadThreadV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThreadV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/assign":{"post":{"operationId":"assignThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/unassign":{"post":{"operationId":"unassignThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/assign:users":{"post":{"operationId":"assignUsers","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}:pin":{"post":{"operationId":"pinThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"unpinThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/drafts":{"post":{"operationId":"createDraft","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/drafts:send":{"post":{"operationId":"sendDraft","responses":{}}},"/v2/message/messages/{id}":{"get":{"operationId":"getMessageV2","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}}},"components":{"responses":{"NotFound":{"content":{"application/json":{}}},"Conflict":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"BadRequest":{"content":{"application/json":{}}},"Forbidden":{"content":{"application/json":{}}}}},"servers":[{"url":"https://message.sls.epilot.io"}]}')}},s={},r=function r(a){var t=s[a];if(void 0!==t)return t.exports;var n=s[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}(390),a=exports;for(var t in r)a[t]=r[t];r.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={330:function(e,s,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var a=t(r(466));s.default=a.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"","version":""},"paths":{"/v1/message/messages":{"post":{"operationId":"sendMessage","parameters":[{"in":"query","name":"do_not_create_entities"}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"put":{"operationId":"updateMessage","responses":{}}},"/outlook/connect":{"get":{"operationId":"connectOutlook","responses":{}}},"/outlook/connection/status":{"get":{"operationId":"getOutlookConnectionStatus","responses":{}}},"/outlook/connection/disconnect":{"post":{"operationId":"disconnectOutlook","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/outlook/shared-mailboxes/connect":{"post":{"operationId":"connectSharedMailbox","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/outlook/oauth/callback":{"get":{"operationId":"outlookOAuthCallback","parameters":[{"name":"code","in":"query","required":false},{"name":"state","in":"query","required":true},{"name":"session_state","in":"query","required":false},{"name":"error","in":"query","required":false},{"name":"error_description","in":"query","required":false},{"name":"error_subcode","in":"query","required":false},{"name":"client_info","in":"query","required":false},{"name":"error_uri","in":"query","required":false},{"name":"admin_consent","in":"query","required":false},{"name":"tenant","in":"query","required":false}],"responses":{}}},"/v1/message/messages/{id}":{"get":{"operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages:search":{"post":{"operationId":"searchMessages","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/messages/{id}/trash":{"post":{"operationId":"trashMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/{id}/untrash":{"post":{"operationId":"untrashMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/{id}/read":{"post":{"operationId":"markReadMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/messages/{id}/read":{"post":{"operationId":"markReadMessageV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/messages/unread/{actor}":{"get":{"operationId":"getUnread","parameters":[{"name":"actor","in":"path","required":true},{"in":"query","name":"email_filter"}],"responses":{}}},"/v2/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessageV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/message/threads:search":{"post":{"operationId":"searchThreadsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads:searchIds":{"post":{"operationId":"searchIds","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads":{"put":{"operationId":"updateThread","responses":{}}},"/v1/message/threads/{id}":{"delete":{"operationId":"deleteThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}:move":{"post":{"operationId":"moveThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}:markAsDone":{"post":{"operationId":"markThreadAsDone","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}:markAsOpen":{"post":{"operationId":"markThreadAsOpen","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/timeline":{"get":{"operationId":"getThreadTimeline","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/trash":{"post":{"operationId":"trashThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/untrash":{"post":{"operationId":"untrashThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/bulk:read":{"post":{"operationId":"threadBulkActionsRead","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:unread":{"post":{"operationId":"threadBulkActionsUnread","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:favorite":{"post":{"operationId":"threadBulkActionsFavorite","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:unfavorite":{"post":{"operationId":"threadBulkActionsUnfavorite","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:trash":{"post":{"operationId":"threadBulkActionsTrash","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:untrash":{"post":{"operationId":"threadBulkActionsUntrash","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:delete":{"post":{"operationId":"threadBulkActionsDelete","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:done":{"post":{"operationId":"threadBulkActionsDone","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/bulk:open":{"post":{"operationId":"threadBulkActionsOpen","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/read":{"post":{"operationId":"markReadThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/threads/{id}/read":{"post":{"operationId":"markReadThreadV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v2/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThreadV2","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/assign":{"post":{"operationId":"assignThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/unassign":{"post":{"operationId":"unassignThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}/assign:users":{"post":{"operationId":"assignUsers","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/message/threads/{id}:pin":{"post":{"operationId":"pinThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"unpinThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/drafts":{"post":{"operationId":"createDraft","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/message/drafts:send":{"post":{"operationId":"sendDraft","responses":{}}},"/v2/message/messages/{id}":{"get":{"operationId":"getMessageV2","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}}},"components":{"responses":{"NotFound":{"content":{"application/json":{}}},"Conflict":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"BadRequest":{"content":{"application/json":{}}},"Forbidden":{"content":{"application/json":{}}}}},"servers":[{"url":"https://message.sls.epilot.io"}]}')}},s={},r=function r(t){var a=s[t];if(void 0!==a)return a.exports;var o=s[t]={exports:{}};return e[t].call(o.exports,o,o.exports,r),o.exports}(330),t=exports;for(var a in r)t[a]=r[a];r.__esModule&&Object.defineProperty(t,"__esModule",{value:!0})})();
@@ -26,6 +26,100 @@
26
26
  "responses": {}
27
27
  }
28
28
  },
29
+ "/outlook/connect": {
30
+ "get": {
31
+ "operationId": "connectOutlook",
32
+ "responses": {}
33
+ }
34
+ },
35
+ "/outlook/connection/status": {
36
+ "get": {
37
+ "operationId": "getOutlookConnectionStatus",
38
+ "responses": {}
39
+ }
40
+ },
41
+ "/outlook/connection/disconnect": {
42
+ "post": {
43
+ "operationId": "disconnectOutlook",
44
+ "requestBody": {
45
+ "required": true,
46
+ "content": {
47
+ "application/json": {}
48
+ }
49
+ },
50
+ "responses": {}
51
+ }
52
+ },
53
+ "/outlook/shared-mailboxes/connect": {
54
+ "post": {
55
+ "operationId": "connectSharedMailbox",
56
+ "requestBody": {
57
+ "required": true,
58
+ "content": {
59
+ "application/json": {}
60
+ }
61
+ },
62
+ "responses": {}
63
+ }
64
+ },
65
+ "/outlook/oauth/callback": {
66
+ "get": {
67
+ "operationId": "outlookOAuthCallback",
68
+ "parameters": [
69
+ {
70
+ "name": "code",
71
+ "in": "query",
72
+ "required": false
73
+ },
74
+ {
75
+ "name": "state",
76
+ "in": "query",
77
+ "required": true
78
+ },
79
+ {
80
+ "name": "session_state",
81
+ "in": "query",
82
+ "required": false
83
+ },
84
+ {
85
+ "name": "error",
86
+ "in": "query",
87
+ "required": false
88
+ },
89
+ {
90
+ "name": "error_description",
91
+ "in": "query",
92
+ "required": false
93
+ },
94
+ {
95
+ "name": "error_subcode",
96
+ "in": "query",
97
+ "required": false
98
+ },
99
+ {
100
+ "name": "client_info",
101
+ "in": "query",
102
+ "required": false
103
+ },
104
+ {
105
+ "name": "error_uri",
106
+ "in": "query",
107
+ "required": false
108
+ },
109
+ {
110
+ "name": "admin_consent",
111
+ "in": "query",
112
+ "required": false
113
+ },
114
+ {
115
+ "name": "tenant",
116
+ "in": "query",
117
+ "required": false
118
+ }
119
+ ],
120
+ "responses": {}
121
+ }
122
+ },
29
123
  "/v1/message/messages/{id}": {
30
124
  "get": {
31
125
  "operationId": "getMessage",
package/dist/openapi.d.ts CHANGED
@@ -551,12 +551,7 @@ declare namespace Components {
551
551
  hydrate?: boolean;
552
552
  }
553
553
  export interface SearchParamsV2 {
554
- /**
555
- * Inbox ID
556
- * example:
557
- * 3f34ce73-089c-4d45-a5ee-c161234e41c3
558
- */
559
- inbox_id?: string;
554
+ inbox_id?: string | string[];
560
555
  /**
561
556
  * Lucene query syntax supported with ElasticSearch
562
557
  * example:
@@ -669,7 +664,7 @@ declare namespace Components {
669
664
  /**
670
665
  * Timestamp of the event
671
666
  * example:
672
- * 2024-01-01T00:00:00.000Z
667
+ * 2024-01-01T00:00:00Z
673
668
  */
674
669
  timestamp: string;
675
670
  }
@@ -743,6 +738,68 @@ declare namespace Paths {
743
738
  }
744
739
  }
745
740
  }
741
+ namespace ConnectOutlook {
742
+ namespace Responses {
743
+ export interface $200 {
744
+ authorization_url?: string;
745
+ }
746
+ }
747
+ }
748
+ namespace ConnectSharedMailbox {
749
+ export interface RequestBody {
750
+ /**
751
+ * Email address of the Outlook shared mailbox to connect
752
+ */
753
+ email: string; // email
754
+ /**
755
+ * Display name for the shared inbox (defaults to mailbox display name)
756
+ */
757
+ name?: string;
758
+ /**
759
+ * Color for the shared inbox (hex code, defaults to green)
760
+ */
761
+ color?: string;
762
+ /**
763
+ * User IDs to assign to this shared inbox
764
+ */
765
+ assignees?: string[];
766
+ /**
767
+ * Description for the shared inbox
768
+ */
769
+ description?: string;
770
+ }
771
+ namespace Responses {
772
+ export interface $201 {
773
+ /**
774
+ * The created shared inbox from email-settings
775
+ */
776
+ shared_inbox?: {
777
+ id?: string;
778
+ name?: string;
779
+ color?: string;
780
+ assignees?: string[];
781
+ description?: string;
782
+ };
783
+ /**
784
+ * The Outlook shared mailbox email address
785
+ */
786
+ outlook_email?: string; // email
787
+ /**
788
+ * Display name of the shared mailbox
789
+ */
790
+ display_name?: string;
791
+ message?: string;
792
+ }
793
+ export interface $400 {
794
+ }
795
+ export interface $401 {
796
+ }
797
+ export interface $403 {
798
+ }
799
+ export interface $500 {
800
+ }
801
+ }
802
+ }
746
803
  namespace CreateDraft {
747
804
  export type RequestBody = Components.Schemas.MessageRequestParams;
748
805
  namespace Responses {
@@ -915,6 +972,29 @@ declare namespace Paths {
915
972
  }
916
973
  }
917
974
  }
975
+ namespace DisconnectOutlook {
976
+ export interface RequestBody {
977
+ /**
978
+ * Azure AD Tenant ID of the connection to disconnect
979
+ */
980
+ tenant_id: string;
981
+ }
982
+ namespace Responses {
983
+ export interface $200 {
984
+ success?: boolean;
985
+ /**
986
+ * The tenant ID that was disconnected
987
+ */
988
+ tenant_id?: string;
989
+ }
990
+ export interface $400 {
991
+ }
992
+ export interface $404 {
993
+ }
994
+ export interface $500 {
995
+ }
996
+ }
997
+ }
918
998
  namespace GetMessage {
919
999
  namespace Parameters {
920
1000
  /**
@@ -1241,6 +1321,78 @@ declare namespace Paths {
1241
1321
  }
1242
1322
  }
1243
1323
  }
1324
+ namespace GetOutlookConnectionStatus {
1325
+ namespace Responses {
1326
+ export interface $200 {
1327
+ /**
1328
+ * List of Outlook connections (one per tenant)
1329
+ */
1330
+ connections: {
1331
+ /**
1332
+ * Current connection status:
1333
+ * - pending_auth: Admin consent granted, waiting for user OAuth
1334
+ * - connected: Fully connected with valid tokens
1335
+ * - expired: Tokens expired, need to re-authenticate
1336
+ *
1337
+ */
1338
+ status: "connected" | "expired" | "pending_auth";
1339
+ /**
1340
+ * Action for UI to take (all call GET /outlook/connect):
1341
+ * - connect: No connection, initiate OAuth
1342
+ * - authorize: Admin consent done, complete OAuth
1343
+ * - reconnect: Re-authenticate expired session
1344
+ * - none: Fully connected, no action needed
1345
+ *
1346
+ */
1347
+ action: "connect" | "authorize" | "reconnect" | "none";
1348
+ /**
1349
+ * Display name of user who connected
1350
+ */
1351
+ connected_by_display_name?: string;
1352
+ /**
1353
+ * Email of the user who connected
1354
+ */
1355
+ connected_by_email?: string; // email
1356
+ /**
1357
+ * Azure AD Object ID of user who connected
1358
+ */
1359
+ connected_by_user_id?: string;
1360
+ /**
1361
+ * When the connection was established
1362
+ */
1363
+ connected_at?: string; // date-time
1364
+ /**
1365
+ * When the connection was last updated
1366
+ */
1367
+ updated_at?: string; // date-time
1368
+ /**
1369
+ * Microsoft Azure AD tenant ID
1370
+ */
1371
+ tenant_id: string;
1372
+ /**
1373
+ * Granted permission scopes
1374
+ */
1375
+ scopes?: string[];
1376
+ /**
1377
+ * When the current access token expires
1378
+ */
1379
+ expires_at?: string; // date-time
1380
+ /**
1381
+ * Whether the current token is still valid
1382
+ */
1383
+ is_token_valid?: boolean;
1384
+ }[];
1385
+ /**
1386
+ * Whether any connections exist
1387
+ */
1388
+ has_connections: boolean;
1389
+ }
1390
+ export interface $400 {
1391
+ }
1392
+ export interface $500 {
1393
+ }
1394
+ }
1395
+ }
1244
1396
  namespace GetThreadTimeline {
1245
1397
  namespace Parameters {
1246
1398
  export type Id = string;
@@ -1458,6 +1610,39 @@ declare namespace Paths {
1458
1610
  export type $500 = Components.Responses.InternalServerError;
1459
1611
  }
1460
1612
  }
1613
+ namespace OutlookOAuthCallback {
1614
+ namespace Parameters {
1615
+ export type AdminConsent = string;
1616
+ export type ClientInfo = string;
1617
+ export type Code = string;
1618
+ export type Error = string;
1619
+ export type ErrorDescription = string;
1620
+ export type ErrorSubcode = string;
1621
+ export type ErrorUri = string;
1622
+ export type SessionState = string;
1623
+ export type State = string;
1624
+ export type Tenant = string;
1625
+ }
1626
+ export interface QueryParameters {
1627
+ code?: Parameters.Code;
1628
+ state: Parameters.State;
1629
+ session_state?: Parameters.SessionState;
1630
+ error?: Parameters.Error;
1631
+ error_description?: Parameters.ErrorDescription;
1632
+ error_subcode?: Parameters.ErrorSubcode;
1633
+ client_info?: Parameters.ClientInfo;
1634
+ error_uri?: Parameters.ErrorUri;
1635
+ admin_consent?: Parameters.AdminConsent;
1636
+ tenant?: Parameters.Tenant;
1637
+ }
1638
+ namespace Responses {
1639
+ export interface $200 {
1640
+ connected?: boolean;
1641
+ expires_at?: string; // date-time
1642
+ scope?: string;
1643
+ }
1644
+ }
1645
+ }
1461
1646
  namespace PinThread {
1462
1647
  namespace Parameters {
1463
1648
  export type Id = string;
@@ -2458,6 +2643,66 @@ export interface OperationMethods {
2458
2643
  data?: Paths.SendMessage.RequestBody,
2459
2644
  config?: AxiosRequestConfig
2460
2645
  ): OperationResponse<Paths.SendMessage.Responses.$201>
2646
+ /**
2647
+ * connectOutlook - Connect Outlook
2648
+ *
2649
+ * Returns Microsoft authorization URL for Outlook OAuth.
2650
+ */
2651
+ 'connectOutlook'(
2652
+ parameters?: Parameters<UnknownParamsObject> | null,
2653
+ data?: any,
2654
+ config?: AxiosRequestConfig
2655
+ ): OperationResponse<Paths.ConnectOutlook.Responses.$200>
2656
+ /**
2657
+ * getOutlookConnectionStatus - Get Outlook Connection Status
2658
+ *
2659
+ * Returns all Microsoft 365 / Outlook connections for the organization.
2660
+ * Supports multiple connections (one per Azure AD tenant).
2661
+ *
2662
+ * Each connection includes an `action` field that tells the UI what button to show
2663
+ * and what endpoint to call. All actions use GET /outlook/connect.
2664
+ *
2665
+ */
2666
+ 'getOutlookConnectionStatus'(
2667
+ parameters?: Parameters<UnknownParamsObject> | null,
2668
+ data?: any,
2669
+ config?: AxiosRequestConfig
2670
+ ): OperationResponse<Paths.GetOutlookConnectionStatus.Responses.$200>
2671
+ /**
2672
+ * disconnectOutlook - Disconnect Outlook
2673
+ *
2674
+ * Removes the Microsoft 365 / Outlook connection for a specific tenant.
2675
+ * This deletes the stored tokens and disconnects the integration.
2676
+ *
2677
+ */
2678
+ 'disconnectOutlook'(
2679
+ parameters?: Parameters<UnknownParamsObject> | null,
2680
+ data?: Paths.DisconnectOutlook.RequestBody,
2681
+ config?: AxiosRequestConfig
2682
+ ): OperationResponse<Paths.DisconnectOutlook.Responses.$200>
2683
+ /**
2684
+ * connectSharedMailbox - Connect Outlook Shared Mailbox
2685
+ *
2686
+ * Connects an Outlook shared mailbox as a shared inbox.
2687
+ * 1. Validates the user has access to the shared mailbox via Microsoft Graph API
2688
+ * 2. Creates a shared inbox entry in email-settings with the Outlook provider info
2689
+ *
2690
+ */
2691
+ 'connectSharedMailbox'(
2692
+ parameters?: Parameters<UnknownParamsObject> | null,
2693
+ data?: Paths.ConnectSharedMailbox.RequestBody,
2694
+ config?: AxiosRequestConfig
2695
+ ): OperationResponse<Paths.ConnectSharedMailbox.Responses.$201>
2696
+ /**
2697
+ * outlookOAuthCallback - Outlook OAuth callback
2698
+ *
2699
+ * Exchanges authorization code for tokens and stores them.
2700
+ */
2701
+ 'outlookOAuthCallback'(
2702
+ parameters?: Parameters<Paths.OutlookOAuthCallback.QueryParameters> | null,
2703
+ data?: any,
2704
+ config?: AxiosRequestConfig
2705
+ ): OperationResponse<Paths.OutlookOAuthCallback.Responses.$200>
2461
2706
  /**
2462
2707
  * getMessage - getMessage
2463
2708
  *
@@ -2928,6 +3173,76 @@ export interface PathsDictionary {
2928
3173
  config?: AxiosRequestConfig
2929
3174
  ): OperationResponse<Paths.UpdateMessage.Responses.$201>
2930
3175
  }
3176
+ ['/outlook/connect']: {
3177
+ /**
3178
+ * connectOutlook - Connect Outlook
3179
+ *
3180
+ * Returns Microsoft authorization URL for Outlook OAuth.
3181
+ */
3182
+ 'get'(
3183
+ parameters?: Parameters<UnknownParamsObject> | null,
3184
+ data?: any,
3185
+ config?: AxiosRequestConfig
3186
+ ): OperationResponse<Paths.ConnectOutlook.Responses.$200>
3187
+ }
3188
+ ['/outlook/connection/status']: {
3189
+ /**
3190
+ * getOutlookConnectionStatus - Get Outlook Connection Status
3191
+ *
3192
+ * Returns all Microsoft 365 / Outlook connections for the organization.
3193
+ * Supports multiple connections (one per Azure AD tenant).
3194
+ *
3195
+ * Each connection includes an `action` field that tells the UI what button to show
3196
+ * and what endpoint to call. All actions use GET /outlook/connect.
3197
+ *
3198
+ */
3199
+ 'get'(
3200
+ parameters?: Parameters<UnknownParamsObject> | null,
3201
+ data?: any,
3202
+ config?: AxiosRequestConfig
3203
+ ): OperationResponse<Paths.GetOutlookConnectionStatus.Responses.$200>
3204
+ }
3205
+ ['/outlook/connection/disconnect']: {
3206
+ /**
3207
+ * disconnectOutlook - Disconnect Outlook
3208
+ *
3209
+ * Removes the Microsoft 365 / Outlook connection for a specific tenant.
3210
+ * This deletes the stored tokens and disconnects the integration.
3211
+ *
3212
+ */
3213
+ 'post'(
3214
+ parameters?: Parameters<UnknownParamsObject> | null,
3215
+ data?: Paths.DisconnectOutlook.RequestBody,
3216
+ config?: AxiosRequestConfig
3217
+ ): OperationResponse<Paths.DisconnectOutlook.Responses.$200>
3218
+ }
3219
+ ['/outlook/shared-mailboxes/connect']: {
3220
+ /**
3221
+ * connectSharedMailbox - Connect Outlook Shared Mailbox
3222
+ *
3223
+ * Connects an Outlook shared mailbox as a shared inbox.
3224
+ * 1. Validates the user has access to the shared mailbox via Microsoft Graph API
3225
+ * 2. Creates a shared inbox entry in email-settings with the Outlook provider info
3226
+ *
3227
+ */
3228
+ 'post'(
3229
+ parameters?: Parameters<UnknownParamsObject> | null,
3230
+ data?: Paths.ConnectSharedMailbox.RequestBody,
3231
+ config?: AxiosRequestConfig
3232
+ ): OperationResponse<Paths.ConnectSharedMailbox.Responses.$201>
3233
+ }
3234
+ ['/outlook/oauth/callback']: {
3235
+ /**
3236
+ * outlookOAuthCallback - Outlook OAuth callback
3237
+ *
3238
+ * Exchanges authorization code for tokens and stores them.
3239
+ */
3240
+ 'get'(
3241
+ parameters?: Parameters<Paths.OutlookOAuthCallback.QueryParameters> | null,
3242
+ data?: any,
3243
+ config?: AxiosRequestConfig
3244
+ ): OperationResponse<Paths.OutlookOAuthCallback.Responses.$200>
3245
+ }
2931
3246
  ['/v1/message/messages/{id}']: {
2932
3247
  /**
2933
3248
  * getMessage - getMessage
package/dist/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.2",
3
3
  "info": {
4
4
  "title": "Message API",
5
- "version": "1.2.0",
5
+ "version": "1.4.0",
6
6
  "description": "Send and receive email messages via your epilot organization\n"
7
7
  },
8
8
  "security": [
@@ -23,6 +23,9 @@
23
23
  {
24
24
  "name": "Drafts"
25
25
  },
26
+ {
27
+ "name": "M365 Integration"
28
+ },
26
29
  {
27
30
  "name": "message_schema",
28
31
  "x-displayName": "Message",
@@ -127,6 +130,435 @@
127
130
  }
128
131
  }
129
132
  },
133
+ "/outlook/connect": {
134
+ "get": {
135
+ "operationId": "connectOutlook",
136
+ "summary": "Connect Outlook",
137
+ "description": "Returns Microsoft authorization URL for Outlook OAuth.",
138
+ "tags": [
139
+ "M365 Integration"
140
+ ],
141
+ "responses": {
142
+ "200": {
143
+ "description": "Authorization URL",
144
+ "content": {
145
+ "application/json": {
146
+ "schema": {
147
+ "type": "object",
148
+ "properties": {
149
+ "authorization_url": {
150
+ "type": "string"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ },
160
+ "/outlook/connection/status": {
161
+ "get": {
162
+ "operationId": "getOutlookConnectionStatus",
163
+ "summary": "Get Outlook Connection Status",
164
+ "description": "Returns all Microsoft 365 / Outlook connections for the organization.\nSupports multiple connections (one per Azure AD tenant).\n\nEach connection includes an `action` field that tells the UI what button to show\nand what endpoint to call. All actions use GET /outlook/connect.\n",
165
+ "tags": [
166
+ "M365 Integration"
167
+ ],
168
+ "responses": {
169
+ "200": {
170
+ "description": "Connection status retrieved successfully",
171
+ "content": {
172
+ "application/json": {
173
+ "schema": {
174
+ "type": "object",
175
+ "required": [
176
+ "connections",
177
+ "has_connections"
178
+ ],
179
+ "properties": {
180
+ "connections": {
181
+ "type": "array",
182
+ "description": "List of Outlook connections (one per tenant)",
183
+ "items": {
184
+ "type": "object",
185
+ "required": [
186
+ "status",
187
+ "action",
188
+ "action_label",
189
+ "tenant_id"
190
+ ],
191
+ "properties": {
192
+ "status": {
193
+ "type": "string",
194
+ "enum": [
195
+ "connected",
196
+ "expired",
197
+ "pending_auth"
198
+ ],
199
+ "description": "Current connection status:\n- pending_auth: Admin consent granted, waiting for user OAuth\n- connected: Fully connected with valid tokens\n- expired: Tokens expired, need to re-authenticate\n"
200
+ },
201
+ "action": {
202
+ "type": "string",
203
+ "enum": [
204
+ "connect",
205
+ "authorize",
206
+ "reconnect",
207
+ "none"
208
+ ],
209
+ "description": "Action for UI to take (all call GET /outlook/connect):\n- connect: No connection, initiate OAuth\n- authorize: Admin consent done, complete OAuth\n- reconnect: Re-authenticate expired session\n- none: Fully connected, no action needed\n"
210
+ },
211
+ "connected_by_display_name": {
212
+ "type": "string",
213
+ "description": "Display name of user who connected"
214
+ },
215
+ "connected_by_email": {
216
+ "type": "string",
217
+ "format": "email",
218
+ "description": "Email of the user who connected"
219
+ },
220
+ "connected_by_user_id": {
221
+ "type": "string",
222
+ "description": "Azure AD Object ID of user who connected"
223
+ },
224
+ "connected_at": {
225
+ "type": "string",
226
+ "format": "date-time",
227
+ "description": "When the connection was established"
228
+ },
229
+ "updated_at": {
230
+ "type": "string",
231
+ "format": "date-time",
232
+ "description": "When the connection was last updated"
233
+ },
234
+ "tenant_id": {
235
+ "type": "string",
236
+ "description": "Microsoft Azure AD tenant ID"
237
+ },
238
+ "scopes": {
239
+ "type": "array",
240
+ "items": {
241
+ "type": "string"
242
+ },
243
+ "description": "Granted permission scopes"
244
+ },
245
+ "expires_at": {
246
+ "type": "string",
247
+ "format": "date-time",
248
+ "description": "When the current access token expires"
249
+ },
250
+ "is_token_valid": {
251
+ "type": "boolean",
252
+ "description": "Whether the current token is still valid"
253
+ }
254
+ }
255
+ }
256
+ },
257
+ "has_connections": {
258
+ "type": "boolean",
259
+ "description": "Whether any connections exist"
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ },
266
+ "400": {
267
+ "description": "Bad request - missing organization ID"
268
+ },
269
+ "500": {
270
+ "description": "Internal server error"
271
+ }
272
+ }
273
+ }
274
+ },
275
+ "/outlook/connection/disconnect": {
276
+ "post": {
277
+ "operationId": "disconnectOutlook",
278
+ "summary": "Disconnect Outlook",
279
+ "description": "Removes the Microsoft 365 / Outlook connection for a specific tenant.\nThis deletes the stored tokens and disconnects the integration.\n",
280
+ "tags": [
281
+ "M365 Integration"
282
+ ],
283
+ "requestBody": {
284
+ "required": true,
285
+ "content": {
286
+ "application/json": {
287
+ "schema": {
288
+ "type": "object",
289
+ "required": [
290
+ "tenant_id"
291
+ ],
292
+ "properties": {
293
+ "tenant_id": {
294
+ "type": "string",
295
+ "description": "Azure AD Tenant ID of the connection to disconnect"
296
+ }
297
+ }
298
+ }
299
+ }
300
+ }
301
+ },
302
+ "responses": {
303
+ "200": {
304
+ "description": "Successfully disconnected",
305
+ "content": {
306
+ "application/json": {
307
+ "schema": {
308
+ "type": "object",
309
+ "properties": {
310
+ "success": {
311
+ "type": "boolean"
312
+ },
313
+ "tenant_id": {
314
+ "type": "string",
315
+ "description": "The tenant ID that was disconnected"
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ },
322
+ "400": {
323
+ "description": "Bad request - missing tenant_id or organization ID"
324
+ },
325
+ "404": {
326
+ "description": "Connection not found"
327
+ },
328
+ "500": {
329
+ "description": "Internal server error"
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "/outlook/shared-mailboxes/connect": {
335
+ "post": {
336
+ "operationId": "connectSharedMailbox",
337
+ "summary": "Connect Outlook Shared Mailbox",
338
+ "description": "Connects an Outlook shared mailbox as a shared inbox.\n1. Validates the user has access to the shared mailbox via Microsoft Graph API\n2. Creates a shared inbox entry in email-settings with the Outlook provider info\n",
339
+ "tags": [
340
+ "M365 Integration"
341
+ ],
342
+ "requestBody": {
343
+ "required": true,
344
+ "content": {
345
+ "application/json": {
346
+ "schema": {
347
+ "type": "object",
348
+ "required": [
349
+ "email"
350
+ ],
351
+ "properties": {
352
+ "email": {
353
+ "type": "string",
354
+ "format": "email",
355
+ "description": "Email address of the Outlook shared mailbox to connect"
356
+ },
357
+ "name": {
358
+ "type": "string",
359
+ "description": "Display name for the shared inbox (defaults to mailbox display name)"
360
+ },
361
+ "color": {
362
+ "type": "string",
363
+ "description": "Color for the shared inbox (hex code, defaults to green)"
364
+ },
365
+ "assignees": {
366
+ "type": "array",
367
+ "items": {
368
+ "type": "string"
369
+ },
370
+ "description": "User IDs to assign to this shared inbox"
371
+ },
372
+ "description": {
373
+ "type": "string",
374
+ "description": "Description for the shared inbox"
375
+ }
376
+ }
377
+ }
378
+ }
379
+ }
380
+ },
381
+ "responses": {
382
+ "201": {
383
+ "description": "Shared mailbox connected successfully",
384
+ "content": {
385
+ "application/json": {
386
+ "schema": {
387
+ "type": "object",
388
+ "properties": {
389
+ "shared_inbox": {
390
+ "type": "object",
391
+ "description": "The created shared inbox from email-settings",
392
+ "properties": {
393
+ "id": {
394
+ "type": "string"
395
+ },
396
+ "name": {
397
+ "type": "string"
398
+ },
399
+ "color": {
400
+ "type": "string"
401
+ },
402
+ "assignees": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "string"
406
+ }
407
+ },
408
+ "description": {
409
+ "type": "string"
410
+ }
411
+ }
412
+ },
413
+ "outlook_email": {
414
+ "type": "string",
415
+ "format": "email",
416
+ "description": "The Outlook shared mailbox email address"
417
+ },
418
+ "display_name": {
419
+ "type": "string",
420
+ "description": "Display name of the shared mailbox"
421
+ },
422
+ "message": {
423
+ "type": "string"
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ },
430
+ "400": {
431
+ "description": "Bad request - missing email parameter"
432
+ },
433
+ "401": {
434
+ "description": "Not connected to Microsoft 365"
435
+ },
436
+ "403": {
437
+ "description": "Access denied - user does not have access to the shared mailbox"
438
+ },
439
+ "500": {
440
+ "description": "Internal server error"
441
+ }
442
+ }
443
+ }
444
+ },
445
+ "/outlook/oauth/callback": {
446
+ "get": {
447
+ "operationId": "outlookOAuthCallback",
448
+ "summary": "Outlook OAuth callback",
449
+ "description": "Exchanges authorization code for tokens and stores them.",
450
+ "tags": [
451
+ "M365 Integration"
452
+ ],
453
+ "security": [],
454
+ "parameters": [
455
+ {
456
+ "name": "code",
457
+ "in": "query",
458
+ "required": false,
459
+ "schema": {
460
+ "type": "string"
461
+ }
462
+ },
463
+ {
464
+ "name": "state",
465
+ "in": "query",
466
+ "required": true,
467
+ "schema": {
468
+ "type": "string"
469
+ }
470
+ },
471
+ {
472
+ "name": "session_state",
473
+ "in": "query",
474
+ "required": false,
475
+ "schema": {
476
+ "type": "string"
477
+ }
478
+ },
479
+ {
480
+ "name": "error",
481
+ "in": "query",
482
+ "required": false,
483
+ "schema": {
484
+ "type": "string"
485
+ }
486
+ },
487
+ {
488
+ "name": "error_description",
489
+ "in": "query",
490
+ "required": false,
491
+ "schema": {
492
+ "type": "string"
493
+ }
494
+ },
495
+ {
496
+ "name": "error_subcode",
497
+ "in": "query",
498
+ "required": false,
499
+ "schema": {
500
+ "type": "string"
501
+ }
502
+ },
503
+ {
504
+ "name": "client_info",
505
+ "in": "query",
506
+ "required": false,
507
+ "schema": {
508
+ "type": "string"
509
+ }
510
+ },
511
+ {
512
+ "name": "error_uri",
513
+ "in": "query",
514
+ "required": false,
515
+ "schema": {
516
+ "type": "string"
517
+ }
518
+ },
519
+ {
520
+ "name": "admin_consent",
521
+ "in": "query",
522
+ "required": false,
523
+ "schema": {
524
+ "type": "string"
525
+ }
526
+ },
527
+ {
528
+ "name": "tenant",
529
+ "in": "query",
530
+ "required": false,
531
+ "schema": {
532
+ "type": "string"
533
+ }
534
+ }
535
+ ],
536
+ "responses": {
537
+ "200": {
538
+ "description": "Stored",
539
+ "content": {
540
+ "application/json": {
541
+ "schema": {
542
+ "type": "object",
543
+ "properties": {
544
+ "connected": {
545
+ "type": "boolean"
546
+ },
547
+ "expires_at": {
548
+ "type": "string",
549
+ "format": "date-time"
550
+ },
551
+ "scope": {
552
+ "type": "string"
553
+ }
554
+ }
555
+ }
556
+ }
557
+ }
558
+ }
559
+ }
560
+ }
561
+ },
130
562
  "/v1/message/messages/{id}": {
131
563
  "get": {
132
564
  "operationId": "getMessage",
@@ -2267,9 +2699,24 @@
2267
2699
  ],
2268
2700
  "properties": {
2269
2701
  "inbox_id": {
2270
- "type": "string",
2271
- "description": "Inbox ID",
2272
- "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2702
+ "oneOf": [
2703
+ {
2704
+ "type": "string",
2705
+ "description": "Inbox ID",
2706
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2707
+ },
2708
+ {
2709
+ "type": "array",
2710
+ "items": {
2711
+ "type": "string"
2712
+ },
2713
+ "description": "Inbox IDs",
2714
+ "example": [
2715
+ "3f34ce73-089c-4d45-a5ee-c161234e41c3",
2716
+ "3f34ce73-089c-4d45-a5ee-c161234e41c4"
2717
+ ]
2718
+ }
2719
+ ]
2273
2720
  },
2274
2721
  "q": {
2275
2722
  "description": "Lucene query syntax supported with ElasticSearch",
@@ -2464,7 +2911,7 @@
2464
2911
  "timestamp": {
2465
2912
  "type": "string",
2466
2913
  "description": "Timestamp of the event",
2467
- "example": "2024-01-01T00:00:00.000Z"
2914
+ "example": "2024-01-01T00:00:00Z"
2468
2915
  }
2469
2916
  }
2470
2917
  },
@@ -2531,9 +2978,6 @@
2531
2978
  }
2532
2979
  },
2533
2980
  "servers": [
2534
- {
2535
- "url": "https://message.sls.epilot.io"
2536
- },
2537
2981
  {
2538
2982
  "url": "https://message.sls.epilot.io"
2539
2983
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/message-client",
3
- "version": "1.20.0",
3
+ "version": "1.23.0",
4
4
  "description": "API Client for epilot Message API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",