starta.apiclient 1.34.805 → 1.35.846
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/accounts.d.ts +2 -1
- package/lib/services/accounts.js +2 -1
- package/lib/services/organizations/index.d.ts +7 -0
- package/lib/services/organizations/index.js +16 -0
- package/lib/services/organizations/services.d.ts +28 -14
- package/lib/services/organizations/services.js +20 -4
- package/package.json +1 -1
|
@@ -48,7 +48,8 @@ export default class Accounts {
|
|
|
48
48
|
getKeys(login: string): Promise<import("../types").StartaResponse>;
|
|
49
49
|
getAllKeys(): Promise<import("../types").StartaResponse>;
|
|
50
50
|
getAddressSuggestions(login: string, term: any): Promise<import("../types").StartaResponse>;
|
|
51
|
-
orders(login: string, { from, to, status, product: { type, id, executor } }: {
|
|
51
|
+
orders(login: string, { organizationLogin, from, to, status, product: { type, id, executor } }: {
|
|
52
|
+
organizationLogin: any;
|
|
52
53
|
from: any;
|
|
53
54
|
to: any;
|
|
54
55
|
status: any;
|
package/lib/services/accounts.js
CHANGED
|
@@ -146,9 +146,10 @@ var Accounts = /** @class */ (function () {
|
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
Accounts.prototype.orders = function (login, _a) {
|
|
149
|
-
var from = _a.from, to = _a.to, status = _a.status, _b = _a.product, _c = _b === void 0 ? { type: undefined, id: undefined, executor: undefined } : _b, type = _c.type, id = _c.id, executor = _c.executor;
|
|
149
|
+
var organizationLogin = _a.organizationLogin, from = _a.from, to = _a.to, status = _a.status, _b = _a.product, _c = _b === void 0 ? { type: undefined, id: undefined, executor: undefined } : _b, type = _c.type, id = _c.id, executor = _c.executor;
|
|
150
150
|
return this._requestRunner.performRequest({
|
|
151
151
|
url: "accounts/".concat(login, "/orders").concat((0, _helpers_1.buildQuery)({
|
|
152
|
+
organizationLogin: organizationLogin,
|
|
152
153
|
from: from,
|
|
153
154
|
to: to,
|
|
154
155
|
status: status,
|
|
@@ -21,6 +21,10 @@ export default class Organizations {
|
|
|
21
21
|
timeZone: any;
|
|
22
22
|
orgType: any;
|
|
23
23
|
}): Promise<import("../../types").StartaResponse>;
|
|
24
|
+
update(account: any, { name, timeZone }: {
|
|
25
|
+
name: any;
|
|
26
|
+
timeZone: any;
|
|
27
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
24
28
|
get(organizationLogin: any): Promise<import("../../types").StartaResponse>;
|
|
25
29
|
getPermissionGroups(organizationLogin: any): Promise<import("../../types").StartaResponse>;
|
|
26
30
|
changeBanner(login: any, file: any): Promise<import("../../types").StartaResponse>;
|
|
@@ -32,6 +36,9 @@ export default class Organizations {
|
|
|
32
36
|
setCategories(organizationLogin: any, { categories }: {
|
|
33
37
|
categories?: never[] | undefined;
|
|
34
38
|
}): Promise<import("../../types").StartaResponse>;
|
|
39
|
+
setOrgType(organizationLogin: any, { orgType }: {
|
|
40
|
+
orgType: 'individual' | 'corporate';
|
|
41
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
35
42
|
setPhoneNumbersSettings(organizationLogin: any, phoneNumbersSettings: any): Promise<import("../../types").StartaResponse>;
|
|
36
43
|
setOnboardingStepComplete(organizationLogin: any, step: any): Promise<import("../../types").StartaResponse>;
|
|
37
44
|
setAddressSettings(organizationLogin: any, addressSettings: any): Promise<import("../../types").StartaResponse>;
|
|
@@ -23,6 +23,14 @@ var Organizations = /** @class */ (function () {
|
|
|
23
23
|
body: { login: login, name: name, currency: currency, isPrivate: isPrivate, description: description, timeZone: timeZone, orgType: orgType },
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
+
Organizations.prototype.update = function (account, _a) {
|
|
27
|
+
var name = _a.name, timeZone = _a.timeZone;
|
|
28
|
+
return this._requestRunner.performRequest({
|
|
29
|
+
url: "accounts/".concat(account),
|
|
30
|
+
method: 'PUT',
|
|
31
|
+
body: { name: name, timeZone: timeZone },
|
|
32
|
+
});
|
|
33
|
+
};
|
|
26
34
|
Organizations.prototype.get = function (organizationLogin) {
|
|
27
35
|
return this._requestRunner.performRequest({
|
|
28
36
|
url: "accounts/".concat(organizationLogin),
|
|
@@ -64,6 +72,14 @@ var Organizations = /** @class */ (function () {
|
|
|
64
72
|
body: { categories: categories },
|
|
65
73
|
});
|
|
66
74
|
};
|
|
75
|
+
Organizations.prototype.setOrgType = function (organizationLogin, _a) {
|
|
76
|
+
var orgType = _a.orgType;
|
|
77
|
+
return this._requestRunner.performRequest({
|
|
78
|
+
url: "accounts/".concat(organizationLogin, "/orgType"),
|
|
79
|
+
method: 'PUT',
|
|
80
|
+
body: { orgType: orgType },
|
|
81
|
+
});
|
|
82
|
+
};
|
|
67
83
|
Organizations.prototype.setPhoneNumbersSettings = function (organizationLogin, phoneNumbersSettings) {
|
|
68
84
|
return this._requestRunner.performRequest({
|
|
69
85
|
url: "accounts/".concat(organizationLogin, "/phoneNumbersSettings"),
|
|
@@ -2,21 +2,35 @@ import { StartaRequestRunner } from '../../types';
|
|
|
2
2
|
export default class Services {
|
|
3
3
|
private _requestRunner;
|
|
4
4
|
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
-
add(organizationLogin: any, { name, image, price, duration, executors
|
|
6
|
-
name:
|
|
7
|
-
image
|
|
8
|
-
price:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
add(organizationLogin: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, duration, executors }: {
|
|
6
|
+
name: string;
|
|
7
|
+
image?: string;
|
|
8
|
+
price: string;
|
|
9
|
+
allowCancellationByCustomer?: boolean;
|
|
10
|
+
disableCancellationByCustomerPriorHours?: number;
|
|
11
|
+
duration: number;
|
|
12
|
+
executors: [
|
|
13
|
+
{
|
|
14
|
+
login: string;
|
|
15
|
+
price?: number;
|
|
16
|
+
duration?: number;
|
|
17
|
+
}
|
|
18
|
+
];
|
|
12
19
|
}): Promise<import("../../types").StartaResponse>;
|
|
13
|
-
update(organizationLogin: any, serviceId: any, { name, image, price, duration, executors
|
|
14
|
-
name:
|
|
15
|
-
image
|
|
16
|
-
price:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
update(organizationLogin: any, serviceId: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, duration, executors }: {
|
|
21
|
+
name: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
price: string;
|
|
24
|
+
allowCancellationByCustomer?: boolean;
|
|
25
|
+
disableCancellationByCustomerPriorHours?: number;
|
|
26
|
+
duration: number;
|
|
27
|
+
executors: [
|
|
28
|
+
{
|
|
29
|
+
login: string;
|
|
30
|
+
price?: number;
|
|
31
|
+
duration?: number;
|
|
32
|
+
}
|
|
33
|
+
];
|
|
20
34
|
}): Promise<import("../../types").StartaResponse>;
|
|
21
35
|
delete(organizationLogin: any, serviceId: any): Promise<import("../../types").StartaResponse>;
|
|
22
36
|
}
|
|
@@ -5,19 +5,35 @@ var Services = /** @class */ (function () {
|
|
|
5
5
|
this._requestRunner = requestRunner;
|
|
6
6
|
}
|
|
7
7
|
Services.prototype.add = function (organizationLogin, _a) {
|
|
8
|
-
var name = _a.name, image = _a.image, price = _a.price,
|
|
8
|
+
var name = _a.name, image = _a.image, price = _a.price, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, duration = _a.duration, executors = _a.executors;
|
|
9
9
|
return this._requestRunner.performRequest({
|
|
10
10
|
url: "accounts/".concat(organizationLogin, "/services"),
|
|
11
11
|
method: 'POST',
|
|
12
|
-
body: {
|
|
12
|
+
body: {
|
|
13
|
+
name: name,
|
|
14
|
+
image: image,
|
|
15
|
+
price: price,
|
|
16
|
+
duration: duration,
|
|
17
|
+
executors: executors,
|
|
18
|
+
allowCancellationByCustomer: allowCancellationByCustomer,
|
|
19
|
+
disableCancellationByCustomerPriorHours: disableCancellationByCustomerPriorHours,
|
|
20
|
+
},
|
|
13
21
|
});
|
|
14
22
|
};
|
|
15
23
|
Services.prototype.update = function (organizationLogin, serviceId, _a) {
|
|
16
|
-
var name = _a.name, image = _a.image, price = _a.price,
|
|
24
|
+
var name = _a.name, image = _a.image, price = _a.price, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, duration = _a.duration, executors = _a.executors;
|
|
17
25
|
return this._requestRunner.performRequest({
|
|
18
26
|
url: "accounts/".concat(organizationLogin, "/services/").concat(serviceId),
|
|
19
27
|
method: 'PUT',
|
|
20
|
-
body: {
|
|
28
|
+
body: {
|
|
29
|
+
name: name,
|
|
30
|
+
image: image,
|
|
31
|
+
price: price,
|
|
32
|
+
duration: duration,
|
|
33
|
+
executors: executors,
|
|
34
|
+
allowCancellationByCustomer: allowCancellationByCustomer,
|
|
35
|
+
disableCancellationByCustomerPriorHours: disableCancellationByCustomerPriorHours,
|
|
36
|
+
},
|
|
21
37
|
});
|
|
22
38
|
};
|
|
23
39
|
Services.prototype.delete = function (organizationLogin, serviceId) {
|