ultracart_rest_api_v2_typescript 4.0.161 → 4.0.163
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 +4 -2
- package/dist/apis/AutoOrderApi.d.ts +29 -0
- package/dist/apis/AutoOrderApi.js +62 -0
- package/dist/models/Coupon.d.ts +12 -1
- package/dist/models/Coupon.js +11 -1
- package/package.json +1 -1
- package/src/apis/AutoOrderApi.ts +67 -0
- package/src/models/Coupon.ts +15 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## ultracart_rest_api_v2_typescript@4.0.
|
|
1
|
+
## ultracart_rest_api_v2_typescript@4.0.163
|
|
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.163 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -54,6 +54,8 @@ Not every change is committed to every SDK.
|
|
|
54
54
|
|
|
55
55
|
| Version | Date | Comments |
|
|
56
56
|
| --: | :-: | --- |
|
|
57
|
+
| 4.0.163 | 06/20/2023 | auto order - establishAutoOrderByReferenceOrderId method added |
|
|
58
|
+
| 4.0.162 | 06/20/2023 | coupon add allowed values for usable_by and new OncePerNewCustomerForItem flag |
|
|
57
59
|
| 4.0.161 | 06/15/2023 | add pickup_dts to order.shipping object |
|
|
58
60
|
| 4.0.160 | 06/14/2023 | dw bi: add request_dts on the execute queries request and report data set objects |
|
|
59
61
|
| 4.0.159 | 06/09/2023 | distribution center pickup times |
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import { AutoOrder, AutoOrderQuery, AutoOrderQueryBatch, AutoOrderResponse, AutoOrdersRequest, AutoOrdersResponse } from '../models';
|
|
14
|
+
export interface EstablishAutoOrderByReferenceOrderIdRequest {
|
|
15
|
+
referenceOrderId: string;
|
|
16
|
+
expand?: string;
|
|
17
|
+
}
|
|
14
18
|
export interface GetAutoOrderRequest {
|
|
15
19
|
autoOrderOid: number;
|
|
16
20
|
expand?: string;
|
|
@@ -77,6 +81,21 @@ export interface UpdateAutoOrdersBatchRequest {
|
|
|
77
81
|
* @interface AutoOrderApiInterface
|
|
78
82
|
*/
|
|
79
83
|
export interface AutoOrderApiInterface {
|
|
84
|
+
/**
|
|
85
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
86
|
+
* @summary Establish an auto order by referencing a regular order id
|
|
87
|
+
* @param {string} referenceOrderId The order id to attach this auto order to
|
|
88
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
89
|
+
* @param {*} [options] Override http request option.
|
|
90
|
+
* @throws {RequiredError}
|
|
91
|
+
* @memberof AutoOrderApiInterface
|
|
92
|
+
*/
|
|
93
|
+
establishAutoOrderByReferenceOrderIdRaw(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
94
|
+
/**
|
|
95
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
96
|
+
* Establish an auto order by referencing a regular order id
|
|
97
|
+
*/
|
|
98
|
+
establishAutoOrderByReferenceOrderId(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
80
99
|
/**
|
|
81
100
|
* Retrieves a single auto order using the specified auto order oid.
|
|
82
101
|
* @summary Retrieve an auto order by oid
|
|
@@ -229,6 +248,16 @@ export interface AutoOrderApiInterface {
|
|
|
229
248
|
*
|
|
230
249
|
*/
|
|
231
250
|
export declare class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
|
|
251
|
+
/**
|
|
252
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
253
|
+
* Establish an auto order by referencing a regular order id
|
|
254
|
+
*/
|
|
255
|
+
establishAutoOrderByReferenceOrderIdRaw(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
256
|
+
/**
|
|
257
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
258
|
+
* Establish an auto order by referencing a regular order id
|
|
259
|
+
*/
|
|
260
|
+
establishAutoOrderByReferenceOrderId(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
232
261
|
/**
|
|
233
262
|
* Retrieves a single auto order using the specified auto order oid.
|
|
234
263
|
* Retrieve an auto order by oid
|
|
@@ -75,6 +75,68 @@ var AutoOrderApi = /** @class */ (function (_super) {
|
|
|
75
75
|
function AutoOrderApi() {
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
80
|
+
* Establish an auto order by referencing a regular order id
|
|
81
|
+
*/
|
|
82
|
+
AutoOrderApi.prototype.establishAutoOrderByReferenceOrderIdRaw = 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 establishAutoOrderByReferenceOrderId.');
|
|
90
|
+
}
|
|
91
|
+
queryParameters = {};
|
|
92
|
+
if (requestParameters.expand !== undefined) {
|
|
93
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
94
|
+
}
|
|
95
|
+
headerParameters = {};
|
|
96
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
97
|
+
// oauth required
|
|
98
|
+
_a = headerParameters;
|
|
99
|
+
_b = "Authorization";
|
|
100
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["auto_order_write"])];
|
|
101
|
+
case 1:
|
|
102
|
+
// oauth required
|
|
103
|
+
_a[_b] = _c.sent();
|
|
104
|
+
_c.label = 2;
|
|
105
|
+
case 2:
|
|
106
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
107
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
108
|
+
}
|
|
109
|
+
return [4 /*yield*/, this.request({
|
|
110
|
+
path: "/auto_order/auto_orders/reference_order_id/{reference_order_id}".replace("{".concat("reference_order_id", "}"), encodeURIComponent(String(requestParameters.referenceOrderId))),
|
|
111
|
+
method: 'POST',
|
|
112
|
+
headers: headerParameters,
|
|
113
|
+
query: queryParameters,
|
|
114
|
+
}, initOverrides)];
|
|
115
|
+
case 3:
|
|
116
|
+
response = _c.sent();
|
|
117
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.AutoOrderResponseFromJSON)(jsonValue); })];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
124
|
+
* Establish an auto order by referencing a regular order id
|
|
125
|
+
*/
|
|
126
|
+
AutoOrderApi.prototype.establishAutoOrderByReferenceOrderId = function (requestParameters, initOverrides) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
var response;
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
switch (_a.label) {
|
|
131
|
+
case 0: return [4 /*yield*/, this.establishAutoOrderByReferenceOrderIdRaw(requestParameters, initOverrides)];
|
|
132
|
+
case 1:
|
|
133
|
+
response = _a.sent();
|
|
134
|
+
return [4 /*yield*/, response.value()];
|
|
135
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
};
|
|
78
140
|
/**
|
|
79
141
|
* Retrieves a single auto order using the specified auto order oid.
|
|
80
142
|
* Retrieve an auto order by oid
|
package/dist/models/Coupon.d.ts
CHANGED
|
@@ -458,8 +458,19 @@ export interface Coupon {
|
|
|
458
458
|
* @type {string}
|
|
459
459
|
* @memberof Coupon
|
|
460
460
|
*/
|
|
461
|
-
usable_by?:
|
|
461
|
+
usable_by?: CouponUsableByEnum;
|
|
462
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* @export
|
|
465
|
+
*/
|
|
466
|
+
export declare const CouponUsableByEnum: {
|
|
467
|
+
readonly Anyone: "Anyone";
|
|
468
|
+
readonly UniqueCode: "UniqueCode";
|
|
469
|
+
readonly OncePerCustomer: "OncePerCustomer";
|
|
470
|
+
readonly OncePerNewCustomer: "OncePerNewCustomer";
|
|
471
|
+
readonly OncePerNewCustomerForItem: "OncePerNewCustomerForItem";
|
|
472
|
+
};
|
|
473
|
+
export type CouponUsableByEnum = typeof CouponUsableByEnum[keyof typeof CouponUsableByEnum];
|
|
463
474
|
export declare function CouponFromJSON(json: any): Coupon;
|
|
464
475
|
export declare function CouponFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coupon;
|
|
465
476
|
export declare function CouponToJSON(value?: Coupon | null): any;
|
package/dist/models/Coupon.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CouponToJSON = exports.CouponFromJSONTyped = exports.CouponFromJSON = void 0;
|
|
16
|
+
exports.CouponToJSON = exports.CouponFromJSONTyped = exports.CouponFromJSON = exports.CouponUsableByEnum = void 0;
|
|
17
17
|
var runtime_1 = require("../runtime");
|
|
18
18
|
var CouponAmountOffItems_1 = require("./CouponAmountOffItems");
|
|
19
19
|
var CouponAmountOffShipping_1 = require("./CouponAmountOffShipping");
|
|
@@ -63,6 +63,16 @@ var CouponTieredPercentOffItems_1 = require("./CouponTieredPercentOffItems");
|
|
|
63
63
|
var CouponTieredPercentOffShipping_1 = require("./CouponTieredPercentOffShipping");
|
|
64
64
|
var CouponTieredPercentOffSubtotal_1 = require("./CouponTieredPercentOffSubtotal");
|
|
65
65
|
var CouponTieredPercentOffSubtotalBasedOnMSRP_1 = require("./CouponTieredPercentOffSubtotalBasedOnMSRP");
|
|
66
|
+
/**
|
|
67
|
+
* @export
|
|
68
|
+
*/
|
|
69
|
+
exports.CouponUsableByEnum = {
|
|
70
|
+
Anyone: 'Anyone',
|
|
71
|
+
UniqueCode: 'UniqueCode',
|
|
72
|
+
OncePerCustomer: 'OncePerCustomer',
|
|
73
|
+
OncePerNewCustomer: 'OncePerNewCustomer',
|
|
74
|
+
OncePerNewCustomerForItem: 'OncePerNewCustomerForItem'
|
|
75
|
+
};
|
|
66
76
|
function CouponFromJSON(json) {
|
|
67
77
|
return CouponFromJSONTyped(json, false);
|
|
68
78
|
}
|
package/package.json
CHANGED
package/src/apis/AutoOrderApi.ts
CHANGED
|
@@ -38,6 +38,11 @@ import {
|
|
|
38
38
|
ErrorResponseToJSON,
|
|
39
39
|
} from '../models';
|
|
40
40
|
|
|
41
|
+
export interface EstablishAutoOrderByReferenceOrderIdRequest {
|
|
42
|
+
referenceOrderId: string;
|
|
43
|
+
expand?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
export interface GetAutoOrderRequest {
|
|
42
47
|
autoOrderOid: number;
|
|
43
48
|
expand?: string;
|
|
@@ -112,6 +117,23 @@ export interface UpdateAutoOrdersBatchRequest {
|
|
|
112
117
|
* @interface AutoOrderApiInterface
|
|
113
118
|
*/
|
|
114
119
|
export interface AutoOrderApiInterface {
|
|
120
|
+
/**
|
|
121
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
122
|
+
* @summary Establish an auto order by referencing a regular order id
|
|
123
|
+
* @param {string} referenceOrderId The order id to attach this auto order to
|
|
124
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
125
|
+
* @param {*} [options] Override http request option.
|
|
126
|
+
* @throws {RequiredError}
|
|
127
|
+
* @memberof AutoOrderApiInterface
|
|
128
|
+
*/
|
|
129
|
+
establishAutoOrderByReferenceOrderIdRaw(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
133
|
+
* Establish an auto order by referencing a regular order id
|
|
134
|
+
*/
|
|
135
|
+
establishAutoOrderByReferenceOrderId(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
136
|
+
|
|
115
137
|
/**
|
|
116
138
|
* Retrieves a single auto order using the specified auto order oid.
|
|
117
139
|
* @summary Retrieve an auto order by oid
|
|
@@ -282,6 +304,51 @@ export interface AutoOrderApiInterface {
|
|
|
282
304
|
*/
|
|
283
305
|
export class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
|
|
284
306
|
|
|
307
|
+
/**
|
|
308
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
309
|
+
* Establish an auto order by referencing a regular order id
|
|
310
|
+
*/
|
|
311
|
+
async establishAutoOrderByReferenceOrderIdRaw(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>> {
|
|
312
|
+
if (requestParameters.referenceOrderId === null || requestParameters.referenceOrderId === undefined) {
|
|
313
|
+
throw new runtime.RequiredError('referenceOrderId','Required parameter requestParameters.referenceOrderId was null or undefined when calling establishAutoOrderByReferenceOrderId.');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const queryParameters: any = {};
|
|
317
|
+
|
|
318
|
+
if (requestParameters.expand !== undefined) {
|
|
319
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
323
|
+
|
|
324
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
325
|
+
// oauth required
|
|
326
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["auto_order_write"]);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
330
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const response = await this.request({
|
|
334
|
+
path: `/auto_order/auto_orders/reference_order_id/{reference_order_id}`.replace(`{${"reference_order_id"}}`, encodeURIComponent(String(requestParameters.referenceOrderId))),
|
|
335
|
+
method: 'POST',
|
|
336
|
+
headers: headerParameters,
|
|
337
|
+
query: queryParameters,
|
|
338
|
+
}, initOverrides);
|
|
339
|
+
|
|
340
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AutoOrderResponseFromJSON(jsonValue));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
|
|
345
|
+
* Establish an auto order by referencing a regular order id
|
|
346
|
+
*/
|
|
347
|
+
async establishAutoOrderByReferenceOrderId(requestParameters: EstablishAutoOrderByReferenceOrderIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse> {
|
|
348
|
+
const response = await this.establishAutoOrderByReferenceOrderIdRaw(requestParameters, initOverrides);
|
|
349
|
+
return await response.value();
|
|
350
|
+
}
|
|
351
|
+
|
|
285
352
|
/**
|
|
286
353
|
* Retrieves a single auto order using the specified auto order oid.
|
|
287
354
|
* Retrieve an auto order by oid
|
package/src/models/Coupon.ts
CHANGED
|
@@ -703,9 +703,23 @@ export interface Coupon {
|
|
|
703
703
|
* @type {string}
|
|
704
704
|
* @memberof Coupon
|
|
705
705
|
*/
|
|
706
|
-
usable_by?:
|
|
706
|
+
usable_by?: CouponUsableByEnum;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* @export
|
|
712
|
+
*/
|
|
713
|
+
export const CouponUsableByEnum = {
|
|
714
|
+
Anyone: 'Anyone',
|
|
715
|
+
UniqueCode: 'UniqueCode',
|
|
716
|
+
OncePerCustomer: 'OncePerCustomer',
|
|
717
|
+
OncePerNewCustomer: 'OncePerNewCustomer',
|
|
718
|
+
OncePerNewCustomerForItem: 'OncePerNewCustomerForItem'
|
|
719
|
+
} as const;
|
|
720
|
+
export type CouponUsableByEnum = typeof CouponUsableByEnum[keyof typeof CouponUsableByEnum];
|
|
721
|
+
|
|
722
|
+
|
|
709
723
|
export function CouponFromJSON(json: any): Coupon {
|
|
710
724
|
return CouponFromJSONTyped(json, false);
|
|
711
725
|
}
|