ultracart_rest_api_v2_typescript 4.0.162 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- ## ultracart_rest_api_v2_typescript@4.0.162
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.162 --save
39
+ npm install ultracart_rest_api_v2_typescript@4.0.163 --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.163 | 06/20/2023 | auto order - establishAutoOrderByReferenceOrderId method added |
57
58
  | 4.0.162 | 06/20/2023 | coupon add allowed values for usable_by and new OncePerNewCustomerForItem flag |
58
59
  | 4.0.161 | 06/15/2023 | add pickup_dts to order.shipping object |
59
60
  | 4.0.160 | 06/14/2023 | dw bi: add request_dts on the execute queries request and report data set objects |
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracart_rest_api_v2_typescript",
3
- "version": "4.0.162",
3
+ "version": "4.0.163",
4
4
  "description": "UltraCart Rest TypeScript SDK",
5
5
  "author": "UltraCart",
6
6
  "repository": {
@@ -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