starta.apiclient 1.37.997 → 1.37.1013
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/lib/services/organizations/customers/customerComments.d.ts +13 -0
- package/lib/services/organizations/customers/customerComments.js +41 -0
- package/lib/services/organizations/{customers.d.ts → customers/index.d.ts} +10 -8
- package/lib/services/organizations/{customers.js → customers/index.js} +19 -11
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StartaRequestRunner } from '../../../types';
|
|
2
|
+
export default class CustomerComments {
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
+
index(organizationLogin: any, customerId: any): Promise<import("../../../types").StartaResponse>;
|
|
6
|
+
add(organizationLogin: any, customerId: any, { message }: {
|
|
7
|
+
message: any;
|
|
8
|
+
}): Promise<import("../../../types").StartaResponse>;
|
|
9
|
+
update(organizationLogin: any, customerId: any, commentId: any, { message }: {
|
|
10
|
+
message: any;
|
|
11
|
+
}): Promise<import("../../../types").StartaResponse>;
|
|
12
|
+
delete(organizationLogin: any, customerId: any, commentId: any): Promise<import("../../../types").StartaResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var CustomerComments = /** @class */ (function () {
|
|
4
|
+
function CustomerComments(requestRunner) {
|
|
5
|
+
this._requestRunner = requestRunner;
|
|
6
|
+
}
|
|
7
|
+
CustomerComments.prototype.index = function (organizationLogin, customerId) {
|
|
8
|
+
return this._requestRunner.performRequest({
|
|
9
|
+
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/comments"),
|
|
10
|
+
method: 'GET',
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
CustomerComments.prototype.add = function (organizationLogin, customerId, _a) {
|
|
14
|
+
var message = _a.message;
|
|
15
|
+
return this._requestRunner.performRequest({
|
|
16
|
+
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/comments"),
|
|
17
|
+
method: 'POST',
|
|
18
|
+
body: {
|
|
19
|
+
message: message,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
CustomerComments.prototype.update = function (organizationLogin, customerId, commentId, _a) {
|
|
24
|
+
var message = _a.message;
|
|
25
|
+
return this._requestRunner.performRequest({
|
|
26
|
+
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/comments/").concat(commentId),
|
|
27
|
+
method: 'PUT',
|
|
28
|
+
body: {
|
|
29
|
+
message: message
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
CustomerComments.prototype.delete = function (organizationLogin, customerId, commentId) {
|
|
34
|
+
return this._requestRunner.performRequest({
|
|
35
|
+
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/comments/").concat(commentId),
|
|
36
|
+
method: 'DELETE',
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return CustomerComments;
|
|
40
|
+
}());
|
|
41
|
+
exports.default = CustomerComments;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { StartaRequestRunner } from '
|
|
2
|
-
|
|
1
|
+
import { StartaRequestRunner } from '../../../types';
|
|
2
|
+
import Comments from './customerComments';
|
|
3
|
+
export default class Customers {
|
|
3
4
|
private _requestRunner;
|
|
4
5
|
constructor(requestRunner: StartaRequestRunner);
|
|
6
|
+
get comments(): Comments;
|
|
5
7
|
index(organizationLogin: any, { phone, email }?: {
|
|
6
8
|
phone?: string;
|
|
7
9
|
email?: string;
|
|
8
|
-
}): Promise<import("
|
|
9
|
-
get(organizationLogin: any, customerId: any): Promise<import("
|
|
10
|
-
orders(organizationLogin: any, customerId: any): Promise<import("
|
|
10
|
+
}): Promise<import("../../../types").StartaResponse>;
|
|
11
|
+
get(organizationLogin: any, customerId: any): Promise<import("../../../types").StartaResponse>;
|
|
12
|
+
orders(organizationLogin: any, customerId: any): Promise<import("../../../types").StartaResponse>;
|
|
11
13
|
add(organizationLogin: any, { login, type, email, phone, firstName, lastName, countryIso2, region, province, zip, city, addressLine1, addressLine2, dateOfBirth, comment, language, discount, }: {
|
|
12
14
|
login: any;
|
|
13
15
|
type: 'client';
|
|
@@ -26,7 +28,7 @@ export default class Accounts {
|
|
|
26
28
|
comment?: any;
|
|
27
29
|
language: any;
|
|
28
30
|
discount?: any;
|
|
29
|
-
}): Promise<import("
|
|
31
|
+
}): Promise<import("../../../types").StartaResponse>;
|
|
30
32
|
update(organizationLogin: any, customerId: any, { type, email, phone, firstName, lastName, countryIso2, region, province, zip, city, addressLine1, addressLine2, dateOfBirth, comment, language, discount, }: {
|
|
31
33
|
type: 'client';
|
|
32
34
|
email: any;
|
|
@@ -44,6 +46,6 @@ export default class Accounts {
|
|
|
44
46
|
comment?: any;
|
|
45
47
|
language: any;
|
|
46
48
|
discount?: any;
|
|
47
|
-
}): Promise<import("
|
|
48
|
-
delete(organizationLogin: any, customerId: any): Promise<import("
|
|
49
|
+
}): Promise<import("../../../types").StartaResponse>;
|
|
50
|
+
delete(organizationLogin: any, customerId: any): Promise<import("../../../types").StartaResponse>;
|
|
49
51
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
3
|
+
var customerComments_1 = require("./customerComments");
|
|
4
|
+
var _helpers_1 = require("../../_helpers");
|
|
5
|
+
var Customers = /** @class */ (function () {
|
|
6
|
+
function Customers(requestRunner) {
|
|
6
7
|
this._requestRunner = requestRunner;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
Object.defineProperty(Customers.prototype, "comments", {
|
|
10
|
+
get: function () {
|
|
11
|
+
return new customerComments_1.default(this._requestRunner);
|
|
12
|
+
},
|
|
13
|
+
enumerable: false,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
Customers.prototype.index = function (organizationLogin, _a) {
|
|
9
17
|
var _b = _a === void 0 ? {} : _a, phone = _b.phone, email = _b.email;
|
|
10
18
|
return this._requestRunner.performRequest({
|
|
11
19
|
url: "accounts/".concat(organizationLogin, "/customers").concat((0, _helpers_1.buildQuery)({
|
|
@@ -15,19 +23,19 @@ var Accounts = /** @class */ (function () {
|
|
|
15
23
|
method: 'GET',
|
|
16
24
|
});
|
|
17
25
|
};
|
|
18
|
-
|
|
26
|
+
Customers.prototype.get = function (organizationLogin, customerId) {
|
|
19
27
|
return this._requestRunner.performRequest({
|
|
20
28
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
21
29
|
method: 'GET',
|
|
22
30
|
});
|
|
23
31
|
};
|
|
24
|
-
|
|
32
|
+
Customers.prototype.orders = function (organizationLogin, customerId) {
|
|
25
33
|
return this._requestRunner.performRequest({
|
|
26
34
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/orders"),
|
|
27
35
|
method: 'GET',
|
|
28
36
|
});
|
|
29
37
|
};
|
|
30
|
-
|
|
38
|
+
Customers.prototype.add = function (organizationLogin, _a) {
|
|
31
39
|
var login = _a.login, _b = _a.type, type = _b === void 0 ? 'client' : _b, email = _a.email, phone = _a.phone, firstName = _a.firstName, lastName = _a.lastName, countryIso2 = _a.countryIso2, region = _a.region, province = _a.province, zip = _a.zip, city = _a.city, addressLine1 = _a.addressLine1, addressLine2 = _a.addressLine2, dateOfBirth = _a.dateOfBirth, comment = _a.comment, language = _a.language, discount = _a.discount;
|
|
32
40
|
return this._requestRunner.performRequest({
|
|
33
41
|
url: "accounts/".concat(organizationLogin, "/customers"),
|
|
@@ -53,7 +61,7 @@ var Accounts = /** @class */ (function () {
|
|
|
53
61
|
},
|
|
54
62
|
});
|
|
55
63
|
};
|
|
56
|
-
|
|
64
|
+
Customers.prototype.update = function (organizationLogin, customerId, _a) {
|
|
57
65
|
var _b = _a.type, type = _b === void 0 ? 'client' : _b, email = _a.email, phone = _a.phone, firstName = _a.firstName, lastName = _a.lastName, countryIso2 = _a.countryIso2, region = _a.region, province = _a.province, zip = _a.zip, city = _a.city, addressLine1 = _a.addressLine1, addressLine2 = _a.addressLine2, dateOfBirth = _a.dateOfBirth, comment = _a.comment, language = _a.language, discount = _a.discount;
|
|
58
66
|
return this._requestRunner.performRequest({
|
|
59
67
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
@@ -78,12 +86,12 @@ var Accounts = /** @class */ (function () {
|
|
|
78
86
|
},
|
|
79
87
|
});
|
|
80
88
|
};
|
|
81
|
-
|
|
89
|
+
Customers.prototype.delete = function (organizationLogin, customerId) {
|
|
82
90
|
return this._requestRunner.performRequest({
|
|
83
91
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
84
92
|
method: 'DELETE',
|
|
85
93
|
});
|
|
86
94
|
};
|
|
87
|
-
return
|
|
95
|
+
return Customers;
|
|
88
96
|
}());
|
|
89
|
-
exports.default =
|
|
97
|
+
exports.default = Customers;
|