ultracart_rest_api_v2_typescript 4.0.35-RC → 4.0.36-RC
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/README.md +3 -2
- package/dist/apis/ConversationApi.d.ts +27 -0
- package/dist/apis/ConversationApi.js +57 -0
- package/dist/models/ConversationAgentAuthResponse.d.ts +12 -0
- package/dist/models/ConversationAgentAuthResponse.js +4 -0
- package/package.json +1 -1
- package/src/apis/ConversationApi.ts +60 -0
- package/src/models/ConversationAgentAuthResponse.ts +16 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## ultracart_rest_api_v2_typescript@4.0.
|
|
1
|
+
## ultracart_rest_api_v2_typescript@4.0.36-RC
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install ultracart_rest_api_v2_typescript@4.0.
|
|
39
|
+
npm install ultracart_rest_api_v2_typescript@4.0.36-RC --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -54,6 +54,7 @@ Not every change is committed to every SDK.
|
|
|
54
54
|
|
|
55
55
|
| Version | Date | Comments |
|
|
56
56
|
| --: | :-: | --- |
|
|
57
|
+
| 4.0.36-RC | 07/18/2022 | twilio dev |
|
|
57
58
|
| 4.0.35-RC | 07/14/2022 | Add channel storefront_oid to the customer activity record |
|
|
58
59
|
| 4.0.34-RC | 07/11/2022 | Customer API - mergeCustomer method |
|
|
59
60
|
| 4.0.33-RC | 07/05/2022 | docs update |
|
|
@@ -14,6 +14,9 @@ import { Conversation, ConversationAgentAuthResponse, ConversationStartRequest,
|
|
|
14
14
|
export interface GetConversationRequest {
|
|
15
15
|
conversationUuid: string;
|
|
16
16
|
}
|
|
17
|
+
export interface GetConversationMultimediaUploadUrlRequest {
|
|
18
|
+
extension: string;
|
|
19
|
+
}
|
|
17
20
|
export interface GetConversationsRequest {
|
|
18
21
|
limit?: number;
|
|
19
22
|
offset?: number;
|
|
@@ -61,6 +64,20 @@ export interface ConversationApiInterface {
|
|
|
61
64
|
* Retrieve a conversation
|
|
62
65
|
*/
|
|
63
66
|
getConversation(requestParameters: GetConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Conversation>;
|
|
67
|
+
/**
|
|
68
|
+
* Get a presigned conersation multimedia upload URL
|
|
69
|
+
* @summary Get a presigned conersation multimedia upload URL
|
|
70
|
+
* @param {string} extension
|
|
71
|
+
* @param {*} [options] Override http request option.
|
|
72
|
+
* @throws {RequiredError}
|
|
73
|
+
* @memberof ConversationApiInterface
|
|
74
|
+
*/
|
|
75
|
+
getConversationMultimediaUploadUrlRaw(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
76
|
+
/**
|
|
77
|
+
* Get a presigned conersation multimedia upload URL
|
|
78
|
+
* Get a presigned conersation multimedia upload URL
|
|
79
|
+
*/
|
|
80
|
+
getConversationMultimediaUploadUrl(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
64
81
|
/**
|
|
65
82
|
* Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
|
|
66
83
|
* @summary Retrieve a list of conversation summaries newest to oldest
|
|
@@ -143,6 +160,16 @@ export declare class ConversationApi extends runtime.BaseAPI implements Conversa
|
|
|
143
160
|
* Retrieve a conversation
|
|
144
161
|
*/
|
|
145
162
|
getConversation(requestParameters: GetConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Conversation>;
|
|
163
|
+
/**
|
|
164
|
+
* Get a presigned conersation multimedia upload URL
|
|
165
|
+
* Get a presigned conersation multimedia upload URL
|
|
166
|
+
*/
|
|
167
|
+
getConversationMultimediaUploadUrlRaw(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
168
|
+
/**
|
|
169
|
+
* Get a presigned conersation multimedia upload URL
|
|
170
|
+
* Get a presigned conersation multimedia upload URL
|
|
171
|
+
*/
|
|
172
|
+
getConversationMultimediaUploadUrl(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
146
173
|
/**
|
|
147
174
|
* Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
|
|
148
175
|
* Retrieve a list of conversation summaries newest to oldest
|
|
@@ -190,6 +190,63 @@ var ConversationApi = /** @class */ (function (_super) {
|
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Get a presigned conersation multimedia upload URL
|
|
195
|
+
* Get a presigned conersation multimedia upload URL
|
|
196
|
+
*/
|
|
197
|
+
ConversationApi.prototype.getConversationMultimediaUploadUrlRaw = function (requestParameters, initOverrides) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
200
|
+
return __generator(this, function (_c) {
|
|
201
|
+
switch (_c.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
if (requestParameters.extension === null || requestParameters.extension === undefined) {
|
|
204
|
+
throw new runtime.RequiredError('extension', 'Required parameter requestParameters.extension was null or undefined when calling getConversationMultimediaUploadUrl.');
|
|
205
|
+
}
|
|
206
|
+
queryParameters = {};
|
|
207
|
+
headerParameters = {};
|
|
208
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
209
|
+
// oauth required
|
|
210
|
+
_a = headerParameters;
|
|
211
|
+
_b = "Authorization";
|
|
212
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["conversation_write"])];
|
|
213
|
+
case 1:
|
|
214
|
+
// oauth required
|
|
215
|
+
_a[_b] = _c.sent();
|
|
216
|
+
_c.label = 2;
|
|
217
|
+
case 2:
|
|
218
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
219
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
220
|
+
}
|
|
221
|
+
return [4 /*yield*/, this.request({
|
|
222
|
+
path: "/conversation/upload_url/{extension}".replace("{".concat("extension", "}"), encodeURIComponent(String(requestParameters.extension))),
|
|
223
|
+
method: 'GET',
|
|
224
|
+
headers: headerParameters,
|
|
225
|
+
query: queryParameters,
|
|
226
|
+
}, initOverrides)];
|
|
227
|
+
case 3:
|
|
228
|
+
response = _c.sent();
|
|
229
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Get a presigned conersation multimedia upload URL
|
|
236
|
+
* Get a presigned conersation multimedia upload URL
|
|
237
|
+
*/
|
|
238
|
+
ConversationApi.prototype.getConversationMultimediaUploadUrl = function (requestParameters, initOverrides) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
240
|
+
return __generator(this, function (_a) {
|
|
241
|
+
switch (_a.label) {
|
|
242
|
+
case 0: return [4 /*yield*/, this.getConversationMultimediaUploadUrlRaw(requestParameters, initOverrides)];
|
|
243
|
+
case 1:
|
|
244
|
+
_a.sent();
|
|
245
|
+
return [2 /*return*/];
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
};
|
|
193
250
|
/**
|
|
194
251
|
* Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
|
|
195
252
|
* Retrieve a list of conversation summaries newest to oldest
|
|
@@ -27,6 +27,18 @@ export interface ConversationAgentAuthResponse {
|
|
|
27
27
|
* @memberof ConversationAgentAuthResponse
|
|
28
28
|
*/
|
|
29
29
|
jwt?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ConversationAgentAuthResponse
|
|
34
|
+
*/
|
|
35
|
+
merchant_id?: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {Array<string>}
|
|
39
|
+
* @memberof ConversationAgentAuthResponse
|
|
40
|
+
*/
|
|
41
|
+
twilio_phone_numbers?: Array<string>;
|
|
30
42
|
/**
|
|
31
43
|
*
|
|
32
44
|
* @type {string}
|
|
@@ -26,6 +26,8 @@ function ConversationAgentAuthResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
26
26
|
return {
|
|
27
27
|
'conversation_participant_arn': !(0, runtime_1.exists)(json, 'conversation_participant_arn') ? undefined : json['conversation_participant_arn'],
|
|
28
28
|
'jwt': !(0, runtime_1.exists)(json, 'jwt') ? undefined : json['jwt'],
|
|
29
|
+
'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
30
|
+
'twilio_phone_numbers': !(0, runtime_1.exists)(json, 'twilio_phone_numbers') ? undefined : json['twilio_phone_numbers'],
|
|
29
31
|
'websocket_url': !(0, runtime_1.exists)(json, 'websocket_url') ? undefined : json['websocket_url'],
|
|
30
32
|
};
|
|
31
33
|
}
|
|
@@ -40,6 +42,8 @@ function ConversationAgentAuthResponseToJSON(value) {
|
|
|
40
42
|
return {
|
|
41
43
|
'conversation_participant_arn': value.conversation_participant_arn,
|
|
42
44
|
'jwt': value.jwt,
|
|
45
|
+
'merchant_id': value.merchant_id,
|
|
46
|
+
'twilio_phone_numbers': value.twilio_phone_numbers,
|
|
43
47
|
'websocket_url': value.websocket_url,
|
|
44
48
|
};
|
|
45
49
|
}
|
package/package.json
CHANGED
|
@@ -39,6 +39,10 @@ export interface GetConversationRequest {
|
|
|
39
39
|
conversationUuid: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export interface GetConversationMultimediaUploadUrlRequest {
|
|
43
|
+
extension: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
export interface GetConversationsRequest {
|
|
43
47
|
limit?: number;
|
|
44
48
|
offset?: number;
|
|
@@ -94,6 +98,22 @@ export interface ConversationApiInterface {
|
|
|
94
98
|
*/
|
|
95
99
|
getConversation(requestParameters: GetConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Conversation>;
|
|
96
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Get a presigned conersation multimedia upload URL
|
|
103
|
+
* @summary Get a presigned conersation multimedia upload URL
|
|
104
|
+
* @param {string} extension
|
|
105
|
+
* @param {*} [options] Override http request option.
|
|
106
|
+
* @throws {RequiredError}
|
|
107
|
+
* @memberof ConversationApiInterface
|
|
108
|
+
*/
|
|
109
|
+
getConversationMultimediaUploadUrlRaw(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Get a presigned conersation multimedia upload URL
|
|
113
|
+
* Get a presigned conersation multimedia upload URL
|
|
114
|
+
*/
|
|
115
|
+
getConversationMultimediaUploadUrl(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
116
|
+
|
|
97
117
|
/**
|
|
98
118
|
* Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
|
|
99
119
|
* @summary Retrieve a list of conversation summaries newest to oldest
|
|
@@ -244,6 +264,46 @@ export class ConversationApi extends runtime.BaseAPI implements ConversationApiI
|
|
|
244
264
|
return await response.value();
|
|
245
265
|
}
|
|
246
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Get a presigned conersation multimedia upload URL
|
|
269
|
+
* Get a presigned conersation multimedia upload URL
|
|
270
|
+
*/
|
|
271
|
+
async getConversationMultimediaUploadUrlRaw(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
272
|
+
if (requestParameters.extension === null || requestParameters.extension === undefined) {
|
|
273
|
+
throw new runtime.RequiredError('extension','Required parameter requestParameters.extension was null or undefined when calling getConversationMultimediaUploadUrl.');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const queryParameters: any = {};
|
|
277
|
+
|
|
278
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
279
|
+
|
|
280
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
281
|
+
// oauth required
|
|
282
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["conversation_write"]);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
286
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const response = await this.request({
|
|
290
|
+
path: `/conversation/upload_url/{extension}`.replace(`{${"extension"}}`, encodeURIComponent(String(requestParameters.extension))),
|
|
291
|
+
method: 'GET',
|
|
292
|
+
headers: headerParameters,
|
|
293
|
+
query: queryParameters,
|
|
294
|
+
}, initOverrides);
|
|
295
|
+
|
|
296
|
+
return new runtime.VoidApiResponse(response);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Get a presigned conersation multimedia upload URL
|
|
301
|
+
* Get a presigned conersation multimedia upload URL
|
|
302
|
+
*/
|
|
303
|
+
async getConversationMultimediaUploadUrl(requestParameters: GetConversationMultimediaUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
304
|
+
await this.getConversationMultimediaUploadUrlRaw(requestParameters, initOverrides);
|
|
305
|
+
}
|
|
306
|
+
|
|
247
307
|
/**
|
|
248
308
|
* Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
|
|
249
309
|
* Retrieve a list of conversation summaries newest to oldest
|
|
@@ -31,6 +31,18 @@ export interface ConversationAgentAuthResponse {
|
|
|
31
31
|
* @memberof ConversationAgentAuthResponse
|
|
32
32
|
*/
|
|
33
33
|
jwt?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ConversationAgentAuthResponse
|
|
38
|
+
*/
|
|
39
|
+
merchant_id?: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {Array<string>}
|
|
43
|
+
* @memberof ConversationAgentAuthResponse
|
|
44
|
+
*/
|
|
45
|
+
twilio_phone_numbers?: Array<string>;
|
|
34
46
|
/**
|
|
35
47
|
*
|
|
36
48
|
* @type {string}
|
|
@@ -51,6 +63,8 @@ export function ConversationAgentAuthResponseFromJSONTyped(json: any, ignoreDisc
|
|
|
51
63
|
|
|
52
64
|
'conversation_participant_arn': !exists(json, 'conversation_participant_arn') ? undefined : json['conversation_participant_arn'],
|
|
53
65
|
'jwt': !exists(json, 'jwt') ? undefined : json['jwt'],
|
|
66
|
+
'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
67
|
+
'twilio_phone_numbers': !exists(json, 'twilio_phone_numbers') ? undefined : json['twilio_phone_numbers'],
|
|
54
68
|
'websocket_url': !exists(json, 'websocket_url') ? undefined : json['websocket_url'],
|
|
55
69
|
};
|
|
56
70
|
}
|
|
@@ -66,6 +80,8 @@ export function ConversationAgentAuthResponseToJSON(value?: ConversationAgentAut
|
|
|
66
80
|
|
|
67
81
|
'conversation_participant_arn': value.conversation_participant_arn,
|
|
68
82
|
'jwt': value.jwt,
|
|
83
|
+
'merchant_id': value.merchant_id,
|
|
84
|
+
'twilio_phone_numbers': value.twilio_phone_numbers,
|
|
69
85
|
'websocket_url': value.websocket_url,
|
|
70
86
|
};
|
|
71
87
|
}
|