@epilot/message-client 1.13.0 → 1.15.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 epilot GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/dist/client.d.ts CHANGED
File without changes
package/dist/client.js CHANGED
File without changes
File without changes
@@ -1 +1 @@
1
- (()=>{"use strict";var e={914:function(e,a,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0});var t=s(r(240));a.default=t.default},240: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":{}}}},"put":{"operationId":"updateMessage"}},"/v1/message/messages/{id}":{"get":{"operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true}]},"delete":{"operationId":"deleteMessage","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/messages/{id}/trash":{"post":{"operationId":"trashMessage","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/messages/{id}/untrash":{"post":{"operationId":"untrashMessage","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/messages/{id}/read":{"post":{"operationId":"markReadMessage","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","requestBody":{"content":{"application/json":{}}}}},"/v1/message/threads":{"put":{"operationId":"updateThread"}},"/v1/message/threads/{id}":{"delete":{"operationId":"deleteThread","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads/{id}/trash":{"post":{"operationId":"trashThread","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads/{id}/untrash":{"post":{"operationId":"untrashThread","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads/{id}/read":{"post":{"operationId":"markReadThread","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/message/threads/{id}/assign":{"post":{"operationId":"assignThread","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/message/threads/{id}/assign:users":{"post":{"operationId":"assignUsers","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/message/drafts":{"post":{"operationId":"createDraft","requestBody":{"content":{"application/json":{}}}}},"/v1/message/drafts:send":{"post":{"operationId":"sendDraft"}},"/v2/message/messages/{id}":{"get":{"operationId":"getMessageV2","parameters":[{"name":"id","in":"path","required":true}]}}},"components":{},"servers":[{"url":"https://message.sls.epilot.io"}]}')}},a={},r=function r(s){var t=a[s];if(void 0!==t)return t.exports;var d=a[s]={exports:{}};return e[s].call(d.exports,d,d.exports,r),d.exports}(914),s=exports;for(var t in r)s[t]=r[t];r.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={914: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(240));s.default=t.default},240: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/{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":{}}},"/v1/message/messages/{id}/unread":{"post":{"operationId":"markUnreadMessage","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads:search":{"post":{"operationId":"searchThreads","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}/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/{id}/read":{"post":{"operationId":"markReadThread","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/message/threads/{id}/unread":{"post":{"operationId":"markUnreadThread","parameters":[{"name":"id","in":"path","required":true}],"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/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":{},"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}(914),a=exports;for(var t in r)a[t]=r[t];r.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './client';
2
- export type { Client, Components, Paths, PathsDictionary, OperationMethods } from './openapi';
2
+ export * from './openapi';
3
3
  export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
package/dist/index.js CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client"), exports);
18
+ __exportStar(require("./openapi"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -18,10 +18,12 @@
18
18
  "content": {
19
19
  "application/json": {}
20
20
  }
21
- }
21
+ },
22
+ "responses": {}
22
23
  },
23
24
  "put": {
24
- "operationId": "updateMessage"
25
+ "operationId": "updateMessage",
26
+ "responses": {}
25
27
  }
26
28
  },
27
29
  "/v1/message/messages/{id}": {
@@ -33,7 +35,8 @@
33
35
  "in": "path",
34
36
  "required": true
35
37
  }
36
- ]
38
+ ],
39
+ "responses": {}
37
40
  },
38
41
  "delete": {
39
42
  "operationId": "deleteMessage",
@@ -43,7 +46,8 @@
43
46
  "in": "path",
44
47
  "required": true
45
48
  }
46
- ]
49
+ ],
50
+ "responses": {}
47
51
  }
48
52
  },
49
53
  "/v1/message/messages/{id}/trash": {
@@ -55,7 +59,8 @@
55
59
  "in": "path",
56
60
  "required": true
57
61
  }
58
- ]
62
+ ],
63
+ "responses": {}
59
64
  }
60
65
  },
61
66
  "/v1/message/messages/{id}/untrash": {
@@ -67,7 +72,8 @@
67
72
  "in": "path",
68
73
  "required": true
69
74
  }
70
- ]
75
+ ],
76
+ "responses": {}
71
77
  }
72
78
  },
73
79
  "/v1/message/messages/{id}/read": {
@@ -79,7 +85,8 @@
79
85
  "in": "path",
80
86
  "required": true
81
87
  }
82
- ]
88
+ ],
89
+ "responses": {}
83
90
  }
84
91
  },
85
92
  "/v1/message/messages/{id}/unread": {
@@ -91,7 +98,8 @@
91
98
  "in": "path",
92
99
  "required": true
93
100
  }
94
- ]
101
+ ],
102
+ "responses": {}
95
103
  }
96
104
  },
97
105
  "/v1/message/threads:search": {
@@ -101,12 +109,14 @@
101
109
  "content": {
102
110
  "application/json": {}
103
111
  }
104
- }
112
+ },
113
+ "responses": {}
105
114
  }
106
115
  },
