ultracart_rest_api_v2_typescript 4.1.73 → 4.1.74
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/.openapi-generator/FILES +1 -0
- package/README.md +3 -2
- package/dist/apis/AutoOrderApi.d.ts +34 -1
- package/dist/apis/AutoOrderApi.js +67 -0
- package/dist/models/AutoOrderItemCancelRequest.d.ts +45 -0
- package/dist/models/AutoOrderItemCancelRequest.js +59 -0
- package/dist/models/OrderFormat.d.ts +6 -0
- package/dist/models/OrderFormat.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/package.json +1 -1
- package/src/apis/AutoOrderApi.ts +81 -0
- package/src/models/AutoOrderItemCancelRequest.ts +85 -0
- package/src/models/OrderFormat.ts +8 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -52,6 +52,7 @@ src/models/AutoOrderAddonItemOption.ts
|
|
|
52
52
|
src/models/AutoOrderAddonItemsUpdateRequest.ts
|
|
53
53
|
src/models/AutoOrderConsolidate.ts
|
|
54
54
|
src/models/AutoOrderItem.ts
|
|
55
|
+
src/models/AutoOrderItemCancelRequest.ts
|
|
55
56
|
src/models/AutoOrderItemFutureSchedule.ts
|
|
56
57
|
src/models/AutoOrderItemOption.ts
|
|
57
58
|
src/models/AutoOrderItemSimpleSchedule.ts
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# UltraCart Typescript SDK
|
|
2
|
-
## ultracart_rest_api_v2_typescript@4.1.
|
|
2
|
+
## ultracart_rest_api_v2_typescript@4.1.74
|
|
3
3
|
|
|
4
4
|
Every API method call has a sample for every language SDK. See https://github.com/UltraCart/sdk_samples
|
|
5
5
|
|
|
6
6
|
Installation
|
|
7
7
|
|
|
8
8
|
```
|
|
9
|
-
npm install ultracart_rest_api_v2_typescript@4.1.
|
|
9
|
+
npm install ultracart_rest_api_v2_typescript@4.1.74 --save
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
```typescript
|
|
@@ -85,6 +85,7 @@ Not every change is committed to every SDK.
|
|
|
85
85
|
|
|
86
86
|
| Version | Date | Comments |
|
|
87
87
|
| --: | :-: | --- |
|
|
88
|
+
| 4.1.74 | 04/15/2026 | auto order - new method cancelAutoOrderItemByReferenceOrderId |
|
|
88
89
|
| 4.1.73 | 04/13/2026 | conversation pbx - queue configuration for ai summary and call record zoho desk |
|
|
89
90
|
| 4.1.72 | 04/11/2026 | conversation pbx - voicemail notification channels |
|
|
90
91
|
| 4.1.71 | 04/06/2026 | coupons - new percent_off_items_with_minimum_item_amount |
|
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import { AutoOrder, AutoOrderAddonItemsUpdateRequest, AutoOrderConsolidate, AutoOrderPropertiesUpdateRequest, AutoOrderQuery, AutoOrderQueryBatch, AutoOrderResponse, AutoOrdersRequest, AutoOrdersResponse } from '../models';
|
|
13
|
+
import { AutoOrder, AutoOrderAddonItemsUpdateRequest, AutoOrderConsolidate, AutoOrderItemCancelRequest, AutoOrderPropertiesUpdateRequest, AutoOrderQuery, AutoOrderQueryBatch, AutoOrderResponse, AutoOrdersRequest, AutoOrdersResponse } from '../models';
|
|
14
|
+
export interface CancelAutoOrderItemByReferenceOrderIdRequest {
|
|
15
|
+
referenceOrderId: string;
|
|
16
|
+
originalItemId: string;
|
|
17
|
+
expand?: string;
|
|
18
|
+
autoOrderItemCancelRequest?: AutoOrderItemCancelRequest;
|
|
19
|
+
}
|
|
14
20
|
export interface ConsolidateAutoOrdersRequest {
|
|
15
21
|
autoOrderOid: number;
|
|
16
22
|
autoOrderConsolidate: AutoOrderConsolidate;
|
|
@@ -109,6 +115,23 @@ export interface UpdateAutoOrdersBatchRequest {
|
|
|
109
115
|
* @interface AutoOrderApiInterface
|
|
110
116
|
*/
|
|
111
117
|
export interface AutoOrderApiInterface {
|
|
118
|
+
/**
|
|
119
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
120
|
+
* @summary Cancel a single item on an auto order
|
|
121
|
+
* @param {string} referenceOrderId The reference order id (original_order_id) of the auto order.
|
|
122
|
+
* @param {string} originalItemId The original_item_id (SKU) of the item to cancel.
|
|
123
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
124
|
+
* @param {AutoOrderItemCancelRequest} [autoOrderItemCancelRequest] Cancel request. Body is optional; omit for default mode=end.
|
|
125
|
+
* @param {*} [options] Override http request option.
|
|
126
|
+
* @throws {RequiredError}
|
|
127
|
+
* @memberof AutoOrderApiInterface
|
|
128
|
+
*/
|
|
129
|
+
cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
130
|
+
/**
|
|
131
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
132
|
+
* Cancel a single item on an auto order
|
|
133
|
+
*/
|
|
134
|
+
cancelAutoOrderItemByReferenceOrderId(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
112
135
|
/**
|
|
113
136
|
* Consolidates mutliple auto orders on the UltraCart account.
|
|
114
137
|
* @summary Consolidates multiple auto orders
|
|
@@ -359,6 +382,16 @@ export interface AutoOrderApiInterface {
|
|
|
359
382
|
*
|
|
360
383
|
*/
|
|
361
384
|
export declare class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
|
|
385
|
+
/**
|
|
386
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
387
|
+
* Cancel a single item on an auto order
|
|
388
|
+
*/
|
|
389
|
+
cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
390
|
+
/**
|
|
391
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
392
|
+
* Cancel a single item on an auto order
|
|
393
|
+
*/
|
|
394
|
+
cancelAutoOrderItemByReferenceOrderId(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
362
395
|
/**
|
|
363
396
|
* Consolidates mutliple auto orders on the UltraCart account.
|
|
364
397
|
* Consolidates multiple auto orders
|
|
@@ -75,6 +75,73 @@ var AutoOrderApi = /** @class */ (function (_super) {
|
|
|
75
75
|
function AutoOrderApi() {
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
80
|
+
* Cancel a single item on an auto order
|
|
81
|
+
*/
|
|
82
|
+
AutoOrderApi.prototype.cancelAutoOrderItemByReferenceOrderIdRaw = function (requestParameters, initOverrides) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
85
|
+
return __generator(this, function (_c) {
|
|
86
|
+
switch (_c.label) {
|
|
87
|
+
case 0:
|
|
88
|
+
if (requestParameters.referenceOrderId === null || requestParameters.referenceOrderId === undefined) {
|
|
89
|
+
throw new runtime.RequiredError('referenceOrderId', 'Required parameter requestParameters.referenceOrderId was null or undefined when calling cancelAutoOrderItemByReferenceOrderId.');
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters.originalItemId === null || requestParameters.originalItemId === undefined) {
|
|
92
|
+
throw new runtime.RequiredError('originalItemId', 'Required parameter requestParameters.originalItemId was null or undefined when calling cancelAutoOrderItemByReferenceOrderId.');
|
|
93
|
+
}
|
|
94
|
+
queryParameters = {};
|
|
95
|
+
if (requestParameters.expand !== undefined) {
|
|
96
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
97
|
+
}
|
|
98
|
+
headerParameters = {};
|
|
99
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
100
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
101
|
+
// oauth required
|
|
102
|
+
_a = headerParameters;
|
|
103
|
+
_b = "Authorization";
|
|
104
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["auto_order_write"])];
|
|
105
|
+
case 1:
|
|
106
|
+
// oauth required
|
|
107
|
+
_a[_b] = _c.sent();
|
|
108
|
+
_c.label = 2;
|
|
109
|
+
case 2:
|
|
110
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
111
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
112
|
+
}
|
|
113
|
+
return [4 /*yield*/, this.request({
|
|
114
|
+
path: "/auto_order/auto_orders/reference_order_id/{reference_order_id}/items/original/{original_item_id}/cancel".replace("{".concat("reference_order_id", "}"), encodeURIComponent(String(requestParameters.referenceOrderId))).replace("{".concat("original_item_id", "}"), encodeURIComponent(String(requestParameters.originalItemId))),
|
|
115
|
+
method: 'POST',
|
|
116
|
+
headers: headerParameters,
|
|
117
|
+
query: queryParameters,
|
|
118
|
+
body: (0, models_1.AutoOrderItemCancelRequestToJSON)(requestParameters.autoOrderItemCancelRequest),
|
|
119
|
+
}, initOverrides)];
|
|
120
|
+
case 3:
|
|
121
|
+
response = _c.sent();
|
|
122
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.AutoOrderResponseFromJSON)(jsonValue); })];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
129
|
+
* Cancel a single item on an auto order
|
|
130
|
+
*/
|
|
131
|
+
AutoOrderApi.prototype.cancelAutoOrderItemByReferenceOrderId = function (requestParameters, initOverrides) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
+
var response;
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0: return [4 /*yield*/, this.cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters, initOverrides)];
|
|
137
|
+
case 1:
|
|
138
|
+
response = _a.sent();
|
|
139
|
+
return [4 /*yield*/, response.value()];
|
|
140
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
78
145
|
/**
|
|
79
146
|
* Consolidates mutliple auto orders on the UltraCart account.
|
|
80
147
|
* Consolidates multiple auto orders
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UltraCart Rest API V2
|
|
3
|
+
* UltraCart REST API Version 2
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2.0.0
|
|
6
|
+
* Contact: support@ultracart.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AutoOrderItemCancelRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface AutoOrderItemCancelRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Optional tiebreaker when more than one item on the auto order shares the same original_item_id. When present, the item with this oid is targeted and its original_item_id must match the URL path parameter (safety check). Leave unset for the common case of a unique original_item_id.
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof AutoOrderItemCancelRequest
|
|
22
|
+
*/
|
|
23
|
+
auto_order_item_oid?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Cancellation mode. 'end' soft-cancels the item by setting no_order_after_dts to the current time, preserving the row for reporting. 'remove' hard-deletes the item from the auto order. Defaults to 'end' (the less destructive option) when omitted.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AutoOrderItemCancelRequest
|
|
28
|
+
*/
|
|
29
|
+
mode?: AutoOrderItemCancelRequestModeEnum;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @export
|
|
33
|
+
*/
|
|
34
|
+
export declare const AutoOrderItemCancelRequestModeEnum: {
|
|
35
|
+
readonly End: "end";
|
|
36
|
+
readonly Remove: "remove";
|
|
37
|
+
};
|
|
38
|
+
export type AutoOrderItemCancelRequestModeEnum = typeof AutoOrderItemCancelRequestModeEnum[keyof typeof AutoOrderItemCancelRequestModeEnum];
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the AutoOrderItemCancelRequest interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfAutoOrderItemCancelRequest(value: object): boolean;
|
|
43
|
+
export declare function AutoOrderItemCancelRequestFromJSON(json: any): AutoOrderItemCancelRequest;
|
|
44
|
+
export declare function AutoOrderItemCancelRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderItemCancelRequest;
|
|
45
|
+
export declare function AutoOrderItemCancelRequestToJSON(value?: AutoOrderItemCancelRequest | null): any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* UltraCart Rest API V2
|
|
6
|
+
* UltraCart REST API Version 2
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2.0.0
|
|
9
|
+
* Contact: support@ultracart.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AutoOrderItemCancelRequestToJSON = exports.AutoOrderItemCancelRequestFromJSONTyped = exports.AutoOrderItemCancelRequestFromJSON = exports.instanceOfAutoOrderItemCancelRequest = exports.AutoOrderItemCancelRequestModeEnum = void 0;
|
|
17
|
+
var runtime_1 = require("../runtime");
|
|
18
|
+
/**
|
|
19
|
+
* @export
|
|
20
|
+
*/
|
|
21
|
+
exports.AutoOrderItemCancelRequestModeEnum = {
|
|
22
|
+
End: 'end',
|
|
23
|
+
Remove: 'remove'
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the AutoOrderItemCancelRequest interface.
|
|
27
|
+
*/
|
|
28
|
+
function instanceOfAutoOrderItemCancelRequest(value) {
|
|
29
|
+
var isInstance = true;
|
|
30
|
+
return isInstance;
|
|
31
|
+
}
|
|
32
|
+
exports.instanceOfAutoOrderItemCancelRequest = instanceOfAutoOrderItemCancelRequest;
|
|
33
|
+
function AutoOrderItemCancelRequestFromJSON(json) {
|
|
34
|
+
return AutoOrderItemCancelRequestFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
exports.AutoOrderItemCancelRequestFromJSON = AutoOrderItemCancelRequestFromJSON;
|
|
37
|
+
function AutoOrderItemCancelRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
38
|
+
if ((json === undefined) || (json === null)) {
|
|
39
|
+
return json;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'auto_order_item_oid': !(0, runtime_1.exists)(json, 'auto_order_item_oid') ? undefined : json['auto_order_item_oid'],
|
|
43
|
+
'mode': !(0, runtime_1.exists)(json, 'mode') ? undefined : json['mode'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.AutoOrderItemCancelRequestFromJSONTyped = AutoOrderItemCancelRequestFromJSONTyped;
|
|
47
|
+
function AutoOrderItemCancelRequestToJSON(value) {
|
|
48
|
+
if (value === undefined) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
if (value === null) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
'auto_order_item_oid': value.auto_order_item_oid,
|
|
56
|
+
'mode': value.mode,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
exports.AutoOrderItemCancelRequestToJSON = AutoOrderItemCancelRequestToJSON;
|
|
@@ -111,6 +111,12 @@ export interface OrderFormat {
|
|
|
111
111
|
* @memberof OrderFormat
|
|
112
112
|
*/
|
|
113
113
|
translate?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* True to render phone numbers as <phone-number-format> web components in the HTML output. Only honored by the div format. Default false preserves legacy scalar rendering for receipts and unauthenticated consumers.
|
|
116
|
+
* @type {boolean}
|
|
117
|
+
* @memberof OrderFormat
|
|
118
|
+
*/
|
|
119
|
+
use_phone_number_web_component?: boolean;
|
|
114
120
|
}
|
|
115
121
|
/**
|
|
116
122
|
* @export
|
|
@@ -57,6 +57,7 @@ function OrderFormatFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
57
57
|
'show_non_sensitive_payment_info': !(0, runtime_1.exists)(json, 'show_non_sensitive_payment_info') ? undefined : json['show_non_sensitive_payment_info'],
|
|
58
58
|
'show_payment_info': !(0, runtime_1.exists)(json, 'show_payment_info') ? undefined : json['show_payment_info'],
|
|
59
59
|
'translate': !(0, runtime_1.exists)(json, 'translate') ? undefined : json['translate'],
|
|
60
|
+
'use_phone_number_web_component': !(0, runtime_1.exists)(json, 'use_phone_number_web_component') ? undefined : json['use_phone_number_web_component'],
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
exports.OrderFormatFromJSONTyped = OrderFormatFromJSONTyped;
|
|
@@ -84,6 +85,7 @@ function OrderFormatToJSON(value) {
|
|
|
84
85
|
'show_non_sensitive_payment_info': value.show_non_sensitive_payment_info,
|
|
85
86
|
'show_payment_info': value.show_payment_info,
|
|
86
87
|
'translate': value.translate,
|
|
88
|
+
'use_phone_number_web_component': value.use_phone_number_web_component,
|
|
87
89
|
};
|
|
88
90
|
}
|
|
89
91
|
exports.OrderFormatToJSON = OrderFormatToJSON;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './AutoOrderAddonItemOption';
|
|
|
26
26
|
export * from './AutoOrderAddonItemsUpdateRequest';
|
|
27
27
|
export * from './AutoOrderConsolidate';
|
|
28
28
|
export * from './AutoOrderItem';
|
|
29
|
+
export * from './AutoOrderItemCancelRequest';
|
|
29
30
|
export * from './AutoOrderItemFutureSchedule';
|
|
30
31
|
export * from './AutoOrderItemOption';
|
|
31
32
|
export * from './AutoOrderItemSimpleSchedule';
|
package/dist/models/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __exportStar(require("./AutoOrderAddonItemOption"), exports);
|
|
|
44
44
|
__exportStar(require("./AutoOrderAddonItemsUpdateRequest"), exports);
|
|
45
45
|
__exportStar(require("./AutoOrderConsolidate"), exports);
|
|
46
46
|
__exportStar(require("./AutoOrderItem"), exports);
|
|
47
|
+
__exportStar(require("./AutoOrderItemCancelRequest"), exports);
|
|
47
48
|
__exportStar(require("./AutoOrderItemFutureSchedule"), exports);
|
|
48
49
|
__exportStar(require("./AutoOrderItemOption"), exports);
|
|
49
50
|
__exportStar(require("./AutoOrderItemSimpleSchedule"), exports);
|
package/package.json
CHANGED
package/src/apis/AutoOrderApi.ts
CHANGED
|
@@ -24,6 +24,9 @@ import {
|
|
|
24
24
|
AutoOrderConsolidate,
|
|
25
25
|
AutoOrderConsolidateFromJSON,
|
|
26
26
|
AutoOrderConsolidateToJSON,
|
|
27
|
+
AutoOrderItemCancelRequest,
|
|
28
|
+
AutoOrderItemCancelRequestFromJSON,
|
|
29
|
+
AutoOrderItemCancelRequestToJSON,
|
|
27
30
|
AutoOrderPropertiesUpdateRequest,
|
|
28
31
|
AutoOrderPropertiesUpdateRequestFromJSON,
|
|
29
32
|
AutoOrderPropertiesUpdateRequestToJSON,
|
|
@@ -47,6 +50,13 @@ import {
|
|
|
47
50
|
ErrorResponseToJSON,
|
|
48
51
|
} from '../models';
|
|
49
52
|
|
|
53
|
+
export interface CancelAutoOrderItemByReferenceOrderIdRequest {
|
|
54
|
+
referenceOrderId: string;
|
|
55
|
+
originalItemId: string;
|
|
56
|
+
expand?: string;
|
|
57
|
+
autoOrderItemCancelRequest?: AutoOrderItemCancelRequest;
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
export interface ConsolidateAutoOrdersRequest {
|
|
51
61
|
autoOrderOid: number;
|
|
52
62
|
autoOrderConsolidate: AutoOrderConsolidate;
|
|
@@ -159,6 +169,25 @@ export interface UpdateAutoOrdersBatchRequest {
|
|
|
159
169
|
* @interface AutoOrderApiInterface
|
|
160
170
|
*/
|
|
161
171
|
export interface AutoOrderApiInterface {
|
|
172
|
+
/**
|
|
173
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
174
|
+
* @summary Cancel a single item on an auto order
|
|
175
|
+
* @param {string} referenceOrderId The reference order id (original_order_id) of the auto order.
|
|
176
|
+
* @param {string} originalItemId The original_item_id (SKU) of the item to cancel.
|
|
177
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
178
|
+
* @param {AutoOrderItemCancelRequest} [autoOrderItemCancelRequest] Cancel request. Body is optional; omit for default mode=end.
|
|
179
|
+
* @param {*} [options] Override http request option.
|
|
180
|
+
* @throws {RequiredError}
|
|
181
|
+
* @memberof AutoOrderApiInterface
|
|
182
|
+
*/
|
|
183
|
+
cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
187
|
+
* Cancel a single item on an auto order
|
|
188
|
+
*/
|
|
189
|
+
cancelAutoOrderItemByReferenceOrderId(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
190
|
+
|
|
162
191
|
/**
|
|
163
192
|
* Consolidates mutliple auto orders on the UltraCart account.
|
|
164
193
|
* @summary Consolidates multiple auto orders
|
|
@@ -439,6 +468,58 @@ export interface AutoOrderApiInterface {
|
|
|
439
468
|
*/
|
|
440
469
|
export class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
|
|
441
470
|
|
|
471
|
+
/**
|
|
472
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
473
|
+
* Cancel a single item on an auto order
|
|
474
|
+
*/
|
|
475
|
+
async cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>> {
|
|
476
|
+
if (requestParameters.referenceOrderId === null || requestParameters.referenceOrderId === undefined) {
|
|
477
|
+
throw new runtime.RequiredError('referenceOrderId','Required parameter requestParameters.referenceOrderId was null or undefined when calling cancelAutoOrderItemByReferenceOrderId.');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (requestParameters.originalItemId === null || requestParameters.originalItemId === undefined) {
|
|
481
|
+
throw new runtime.RequiredError('originalItemId','Required parameter requestParameters.originalItemId was null or undefined when calling cancelAutoOrderItemByReferenceOrderId.');
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const queryParameters: any = {};
|
|
485
|
+
|
|
486
|
+
if (requestParameters.expand !== undefined) {
|
|
487
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
491
|
+
|
|
492
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
493
|
+
|
|
494
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
495
|
+
// oauth required
|
|
496
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["auto_order_write"]);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
500
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const response = await this.request({
|
|
504
|
+
path: `/auto_order/auto_orders/reference_order_id/{reference_order_id}/items/original/{original_item_id}/cancel`.replace(`{${"reference_order_id"}}`, encodeURIComponent(String(requestParameters.referenceOrderId))).replace(`{${"original_item_id"}}`, encodeURIComponent(String(requestParameters.originalItemId))),
|
|
505
|
+
method: 'POST',
|
|
506
|
+
headers: headerParameters,
|
|
507
|
+
query: queryParameters,
|
|
508
|
+
body: AutoOrderItemCancelRequestToJSON(requestParameters.autoOrderItemCancelRequest),
|
|
509
|
+
}, initOverrides);
|
|
510
|
+
|
|
511
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AutoOrderResponseFromJSON(jsonValue));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
|
|
516
|
+
* Cancel a single item on an auto order
|
|
517
|
+
*/
|
|
518
|
+
async cancelAutoOrderItemByReferenceOrderId(requestParameters: CancelAutoOrderItemByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse> {
|
|
519
|
+
const response = await this.cancelAutoOrderItemByReferenceOrderIdRaw(requestParameters, initOverrides);
|
|
520
|
+
return await response.value();
|
|
521
|
+
}
|
|
522
|
+
|
|
442
523
|
/**
|
|
443
524
|
* Consolidates mutliple auto orders on the UltraCart account.
|
|
444
525
|
* Consolidates multiple auto orders
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* UltraCart Rest API V2
|
|
5
|
+
* UltraCart REST API Version 2
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.0
|
|
8
|
+
* Contact: support@ultracart.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AutoOrderItemCancelRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AutoOrderItemCancelRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Optional tiebreaker when more than one item on the auto order shares the same original_item_id. When present, the item with this oid is targeted and its original_item_id must match the URL path parameter (safety check). Leave unset for the common case of a unique original_item_id.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof AutoOrderItemCancelRequest
|
|
26
|
+
*/
|
|
27
|
+
auto_order_item_oid?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Cancellation mode. 'end' soft-cancels the item by setting no_order_after_dts to the current time, preserving the row for reporting. 'remove' hard-deletes the item from the auto order. Defaults to 'end' (the less destructive option) when omitted.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AutoOrderItemCancelRequest
|
|
32
|
+
*/
|
|
33
|
+
mode?: AutoOrderItemCancelRequestModeEnum;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @export
|
|
40
|
+
*/
|
|
41
|
+
export const AutoOrderItemCancelRequestModeEnum = {
|
|
42
|
+
End: 'end',
|
|
43
|
+
Remove: 'remove'
|
|
44
|
+
} as const;
|
|
45
|
+
export type AutoOrderItemCancelRequestModeEnum = typeof AutoOrderItemCancelRequestModeEnum[keyof typeof AutoOrderItemCancelRequestModeEnum];
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the AutoOrderItemCancelRequest interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfAutoOrderItemCancelRequest(value: object): boolean {
|
|
52
|
+
let isInstance = true;
|
|
53
|
+
|
|
54
|
+
return isInstance;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function AutoOrderItemCancelRequestFromJSON(json: any): AutoOrderItemCancelRequest {
|
|
58
|
+
return AutoOrderItemCancelRequestFromJSONTyped(json, false);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function AutoOrderItemCancelRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderItemCancelRequest {
|
|
62
|
+
if ((json === undefined) || (json === null)) {
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'auto_order_item_oid': !exists(json, 'auto_order_item_oid') ? undefined : json['auto_order_item_oid'],
|
|
68
|
+
'mode': !exists(json, 'mode') ? undefined : json['mode'],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function AutoOrderItemCancelRequestToJSON(value?: AutoOrderItemCancelRequest | null): any {
|
|
73
|
+
if (value === undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
if (value === null) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'auto_order_item_oid': value.auto_order_item_oid,
|
|
82
|
+
'mode': value.mode,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -115,6 +115,12 @@ export interface OrderFormat {
|
|
|
115
115
|
* @memberof OrderFormat
|
|
116
116
|
*/
|
|
117
117
|
translate?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* True to render phone numbers as <phone-number-format> web components in the HTML output. Only honored by the div format. Default false preserves legacy scalar rendering for receipts and unauthenticated consumers.
|
|
120
|
+
* @type {boolean}
|
|
121
|
+
* @memberof OrderFormat
|
|
122
|
+
*/
|
|
123
|
+
use_phone_number_web_component?: boolean;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
|
|
@@ -166,6 +172,7 @@ export function OrderFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
166
172
|
'show_non_sensitive_payment_info': !exists(json, 'show_non_sensitive_payment_info') ? undefined : json['show_non_sensitive_payment_info'],
|
|
167
173
|
'show_payment_info': !exists(json, 'show_payment_info') ? undefined : json['show_payment_info'],
|
|
168
174
|
'translate': !exists(json, 'translate') ? undefined : json['translate'],
|
|
175
|
+
'use_phone_number_web_component': !exists(json, 'use_phone_number_web_component') ? undefined : json['use_phone_number_web_component'],
|
|
169
176
|
};
|
|
170
177
|
}
|
|
171
178
|
|
|
@@ -194,6 +201,7 @@ export function OrderFormatToJSON(value?: OrderFormat | null): any {
|
|
|
194
201
|
'show_non_sensitive_payment_info': value.show_non_sensitive_payment_info,
|
|
195
202
|
'show_payment_info': value.show_payment_info,
|
|
196
203
|
'translate': value.translate,
|
|
204
|
+
'use_phone_number_web_component': value.use_phone_number_web_component,
|
|
197
205
|
};
|
|
198
206
|
}
|
|
199
207
|
|
package/src/models/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './AutoOrderAddonItemOption';
|
|
|
28
28
|
export * from './AutoOrderAddonItemsUpdateRequest';
|
|
29
29
|
export * from './AutoOrderConsolidate';
|
|
30
30
|
export * from './AutoOrderItem';
|
|
31
|
+
export * from './AutoOrderItemCancelRequest';
|
|
31
32
|
export * from './AutoOrderItemFutureSchedule';
|
|
32
33
|
export * from './AutoOrderItemOption';
|
|
33
34
|
export * from './AutoOrderItemSimpleSchedule';
|