starta.apiclient 1.0.0

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.
Files changed (49) hide show
  1. package/lib/factory.d.ts +4 -0
  2. package/lib/factory.js +8 -0
  3. package/lib/index.d.ts +5 -0
  4. package/lib/index.js +7 -0
  5. package/lib/request.d.ts +3 -0
  6. package/lib/request.js +60 -0
  7. package/lib/services/_helpers.d.ts +1 -0
  8. package/lib/services/_helpers.js +26 -0
  9. package/lib/services/accounts.d.ts +61 -0
  10. package/lib/services/accounts.js +163 -0
  11. package/lib/services/emailConfirmations.d.ts +7 -0
  12. package/lib/services/emailConfirmations.js +24 -0
  13. package/lib/services/healthcheck.d.ts +6 -0
  14. package/lib/services/healthcheck.js +15 -0
  15. package/lib/services/index.d.ts +21 -0
  16. package/lib/services/index.js +73 -0
  17. package/lib/services/organizations/customers.d.ts +47 -0
  18. package/lib/services/organizations/customers.js +87 -0
  19. package/lib/services/organizations/dashboard.d.ts +11 -0
  20. package/lib/services/organizations/dashboard.js +28 -0
  21. package/lib/services/organizations/index.d.ts +74 -0
  22. package/lib/services/organizations/index.js +222 -0
  23. package/lib/services/organizations/integrations.d.ts +10 -0
  24. package/lib/services/organizations/integrations.js +17 -0
  25. package/lib/services/organizations/members.d.ts +6 -0
  26. package/lib/services/organizations/members.js +16 -0
  27. package/lib/services/organizations/orders.d.ts +45 -0
  28. package/lib/services/organizations/orders.js +74 -0
  29. package/lib/services/organizations/payments.d.ts +16 -0
  30. package/lib/services/organizations/payments.js +33 -0
  31. package/lib/services/organizations/public.d.ts +14 -0
  32. package/lib/services/organizations/public.js +41 -0
  33. package/lib/services/organizations/rooms.d.ts +17 -0
  34. package/lib/services/organizations/rooms.js +45 -0
  35. package/lib/services/organizations/seminars.d.ts +38 -0
  36. package/lib/services/organizations/seminars.js +67 -0
  37. package/lib/services/organizations/services.d.ts +22 -0
  38. package/lib/services/organizations/services.js +31 -0
  39. package/lib/services/passwordResets.d.ts +15 -0
  40. package/lib/services/passwordResets.js +25 -0
  41. package/lib/services/sessions.d.ts +17 -0
  42. package/lib/services/sessions.js +37 -0
  43. package/lib/services/system.d.ts +6 -0
  44. package/lib/services/system.js +20 -0
  45. package/lib/services/webhooks.d.ts +6 -0
  46. package/lib/services/webhooks.js +21 -0
  47. package/lib/types.d.ts +25 -0
  48. package/lib/types.js +2 -0
  49. package/package.json +26 -0
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Accounts = /** @class */ (function () {
4
+ function Accounts(request) {
5
+ this._request = request;
6
+ }
7
+ Accounts.prototype.ordersStats = function (organizationLogin, _a) {
8
+ var period = _a.period, customFrom = _a.customFrom, customTo = _a.customTo;
9
+ if (['today', 'yesterday', 'thisweek', 'thismonth', 'thisyear', 'custom'].indexOf(period) === -1) {
10
+ throw new Error('Incorrect value of period');
11
+ }
12
+ if (period === 'custom' && (!customFrom || !customTo)) {
13
+ throw new Error('For custom period please pass values to customFrom and customTo');
14
+ }
15
+ return this._request({
16
+ url: "accounts/".concat(organizationLogin, "/dashboard/orders-stats?period=").concat(period, "&customFrom=").concat(customFrom, "&customTo=").concat(customTo),
17
+ method: 'GET',
18
+ });
19
+ };
20
+ Accounts.prototype.orders = function (organizationLogin) {
21
+ return this._request({
22
+ url: "accounts/".concat(organizationLogin, "/dashboard/orders"),
23
+ method: 'GET',
24
+ });
25
+ };
26
+ return Accounts;
27
+ }());
28
+ exports.default = Accounts;
@@ -0,0 +1,74 @@
1
+ import { StartaRequest } from '../../types';
2
+ import Customers from './customers';
3
+ import Orders from './orders';
4
+ import Rooms from './rooms';
5
+ import Seminars from './seminars';
6
+ import Members from './members';
7
+ import Services from './services';
8
+ import Payments from './payments';
9
+ import Dashboard from './dashboard';
10
+ import Public from './public';
11
+ import Integrations from './integrations';
12
+ export default class Organizations {
13
+ private _request;
14
+ constructor(request: StartaRequest);
15
+ create(account: any, { login, name, currency, isPrivate, description, timeZone, orgType }: {
16
+ login: any;
17
+ name: any;
18
+ currency: any;
19
+ isPrivate: any;
20
+ description: any;
21
+ timeZone: any;
22
+ orgType: any;
23
+ }): Promise<import("../../types").StartaResponse>;
24
+ get(organizationLogin: any): Promise<import("../../types").StartaResponse>;
25
+ getPermissionGroups(organizationLogin: any): Promise<import("../../types").StartaResponse>;
26
+ changeBanner(login: any, file: any): Promise<import("../../types").StartaResponse>;
27
+ addMember(organizationLogin: any, { account, login }: {
28
+ account: any;
29
+ login: any;
30
+ }): Promise<import("../../types").StartaResponse>;
31
+ deleteMember(organizationLogin: any, memberLogin: any): Promise<import("../../types").StartaResponse>;
32
+ setCategories(organizationLogin: any, { categories }: {
33
+ categories?: never[] | undefined;
34
+ }): Promise<import("../../types").StartaResponse>;
35
+ setPhoneNumbersSettings(organizationLogin: any, phoneNumbersSettings: any): Promise<import("../../types").StartaResponse>;
36
+ setOnboardingStepComplete(organizationLogin: any, step: any): Promise<import("../../types").StartaResponse>;
37
+ setAddressSettings(organizationLogin: any, addressSettings: any): Promise<import("../../types").StartaResponse>;
38
+ setDescription(organizationLogin: any, description: any): Promise<import("../../types").StartaResponse>;
39
+ getBookingWidgetSettings(organizationLogin: any): Promise<import("../../types").StartaResponse>;
40
+ setBookingWidgetSettings(organizationLogin: any, { enabled, bookingInterval, openButtonEnabled, theme }: {
41
+ enabled: any;
42
+ bookingInterval: any;
43
+ openButtonEnabled: any;
44
+ theme: any;
45
+ }): Promise<import("../../types").StartaResponse>;
46
+ setBookingWidgetStyles(organizationLogin: any, bookingWidgetStyles: any): Promise<import("../../types").StartaResponse>;
47
+ setWorkingSchedule(organizationLogin: any, { weekly: { mon, tue, wed, thu, fri, sat, sun } }: {
48
+ weekly: {
49
+ mon: any;
50
+ tue: any;
51
+ wed: any;
52
+ thu: any;
53
+ fri: any;
54
+ sat: any;
55
+ sun: any;
56
+ };
57
+ }): Promise<import("../../types").StartaResponse>;
58
+ getMembersSchedule(organizationLogin: any, date: any): Promise<import("../../types").StartaResponse>;
59
+ getSingleMemberSchedule(organizationLogin: any, member: any, from: any, to: any): Promise<import("../../types").StartaResponse>;
60
+ get orders(): Orders;
61
+ get customers(): Customers;
62
+ get rooms(): Rooms;
63
+ get seminars(): Seminars;
64
+ get members(): Members;
65
+ get services(): Services;
66
+ get public(): Public;
67
+ get payments(): Payments;
68
+ get dashboard(): Dashboard;
69
+ get integrations(): Integrations;
70
+ updateRoles(organizationLogin: any, roles: any): Promise<import("../../types").StartaResponse>;
71
+ setLicense(organizationLogin: any, { maxMembers }: {
72
+ maxMembers: any;
73
+ }): Promise<import("../../types").StartaResponse>;
74
+ }
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var customers_1 = require("./customers");
4
+ var orders_1 = require("./orders");
5
+ var rooms_1 = require("./rooms");
6
+ var seminars_1 = require("./seminars");
7
+ var members_1 = require("./members");
8
+ var services_1 = require("./services");
9
+ var payments_1 = require("./payments");
10
+ var dashboard_1 = require("./dashboard");
11
+ var public_1 = require("./public");
12
+ var integrations_1 = require("./integrations");
13
+ var _helpers_1 = require("../_helpers");
14
+ var Organizations = /** @class */ (function () {
15
+ function Organizations(request) {
16
+ this._request = request;
17
+ }
18
+ Organizations.prototype.create = function (account, _a) {
19
+ var login = _a.login, name = _a.name, currency = _a.currency, isPrivate = _a.isPrivate, description = _a.description, timeZone = _a.timeZone, orgType = _a.orgType;
20
+ return this._request({
21
+ url: "accounts/".concat(account, "/organizations"),
22
+ method: 'POST',
23
+ body: { login: login, name: name, currency: currency, isPrivate: isPrivate, description: description, timeZone: timeZone, orgType: orgType },
24
+ });
25
+ };
26
+ Organizations.prototype.get = function (organizationLogin) {
27
+ return this._request({
28
+ url: "accounts/".concat(organizationLogin),
29
+ method: 'GET',
30
+ });
31
+ };
32
+ Organizations.prototype.getPermissionGroups = function (organizationLogin) {
33
+ return this._request({
34
+ url: "accounts/".concat(organizationLogin, "/permissionGroups"),
35
+ method: 'GET',
36
+ });
37
+ };
38
+ Organizations.prototype.changeBanner = function (login, file) {
39
+ return this._request({
40
+ url: "accounts/".concat(login, "/banner"),
41
+ method: 'PUT',
42
+ body: { file: file },
43
+ });
44
+ };
45
+ Organizations.prototype.addMember = function (organizationLogin, _a) {
46
+ var account = _a.account, login = _a.login;
47
+ return this._request({
48
+ url: "accounts/".concat(organizationLogin, "/members"),
49
+ method: 'POST',
50
+ body: { account: account, login: login },
51
+ });
52
+ };
53
+ Organizations.prototype.deleteMember = function (organizationLogin, memberLogin) {
54
+ return this._request({
55
+ url: "accounts/".concat(organizationLogin, "/members/").concat(memberLogin),
56
+ method: 'DELETE',
57
+ });
58
+ };
59
+ Organizations.prototype.setCategories = function (organizationLogin, _a) {
60
+ var _b = _a.categories, categories = _b === void 0 ? [] : _b;
61
+ return this._request({
62
+ url: "accounts/".concat(organizationLogin, "/categories"),
63
+ method: 'PUT',
64
+ body: { categories: categories },
65
+ });
66
+ };
67
+ Organizations.prototype.setPhoneNumbersSettings = function (organizationLogin, phoneNumbersSettings) {
68
+ return this._request({
69
+ url: "accounts/".concat(organizationLogin, "/phoneNumbersSettings"),
70
+ method: 'PUT',
71
+ body: { phoneNumbersSettings: phoneNumbersSettings },
72
+ });
73
+ };
74
+ Organizations.prototype.setOnboardingStepComplete = function (organizationLogin, step) {
75
+ return this._request({
76
+ url: "accounts/".concat(organizationLogin, "/onboarding/").concat(step, "/completed"),
77
+ method: 'PUT',
78
+ });
79
+ };
80
+ Organizations.prototype.setAddressSettings = function (organizationLogin, addressSettings) {
81
+ return this._request({
82
+ url: "accounts/".concat(organizationLogin, "/addressSettings"),
83
+ method: 'PUT',
84
+ body: { addressSettings: addressSettings },
85
+ });
86
+ };
87
+ Organizations.prototype.setDescription = function (organizationLogin, description) {
88
+ return this._request({
89
+ url: "accounts/".concat(organizationLogin, "/description"),
90
+ method: 'PUT',
91
+ body: description,
92
+ });
93
+ };
94
+ Organizations.prototype.getBookingWidgetSettings = function (organizationLogin) {
95
+ return this._request({
96
+ url: "accounts/".concat(organizationLogin, "/bookingWidgetSettings"),
97
+ method: 'GET',
98
+ });
99
+ };
100
+ Organizations.prototype.setBookingWidgetSettings = function (organizationLogin, _a) {
101
+ var enabled = _a.enabled, bookingInterval = _a.bookingInterval, openButtonEnabled = _a.openButtonEnabled, theme = _a.theme;
102
+ return this._request({
103
+ url: "accounts/".concat(organizationLogin, "/bookingWidget/settings"),
104
+ method: 'PUT',
105
+ body: { enabled: enabled, bookingInterval: bookingInterval, openButtonEnabled: openButtonEnabled, theme: theme },
106
+ });
107
+ };
108
+ Organizations.prototype.setBookingWidgetStyles = function (organizationLogin, bookingWidgetStyles) {
109
+ return this._request({
110
+ url: "accounts/".concat(organizationLogin, "/bookingWidget/styles"),
111
+ method: 'PUT',
112
+ body: bookingWidgetStyles,
113
+ });
114
+ };
115
+ Organizations.prototype.setWorkingSchedule = function (organizationLogin, _a) {
116
+ var _b = _a.weekly, mon = _b.mon, tue = _b.tue, wed = _b.wed, thu = _b.thu, fri = _b.fri, sat = _b.sat, sun = _b.sun;
117
+ return this._request({
118
+ url: "accounts/".concat(organizationLogin, "/workingSchedule"),
119
+ method: 'PUT',
120
+ body: { weekly: { mon: mon, tue: tue, wed: wed, thu: thu, fri: fri, sat: sat, sun: sun } },
121
+ });
122
+ };
123
+ Organizations.prototype.getMembersSchedule = function (organizationLogin, date /* YYYY-MM-DD */) {
124
+ return this._request({
125
+ url: "accounts/".concat(organizationLogin, "/members/schedule/").concat(date),
126
+ method: 'GET',
127
+ });
128
+ };
129
+ Organizations.prototype.getSingleMemberSchedule = function (organizationLogin, member, from, to /* YYYY-MM-DD */) {
130
+ return this._request({
131
+ url: "accounts/".concat(organizationLogin, "/members/").concat(member, "/schedule").concat((0, _helpers_1.buildQuery)({ from: from, to: to })),
132
+ method: 'GET',
133
+ });
134
+ };
135
+ Object.defineProperty(Organizations.prototype, "orders", {
136
+ get: function () {
137
+ return new orders_1.default(this._request);
138
+ },
139
+ enumerable: false,
140
+ configurable: true
141
+ });
142
+ Object.defineProperty(Organizations.prototype, "customers", {
143
+ get: function () {
144
+ return new customers_1.default(this._request);
145
+ },
146
+ enumerable: false,
147
+ configurable: true
148
+ });
149
+ Object.defineProperty(Organizations.prototype, "rooms", {
150
+ get: function () {
151
+ return new rooms_1.default(this._request);
152
+ },
153
+ enumerable: false,
154
+ configurable: true
155
+ });
156
+ Object.defineProperty(Organizations.prototype, "seminars", {
157
+ get: function () {
158
+ return new seminars_1.default(this._request);
159
+ },
160
+ enumerable: false,
161
+ configurable: true
162
+ });
163
+ Object.defineProperty(Organizations.prototype, "members", {
164
+ get: function () {
165
+ return new members_1.default(this._request);
166
+ },
167
+ enumerable: false,
168
+ configurable: true
169
+ });
170
+ Object.defineProperty(Organizations.prototype, "services", {
171
+ get: function () {
172
+ return new services_1.default(this._request);
173
+ },
174
+ enumerable: false,
175
+ configurable: true
176
+ });
177
+ Object.defineProperty(Organizations.prototype, "public", {
178
+ get: function () {
179
+ return new public_1.default(this._request);
180
+ },
181
+ enumerable: false,
182
+ configurable: true
183
+ });
184
+ Object.defineProperty(Organizations.prototype, "payments", {
185
+ get: function () {
186
+ return new payments_1.default(this._request);
187
+ },
188
+ enumerable: false,
189
+ configurable: true
190
+ });
191
+ Object.defineProperty(Organizations.prototype, "dashboard", {
192
+ get: function () {
193
+ return new dashboard_1.default(this._request);
194
+ },
195
+ enumerable: false,
196
+ configurable: true
197
+ });
198
+ Object.defineProperty(Organizations.prototype, "integrations", {
199
+ get: function () {
200
+ return new integrations_1.default(this._request);
201
+ },
202
+ enumerable: false,
203
+ configurable: true
204
+ });
205
+ Organizations.prototype.updateRoles = function (organizationLogin, roles) {
206
+ return this._request({
207
+ url: "accounts/".concat(organizationLogin, "/roles"),
208
+ method: 'PUT',
209
+ body: { roles: roles },
210
+ });
211
+ };
212
+ Organizations.prototype.setLicense = function (organizationLogin, _a) {
213
+ var maxMembers = _a.maxMembers;
214
+ return this._request({
215
+ url: "accounts/".concat(organizationLogin, "/license"),
216
+ method: 'PUT',
217
+ body: { maxMembers: maxMembers },
218
+ });
219
+ };
220
+ return Organizations;
221
+ }());
222
+ exports.default = Organizations;
@@ -0,0 +1,10 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Accounts {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ setLiqpay(organizationLogin: any, { enabled, publicKey, privateKey }: {
6
+ enabled: any;
7
+ publicKey: any;
8
+ privateKey: any;
9
+ }): Promise<import("../../types").StartaResponse>;
10
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Accounts = /** @class */ (function () {
4
+ function Accounts(request) {
5
+ this._request = request;
6
+ }
7
+ Accounts.prototype.setLiqpay = function (organizationLogin, _a) {
8
+ var enabled = _a.enabled, publicKey = _a.publicKey, privateKey = _a.privateKey;
9
+ return this._request({
10
+ url: "accounts/".concat(organizationLogin, "/integrations/liqpay"),
11
+ method: 'PUT',
12
+ body: { enabled: enabled, publicKey: publicKey, privateKey: privateKey },
13
+ });
14
+ };
15
+ return Accounts;
16
+ }());
17
+ exports.default = Accounts;
@@ -0,0 +1,6 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Accounts {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ updateRoles(organizationLogin: any, member: any, roles: any): Promise<import("../../types").StartaResponse>;
6
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Accounts = /** @class */ (function () {
4
+ function Accounts(request) {
5
+ this._request = request;
6
+ }
7
+ Accounts.prototype.updateRoles = function (organizationLogin, member, roles) {
8
+ return this._request({
9
+ url: "accounts/".concat(organizationLogin, "/members/").concat(member, "/roles"),
10
+ method: 'PUT',
11
+ body: { roles: roles },
12
+ });
13
+ };
14
+ return Accounts;
15
+ }());
16
+ exports.default = Accounts;
@@ -0,0 +1,45 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Orders {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ index(organizationLogin: any, { from, to, status, product: { type, id, executor } }: {
6
+ from?: string;
7
+ to?: string;
8
+ status?: string;
9
+ product: {
10
+ type?: string;
11
+ id?: string;
12
+ executor?: string;
13
+ };
14
+ }): Promise<import("../../types").StartaResponse>;
15
+ isTimeSlotAvailable(organizationLogin: any, { executor, starttime, endtime, skipOrderId }: {
16
+ executor: any;
17
+ starttime: any;
18
+ endtime: any;
19
+ skipOrderId: any;
20
+ }): Promise<import("../../types").StartaResponse>;
21
+ get(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
22
+ add(organizationLogin: any, { product: { type, id, executor }, starttime, endtime, customerId, status }: {
23
+ product: {
24
+ type: any;
25
+ id: any;
26
+ executor: any;
27
+ };
28
+ starttime: any;
29
+ endtime: any;
30
+ customerId: any;
31
+ status?: string | undefined;
32
+ }): Promise<import("../../types").StartaResponse>;
33
+ update(organizationLogin: any, orderId: any, { product: { type, id, executor }, starttime, endtime, customerId, status }: {
34
+ product: {
35
+ type: any;
36
+ id: any;
37
+ executor: any;
38
+ };
39
+ starttime: any;
40
+ endtime: any;
41
+ customerId: any;
42
+ status: any;
43
+ }): Promise<import("../../types").StartaResponse>;
44
+ delete(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
45
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var _helpers_1 = require("../_helpers");
4
+ var Orders = /** @class */ (function () {
5
+ function Orders(request) {
6
+ this._request = request;
7
+ }
8
+ Orders.prototype.index = function (organizationLogin, _a) {
9
+ var from = _a.from, to = _a.to, status = _a.status, _b = _a.product, _c = _b === void 0 ? {} : _b, type = _c.type, id = _c.id, executor = _c.executor;
10
+ return this._request({
11
+ url: "accounts/".concat(organizationLogin, "/orders").concat((0, _helpers_1.buildQuery)({
12
+ from: from,
13
+ to: to,
14
+ status: status,
15
+ product: { type: type, id: id, executor: executor },
16
+ })),
17
+ method: 'GET',
18
+ });
19
+ };
20
+ Orders.prototype.isTimeSlotAvailable = function (organizationLogin, _a) {
21
+ var executor = _a.executor, starttime = _a.starttime, endtime = _a.endtime, skipOrderId = _a.skipOrderId;
22
+ return this._request({
23
+ url: "accounts/".concat(organizationLogin, "/orders/is-time-slot-available").concat((0, _helpers_1.buildQuery)({
24
+ executor: executor,
25
+ starttime: starttime,
26
+ endtime: endtime,
27
+ skipOrderId: skipOrderId,
28
+ })),
29
+ method: 'GET',
30
+ });
31
+ };
32
+ Orders.prototype.get = function (organizationLogin, orderId) {
33
+ return this._request({
34
+ url: "accounts/".concat(organizationLogin, "/orders/").concat(orderId),
35
+ method: 'GET',
36
+ });
37
+ };
38
+ Orders.prototype.add = function (organizationLogin, _a) {
39
+ var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, _c = _a.status, status = _c === void 0 ? 'new' : _c;
40
+ return this._request({
41
+ url: "accounts/".concat(organizationLogin, "/orders"),
42
+ method: 'POST',
43
+ body: {
44
+ product: { type: type, id: id, executor: executor },
45
+ starttime: starttime,
46
+ endtime: endtime,
47
+ customerId: customerId,
48
+ status: status,
49
+ },
50
+ });
51
+ };
52
+ Orders.prototype.update = function (organizationLogin, orderId, _a) {
53
+ var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, status = _a.status;
54
+ return this._request({
55
+ url: "accounts/".concat(organizationLogin, "/orders/").concat(orderId),
56
+ method: 'PUT',
57
+ body: {
58
+ product: { type: type, id: id, executor: executor },
59
+ starttime: starttime,
60
+ endtime: endtime,
61
+ customerId: customerId,
62
+ status: status,
63
+ },
64
+ });
65
+ };
66
+ Orders.prototype.delete = function (organizationLogin, orderId) {
67
+ return this._request({
68
+ url: "accounts/".concat(organizationLogin, "/orders/").concat(orderId),
69
+ method: 'DELETE',
70
+ });
71
+ };
72
+ return Orders;
73
+ }());
74
+ exports.default = Orders;
@@ -0,0 +1,16 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Payments {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ addLiqpay(organizationLogin: any, { signature, data }: {
6
+ signature: any;
7
+ data: any;
8
+ }): Promise<import("../../types").StartaResponse>;
9
+ addManual(organizationLogin: any, { orderId, currency, date, amount, method }: {
10
+ orderId: any;
11
+ currency: any;
12
+ date: any;
13
+ amount: any;
14
+ method: any;
15
+ }): Promise<import("../../types").StartaResponse>;
16
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Payments = /** @class */ (function () {
4
+ function Payments(request) {
5
+ this._request = request;
6
+ }
7
+ Payments.prototype.addLiqpay = function (organizationLogin, _a) {
8
+ var signature = _a.signature, data = _a.data;
9
+ return this._request({
10
+ url: "accounts/".concat(organizationLogin, "/payments/liqpay"),
11
+ method: 'POST',
12
+ body: {
13
+ signature: signature,
14
+ data: data,
15
+ },
16
+ });
17
+ };
18
+ Payments.prototype.addManual = function (organizationLogin, _a) {
19
+ var orderId = _a.orderId, currency = _a.currency, date = _a.date, amount = _a.amount, method = _a.method;
20
+ return this._request({
21
+ url: "accounts/".concat(organizationLogin, "/payments/manual"),
22
+ method: 'POST',
23
+ body: {
24
+ orderId: orderId,
25
+ date: date,
26
+ amount: amount,
27
+ method: method,
28
+ },
29
+ });
30
+ };
31
+ return Payments;
32
+ }());
33
+ exports.default = Payments;
@@ -0,0 +1,14 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Public {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ info(organizationLogin: any): Promise<import("../../types").StartaResponse>;
6
+ getAvailableTimeSlots(organizationLogin: any, serviceId: any, executor: any, month: any): Promise<import("../../types").StartaResponse>;
7
+ getOrder(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
8
+ getOrders(organizationLogin: any): Promise<import("../../types").StartaResponse>;
9
+ createOrder(organizationLogin: any, { customer, product, starttime }: {
10
+ customer: any;
11
+ product: any;
12
+ starttime: any;
13
+ }): Promise<import("../../types").StartaResponse>;
14
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Public = /** @class */ (function () {
4
+ function Public(request) {
5
+ this._request = request;
6
+ }
7
+ Public.prototype.info = function (organizationLogin) {
8
+ return this._request({
9
+ url: "accounts/".concat(organizationLogin, "/public/info"),
10
+ method: 'GET',
11
+ });
12
+ };
13
+ Public.prototype.getAvailableTimeSlots = function (organizationLogin, serviceId, executor, month) {
14
+ return this._request({
15
+ url: "accounts/".concat(organizationLogin, "/public/availableTimeSlots?serviceId=").concat(serviceId, "&executor=").concat(executor, "&month=").concat(month),
16
+ method: 'GET',
17
+ });
18
+ };
19
+ Public.prototype.getOrder = function (organizationLogin, orderId) {
20
+ return this._request({
21
+ url: "accounts/".concat(organizationLogin, "/public/orders/").concat(orderId),
22
+ method: 'GET',
23
+ });
24
+ };
25
+ Public.prototype.getOrders = function (organizationLogin) {
26
+ return this._request({
27
+ url: "accounts/".concat(organizationLogin, "/public/orders"),
28
+ method: 'GET',
29
+ });
30
+ };
31
+ Public.prototype.createOrder = function (organizationLogin, _a) {
32
+ var customer = _a.customer, product = _a.product, starttime = _a.starttime;
33
+ return this._request({
34
+ url: "accounts/".concat(organizationLogin, "/public/orders"),
35
+ method: 'POST',
36
+ body: { customer: customer, product: product, starttime: starttime },
37
+ });
38
+ };
39
+ return Public;
40
+ }());
41
+ exports.default = Public;
@@ -0,0 +1,17 @@
1
+ import { StartaRequest } from '../../types';
2
+ export default class Rooms {
3
+ private _request;
4
+ constructor(request: StartaRequest);
5
+ add(organizationLogin: any, { name, pricePerHour, description }: {
6
+ name: any;
7
+ pricePerHour: any;
8
+ description: any;
9
+ }): Promise<import("../../types").StartaResponse>;
10
+ update(organizationLogin: any, roomId: any, { name, pricePerHour, description }: {
11
+ name: any;
12
+ pricePerHour: any;
13
+ description: any;
14
+ }): Promise<import("../../types").StartaResponse>;
15
+ delete(organizationLogin: any, roomId: any): Promise<import("../../types").StartaResponse>;
16
+ getSchedule(organizationLogin: any, date: any): Promise<import("../../types").StartaResponse>;
17
+ }