107
116
  "/v1/message/threads": {
108
117
  "put": {
109
- "operationId": "updateThread"
118
+ "operationId": "updateThread",
119
+ "responses": {}
110
120
  }
111
121
  },
112
122
  "/v1/message/threads/{id}": {
@@ -118,7 +128,8 @@
118
128
  "in": "path",
119
129
  "required": true
120
130
  }
121
- ]
131
+ ],
132
+ "responses": {}
122
133
  }
123
134
  },
124
135
  "/v1/message/threads/{id}/trash": {
@@ -130,7 +141,8 @@
130
141
  "in": "path",
131
142
  "required": true
132
143
  }
133
- ]
144
+ ],
145
+ "responses": {}
134
146
  }
135
147
  },
136
148
  "/v1/message/threads/{id}/untrash": {
@@ -142,7 +154,8 @@
142
154
  "in": "path",
143
155
  "required": true
144
156
  }
145
- ]
157
+ ],
158
+ "responses": {}
146
159
  }
147
160
  },
148
161
  "/v1/message/threads/{id}/read": {
@@ -154,7 +167,8 @@
154
167
  "in": "path",
155
168
  "required": true
156
169
  }
157
- ]
170
+ ],
171
+ "responses": {}
158
172
  }
159
173
  },
160
174
  "/v1/message/threads/{id}/unread": {
@@ -166,7 +180,8 @@
166
180
  "in": "path",
167
181
  "required": true
168
182
  }
169
- ]
183
+ ],
184
+ "responses": {}
170
185
  }
171
186
  },
172
187
  "/v1/message/threads/{id}/assign": {
@@ -184,7 +199,27 @@
184
199
  "content": {
185
200
  "application/json": {}
186
201
  }
187
- }
202
+ },
203
+ "responses": {}
204
+ }
205
+ },
206
+ "/v1/message/threads/{id}/unassign": {
207
+ "post": {
208
+ "operationId": "unassignThread",
209
+ "parameters": [
210
+ {
211
+ "name": "id",
212
+ "in": "path",
213
+ "required": true
214
+ }
215
+ ],
216
+ "requestBody": {
217
+ "required": true,
218
+ "content": {
219
+ "application/json": {}
220
+ }
221
+ },
222
+ "responses": {}
188
223
  }
189
224
  },
190
225
  "/v1/message/threads/{id}/assign:users": {
@@ -202,7 +237,8 @@
202
237
  "content": {
203
238
  "application/json": {}
204
239
  }
205
- }
240
+ },
241
+ "responses": {}
206
242
  }
207
243
  },
208
244
  "/v1/message/drafts": {
@@ -212,12 +248,14 @@
212
248
  "content": {
213
249
  "application/json": {}
214
250
  }
215
- }
251
+ },
252
+ "responses": {}
216
253
  }
217
254
  },
218
255
  "/v1/message/drafts:send": {
219
256
  "post": {
220
- "operationId": "sendDraft"
257
+ "operationId": "sendDraft",
258
+ "responses": {}
221
259
  }
222
260
  },
223
261
  "/v2/message/messages/{id}": {
@@ -229,7 +267,8 @@
229
267
  "in": "path",
230
268
  "required": true
231
269
  }
232
- ]
270
+ ],
271
+ "responses": {}
233
272
  }
234
273
  }
235
274
  },
package/dist/openapi.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable */
2
+
2
3
  import type {
3
4
  OpenAPIClient,
4
5
  Parameters,
5
6
  UnknownParamsObject,
6
7
  OperationResponse,
7
8
  AxiosRequestConfig,
8
- } from 'openapi-client-axios';
9
+ } from 'openapi-client-axios';
9
10
 
10
11
  declare namespace Components {
11
12
  namespace Schemas {
@@ -1311,6 +1312,37 @@ declare namespace Paths {
1311
1312
  }
1312
1313
  }
1313
1314
  }
