ultracart_rest_api_v2_typescript 4.0.24-RC → 4.0.34-RC
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 +12 -2
- package/dist/apis/CustomerApi.d.ts +32 -1
- package/dist/apis/CustomerApi.js +65 -0
- package/dist/models/CustomerActivity.d.ts +24 -0
- package/dist/models/CustomerActivity.js +8 -0
- package/dist/models/CustomerMergeRequest.d.ts +33 -0
- package/dist/models/CustomerMergeRequest.js +44 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/package.json +1 -1
- package/src/apis/CustomerApi.ts +78 -0
- package/src/models/CustomerActivity.ts +32 -0
- package/src/models/CustomerMergeRequest.ts +64 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -215,6 +215,7 @@ src/models/CustomerEmailListChanges.ts
|
|
|
215
215
|
src/models/CustomerLoyalty.ts
|
|
216
216
|
src/models/CustomerLoyaltyLedger.ts
|
|
217
217
|
src/models/CustomerLoyaltyRedemption.ts
|
|
218
|
+
src/models/CustomerMergeRequest.ts
|
|
218
219
|
src/models/CustomerOrdersSummary.ts
|
|
219
220
|
src/models/CustomerPricingTier.ts
|
|
220
221
|
src/models/CustomerPrivacy.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.34-RC
|
|
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.34-RC --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -54,6 +54,16 @@ Not every change is committed to every SDK.
|
|
|
54
54
|
|
|
55
55
|
| Version | Date | Comments |
|
|
56
56
|
| --: | :-: | --- |
|
|
57
|
+
| 4.0.34-RC | 07/11/2022 | Customer API - mergeCustomer method |
|
|
58
|
+
| 4.0.33-RC | 07/05/2022 | docs update |
|
|
59
|
+
| 4.0.32-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
60
|
+
| 4.0.31-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
61
|
+
| 4.0.30-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
62
|
+
| 4.0.29-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
63
|
+
| 4.0.28-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
64
|
+
| 4.0.27-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
65
|
+
| 4.0.26-RC | 06/24/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
66
|
+
| 4.0.25-RC | 06/23/2022 | removed unneeded consumes declarations on several api calls (yaml fix) |
|
|
57
67
|
| 4.0.24-RC | 06/23/2022 | automation test |
|
|
58
68
|
| 4.0.23-RC | 06/23/2022 | automation test |
|
|
59
69
|
| 4.0.22-RC | 06/23/2022 | v4 automation testing - not production ready |
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import { AdjustInternalCertificateRequest, AdjustInternalCertificateResponse, BaseResponse, Customer, CustomerEditorValues, CustomerEmailListChanges, CustomerQuery, CustomerResponse, CustomerStoreCreditAddRequest, CustomerStoreCreditResponse, CustomersResponse, DataTablesServerSideResponse, EmailListsResponse, EmailVerifyTokenRequest, EmailVerifyTokenResponse, EmailVerifyTokenValidateRequest, EmailVerifyTokenValidateResponse, LookupRequest, LookupResponse } from '../models';
|
|
13
|
+
import { AdjustInternalCertificateRequest, AdjustInternalCertificateResponse, BaseResponse, Customer, CustomerEditorValues, CustomerEmailListChanges, CustomerMergeRequest, CustomerQuery, CustomerResponse, CustomerStoreCreditAddRequest, CustomerStoreCreditResponse, CustomersResponse, DataTablesServerSideResponse, EmailListsResponse, EmailVerifyTokenRequest, EmailVerifyTokenResponse, EmailVerifyTokenValidateRequest, EmailVerifyTokenValidateResponse, LookupRequest, LookupResponse } from '../models';
|
|
14
14
|
export interface AddCustomerStoreCreditRequest {
|
|
15
15
|
customerProfileOid: number;
|
|
16
16
|
storeCreditRequest: CustomerStoreCreditAddRequest;
|
|
@@ -85,6 +85,11 @@ export interface InsertCustomerRequest {
|
|
|
85
85
|
customer: Customer;
|
|
86
86
|
expand?: string;
|
|
87
87
|
}
|
|
88
|
+
export interface MergeCustomerRequest {
|
|
89
|
+
customerProfileOid: number;
|
|
90
|
+
customer: CustomerMergeRequest;
|
|
91
|
+
expand?: string;
|
|
92
|
+
}
|
|
88
93
|
export interface SearchCustomerProfileValuesRequest {
|
|
89
94
|
lookupRequest: LookupRequest;
|
|
90
95
|
}
|
|
@@ -328,6 +333,22 @@ export interface CustomerApiInterface {
|
|
|
328
333
|
* Insert a customer
|
|
329
334
|
*/
|
|
330
335
|
insertCustomer(requestParameters: InsertCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerResponse>;
|
|
336
|
+
/**
|
|
337
|
+
* Merge customer into this customer.
|
|
338
|
+
* @summary Merge customer into this customer
|
|
339
|
+
* @param {number} customerProfileOid The customer_profile_oid to update.
|
|
340
|
+
* @param {CustomerMergeRequest} customer Customer to merge into this profile.
|
|
341
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
342
|
+
* @param {*} [options] Override http request option.
|
|
343
|
+
* @throws {RequiredError}
|
|
344
|
+
* @memberof CustomerApiInterface
|
|
345
|
+
*/
|
|
346
|
+
mergeCustomerRaw(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
347
|
+
/**
|
|
348
|
+
* Merge customer into this customer.
|
|
349
|
+
* Merge customer into this customer
|
|
350
|
+
*/
|
|
351
|
+
mergeCustomer(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
331
352
|
/**
|
|
332
353
|
*
|
|
333
354
|
* @summary Searches for all matching values (using POST)
|
|
@@ -521,6 +542,16 @@ export declare class CustomerApi extends runtime.BaseAPI implements CustomerApiI
|
|
|
521
542
|
* Insert a customer
|
|
522
543
|
*/
|
|
523
544
|
insertCustomer(requestParameters: InsertCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerResponse>;
|
|
545
|
+
/**
|
|
546
|
+
* Merge customer into this customer.
|
|
547
|
+
* Merge customer into this customer
|
|
548
|
+
*/
|
|
549
|
+
mergeCustomerRaw(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
550
|
+
/**
|
|
551
|
+
* Merge customer into this customer.
|
|
552
|
+
* Merge customer into this customer
|
|
553
|
+
*/
|
|
554
|
+
mergeCustomer(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
524
555
|
/**
|
|
525
556
|
* Searches for all matching values (using POST)
|
|
526
557
|
*/
|
package/dist/apis/CustomerApi.js
CHANGED
|
@@ -969,6 +969,71 @@ var CustomerApi = /** @class */ (function (_super) {
|
|
|
969
969
|
});
|
|
970
970
|
});
|
|
971
971
|
};
|
|
972
|
+
/**
|
|
973
|
+
* Merge customer into this customer.
|
|
974
|
+
* Merge customer into this customer
|
|
975
|
+
*/
|
|
976
|
+
CustomerApi.prototype.mergeCustomerRaw = function (requestParameters, initOverrides) {
|
|
977
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
978
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
979
|
+
return __generator(this, function (_c) {
|
|
980
|
+
switch (_c.label) {
|
|
981
|
+
case 0:
|
|
982
|
+
if (requestParameters.customerProfileOid === null || requestParameters.customerProfileOid === undefined) {
|
|
983
|
+
throw new runtime.RequiredError('customerProfileOid', 'Required parameter requestParameters.customerProfileOid was null or undefined when calling mergeCustomer.');
|
|
984
|
+
}
|
|
985
|
+
if (requestParameters.customer === null || requestParameters.customer === undefined) {
|
|
986
|
+
throw new runtime.RequiredError('customer', 'Required parameter requestParameters.customer was null or undefined when calling mergeCustomer.');
|
|
987
|
+
}
|
|
988
|
+
queryParameters = {};
|
|
989
|
+
if (requestParameters.expand !== undefined) {
|
|
990
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
991
|
+
}
|
|
992
|
+
headerParameters = {};
|
|
993
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
994
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
995
|
+
// oauth required
|
|
996
|
+
_a = headerParameters;
|
|
997
|
+
_b = "Authorization";
|
|
998
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["customer_write"])];
|
|
999
|
+
case 1:
|
|
1000
|
+
// oauth required
|
|
1001
|
+
_a[_b] = _c.sent();
|
|
1002
|
+
_c.label = 2;
|
|
1003
|
+
case 2:
|
|
1004
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1005
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
1006
|
+
}
|
|
1007
|
+
return [4 /*yield*/, this.request({
|
|
1008
|
+
path: "/customer/customers/{customer_profile_oid}/merge".replace("{".concat("customer_profile_oid", "}"), encodeURIComponent(String(requestParameters.customerProfileOid))),
|
|
1009
|
+
method: 'PUT',
|
|
1010
|
+
headers: headerParameters,
|
|
1011
|
+
query: queryParameters,
|
|
1012
|
+
body: (0, models_1.CustomerMergeRequestToJSON)(requestParameters.customer),
|
|
1013
|
+
}, initOverrides)];
|
|
1014
|
+
case 3:
|
|
1015
|
+
response = _c.sent();
|
|
1016
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
};
|
|
1021
|
+
/**
|
|
1022
|
+
* Merge customer into this customer.
|
|
1023
|
+
* Merge customer into this customer
|
|
1024
|
+
*/
|
|
1025
|
+
CustomerApi.prototype.mergeCustomer = function (requestParameters, initOverrides) {
|
|
1026
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1027
|
+
return __generator(this, function (_a) {
|
|
1028
|
+
switch (_a.label) {
|
|
1029
|
+
case 0: return [4 /*yield*/, this.mergeCustomerRaw(requestParameters, initOverrides)];
|
|
1030
|
+
case 1:
|
|
1031
|
+
_a.sent();
|
|
1032
|
+
return [2 /*return*/];
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
});
|
|
1036
|
+
};
|
|
972
1037
|
/**
|
|
973
1038
|
* Searches for all matching values (using POST)
|
|
974
1039
|
*/
|
|
@@ -25,6 +25,18 @@ export interface CustomerActivity {
|
|
|
25
25
|
* @memberof CustomerActivity
|
|
26
26
|
*/
|
|
27
27
|
activities?: Array<Activity>;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
* @memberof CustomerActivity
|
|
32
|
+
*/
|
|
33
|
+
global_unsubscribed?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof CustomerActivity
|
|
38
|
+
*/
|
|
39
|
+
global_unsubscribed_dts?: string;
|
|
28
40
|
/**
|
|
29
41
|
*
|
|
30
42
|
* @type {Array<ListSegmentMembership>}
|
|
@@ -43,6 +55,18 @@ export interface CustomerActivity {
|
|
|
43
55
|
* @memberof CustomerActivity
|
|
44
56
|
*/
|
|
45
57
|
properties_list?: Array<Property>;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
* @memberof CustomerActivity
|
|
62
|
+
*/
|
|
63
|
+
spam_complaint?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof CustomerActivity
|
|
68
|
+
*/
|
|
69
|
+
spam_complaint_dts?: string;
|
|
46
70
|
}
|
|
47
71
|
export declare function CustomerActivityFromJSON(json: any): CustomerActivity;
|
|
48
72
|
export declare function CustomerActivityFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerActivity;
|
|
@@ -29,9 +29,13 @@ function CustomerActivityFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
31
31
|
'activities': !(0, runtime_1.exists)(json, 'activities') ? undefined : (json['activities'].map(Activity_1.ActivityFromJSON)),
|
|
32
|
+
'global_unsubscribed': !(0, runtime_1.exists)(json, 'global_unsubscribed') ? undefined : json['global_unsubscribed'],
|
|
33
|
+
'global_unsubscribed_dts': !(0, runtime_1.exists)(json, 'global_unsubscribed_dts') ? undefined : json['global_unsubscribed_dts'],
|
|
32
34
|
'memberships': !(0, runtime_1.exists)(json, 'memberships') ? undefined : (json['memberships'].map(ListSegmentMembership_1.ListSegmentMembershipFromJSON)),
|
|
33
35
|
'metrics': !(0, runtime_1.exists)(json, 'metrics') ? undefined : (json['metrics'].map(Metric_1.MetricFromJSON)),
|
|
34
36
|
'properties_list': !(0, runtime_1.exists)(json, 'properties_list') ? undefined : (json['properties_list'].map(Property_1.PropertyFromJSON)),
|
|
37
|
+
'spam_complaint': !(0, runtime_1.exists)(json, 'spam_complaint') ? undefined : json['spam_complaint'],
|
|
38
|
+
'spam_complaint_dts': !(0, runtime_1.exists)(json, 'spam_complaint_dts') ? undefined : json['spam_complaint_dts'],
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
41
|
exports.CustomerActivityFromJSONTyped = CustomerActivityFromJSONTyped;
|
|
@@ -44,9 +48,13 @@ function CustomerActivityToJSON(value) {
|
|
|
44
48
|
}
|
|
45
49
|
return {
|
|
46
50
|
'activities': value.activities === undefined ? undefined : (value.activities.map(Activity_1.ActivityToJSON)),
|
|
51
|
+
'global_unsubscribed': value.global_unsubscribed,
|
|
52
|
+
'global_unsubscribed_dts': value.global_unsubscribed_dts,
|
|
47
53
|
'memberships': value.memberships === undefined ? undefined : (value.memberships.map(ListSegmentMembership_1.ListSegmentMembershipToJSON)),
|
|
48
54
|
'metrics': value.metrics === undefined ? undefined : (value.metrics.map(Metric_1.MetricToJSON)),
|
|
49
55
|
'properties_list': value.properties_list === undefined ? undefined : (value.properties_list.map(Property_1.PropertyToJSON)),
|
|
56
|
+
'spam_complaint': value.spam_complaint,
|
|
57
|
+
'spam_complaint_dts': value.spam_complaint_dts,
|
|
50
58
|
};
|
|
51
59
|
}
|
|
52
60
|
exports.CustomerActivityToJSON = CustomerActivityToJSON;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 CustomerMergeRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface CustomerMergeRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Customer profile oid to merge
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof CustomerMergeRequest
|
|
22
|
+
*/
|
|
23
|
+
customer_profile_oid?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Email of the customer profile to merge
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof CustomerMergeRequest
|
|
28
|
+
*/
|
|
29
|
+
email?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function CustomerMergeRequestFromJSON(json: any): CustomerMergeRequest;
|
|
32
|
+
export declare function CustomerMergeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerMergeRequest;
|
|
33
|
+
export declare function CustomerMergeRequestToJSON(value?: CustomerMergeRequest | null): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
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.CustomerMergeRequestToJSON = exports.CustomerMergeRequestFromJSONTyped = exports.CustomerMergeRequestFromJSON = void 0;
|
|
17
|
+
var runtime_1 = require("../runtime");
|
|
18
|
+
function CustomerMergeRequestFromJSON(json) {
|
|
19
|
+
return CustomerMergeRequestFromJSONTyped(json, false);
|
|
20
|
+
}
|
|
21
|
+
exports.CustomerMergeRequestFromJSON = CustomerMergeRequestFromJSON;
|
|
22
|
+
function CustomerMergeRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
23
|
+
if ((json === undefined) || (json === null)) {
|
|
24
|
+
return json;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
'customer_profile_oid': !(0, runtime_1.exists)(json, 'customer_profile_oid') ? undefined : json['customer_profile_oid'],
|
|
28
|
+
'email': !(0, runtime_1.exists)(json, 'email') ? undefined : json['email'],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.CustomerMergeRequestFromJSONTyped = CustomerMergeRequestFromJSONTyped;
|
|
32
|
+
function CustomerMergeRequestToJSON(value) {
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (value === null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'customer_profile_oid': value.customer_profile_oid,
|
|
41
|
+
'email': value.email,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
exports.CustomerMergeRequestToJSON = CustomerMergeRequestToJSON;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -191,6 +191,7 @@ export * from './CustomerEmailListChanges';
|
|
|
191
191
|
export * from './CustomerLoyalty';
|
|
192
192
|
export * from './CustomerLoyaltyLedger';
|
|
193
193
|
export * from './CustomerLoyaltyRedemption';
|
|
194
|
+
export * from './CustomerMergeRequest';
|
|
194
195
|
export * from './CustomerOrdersSummary';
|
|
195
196
|
export * from './CustomerPricingTier';
|
|
196
197
|
export * from './CustomerPrivacy';
|
package/dist/models/index.js
CHANGED
|
@@ -209,6 +209,7 @@ __exportStar(require("./CustomerEmailListChanges"), exports);
|
|
|
209
209
|
__exportStar(require("./CustomerLoyalty"), exports);
|
|
210
210
|
__exportStar(require("./CustomerLoyaltyLedger"), exports);
|
|
211
211
|
__exportStar(require("./CustomerLoyaltyRedemption"), exports);
|
|
212
|
+
__exportStar(require("./CustomerMergeRequest"), exports);
|
|
212
213
|
__exportStar(require("./CustomerOrdersSummary"), exports);
|
|
213
214
|
__exportStar(require("./CustomerPricingTier"), exports);
|
|
214
215
|
__exportStar(require("./CustomerPrivacy"), exports);
|
package/package.json
CHANGED
package/src/apis/CustomerApi.ts
CHANGED
|
@@ -33,6 +33,9 @@ import {
|
|
|
33
33
|
CustomerEmailListChanges,
|
|
34
34
|
CustomerEmailListChangesFromJSON,
|
|
35
35
|
CustomerEmailListChangesToJSON,
|
|
36
|
+
CustomerMergeRequest,
|
|
37
|
+
CustomerMergeRequestFromJSON,
|
|
38
|
+
CustomerMergeRequestToJSON,
|
|
36
39
|
CustomerQuery,
|
|
37
40
|
CustomerQueryFromJSON,
|
|
38
41
|
CustomerQueryToJSON,
|
|
@@ -162,6 +165,12 @@ export interface InsertCustomerRequest {
|
|
|
162
165
|
expand?: string;
|
|
163
166
|
}
|
|
164
167
|
|
|
168
|
+
export interface MergeCustomerRequest {
|
|
169
|
+
customerProfileOid: number;
|
|
170
|
+
customer: CustomerMergeRequest;
|
|
171
|
+
expand?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
165
174
|
export interface SearchCustomerProfileValuesRequest {
|
|
166
175
|
lookupRequest: LookupRequest;
|
|
167
176
|
}
|
|
@@ -435,6 +444,24 @@ export interface CustomerApiInterface {
|
|
|
435
444
|
*/
|
|
436
445
|
insertCustomer(requestParameters: InsertCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerResponse>;
|
|
437
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Merge customer into this customer.
|
|
449
|
+
* @summary Merge customer into this customer
|
|
450
|
+
* @param {number} customerProfileOid The customer_profile_oid to update.
|
|
451
|
+
* @param {CustomerMergeRequest} customer Customer to merge into this profile.
|
|
452
|
+
* @param {string} [expand] The object expansion to perform on the result. See documentation for examples
|
|
453
|
+
* @param {*} [options] Override http request option.
|
|
454
|
+
* @throws {RequiredError}
|
|
455
|
+
* @memberof CustomerApiInterface
|
|
456
|
+
*/
|
|
457
|
+
mergeCustomerRaw(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Merge customer into this customer.
|
|
461
|
+
* Merge customer into this customer
|
|
462
|
+
*/
|
|
463
|
+
mergeCustomer(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
464
|
+
|
|
438
465
|
/**
|
|
439
466
|
*
|
|
440
467
|
* @summary Searches for all matching values (using POST)
|
|
@@ -1211,6 +1238,57 @@ export class CustomerApi extends runtime.BaseAPI implements CustomerApiInterface
|
|
|
1211
1238
|
return await response.value();
|
|
1212
1239
|
}
|
|
1213
1240
|
|
|
1241
|
+
/**
|
|
1242
|
+
* Merge customer into this customer.
|
|
1243
|
+
* Merge customer into this customer
|
|
1244
|
+
*/
|
|
1245
|
+
async mergeCustomerRaw(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
1246
|
+
if (requestParameters.customerProfileOid === null || requestParameters.customerProfileOid === undefined) {
|
|
1247
|
+
throw new runtime.RequiredError('customerProfileOid','Required parameter requestParameters.customerProfileOid was null or undefined when calling mergeCustomer.');
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
if (requestParameters.customer === null || requestParameters.customer === undefined) {
|
|
1251
|
+
throw new runtime.RequiredError('customer','Required parameter requestParameters.customer was null or undefined when calling mergeCustomer.');
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
const queryParameters: any = {};
|
|
1255
|
+
|
|
1256
|
+
if (requestParameters.expand !== undefined) {
|
|
1257
|
+
queryParameters['_expand'] = requestParameters.expand;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1261
|
+
|
|
1262
|
+
headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
|
|
1263
|
+
|
|
1264
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1265
|
+
// oauth required
|
|
1266
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["customer_write"]);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1270
|
+
headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
const response = await this.request({
|
|
1274
|
+
path: `/customer/customers/{customer_profile_oid}/merge`.replace(`{${"customer_profile_oid"}}`, encodeURIComponent(String(requestParameters.customerProfileOid))),
|
|
1275
|
+
method: 'PUT',
|
|
1276
|
+
headers: headerParameters,
|
|
1277
|
+
query: queryParameters,
|
|
1278
|
+
body: CustomerMergeRequestToJSON(requestParameters.customer),
|
|
1279
|
+
}, initOverrides);
|
|
1280
|
+
|
|
1281
|
+
return new runtime.VoidApiResponse(response);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Merge customer into this customer.
|
|
1286
|
+
* Merge customer into this customer
|
|
1287
|
+
*/
|
|
1288
|
+
async mergeCustomer(requestParameters: MergeCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
1289
|
+
await this.mergeCustomerRaw(requestParameters, initOverrides);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1214
1292
|
/**
|
|
1215
1293
|
* Searches for all matching values (using POST)
|
|
1216
1294
|
*/
|
|
@@ -50,6 +50,18 @@ export interface CustomerActivity {
|
|
|
50
50
|
* @memberof CustomerActivity
|
|
51
51
|
*/
|
|
52
52
|
activities?: Array<Activity>;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
* @memberof CustomerActivity
|
|
57
|
+
*/
|
|
58
|
+
global_unsubscribed?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof CustomerActivity
|
|
63
|
+
*/
|
|
64
|
+
global_unsubscribed_dts?: string;
|
|
53
65
|
/**
|
|
54
66
|
*
|
|
55
67
|
* @type {Array<ListSegmentMembership>}
|
|
@@ -68,6 +80,18 @@ export interface CustomerActivity {
|
|
|
68
80
|
* @memberof CustomerActivity
|
|
69
81
|
*/
|
|
70
82
|
properties_list?: Array<Property>;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @memberof CustomerActivity
|
|
87
|
+
*/
|
|
88
|
+
spam_complaint?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @type {string}
|
|
92
|
+
* @memberof CustomerActivity
|
|
93
|
+
*/
|
|
94
|
+
spam_complaint_dts?: string;
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
export function CustomerActivityFromJSON(json: any): CustomerActivity {
|
|
@@ -81,9 +105,13 @@ export function CustomerActivityFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
81
105
|
return {
|
|
82
106
|
|
|
83
107
|
'activities': !exists(json, 'activities') ? undefined : ((json['activities'] as Array<any>).map(ActivityFromJSON)),
|
|
108
|
+
'global_unsubscribed': !exists(json, 'global_unsubscribed') ? undefined : json['global_unsubscribed'],
|
|
109
|
+
'global_unsubscribed_dts': !exists(json, 'global_unsubscribed_dts') ? undefined : json['global_unsubscribed_dts'],
|
|
84
110
|
'memberships': !exists(json, 'memberships') ? undefined : ((json['memberships'] as Array<any>).map(ListSegmentMembershipFromJSON)),
|
|
85
111
|
'metrics': !exists(json, 'metrics') ? undefined : ((json['metrics'] as Array<any>).map(MetricFromJSON)),
|
|
86
112
|
'properties_list': !exists(json, 'properties_list') ? undefined : ((json['properties_list'] as Array<any>).map(PropertyFromJSON)),
|
|
113
|
+
'spam_complaint': !exists(json, 'spam_complaint') ? undefined : json['spam_complaint'],
|
|
114
|
+
'spam_complaint_dts': !exists(json, 'spam_complaint_dts') ? undefined : json['spam_complaint_dts'],
|
|
87
115
|
};
|
|
88
116
|
}
|
|
89
117
|
|
|
@@ -97,9 +125,13 @@ export function CustomerActivityToJSON(value?: CustomerActivity | null): any {
|
|
|
97
125
|
return {
|
|
98
126
|
|
|
99
127
|
'activities': value.activities === undefined ? undefined : ((value.activities as Array<any>).map(ActivityToJSON)),
|
|
128
|
+
'global_unsubscribed': value.global_unsubscribed,
|
|
129
|
+
'global_unsubscribed_dts': value.global_unsubscribed_dts,
|
|
100
130
|
'memberships': value.memberships === undefined ? undefined : ((value.memberships as Array<any>).map(ListSegmentMembershipToJSON)),
|
|
101
131
|
'metrics': value.metrics === undefined ? undefined : ((value.metrics as Array<any>).map(MetricToJSON)),
|
|
102
132
|
'properties_list': value.properties_list === undefined ? undefined : ((value.properties_list as Array<any>).map(PropertyToJSON)),
|
|
133
|
+
'spam_complaint': value.spam_complaint,
|
|
134
|
+
'spam_complaint_dts': value.spam_complaint_dts,
|
|
103
135
|
};
|
|
104
136
|
}
|
|
105
137
|
|
|
@@ -0,0 +1,64 @@
|
|
|
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 CustomerMergeRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CustomerMergeRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Customer profile oid to merge
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof CustomerMergeRequest
|
|
26
|
+
*/
|
|
27
|
+
customer_profile_oid?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Email of the customer profile to merge
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof CustomerMergeRequest
|
|
32
|
+
*/
|
|
33
|
+
email?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function CustomerMergeRequestFromJSON(json: any): CustomerMergeRequest {
|
|
37
|
+
return CustomerMergeRequestFromJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function CustomerMergeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerMergeRequest {
|
|
41
|
+
if ((json === undefined) || (json === null)) {
|
|
42
|
+
return json;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
|
|
46
|
+
'customer_profile_oid': !exists(json, 'customer_profile_oid') ? undefined : json['customer_profile_oid'],
|
|
47
|
+
'email': !exists(json, 'email') ? undefined : json['email'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function CustomerMergeRequestToJSON(value?: CustomerMergeRequest | null): any {
|
|
52
|
+
if (value === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (value === null) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'customer_profile_oid': value.customer_profile_oid,
|
|
61
|
+
'email': value.email,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -193,6 +193,7 @@ export * from './CustomerEmailListChanges';
|
|
|
193
193
|
export * from './CustomerLoyalty';
|
|
194
194
|
export * from './CustomerLoyaltyLedger';
|
|
195
195
|
export * from './CustomerLoyaltyRedemption';
|
|
196
|
+
export * from './CustomerMergeRequest';
|
|
196
197
|
export * from './CustomerOrdersSummary';
|
|
197
198
|
export * from './CustomerPricingTier';
|
|
198
199
|
export * from './CustomerPrivacy';
|