ultracart_rest_api_v2_typescript 4.1.0 → 4.1.2
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 +31 -0
- package/dist/apis/AutoOrderApi.js +67 -0
- package/dist/models/ChannelPartnerOrder.d.ts +6 -0
- package/dist/models/ChannelPartnerOrder.js +2 -0
- package/dist/models/ItemPaymentProcessing.d.ts +1 -1
- package/dist/models/OrderCoupon.d.ts +1 -1
- package/package.json +1 -1
- package/src/apis/AutoOrderApi.ts +76 -0
- package/src/models/ChannelPartnerOrder.ts +8 -0
- package/src/models/ItemPaymentProcessing.ts +1 -1
- package/src/models/OrderCoupon.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## ultracart_rest_api_v2_typescript@4.1.
|
|
1
|
+
## ultracart_rest_api_v2_typescript@4.1.2
|
|
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.1.
|
|
39
|
+
npm install ultracart_rest_api_v2_typescript@4.1.2 --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.1.2 | 03/05/2025 | added ChannelPartnerOrder.use_prior_payment_information_from_order_id |
|
|
58
|
+
| 4.1.1 | 02/28/2025 | auto order pause method |
|
|
57
59
|
| 4.1.0 | 02/21/2025 | ItemApi.getInventorySnapshot had bad nickname causing bad sdk method name |
|
|
58
60
|
| 4.0.245 | 02/20/2025 | automation fix |
|
|
59
61
|
| 4.0.244 | 02/20/2025 | no change, revving sdk to troubleshoot java deployment automation |
|
|
@@ -68,6 +68,11 @@ export interface GetAutoOrdersByQueryRequest {
|
|
|
68
68
|
sort?: string;
|
|
69
69
|
expand?: string;
|
|
70
70
|
}
|
|
71
|
+
export interface PauseAutoOrderRequest {
|
|
72
|
+
autoOrderOid: number;
|
|
73
|
+
autoOrder: AutoOrder;
|
|
74
|
+
expand?: string;
|
|
75
|
+
}
|
|
71
76
|
export interface UpdateAutoOrderRequest {
|
|
72
77
|
autoOrderOid: number;
|
|
73
78
|
autoOrder: AutoOrder;
|
|
@@ -232,6 +237,22 @@ export interface AutoOrderApiInterface {
|
|
|
232
237
|
* Retrieve auto orders by query
|
|
233
238
|
*/
|
|
234
239
|
getAutoOrdersByQuery(requestParameters: GetAutoOrdersByQueryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrdersResponse>;
|
|
240
|
+
/**
|
|
241
|
+
* Completely pause an auto order
|
|
242
|
+
* @summary Pause auto order
|
|
243
|
+
* @param {number} autoOrderOid The auto order oid to pause.
|
|
244
|
+
* @param {AutoOrder} autoOrder Auto orders to pause
|
|
245
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
246
|
+
* @param {*} [options] Override http request option.
|
|
247
|
+
* @throws {RequiredError}
|
|
248
|
+
* @memberof AutoOrderApiInterface
|
|
249
|
+
*/
|
|
250
|
+
pauseAutoOrderRaw(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
251
|
+
/**
|
|
252
|
+
* Completely pause an auto order
|
|
253
|
+
* Pause auto order
|
|
254
|
+
*/
|
|
255
|
+
pauseAutoOrder(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
235
256
|
/**
|
|
236
257
|
* Update an auto order on the UltraCart account.
|
|
237
258
|
* @summary Update an auto order
|
|
@@ -351,6 +372,16 @@ export declare class AutoOrderApi extends runtime.BaseAPI implements AutoOrderAp
|
|
|
351
372
|
* Retrieve auto orders by query
|
|
352
373
|
*/
|
|
353
374
|
getAutoOrdersByQuery(requestParameters: GetAutoOrdersByQueryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrdersResponse>;
|
|
375
|
+
/**
|
|
376
|
+
* Completely pause an auto order
|
|
377
|
+
* Pause auto order
|
|
378
|
+
*/
|
|
379
|
+
pauseAutoOrderRaw(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
380
|
+
/**
|
|
381
|
+
* Completely pause an auto order
|
|
382
|
+
* Pause auto order
|
|
383
|
+
*/
|
|
384
|
+
pauseAutoOrder(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
354
385
|
/**
|
|
355
386
|
* Update an auto order on the UltraCart account.
|
|
356
387
|
* Update an auto order
|
|
@@ -653,6 +653,73 @@ var AutoOrderApi = /** @class */ (function (_super) {
|
|
|
653
653
|
});
|
|
654
654
|
});
|
|
655
655
|
};
|
|
656
|
+
/**
|
|
657
|
+
* Completely pause an auto order
|
|
658
|
+
* Pause auto order
|
|
659
|
+
*/
|
|
660
|
+
AutoOrderApi.prototype.pauseAutoOrderRaw = function (requestParameters, initOverrides) {
|
|
661
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
662
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
663
|
+
return __generator(this, function (_c) {
|
|
664
|
+
switch (_c.label) {
|
|
665
|
+
case 0:
|
|
666
|
+
if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
|
|
667
|
+
throw new runtime.RequiredError('autoOrderOid', 'Required parameter requestParameters.autoOrderOid was null or undefined when calling pauseAutoOrder.');
|
|
668
|
+
}
|
|
669
|
+
if (requestParameters.autoOrder === null || requestParameters.autoOrder === undefined) {
|
|
670
|
+
throw new runtime.RequiredError('autoOrder', 'Required parameter requestParameters.autoOrder was null or undefined when calling pauseAutoOrder.');
|
|
671
|
+
}
|
|
672
|
+
queryParameters = {};
|
|
673
|
+
if (requestParameters.expand !== undefined) {
|
|
674
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
675
|
+
}
|
|
676
|
+
headerParameters = {};
|
|
677
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
678
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
679
|
+
// oauth required
|
|
680
|
+
_a = headerParameters;
|
|
681
|
+
_b = "Authorization";
|
|
682
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["auto_order_write"])];
|
|
683
|
+
case 1:
|
|
684
|
+
// oauth required
|
|
685
|
+
_a[_b] = _c.sent();
|
|
686
|
+
_c.label = 2;
|
|
687
|
+
case 2:
|
|
688
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
689
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
690
|
+
}
|
|
691
|
+
return [4 /*yield*/, this.request({
|
|
692
|
+
path: "/auto_order/auto_orders/{auto_order_oid}/pause".replace("{".concat("auto_order_oid", "}"), encodeURIComponent(String(requestParameters.autoOrderOid))),
|
|
693
|
+
method: 'PUT',
|
|
694
|
+
headers: headerParameters,
|
|
695
|
+
query: queryParameters,
|
|
696
|
+
body: (0, models_1.AutoOrderToJSON)(requestParameters.autoOrder),
|
|
697
|
+
}, initOverrides)];
|
|
698
|
+
case 3:
|
|
699
|
+
response = _c.sent();
|
|
700
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.AutoOrderResponseFromJSON)(jsonValue); })];
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
});
|
|
704
|
+
};
|
|
705
|
+
/**
|
|
706
|
+
* Completely pause an auto order
|
|
707
|
+
* Pause auto order
|
|
708
|
+
*/
|
|
709
|
+
AutoOrderApi.prototype.pauseAutoOrder = function (requestParameters, initOverrides) {
|
|
710
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
711
|
+
var response;
|
|
712
|
+
return __generator(this, function (_a) {
|
|
713
|
+
switch (_a.label) {
|
|
714
|
+
case 0: return [4 /*yield*/, this.pauseAutoOrderRaw(requestParameters, initOverrides)];
|
|
715
|
+
case 1:
|
|
716
|
+
response = _a.sent();
|
|
717
|
+
return [4 /*yield*/, response.value()];
|
|
718
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
};
|
|
656
723
|
/**
|
|
657
724
|
* Update an auto order on the UltraCart account.
|
|
658
725
|
* Update an auto order
|
|
@@ -569,6 +569,12 @@ export interface ChannelPartnerOrder {
|
|
|
569
569
|
* @memberof ChannelPartnerOrder
|
|
570
570
|
*/
|
|
571
571
|
treat_warnings_as_errors?: boolean;
|
|
572
|
+
/**
|
|
573
|
+
* An Order Id from a prior purchase of this customer which is used to retrieve vaulted payment information in order to pay for this current order.
|
|
574
|
+
* @type {string}
|
|
575
|
+
* @memberof ChannelPartnerOrder
|
|
576
|
+
*/
|
|
577
|
+
use_prior_payment_information_from_order_id?: string;
|
|
572
578
|
}
|
|
573
579
|
/**
|
|
574
580
|
* @export
|
|
@@ -149,6 +149,7 @@ function ChannelPartnerOrderFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
149
149
|
'tax_exempt': !(0, runtime_1.exists)(json, 'tax_exempt') ? undefined : json['tax_exempt'],
|
|
150
150
|
'transaction': !(0, runtime_1.exists)(json, 'transaction') ? undefined : (0, ChannelPartnerOrderTransaction_1.ChannelPartnerOrderTransactionFromJSON)(json['transaction']),
|
|
151
151
|
'treat_warnings_as_errors': !(0, runtime_1.exists)(json, 'treat_warnings_as_errors') ? undefined : json['treat_warnings_as_errors'],
|
|
152
|
+
'use_prior_payment_information_from_order_id': !(0, runtime_1.exists)(json, 'use_prior_payment_information_from_order_id') ? undefined : json['use_prior_payment_information_from_order_id'],
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
155
|
exports.ChannelPartnerOrderFromJSONTyped = ChannelPartnerOrderFromJSONTyped;
|
|
@@ -252,6 +253,7 @@ function ChannelPartnerOrderToJSON(value) {
|
|
|
252
253
|
'tax_exempt': value.tax_exempt,
|
|
253
254
|
'transaction': (0, ChannelPartnerOrderTransaction_1.ChannelPartnerOrderTransactionToJSON)(value.transaction),
|
|
254
255
|
'treat_warnings_as_errors': value.treat_warnings_as_errors,
|
|
256
|
+
'use_prior_payment_information_from_order_id': value.use_prior_payment_information_from_order_id,
|
|
255
257
|
};
|
|
256
258
|
}
|
|
257
259
|
exports.ChannelPartnerOrderToJSON = ChannelPartnerOrderToJSON;
|
|
@@ -22,7 +22,7 @@ export interface ItemPaymentProcessing {
|
|
|
22
22
|
*/
|
|
23
23
|
block_prepaid?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* True if this item should block any refund attempts
|
|
25
|
+
* True if this item should block any refund attempts, set to false otherwise, null value will not update the field
|
|
26
26
|
* @type {boolean}
|
|
27
27
|
* @memberof ItemPaymentProcessing
|
|
28
28
|
*/
|
package/package.json
CHANGED
package/src/apis/AutoOrderApi.ts
CHANGED
|
@@ -106,6 +106,12 @@ export interface GetAutoOrdersByQueryRequest {
|
|
|
106
106
|
expand?: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
export interface PauseAutoOrderRequest {
|
|
110
|
+
autoOrderOid: number;
|
|
111
|
+
autoOrder: AutoOrder;
|
|
112
|
+
expand?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
export interface UpdateAutoOrderRequest {
|
|
110
116
|
autoOrderOid: number;
|
|
111
117
|
autoOrder: AutoOrder;
|
|
@@ -288,6 +294,24 @@ export interface AutoOrderApiInterface {
|
|
|
288
294
|
*/
|
|
289
295
|
getAutoOrdersByQuery(requestParameters: GetAutoOrdersByQueryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrdersResponse>;
|
|
290
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Completely pause an auto order
|
|
299
|
+
* @summary Pause auto order
|
|
300
|
+
* @param {number} autoOrderOid The auto order oid to pause.
|
|
301
|
+
* @param {AutoOrder} autoOrder Auto orders to pause
|
|
302
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
303
|
+
* @param {*} [options] Override http request option.
|
|
304
|
+
* @throws {RequiredError}
|
|
305
|
+
* @memberof AutoOrderApiInterface
|
|
306
|
+
*/
|
|
307
|
+
pauseAutoOrderRaw(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Completely pause an auto order
|
|
311
|
+
* Pause auto order
|
|
312
|
+
*/
|
|
313
|
+
pauseAutoOrder(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
|
|
314
|
+
|
|
291
315
|
/**
|
|
292
316
|
* Update an auto order on the UltraCart account.
|
|
293
317
|
* @summary Update an auto order
|
|
@@ -802,6 +826,58 @@ export class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterfa
|
|
|
802
826
|
return await response.value();
|
|
803
827
|
}
|
|
804
828
|
|
|
829
|
+
/**
|
|
830
|
+
* Completely pause an auto order
|
|
831
|
+
* Pause auto order
|
|
832
|
+
*/
|
|
833
|
+
async pauseAutoOrderRaw(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderResponse>> {
|
|
834
|
+
if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
|
|
835
|
+
throw new runtime.RequiredError('autoOrderOid','Required parameter requestParameters.autoOrderOid was null or undefined when calling pauseAutoOrder.');
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (requestParameters.autoOrder === null || requestParameters.autoOrder === undefined) {
|
|
839
|
+
throw new runtime.RequiredError('autoOrder','Required parameter requestParameters.autoOrder was null or undefined when calling pauseAutoOrder.');
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
const queryParameters: any = {};
|
|
843
|
+
|
|
844
|
+
if (requestParameters.expand !== undefined) {
|
|
845
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
849
|
+
|
|
850
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
851
|
+
|
|
852
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
853
|
+
// oauth required
|
|
854
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["auto_order_write"]);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
858
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const response = await this.request({
|
|
862
|
+
path: `/auto_order/auto_orders/{auto_order_oid}/pause`.replace(`{${"auto_order_oid"}}`, encodeURIComponent(String(requestParameters.autoOrderOid))),
|
|
863
|
+
method: 'PUT',
|
|
864
|
+
headers: headerParameters,
|
|
865
|
+
query: queryParameters,
|
|
866
|
+
body: AutoOrderToJSON(requestParameters.autoOrder),
|
|
867
|
+
}, initOverrides);
|
|
868
|
+
|
|
869
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AutoOrderResponseFromJSON(jsonValue));
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Completely pause an auto order
|
|
874
|
+
* Pause auto order
|
|
875
|
+
*/
|
|
876
|
+
async pauseAutoOrder(requestParameters: PauseAutoOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse> {
|
|
877
|
+
const response = await this.pauseAutoOrderRaw(requestParameters, initOverrides);
|
|
878
|
+
return await response.value();
|
|
879
|
+
}
|
|
880
|
+
|
|
805
881
|
/**
|
|
806
882
|
* Update an auto order on the UltraCart account.
|
|
807
883
|
* Update an auto order
|
|
@@ -584,6 +584,12 @@ export interface ChannelPartnerOrder {
|
|
|
584
584
|
* @memberof ChannelPartnerOrder
|
|
585
585
|
*/
|
|
586
586
|
treat_warnings_as_errors?: boolean;
|
|
587
|
+
/**
|
|
588
|
+
* An Order Id from a prior purchase of this customer which is used to retrieve vaulted payment information in order to pay for this current order.
|
|
589
|
+
* @type {string}
|
|
590
|
+
* @memberof ChannelPartnerOrder
|
|
591
|
+
*/
|
|
592
|
+
use_prior_payment_information_from_order_id?: string;
|
|
587
593
|
}
|
|
588
594
|
|
|
589
595
|
|
|
@@ -727,6 +733,7 @@ export function ChannelPartnerOrderFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
727
733
|
'tax_exempt': !exists(json, 'tax_exempt') ? undefined : json['tax_exempt'],
|
|
728
734
|
'transaction': !exists(json, 'transaction') ? undefined : ChannelPartnerOrderTransactionFromJSON(json['transaction']),
|
|
729
735
|
'treat_warnings_as_errors': !exists(json, 'treat_warnings_as_errors') ? undefined : json['treat_warnings_as_errors'],
|
|
736
|
+
'use_prior_payment_information_from_order_id': !exists(json, 'use_prior_payment_information_from_order_id') ? undefined : json['use_prior_payment_information_from_order_id'],
|
|
730
737
|
};
|
|
731
738
|
}
|
|
732
739
|
|
|
@@ -831,6 +838,7 @@ export function ChannelPartnerOrderToJSON(value?: ChannelPartnerOrder | null): a
|
|
|
831
838
|
'tax_exempt': value.tax_exempt,
|
|
832
839
|
'transaction': ChannelPartnerOrderTransactionToJSON(value.transaction),
|
|
833
840
|
'treat_warnings_as_errors': value.treat_warnings_as_errors,
|
|
841
|
+
'use_prior_payment_information_from_order_id': value.use_prior_payment_information_from_order_id,
|
|
834
842
|
};
|
|
835
843
|
}
|
|
836
844
|
|
|
@@ -26,7 +26,7 @@ export interface ItemPaymentProcessing {
|
|
|
26
26
|
*/
|
|
27
27
|
block_prepaid?: boolean;
|
|
28
28
|
/**
|
|
29
|
-
* True if this item should block any refund attempts
|
|
29
|
+
* True if this item should block any refund attempts, set to false otherwise, null value will not update the field
|
|
30
30
|
* @type {boolean}
|
|
31
31
|
* @memberof ItemPaymentProcessing
|
|
32
32
|
*/
|