ultracart_rest_api_v2_typescript 4.0.169 → 4.0.170
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 +2 -0
- package/README.md +3 -2
- package/dist/apis/OrderApi.d.ts +28 -1
- package/dist/apis/OrderApi.js +61 -0
- package/dist/models/EmailSettings.d.ts +18 -0
- package/dist/models/EmailSettings.js +6 -0
- package/dist/models/OrderValidationRequest.d.ts +34 -0
- package/dist/models/OrderValidationRequest.js +45 -0
- package/dist/models/OrderValidationResponse.d.ts +39 -0
- package/dist/models/OrderValidationResponse.js +46 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/package.json +1 -1
- package/src/apis/OrderApi.ts +70 -0
- package/src/models/EmailSettings.ts +24 -0
- package/src/models/OrderValidationRequest.ts +71 -0
- package/src/models/OrderValidationResponse.ts +72 -0
- package/src/models/index.ts +2 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -642,6 +642,8 @@ src/models/OrderTrackingNumberDetail.ts
|
|
|
642
642
|
src/models/OrderTrackingNumberDetails.ts
|
|
643
643
|
src/models/OrderTransactionalMerchantNote.ts
|
|
644
644
|
src/models/OrderUtm.ts
|
|
645
|
+
src/models/OrderValidationRequest.ts
|
|
646
|
+
src/models/OrderValidationResponse.ts
|
|
645
647
|
src/models/OrdersResponse.ts
|
|
646
648
|
src/models/Permission.ts
|
|
647
649
|
src/models/PointOfSaleLocation.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## ultracart_rest_api_v2_typescript@4.0.
|
|
1
|
+
## ultracart_rest_api_v2_typescript@4.0.170
|
|
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.170 --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.170 | 08/14/2023 | esp - expose rate limiter values in settings object |
|
|
57
58
|
| 4.0.169 | 07/27/2023 | dw bi - add settings to the report and page objects |
|
|
58
59
|
| 4.0.168 | 07/19/2023 | dw bi - add data_source_uuid to filter connection obj |
|
|
59
60
|
| 4.0.167 | 07/19/2023 | dw bi - add data_source_uuid to page visualization obj |
|
package/dist/apis/OrderApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import { AccountsReceivableRetryConfig, AccountsReceivableRetryConfigResponse, AccountsReceivableRetryStatsResponse, BaseResponse, Order, OrderByTokenQuery, OrderEdiDocumentsResponse, OrderFormat, OrderFormatResponse, OrderInvoiceResponse, OrderPackingSlipResponse, OrderProcessPaymentRequest, OrderProcessPaymentResponse, OrderQuery, OrderQueryBatch, OrderRefundableResponse, OrderReplacement, OrderReplacementResponse, OrderResponse, OrderTokenResponse, OrdersResponse } from '../models';
|
|
13
|
+
import { AccountsReceivableRetryConfig, AccountsReceivableRetryConfigResponse, AccountsReceivableRetryStatsResponse, BaseResponse, Order, OrderByTokenQuery, OrderEdiDocumentsResponse, OrderFormat, OrderFormatResponse, OrderInvoiceResponse, OrderPackingSlipResponse, OrderProcessPaymentRequest, OrderProcessPaymentResponse, OrderQuery, OrderQueryBatch, OrderRefundableResponse, OrderReplacement, OrderReplacementResponse, OrderResponse, OrderTokenResponse, OrderValidationRequest, OrderValidationResponse, OrdersResponse } from '../models';
|
|
14
14
|
export interface AdjustOrderTotalRequest {
|
|
15
15
|
orderId: string;
|
|
16
16
|
desiredTotal: string;
|
|
@@ -143,6 +143,9 @@ export interface UpdateOrderRequest {
|
|
|
143
143
|
order: Order;
|
|
144
144
|
expand?: string;
|
|
145
145
|
}
|
|
146
|
+
export interface ValidateOrderRequest {
|
|
147
|
+
validationRequest: OrderValidationRequest;
|
|
148
|
+
}
|
|
146
149
|
/**
|
|
147
150
|
* OrderApi - interface
|
|
148
151
|
*
|
|
@@ -570,6 +573,20 @@ export interface OrderApiInterface {
|
|
|
570
573
|
* Update an order
|
|
571
574
|
*/
|
|
572
575
|
updateOrder(requestParameters: UpdateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
|
|
576
|
+
/**
|
|
577
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
578
|
+
* @summary Validate
|
|
579
|
+
* @param {OrderValidationRequest} validationRequest Validation request
|
|
580
|
+
* @param {*} [options] Override http request option.
|
|
581
|
+
* @throws {RequiredError}
|
|
582
|
+
* @memberof OrderApiInterface
|
|
583
|
+
*/
|
|
584
|
+
validateOrderRaw(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderValidationResponse>>;
|
|
585
|
+
/**
|
|
586
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
587
|
+
* Validate
|
|
588
|
+
*/
|
|
589
|
+
validateOrder(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderValidationResponse>;
|
|
573
590
|
}
|
|
574
591
|
/**
|
|
575
592
|
*
|
|
@@ -835,4 +852,14 @@ export declare class OrderApi extends runtime.BaseAPI implements OrderApiInterfa
|
|
|
835
852
|
* Update an order
|
|
836
853
|
*/
|
|
837
854
|
updateOrder(requestParameters: UpdateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
|
|
855
|
+
/**
|
|
856
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
857
|
+
* Validate
|
|
858
|
+
*/
|
|
859
|
+
validateOrderRaw(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderValidationResponse>>;
|
|
860
|
+
/**
|
|
861
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
862
|
+
* Validate
|
|
863
|
+
*/
|
|
864
|
+
validateOrder(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderValidationResponse>;
|
|
838
865
|
}
|
package/dist/apis/OrderApi.js
CHANGED
|
@@ -1797,6 +1797,67 @@ var OrderApi = /** @class */ (function (_super) {
|
|
|
1797
1797
|
});
|
|
1798
1798
|
});
|
|
1799
1799
|
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
1802
|
+
* Validate
|
|
1803
|
+
*/
|
|
1804
|
+
OrderApi.prototype.validateOrderRaw = function (requestParameters, initOverrides) {
|
|
1805
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1806
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
1807
|
+
return __generator(this, function (_c) {
|
|
1808
|
+
switch (_c.label) {
|
|
1809
|
+
case 0:
|
|
1810
|
+
if (requestParameters.validationRequest === null || requestParameters.validationRequest === undefined) {
|
|
1811
|
+
throw new runtime.RequiredError('validationRequest', 'Required parameter requestParameters.validationRequest was null or undefined when calling validateOrder.');
|
|
1812
|
+
}
|
|
1813
|
+
queryParameters = {};
|
|
1814
|
+
headerParameters = {};
|
|
1815
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1816
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
1817
|
+
// oauth required
|
|
1818
|
+
_a = headerParameters;
|
|
1819
|
+
_b = "Authorization";
|
|
1820
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["order_read", "order_write"])];
|
|
1821
|
+
case 1:
|
|
1822
|
+
// oauth required
|
|
1823
|
+
_a[_b] = _c.sent();
|
|
1824
|
+
_c.label = 2;
|
|
1825
|
+
case 2:
|
|
1826
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1827
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
1828
|
+
}
|
|
1829
|
+
return [4 /*yield*/, this.request({
|
|
1830
|
+
path: "/order/validate",
|
|
1831
|
+
method: 'POST',
|
|
1832
|
+
headers: headerParameters,
|
|
1833
|
+
query: queryParameters,
|
|
1834
|
+
body: (0, models_1.OrderValidationRequestToJSON)(requestParameters.validationRequest),
|
|
1835
|
+
}, initOverrides)];
|
|
1836
|
+
case 3:
|
|
1837
|
+
response = _c.sent();
|
|
1838
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.OrderValidationResponseFromJSON)(jsonValue); })];
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1841
|
+
});
|
|
1842
|
+
};
|
|
1843
|
+
/**
|
|
1844
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
1845
|
+
* Validate
|
|
1846
|
+
*/
|
|
1847
|
+
OrderApi.prototype.validateOrder = function (requestParameters, initOverrides) {
|
|
1848
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1849
|
+
var response;
|
|
1850
|
+
return __generator(this, function (_a) {
|
|
1851
|
+
switch (_a.label) {
|
|
1852
|
+
case 0: return [4 /*yield*/, this.validateOrderRaw(requestParameters, initOverrides)];
|
|
1853
|
+
case 1:
|
|
1854
|
+
response = _a.sent();
|
|
1855
|
+
return [4 /*yield*/, response.value()];
|
|
1856
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
1857
|
+
}
|
|
1858
|
+
});
|
|
1859
|
+
});
|
|
1860
|
+
};
|
|
1800
1861
|
return OrderApi;
|
|
1801
1862
|
}(runtime.BaseAPI));
|
|
1802
1863
|
exports.OrderApi = OrderApi;
|
|
@@ -15,6 +15,24 @@
|
|
|
15
15
|
* @interface EmailSettings
|
|
16
16
|
*/
|
|
17
17
|
export interface EmailSettings {
|
|
18
|
+
/**
|
|
19
|
+
* Emails per day allowed
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof EmailSettings
|
|
22
|
+
*/
|
|
23
|
+
emails_per_day?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Emails per hour allowed
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof EmailSettings
|
|
28
|
+
*/
|
|
29
|
+
emails_per_hour?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Emails per month allowed
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof EmailSettings
|
|
34
|
+
*/
|
|
35
|
+
emails_per_month?: number;
|
|
18
36
|
/**
|
|
19
37
|
*
|
|
20
38
|
* @type {string}
|
|
@@ -24,6 +24,9 @@ function EmailSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
24
24
|
return json;
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
+
'emails_per_day': !(0, runtime_1.exists)(json, 'emails_per_day') ? undefined : json['emails_per_day'],
|
|
28
|
+
'emails_per_hour': !(0, runtime_1.exists)(json, 'emails_per_hour') ? undefined : json['emails_per_hour'],
|
|
29
|
+
'emails_per_month': !(0, runtime_1.exists)(json, 'emails_per_month') ? undefined : json['emails_per_month'],
|
|
27
30
|
'marketing_esp_domain_user': !(0, runtime_1.exists)(json, 'marketing_esp_domain_user') ? undefined : json['marketing_esp_domain_user'],
|
|
28
31
|
'marketing_esp_domain_uuid': !(0, runtime_1.exists)(json, 'marketing_esp_domain_uuid') ? undefined : json['marketing_esp_domain_uuid'],
|
|
29
32
|
'marketing_esp_friendly_name': !(0, runtime_1.exists)(json, 'marketing_esp_friendly_name') ? undefined : json['marketing_esp_friendly_name'],
|
|
@@ -50,6 +53,9 @@ function EmailSettingsToJSON(value) {
|
|
|
50
53
|
return null;
|
|
51
54
|
}
|
|
52
55
|
return {
|
|
56
|
+
'emails_per_day': value.emails_per_day,
|
|
57
|
+
'emails_per_hour': value.emails_per_hour,
|
|
58
|
+
'emails_per_month': value.emails_per_month,
|
|
53
59
|
'marketing_esp_domain_user': value.marketing_esp_domain_user,
|
|
54
60
|
'marketing_esp_domain_uuid': value.marketing_esp_domain_uuid,
|
|
55
61
|
'marketing_esp_friendly_name': value.marketing_esp_friendly_name,
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { Order } from './Order';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface OrderValidationRequest
|
|
17
|
+
*/
|
|
18
|
+
export interface OrderValidationRequest {
|
|
19
|
+
/**
|
|
20
|
+
* Checks to perform
|
|
21
|
+
* @type {Array<string>}
|
|
22
|
+
* @memberof OrderValidationRequest
|
|
23
|
+
*/
|
|
24
|
+
checks?: Array<string>;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {Order}
|
|
28
|
+
* @memberof OrderValidationRequest
|
|
29
|
+
*/
|
|
30
|
+
order?: Order;
|
|
31
|
+
}
|
|
32
|
+
export declare function OrderValidationRequestFromJSON(json: any): OrderValidationRequest;
|
|
33
|
+
export declare function OrderValidationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderValidationRequest;
|
|
34
|
+
export declare function OrderValidationRequestToJSON(value?: OrderValidationRequest | null): any;
|
|
@@ -0,0 +1,45 @@
|
|
|
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.OrderValidationRequestToJSON = exports.OrderValidationRequestFromJSONTyped = exports.OrderValidationRequestFromJSON = void 0;
|
|
17
|
+
var runtime_1 = require("../runtime");
|
|
18
|
+
var Order_1 = require("./Order");
|
|
19
|
+
function OrderValidationRequestFromJSON(json) {
|
|
20
|
+
return OrderValidationRequestFromJSONTyped(json, false);
|
|
21
|
+
}
|
|
22
|
+
exports.OrderValidationRequestFromJSON = OrderValidationRequestFromJSON;
|
|
23
|
+
function OrderValidationRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if ((json === undefined) || (json === null)) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'checks': !(0, runtime_1.exists)(json, 'checks') ? undefined : json['checks'],
|
|
29
|
+
'order': !(0, runtime_1.exists)(json, 'order') ? undefined : (0, Order_1.OrderFromJSON)(json['order']),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.OrderValidationRequestFromJSONTyped = OrderValidationRequestFromJSONTyped;
|
|
33
|
+
function OrderValidationRequestToJSON(value) {
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
if (value === null) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'checks': value.checks,
|
|
42
|
+
'order': (0, Order_1.OrderToJSON)(value.order),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.OrderValidationRequestToJSON = OrderValidationRequestToJSON;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 OrderValidationResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface OrderValidationResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Errors to display to the merchant if they failed any of the validations checked
|
|
20
|
+
* @type {Array<string>}
|
|
21
|
+
* @memberof OrderValidationResponse
|
|
22
|
+
*/
|
|
23
|
+
errors?: Array<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Informational messages
|
|
26
|
+
* @type {Array<string>}
|
|
27
|
+
* @memberof OrderValidationResponse
|
|
28
|
+
*/
|
|
29
|
+
messages?: Array<string>;
|
|
30
|
+
/**
|
|
31
|
+
* If true, this order was updated during the validation call. This may happen during address standardization fixes.
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof OrderValidationResponse
|
|
34
|
+
*/
|
|
35
|
+
order_was_updated?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function OrderValidationResponseFromJSON(json: any): OrderValidationResponse;
|
|
38
|
+
export declare function OrderValidationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderValidationResponse;
|
|
39
|
+
export declare function OrderValidationResponseToJSON(value?: OrderValidationResponse | null): any;
|
|
@@ -0,0 +1,46 @@
|
|
|
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.OrderValidationResponseToJSON = exports.OrderValidationResponseFromJSONTyped = exports.OrderValidationResponseFromJSON = void 0;
|
|
17
|
+
var runtime_1 = require("../runtime");
|
|
18
|
+
function OrderValidationResponseFromJSON(json) {
|
|
19
|
+
return OrderValidationResponseFromJSONTyped(json, false);
|
|
20
|
+
}
|
|
21
|
+
exports.OrderValidationResponseFromJSON = OrderValidationResponseFromJSON;
|
|
22
|
+
function OrderValidationResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
23
|
+
if ((json === undefined) || (json === null)) {
|
|
24
|
+
return json;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
'errors': !(0, runtime_1.exists)(json, 'errors') ? undefined : json['errors'],
|
|
28
|
+
'messages': !(0, runtime_1.exists)(json, 'messages') ? undefined : json['messages'],
|
|
29
|
+
'order_was_updated': !(0, runtime_1.exists)(json, 'order_was_updated') ? undefined : json['order_was_updated'],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.OrderValidationResponseFromJSONTyped = OrderValidationResponseFromJSONTyped;
|
|
33
|
+
function OrderValidationResponseToJSON(value) {
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
if (value === null) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'errors': value.errors,
|
|
42
|
+
'messages': value.messages,
|
|
43
|
+
'order_was_updated': value.order_was_updated,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.OrderValidationResponseToJSON = OrderValidationResponseToJSON;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -616,6 +616,8 @@ export * from './OrderTrackingNumberDetail';
|
|
|
616
616
|
export * from './OrderTrackingNumberDetails';
|
|
617
617
|
export * from './OrderTransactionalMerchantNote';
|
|
618
618
|
export * from './OrderUtm';
|
|
619
|
+
export * from './OrderValidationRequest';
|
|
620
|
+
export * from './OrderValidationResponse';
|
|
619
621
|
export * from './OrdersResponse';
|
|
620
622
|
export * from './Permission';
|
|
621
623
|
export * from './PointOfSaleLocation';
|
package/dist/models/index.js
CHANGED
|
@@ -634,6 +634,8 @@ __exportStar(require("./OrderTrackingNumberDetail"), exports);
|
|
|
634
634
|
__exportStar(require("./OrderTrackingNumberDetails"), exports);
|
|
635
635
|
__exportStar(require("./OrderTransactionalMerchantNote"), exports);
|
|
636
636
|
__exportStar(require("./OrderUtm"), exports);
|
|
637
|
+
__exportStar(require("./OrderValidationRequest"), exports);
|
|
638
|
+
__exportStar(require("./OrderValidationResponse"), exports);
|
|
637
639
|
__exportStar(require("./OrdersResponse"), exports);
|
|
638
640
|
__exportStar(require("./Permission"), exports);
|
|
639
641
|
__exportStar(require("./PointOfSaleLocation"), exports);
|
package/package.json
CHANGED
package/src/apis/OrderApi.ts
CHANGED
|
@@ -78,6 +78,12 @@ import {
|
|
|
78
78
|
OrderTokenResponse,
|
|
79
79
|
OrderTokenResponseFromJSON,
|
|
80
80
|
OrderTokenResponseToJSON,
|
|
81
|
+
OrderValidationRequest,
|
|
82
|
+
OrderValidationRequestFromJSON,
|
|
83
|
+
OrderValidationRequestToJSON,
|
|
84
|
+
OrderValidationResponse,
|
|
85
|
+
OrderValidationResponseFromJSON,
|
|
86
|
+
OrderValidationResponseToJSON,
|
|
81
87
|
OrdersResponse,
|
|
82
88
|
OrdersResponseFromJSON,
|
|
83
89
|
OrdersResponseToJSON,
|
|
@@ -240,6 +246,10 @@ export interface UpdateOrderRequest {
|
|
|
240
246
|
expand?: string;
|
|
241
247
|
}
|
|
242
248
|
|
|
249
|
+
export interface ValidateOrderRequest {
|
|
250
|
+
validationRequest: OrderValidationRequest;
|
|
251
|
+
}
|
|
252
|
+
|
|
243
253
|
/**
|
|
244
254
|
* OrderApi - interface
|
|
245
255
|
*
|
|
@@ -719,6 +729,22 @@ export interface OrderApiInterface {
|
|
|
719
729
|
*/
|
|
720
730
|
updateOrder(requestParameters: UpdateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
|
|
721
731
|
|
|
732
|
+
/**
|
|
733
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
734
|
+
* @summary Validate
|
|
735
|
+
* @param {OrderValidationRequest} validationRequest Validation request
|
|
736
|
+
* @param {*} [options] Override http request option.
|
|
737
|
+
* @throws {RequiredError}
|
|
738
|
+
* @memberof OrderApiInterface
|
|
739
|
+
*/
|
|
740
|
+
validateOrderRaw(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderValidationResponse>>;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
744
|
+
* Validate
|
|
745
|
+
*/
|
|
746
|
+
validateOrder(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderValidationResponse>;
|
|
747
|
+
|
|
722
748
|
}
|
|
723
749
|
|
|
724
750
|
/**
|
|
@@ -2045,4 +2071,48 @@ export class OrderApi extends runtime.BaseAPI implements OrderApiInterface {
|
|
|
2045
2071
|
return await response.value();
|
|
2046
2072
|
}
|
|
2047
2073
|
|
|
2074
|
+
/**
|
|
2075
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
2076
|
+
* Validate
|
|
2077
|
+
*/
|
|
2078
|
+
async validateOrderRaw(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderValidationResponse>> {
|
|
2079
|
+
if (requestParameters.validationRequest === null || requestParameters.validationRequest === undefined) {
|
|
2080
|
+
throw new runtime.RequiredError('validationRequest','Required parameter requestParameters.validationRequest was null or undefined when calling validateOrder.');
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
const queryParameters: any = {};
|
|
2084
|
+
|
|
2085
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
2086
|
+
|
|
2087
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2088
|
+
|
|
2089
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2090
|
+
// oauth required
|
|
2091
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["order_read", "order_write"]);
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
2095
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
const response = await this.request({
|
|
2099
|
+
path: `/order/validate`,
|
|
2100
|
+
method: 'POST',
|
|
2101
|
+
headers: headerParameters,
|
|
2102
|
+
query: queryParameters,
|
|
2103
|
+
body: OrderValidationRequestToJSON(requestParameters.validationRequest),
|
|
2104
|
+
}, initOverrides);
|
|
2105
|
+
|
|
2106
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OrderValidationResponseFromJSON(jsonValue));
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
|
2111
|
+
* Validate
|
|
2112
|
+
*/
|
|
2113
|
+
async validateOrder(requestParameters: ValidateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderValidationResponse> {
|
|
2114
|
+
const response = await this.validateOrderRaw(requestParameters, initOverrides);
|
|
2115
|
+
return await response.value();
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2048
2118
|
}
|
|
@@ -19,6 +19,24 @@ import { exists, mapValues } from '../runtime';
|
|
|
19
19
|
* @interface EmailSettings
|
|
20
20
|
*/
|
|
21
21
|
export interface EmailSettings {
|
|
22
|
+
/**
|
|
23
|
+
* Emails per day allowed
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof EmailSettings
|
|
26
|
+
*/
|
|
27
|
+
emails_per_day?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Emails per hour allowed
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof EmailSettings
|
|
32
|
+
*/
|
|
33
|
+
emails_per_hour?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Emails per month allowed
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof EmailSettings
|
|
38
|
+
*/
|
|
39
|
+
emails_per_month?: number;
|
|
22
40
|
/**
|
|
23
41
|
*
|
|
24
42
|
* @type {string}
|
|
@@ -121,6 +139,9 @@ export function EmailSettingsFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
121
139
|
}
|
|
122
140
|
return {
|
|
123
141
|
|
|
142
|
+
'emails_per_day': !exists(json, 'emails_per_day') ? undefined : json['emails_per_day'],
|
|
143
|
+
'emails_per_hour': !exists(json, 'emails_per_hour') ? undefined : json['emails_per_hour'],
|
|
144
|
+
'emails_per_month': !exists(json, 'emails_per_month') ? undefined : json['emails_per_month'],
|
|
124
145
|
'marketing_esp_domain_user': !exists(json, 'marketing_esp_domain_user') ? undefined : json['marketing_esp_domain_user'],
|
|
125
146
|
'marketing_esp_domain_uuid': !exists(json, 'marketing_esp_domain_uuid') ? undefined : json['marketing_esp_domain_uuid'],
|
|
126
147
|
'marketing_esp_friendly_name': !exists(json, 'marketing_esp_friendly_name') ? undefined : json['marketing_esp_friendly_name'],
|
|
@@ -148,6 +169,9 @@ export function EmailSettingsToJSON(value?: EmailSettings | null): any {
|
|
|
148
169
|
}
|
|
149
170
|
return {
|
|
150
171
|
|
|
172
|
+
'emails_per_day': value.emails_per_day,
|
|
173
|
+
'emails_per_hour': value.emails_per_hour,
|
|
174
|
+
'emails_per_month': value.emails_per_month,
|
|
151
175
|
'marketing_esp_domain_user': value.marketing_esp_domain_user,
|
|
152
176
|
'marketing_esp_domain_uuid': value.marketing_esp_domain_uuid,
|
|
153
177
|
'marketing_esp_friendly_name': value.marketing_esp_friendly_name,
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
import {
|
|
17
|
+
Order,
|
|
18
|
+
OrderFromJSON,
|
|
19
|
+
OrderFromJSONTyped,
|
|
20
|
+
OrderToJSON,
|
|
21
|
+
} from './Order';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface OrderValidationRequest
|
|
27
|
+
*/
|
|
28
|
+
export interface OrderValidationRequest {
|
|
29
|
+
/**
|
|
30
|
+
* Checks to perform
|
|
31
|
+
* @type {Array<string>}
|
|
32
|
+
* @memberof OrderValidationRequest
|
|
33
|
+
*/
|
|
34
|
+
checks?: Array<string>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {Order}
|
|
38
|
+
* @memberof OrderValidationRequest
|
|
39
|
+
*/
|
|
40
|
+
order?: Order;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function OrderValidationRequestFromJSON(json: any): OrderValidationRequest {
|
|
44
|
+
return OrderValidationRequestFromJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function OrderValidationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderValidationRequest {
|
|
48
|
+
if ((json === undefined) || (json === null)) {
|
|
49
|
+
return json;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
|
|
53
|
+
'checks': !exists(json, 'checks') ? undefined : json['checks'],
|
|
54
|
+
'order': !exists(json, 'order') ? undefined : OrderFromJSON(json['order']),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function OrderValidationRequestToJSON(value?: OrderValidationRequest | null): any {
|
|
59
|
+
if (value === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (value === null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'checks': value.checks,
|
|
68
|
+
'order': OrderToJSON(value.order),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
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 OrderValidationResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface OrderValidationResponse {
|
|
22
|
+
/**
|
|
23
|
+
* Errors to display to the merchant if they failed any of the validations checked
|
|
24
|
+
* @type {Array<string>}
|
|
25
|
+
* @memberof OrderValidationResponse
|
|
26
|
+
*/
|
|
27
|
+
errors?: Array<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Informational messages
|
|
30
|
+
* @type {Array<string>}
|
|
31
|
+
* @memberof OrderValidationResponse
|
|
32
|
+
*/
|
|
33
|
+
messages?: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
* If true, this order was updated during the validation call. This may happen during address standardization fixes.
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof OrderValidationResponse
|
|
38
|
+
*/
|
|
39
|
+
order_was_updated?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function OrderValidationResponseFromJSON(json: any): OrderValidationResponse {
|
|
43
|
+
return OrderValidationResponseFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function OrderValidationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderValidationResponse {
|
|
47
|
+
if ((json === undefined) || (json === null)) {
|
|
48
|
+
return json;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
|
|
52
|
+
'errors': !exists(json, 'errors') ? undefined : json['errors'],
|
|
53
|
+
'messages': !exists(json, 'messages') ? undefined : json['messages'],
|
|
54
|
+
'order_was_updated': !exists(json, 'order_was_updated') ? undefined : json['order_was_updated'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function OrderValidationResponseToJSON(value?: OrderValidationResponse | null): any {
|
|
59
|
+
if (value === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (value === null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'errors': value.errors,
|
|
68
|
+
'messages': value.messages,
|
|
69
|
+
'order_was_updated': value.order_was_updated,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -618,6 +618,8 @@ export * from './OrderTrackingNumberDetail';
|
|
|
618
618
|
export * from './OrderTrackingNumberDetails';
|
|
619
619
|
export * from './OrderTransactionalMerchantNote';
|
|
620
620
|
export * from './OrderUtm';
|
|
621
|
+
export * from './OrderValidationRequest';
|
|
622
|
+
export * from './OrderValidationResponse';
|
|
621
623
|
export * from './OrdersResponse';
|
|
622
624
|
export * from './Permission';
|
|
623
625
|
export * from './PointOfSaleLocation';
|