ultracart_rest_api_v2_typescript 4.0.87-RC → 4.0.88-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/ConversationMessage.d.ts +6 -0
- package/dist/models/ConversationMessage.js +2 -0
- package/package.json +1 -1
- package/src/apis/ConversationApi.ts +60 -0
- package/src/models/ConversationMessage.ts +8 -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.88-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.88-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.88-RC | 11/29/2022 | converstation marked convo read method |
|
|
57
58
|
| 4.0.87-RC | 11/21/2022 | coupon - addl optional minimums for percent off msrp items coupon |
|
|
58
59
|
| 4.0.86-RC | 11/21/2022 | conversation context method |
|
|
59
60
|
| 4.0.85-RC | 11/21/2022 | adjusted conversation event model |
|
|
@@ -38,6 +38,9 @@ export interface JoinConversationRequest {
|
|
|
38
38
|
export interface LeaveConversationRequest {
|
|
39
39
|
conversationUuid: string;
|
|
40
40
|
}
|
|
41
|
+
export interface MarkReadConversationRequest {
|
|
42
|
+
conversationUuid: string;
|
|
43
|
+
}
|
|
41
44
|
export interface StartConversationRequest {
|
|
42
45
|
startRequest: ConversationStartRequest;
|
|
43
46
|
}
|
|
@@ -195,6 +198,20 @@ export interface ConversationApiInterface {
|
|
|
195
198
|
* Leave a conversation
|
|
196
199
|
*/
|
|
197
200
|
leaveConversation(requestParameters: LeaveConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Mark a conversation as read
|
|
203
|
+
* @summary Mark a conversation as read
|
|
204
|
+
* @param {string} conversationUuid
|
|
205
|
+
* @param {*} [options] Override http request option.
|
|
206
|
+
* @throws {RequiredError}
|
|
207
|
+
* @memberof ConversationApiInterface
|
|
208
|
+
*/
|
|
209
|
+
markReadConversationRaw(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
210
|
+
/**
|
|
211
|
+
* Mark a conversation as read
|
|
212
|
+
* Mark a conversation as read
|
|
213
|
+
*/
|
|
214
|
+
markReadConversation(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
198
215
|
/**
|
|
199
216
|
* Start a new conversation
|
|
200
217
|
* @summary Start a conversation
|
|
@@ -329,6 +346,16 @@ export declare class ConversationApi extends runtime.BaseAPI implements Conversa
|
|
|
329
346
|
* Leave a conversation
|
|
330
347
|
*/
|
|
331
348
|
leaveConversation(requestParameters: LeaveConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
349
|
+
/**
|
|
350
|
+
* Mark a conversation as read
|
|
351
|
+
* Mark a conversation as read
|
|
352
|
+
*/
|
|
353
|
+
markReadConversationRaw(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
354
|
+
/**
|
|
355
|
+
* Mark a conversation as read
|
|
356
|
+
* Mark a conversation as read
|
|
357
|
+
*/
|
|
358
|
+
markReadConversation(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
332
359
|
/**
|
|
333
360
|
* Start a new conversation
|
|
334
361
|
* Start a conversation
|
|
@@ -669,6 +669,63 @@ var ConversationApi = /** @class */ (function (_super) {
|
|
|
669
669
|
});
|
|
670
670
|
});
|
|
671
671
|
};
|
|
672
|
+
/**
|
|
673
|
+
* Mark a conversation as read
|
|
674
|
+
* Mark a conversation as read
|
|
675
|
+
*/
|
|
676
|
+
ConversationApi.prototype.markReadConversationRaw = function (requestParameters, initOverrides) {
|
|
677
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
678
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
679
|
+
return __generator(this, function (_c) {
|
|
680
|
+
switch (_c.label) {
|
|
681
|
+
case 0:
|
|
682
|
+
if (requestParameters.conversationUuid === null || requestParameters.conversationUuid === undefined) {
|
|
683
|
+
throw new runtime.RequiredError('conversationUuid', 'Required parameter requestParameters.conversationUuid was null or undefined when calling markReadConversation.');
|
|
684
|
+
}
|
|
685
|
+
queryParameters = {};
|
|
686
|
+
headerParameters = {};
|
|
687
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
688
|
+
// oauth required
|
|
689
|
+
_a = headerParameters;
|
|
690
|
+
_b = "Authorization";
|
|
691
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["conversation_write"])];
|
|
692
|
+
case 1:
|
|
693
|
+
// oauth required
|
|
694
|
+
_a[_b] = _c.sent();
|
|
695
|
+
_c.label = 2;
|
|
696
|
+
case 2:
|
|
697
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
698
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
699
|
+
}
|
|
700
|
+
return [4 /*yield*/, this.request({
|
|
701
|
+
path: "/conversation/conversations/{conversation_uuid}/markread".replace("{".concat("conversation_uuid", "}"), encodeURIComponent(String(requestParameters.conversationUuid))),
|
|
702
|
+
method: 'PUT',
|
|
703
|
+
headers: headerParameters,
|
|
704
|
+
query: queryParameters,
|
|
705
|
+
}, initOverrides)];
|
|
706
|
+
case 3:
|
|
707
|
+
response = _c.sent();
|
|
708
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* Mark a conversation as read
|
|
715
|
+
* Mark a conversation as read
|
|
716
|
+
*/
|
|
717
|
+
ConversationApi.prototype.markReadConversation = function (requestParameters, initOverrides) {
|
|
718
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
719
|
+
return __generator(this, function (_a) {
|
|
720
|
+
switch (_a.label) {
|
|
721
|
+
case 0: return [4 /*yield*/, this.markReadConversationRaw(requestParameters, initOverrides)];
|
|
722
|
+
case 1:
|
|
723
|
+
_a.sent();
|
|
724
|
+
return [2 /*return*/];
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
};
|
|
672
729
|
/**
|
|
673
730
|
* Start a new conversation
|
|
674
731
|
* Start a conversation
|
|
@@ -46,6 +46,12 @@ export interface ConversationMessage {
|
|
|
46
46
|
* @memberof ConversationMessage
|
|
47
47
|
*/
|
|
48
48
|
conversation_message_uuid?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Delay message transmission until date/time
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof ConversationMessage
|
|
53
|
+
*/
|
|
54
|
+
delay_until_dts?: string;
|
|
49
55
|
/**
|
|
50
56
|
*
|
|
51
57
|
* @type {Array<string>}
|
|
@@ -37,6 +37,7 @@ function ConversationMessageFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
37
37
|
'body': !(0, runtime_1.exists)(json, 'body') ? undefined : json['body'],
|
|
38
38
|
'client_message_id': !(0, runtime_1.exists)(json, 'client_message_id') ? undefined : json['client_message_id'],
|
|
39
39
|
'conversation_message_uuid': !(0, runtime_1.exists)(json, 'conversation_message_uuid') ? undefined : json['conversation_message_uuid'],
|
|
40
|
+
'delay_until_dts': !(0, runtime_1.exists)(json, 'delay_until_dts') ? undefined : json['delay_until_dts'],
|
|
40
41
|
'media_urls': !(0, runtime_1.exists)(json, 'media_urls') ? undefined : json['media_urls'],
|
|
41
42
|
'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
42
43
|
'message_dts': !(0, runtime_1.exists)(json, 'message_dts') ? undefined : json['message_dts'],
|
|
@@ -60,6 +61,7 @@ function ConversationMessageToJSON(value) {
|
|
|
60
61
|
'body': value.body,
|
|
61
62
|
'client_message_id': value.client_message_id,
|
|
62
63
|
'conversation_message_uuid': value.conversation_message_uuid,
|
|
64
|
+
'delay_until_dts': value.delay_until_dts,
|
|
63
65
|
'media_urls': value.media_urls,
|
|
64
66
|
'merchant_id': value.merchant_id,
|
|
65
67
|
'message_dts': value.message_dts,
|
package/package.json
CHANGED
|
@@ -84,6 +84,10 @@ export interface LeaveConversationRequest {
|
|
|
84
84
|
conversationUuid: string;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
export interface MarkReadConversationRequest {
|
|
88
|
+
conversationUuid: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
87
91
|
export interface StartConversationRequest {
|
|
88
92
|
startRequest: ConversationStartRequest;
|
|
89
93
|
}
|
|
@@ -263,6 +267,22 @@ export interface ConversationApiInterface {
|
|
|
263
267
|
*/
|
|
264
268
|
leaveConversation(requestParameters: LeaveConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
265
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Mark a conversation as read
|
|
272
|
+
* @summary Mark a conversation as read
|
|
273
|
+
* @param {string} conversationUuid
|
|
274
|
+
* @param {*} [options] Override http request option.
|
|
275
|
+
* @throws {RequiredError}
|
|
276
|
+
* @memberof ConversationApiInterface
|
|
277
|
+
*/
|
|
278
|
+
markReadConversationRaw(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Mark a conversation as read
|
|
282
|
+
* Mark a conversation as read
|
|
283
|
+
*/
|
|
284
|
+
markReadConversation(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
285
|
+
|
|
266
286
|
/**
|
|
267
287
|
* Start a new conversation
|
|
268
288
|
* @summary Start a conversation
|
|
@@ -722,6 +742,46 @@ export class ConversationApi extends runtime.BaseAPI implements ConversationApiI
|
|
|
722
742
|
await this.leaveConversationRaw(requestParameters, initOverrides);
|
|
723
743
|
}
|
|
724
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Mark a conversation as read
|
|
747
|
+
* Mark a conversation as read
|
|
748
|
+
*/
|
|
749
|
+
async markReadConversationRaw(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
750
|
+
if (requestParameters.conversationUuid === null || requestParameters.conversationUuid === undefined) {
|
|
751
|
+
throw new runtime.RequiredError('conversationUuid','Required parameter requestParameters.conversationUuid was null or undefined when calling markReadConversation.');
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const queryParameters: any = {};
|
|
755
|
+
|
|
756
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
757
|
+
|
|
758
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
759
|
+
// oauth required
|
|
760
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["conversation_write"]);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
764
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const response = await this.request({
|
|
768
|
+
path: `/conversation/conversations/{conversation_uuid}/markread`.replace(`{${"conversation_uuid"}}`, encodeURIComponent(String(requestParameters.conversationUuid))),
|
|
769
|
+
method: 'PUT',
|
|
770
|
+
headers: headerParameters,
|
|
771
|
+
query: queryParameters,
|
|
772
|
+
}, initOverrides);
|
|
773
|
+
|
|
774
|
+
return new runtime.VoidApiResponse(response);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Mark a conversation as read
|
|
779
|
+
* Mark a conversation as read
|
|
780
|
+
*/
|
|
781
|
+
async markReadConversation(requestParameters: MarkReadConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
782
|
+
await this.markReadConversationRaw(requestParameters, initOverrides);
|
|
783
|
+
}
|
|
784
|
+
|
|
725
785
|
/**
|
|
726
786
|
* Start a new conversation
|
|
727
787
|
* Start a conversation
|
|
@@ -56,6 +56,12 @@ export interface ConversationMessage {
|
|
|
56
56
|
* @memberof ConversationMessage
|
|
57
57
|
*/
|
|
58
58
|
conversation_message_uuid?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Delay message transmission until date/time
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof ConversationMessage
|
|
63
|
+
*/
|
|
64
|
+
delay_until_dts?: string;
|
|
59
65
|
/**
|
|
60
66
|
*
|
|
61
67
|
* @type {Array<string>}
|
|
@@ -126,6 +132,7 @@ export function ConversationMessageFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
126
132
|
'body': !exists(json, 'body') ? undefined : json['body'],
|
|
127
133
|
'client_message_id': !exists(json, 'client_message_id') ? undefined : json['client_message_id'],
|
|
128
134
|
'conversation_message_uuid': !exists(json, 'conversation_message_uuid') ? undefined : json['conversation_message_uuid'],
|
|
135
|
+
'delay_until_dts': !exists(json, 'delay_until_dts') ? undefined : json['delay_until_dts'],
|
|
129
136
|
'media_urls': !exists(json, 'media_urls') ? undefined : json['media_urls'],
|
|
130
137
|
'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
131
138
|
'message_dts': !exists(json, 'message_dts') ? undefined : json['message_dts'],
|
|
@@ -150,6 +157,7 @@ export function ConversationMessageToJSON(value?: ConversationMessage | null): a
|
|
|
150
157
|
'body': value.body,
|
|
151
158
|
'client_message_id': value.client_message_id,
|
|
152
159
|
'conversation_message_uuid': value.conversation_message_uuid,
|
|
160
|
+
'delay_until_dts': value.delay_until_dts,
|
|
153
161
|
'media_urls': value.media_urls,
|
|
154
162
|
'merchant_id': value.merchant_id,
|
|
155
163
|
'message_dts': value.message_dts,
|