starta.apiclient 1.37.3201 → 1.37.3206

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.
@@ -91,16 +91,16 @@ export default class Accounts {
91
91
  getAllKeys(): Promise<import("../types").StartaResponse>;
92
92
  getAddressSuggestions(login: string, term: string, language?: string): Promise<import("../types").StartaResponse>;
93
93
  setStatus(login: string, status: 'client' | 'potentialOrganization' | 'hasOrganization' | 'onboarding' | 'trial' | 'license'): Promise<import("../types").StartaResponse>;
94
- orders(login: string, { organizationLogin, from, to, status, product: { type, id, executor }, sortColumn, sortDirection, statusOperator }: {
94
+ orders(login: string, { organizationLogin, from, to, status, products, sortColumn, sortDirection, statusOperator }: {
95
95
  organizationLogin?: any;
96
96
  from?: string;
97
97
  to?: string;
98
98
  status?: OrderStatus | OrderStatus[];
99
- product?: {
99
+ products?: Array<{
100
100
  type?: string;
101
101
  id?: string;
102
- executor?: string;
103
- };
102
+ executors?: Array<string>;
103
+ }>;
104
104
  statusOperator?: '$eq' | '$ne' | '$in' | '$nin';
105
105
  sortDirection?: 'asc' | 'desc';
106
106
  sortColumn?: 'starttime';
@@ -221,14 +221,14 @@ class Accounts {
221
221
  body: { status },
222
222
  });
223
223
  }
224
- orders(login, { organizationLogin, from, to, status, product: { type, id, executor } = {}, sortColumn, sortDirection, statusOperator }) {
224
+ orders(login, { organizationLogin, from, to, status, products, sortColumn, sortDirection, statusOperator }) {
225
225
  return this._requestRunner.performRequest({
226
226
  url: `accounts/${login}/orders${(0, _helpers_1.buildQuery)({
227
227
  organizationLogin,
228
228
  from,
229
229
  to,
230
230
  status,
231
- product: { type, id, executor },
231
+ products,
232
232
  sortColumn,
233
233
  sortDirection,
234
234
  statusOperator
@@ -89,7 +89,6 @@ export default class Organizations {
89
89
  setForYearBonus(organizationLogin: string, bonusForYearUntil: string): Promise<import("../../types").StartaResponse>;
90
90
  getBillingInfo(organizationLogin: string, month?: string): Promise<import("../../types").StartaResponse>;
91
91
  setTariff(organizationLogin: string, { tariff, period, successUrl, cancelUrl }: TariffDetails): Promise<import("../../types").StartaResponse>;
92
- getSMSCreditsPaymentLink(organizationLogin: string, creditsPackage: 'lite250' | 'pro250'): Promise<import("../../types").StartaResponse>;
93
92
  get orders(): Orders;
94
93
  get customers(): Customers;
95
94
  get rooms(): Rooms;
@@ -202,13 +202,6 @@ class Organizations {
202
202
  body: { tariff, period, successUrl, cancelUrl },
203
203
  });
204
204
  }
205
- getSMSCreditsPaymentLink(organizationLogin, creditsPackage) {
206
- return this._requestRunner.performRequest({
207
- url: `accounts/${organizationLogin}/smsCreditsPaymentLink`,
208
- method: 'GET',
209
- body: { creditsPackage },
210
- });
211
- }
212
205
  get orders() {
213
206
  return new orders_1.default(this._requestRunner);
214
207
  }
@@ -2,7 +2,7 @@ import { StartaRequestRunner, OrderStatus, OrderRepeatSettings } from '../../typ
2
2
  export default class Orders {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
- index(organizationLogin: any, { from, to, status, startaCommissionMonth, product: { type, id, executor }, sortColumn, sortDirection, statusOperator, needsToBeConfirmedByOrganization, needsToBeApprovedByCustomer, }: {
5
+ index(organizationLogin: string, { from, to, status, startaCommissionMonth, product, sortColumn, sortDirection, statusOperator, needsToBeConfirmedByOrganization, needsToBeApprovedByCustomer, }: {
6
6
  from?: string;
7
7
  to?: string;
8
8
  status?: OrderStatus | OrderStatus[];
@@ -10,7 +10,7 @@ export default class Orders {
10
10
  product?: {
11
11
  type?: string;
12
12
  id?: string;
13
- executor?: string;
13
+ executors?: Array<string>;
14
14
  };
15
15
  statusOperator?: '$eq' | '$ne' | '$in' | '$nin';
16
16
  sortDirection?: 'asc' | 'desc';
@@ -18,20 +18,24 @@ export default class Orders {
18
18
  needsToBeConfirmedByOrganization?: boolean;
19
19
  needsToBeApprovedByCustomer?: boolean;
20
20
  }): Promise<import("../../types").StartaResponse>;
21
- isTimeSlotAvailable(organizationLogin: any, { executor, starttime, endtime, skipOrderId, scheduleId }: {
21
+ isTimeSlotAvailable(organizationLogin: string, { executor, starttime, endtime, skipOrderId, scheduleId }: {
22
22
  executor: any;
23
23
  starttime: any;
24
24
  endtime: any;
25
25
  skipOrderId: any;
26
26
  scheduleId: any;
27
27
  }): Promise<import("../../types").StartaResponse>;
28
- get(organizationOrCustomerLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
29
- add(organizationLogin: any, { product: { type, id, executor }, starttime, endtime, customerId, price, duration, scheduleId, status, repeatSettings, discountType }: {
30
- product: {
28
+ get(organizationOrCustomerLogin: string, orderId: any): Promise<import("../../types").StartaResponse>;
29
+ add(organizationLogin: string, { products, starttime, endtime, customerId, price, duration, scheduleId, status, repeatSettings, discountType }: {
30
+ products: Array<{
31
31
  type: any;
32
32
  id: any;
33
- executor?: any;
34
- };
33
+ executors?: Array<string>;
34
+ amount?: number;
35
+ timeOffset?: number;
36
+ price?: number;
37
+ duration?: number;
38
+ }>;
35
39
  starttime?: any;
36
40
  endtime?: any;
37
41
  customerId: any;
@@ -42,12 +46,16 @@ export default class Orders {
42
46
  repeatSettings?: OrderRepeatSettings;
43
47
  discountType?: 'relative' | 'absolute';
44
48
  }): Promise<import("../../types").StartaResponse>;
45
- update(organizationLogin: any, orderId: any, { product: { type, id, executor }, starttime, endtime, price, duration, scheduleId, status, repeatSettings, discountType }: {
46
- product: {
49
+ update(organizationLogin: any, orderId: any, { products, starttime, endtime, price, duration, scheduleId, status, repeatSettings, discountType }: {
50
+ products: Array<{
47
51
  type: any;
48
52
  id: any;
49
- executor?: any;
50
- };
53
+ executors?: Array<string>;
54
+ amount?: number;
55
+ timeOffset?: number;
56
+ price?: number;
57
+ duration?: number;
58
+ }>;
51
59
  starttime?: any;
52
60
  endtime?: any;
53
61
  price?: any;
@@ -5,14 +5,14 @@ class Orders {
5
5
  constructor(requestRunner) {
6
6
  this._requestRunner = requestRunner;
7
7
  }
8
- index(organizationLogin, { from, to, status, startaCommissionMonth, product: { type, id, executor } = {}, sortColumn, sortDirection, statusOperator, needsToBeConfirmedByOrganization, needsToBeApprovedByCustomer, }) {
8
+ index(organizationLogin, { from, to, status, startaCommissionMonth, product, sortColumn, sortDirection, statusOperator, needsToBeConfirmedByOrganization, needsToBeApprovedByCustomer, }) {
9
9
  return this._requestRunner.performRequest({
10
10
  url: `accounts/${organizationLogin}/orders${(0, _helpers_1.buildQuery)({
11
11
  from,
12
12
  to,
13
13
  status,
14
14
  startaCommissionMonth,
15
- product: { type, id, executor },
15
+ product,
16
16
  sortColumn,
17
17
  sortDirection,
18
18
  statusOperator,
@@ -40,12 +40,12 @@ class Orders {
40
40
  method: 'GET',
41
41
  });
42
42
  }
43
- add(organizationLogin, { product: { type, id, executor }, starttime, endtime, customerId, price, duration, scheduleId, status = 'new', repeatSettings, discountType }) {
43
+ add(organizationLogin, { products, starttime, endtime, customerId, price, duration, scheduleId, status = 'new', repeatSettings, discountType }) {
44
44
  return this._requestRunner.performRequest({
45
45
  url: `accounts/${organizationLogin}/orders`,
46
46
  method: 'POST',
47
47
  body: {
48
- product: { type, id, executor },
48
+ products,
49
49
  starttime,
50
50
  endtime,
51
51
  customerId,
@@ -58,12 +58,12 @@ class Orders {
58
58
  },
59
59
  });
60
60
  }
61
- update(organizationLogin, orderId, { product: { type, id, executor }, starttime, endtime, price, duration, scheduleId, status, repeatSettings, discountType }) {
61
+ update(organizationLogin, orderId, { products, starttime, endtime, price, duration, scheduleId, status, repeatSettings, discountType }) {
62
62
  return this._requestRunner.performRequest({
63
63
  url: `accounts/${organizationLogin}/orders/${orderId}`,
64
64
  method: 'PUT',
65
65
  body: {
66
- product: { type, id, executor },
66
+ products,
67
67
  starttime,
68
68
  endtime,
69
69
  price,
@@ -3,19 +3,32 @@ export default class Public {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
5
  info(organizationLogin: any): Promise<import("../../types").StartaResponse>;
6
- getAvailableTimeSlots(organizationLogin: any, { serviceId, executor, month, scheduleId }: {
7
- serviceId: any;
8
- executor: any;
9
- month: any;
10
- scheduleId: any;
6
+ getAvailableTimeSlots(organizationLogin: string, { products, month, scheduleId }: {
7
+ products: Array<{
8
+ type: any;
9
+ id: any;
10
+ executors?: Array<string>;
11
+ amount?: number;
12
+ timeOffset?: number;
13
+ price?: number;
14
+ duration?: number;
15
+ }>;
16
+ month: string;
17
+ scheduleId: string;
11
18
  }): Promise<import("../../types").StartaResponse>;
12
19
  cancelOrder(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
13
20
  addFeedback(organizationLogin: any, orderId: any, { rating, text }: {
14
21
  rating: number;
15
22
  text: string;
16
23
  }): Promise<import("../../types").StartaResponse>;
17
- createOrder(organizationLogin: any, { product, starttime, scheduleId, customerInfo }: {
18
- product: any;
24
+ createOrder(organizationLogin: any, { products, starttime, scheduleId, customerInfo }: {
25
+ products: Array<{
26
+ type: any;
27
+ id: any;
28
+ executors?: Array<string>;
29
+ amount?: number;
30
+ timeOffset?: number;
31
+ }>;
19
32
  starttime: any;
20
33
  scheduleId: any;
21
34
  customerInfo?: {
@@ -11,13 +11,12 @@ class Public {
11
11
  method: 'GET',
12
12
  });
13
13
  }
14
- getAvailableTimeSlots(organizationLogin, { serviceId, executor, month, scheduleId }) {
14
+ getAvailableTimeSlots(organizationLogin, { products, month, scheduleId }) {
15
15
  return this._requestRunner.performRequest({
16
16
  url: `accounts/${organizationLogin}/public/availableTimeSlots${(0, _helpers_1.buildQuery)({
17
- serviceId,
18
- executor,
17
+ products,
19
18
  month,
20
- scheduleId
19
+ scheduleId,
21
20
  })}`,
22
21
  method: 'GET',
23
22
  });
@@ -36,11 +35,11 @@ class Public {
36
35
  body: { rating, text },
37
36
  });
38
37
  }
39
- createOrder(organizationLogin, { product, starttime, scheduleId, customerInfo }) {
38
+ createOrder(organizationLogin, { products, starttime, scheduleId, customerInfo }) {
40
39
  return this._requestRunner.performRequest({
41
40
  url: `accounts/${organizationLogin}/public/orders`,
42
41
  method: 'POST',
43
- body: { product, starttime, scheduleId, customerInfo },
42
+ body: { products, starttime, scheduleId, customerInfo },
44
43
  });
45
44
  }
46
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.3201",
3
+ "version": "1.37.3206",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",