1315
+ namespace UnassignThread {
1316
+ namespace Parameters {
1317
+ export type Id = string;
1318
+ }
1319
+ export interface PathParameters {
1320
+ id: Parameters.Id;
1321
+ }
1322
+ /**
1323
+ * Entities which thread is unassigned from
1324
+ */
1325
+ export type RequestBody = {
1326
+ /**
1327
+ * Entity slug
1328
+ * example:
1329
+ * contact
1330
+ */
1331
+ slug?: string;
1332
+ /**
1333
+ * Entity ID
1334
+ * example:
1335
+ * 3f34ce73-089c-4d45-a5ee-c161234e41c3
1336
+ */
1337
+ entity_id?: string;
1338
+ }[];
1339
+ namespace Responses {
1340
+ export interface $204 {
1341
+ }
1342
+ export interface $403 {
1343
+ }
1344
+ }
1345
+ }
1314
1346
  namespace UntrashMessage {
1315
1347
  namespace Parameters {
1316
1348
  export type Id = string;
@@ -1716,6 +1748,16 @@ export interface OperationMethods {
1716
1748
  data?: Paths.AssignThread.RequestBody,
1717
1749
  config?: AxiosRequestConfig
1718
1750
  ): OperationResponse<Paths.AssignThread.Responses.$204>
1751
+ /**
1752
+ * unassignThread - unassignThread
1753
+ *
1754
+ * Unassign thread from entities
1755
+ */
1756
+ 'unassignThread'(
1757
+ parameters?: Parameters<Paths.UnassignThread.PathParameters> | null,
1758
+ data?: Paths.UnassignThread.RequestBody,
1759
+ config?: AxiosRequestConfig
1760
+ ): OperationResponse<Paths.UnassignThread.Responses.$204>
1719
1761
  /**
1720
1762
  * assignUsers - assignUsers
1721
1763
  *
@@ -1964,6 +2006,18 @@ export interface PathsDictionary {
1964
2006
  config?: AxiosRequestConfig
1965
2007
  ): OperationResponse<Paths.AssignThread.Responses.$204>
1966
2008
  }
2009
+ ['/v1/message/threads/{id}/unassign']: {
2010
+ /**
2011
+ * unassignThread - unassignThread
2012
+ *
2013
+ * Unassign thread from entities
2014
+ */
2015
+ 'post'(
2016
+ parameters?: Parameters<Paths.UnassignThread.PathParameters> | null,
2017
+ data?: Paths.UnassignThread.RequestBody,
2018
+ config?: AxiosRequestConfig
2019
+ ): OperationResponse<Paths.UnassignThread.Responses.$204>
2020
+ }
1967
2021
  ['/v1/message/threads/{id}/assign:users']: {
1968
2022
  /**
1969
2023
  * assignUsers - assignUsers
@@ -2027,3 +2081,13 @@ export interface PathsDictionary {
2027
2081
  }
2028
2082
 
2029
2083
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
2084
+
2085
+ export type Address = Components.Schemas.Address;
2086
+ export type AttachmentsRelation = Components.Schemas.AttachmentsRelation;
2087
+ export type BaseEntity = Components.Schemas.BaseEntity;
2088
+ export type File = Components.Schemas.File;
2089
+ export type Message = Components.Schemas.Message;
2090
+ export type MessageRequestParams = Components.Schemas.MessageRequestParams;
2091
+ export type MessageV2 = Components.Schemas.MessageV2;
2092
+ export type SearchParams = Components.Schemas.SearchParams;
2093
+ export type Thread = Components.Schemas.Thread;
package/dist/openapi.json CHANGED
@@ -595,6 +595,61 @@
595
595
  }
596
596
  }
597
597
  },
598
+ "/v1/message/threads/{id}/unassign": {
599
+ "post": {
600
+ "operationId": "unassignThread",
601
+ "summary": "unassignThread",
602
+ "description": "Unassign thread from entities",
603
+ "tags": [
604
+ "Threads"
605
+ ],
606
+ "parameters": [
607
+ {
608
+ "name": "id",
609
+ "description": "Thread ID",
610
+ "in": "path",
611
+ "required": true,
612
+ "schema": {
613
+ "type": "string"
614
+ }
615
+ }
616
+ ],
617
+ "requestBody": {
618
+ "required": true,
619
+ "content": {
620
+ "application/json": {
621
+ "schema": {
622
+ "description": "Entities which thread is unassigned from",
623
+ "type": "array",
624
+ "items": {
625
+ "type": "object",
626
+ "properties": {
627
+ "slug": {
628
+ "description": "Entity slug",
629
+ "type": "string",
630
+ "example": "contact"
631
+ },
632
+ "entity_id": {
633
+ "description": "Entity ID",
634
+ "type": "string",
635
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }
641
+ }
642
+ },
643
+ "responses": {
644
+ "204": {
645
+ "description": "Success"
646
+ },
647
+ "403": {
648
+ "description": "Forbidden"
649
+ }
650
+ }
651
+ }
652
+ },
598
653
  "/v1/message/threads/{id}/assign:users": {
599
654
  "post": {
600
655
  "operationId": "assignUsers",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/message-client",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "API Client for epilot Message API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "typescript": "tsc",
24
24
  "bundle-definition": "webpack",
25
25
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/message.yaml",
26
- "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
26
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
27
27
  "build": "tsc && npm run bundle-definition",
28
28
  "build:watch": "npm run build && tsc -w",
29
29
  "prepublishOnly": "npm run typegen && npm run build",
@@ -62,8 +62,7 @@
62
62
  "copy-webpack-plugin": "^7.0.0",
63
63
  "jest": "^26.6.3",
64
64
  "json-loader": "^0.5.7",
65
- "openapi-client-axios-typegen": "^7.4.1",
66
- "openapicmd": "^2.1.0",
65
+ "openapicmd": "^2.6.0",
67
66
  "ts-jest": "^26.5.0",
68
67
  "ts-loader": "^8.0.14",
69
68
  "ts-node": "^10.9.1",
@@ -71,5 +70,5 @@
71
70
  "webpack": "^5.18.0",
72
71
  "webpack-cli": "^4.4.0"
73
72
  },
74
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
75
- }
73
+ "gitHead": "6c12dc4aaf7ddf60ad11c6f596fb478559fa3052"
74
+ }