starta.apiclient 1.37.949 → 1.37.965

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.
@@ -41,7 +41,12 @@ export default class Organizations {
41
41
  setOrgType(organizationLogin: any, { orgType }: {
42
42
  orgType: 'individual' | 'corporate';
43
43
  }): Promise<import("../../types").StartaResponse>;
44
- setPhoneNumbersSettings(organizationLogin: any, phoneNumbersSettings: any): Promise<import("../../types").StartaResponse>;
44
+ setContactsSettings(organizationLogin: string, contactsSettings: {
45
+ contacts: Array<{
46
+ type: string;
47
+ contact: string;
48
+ }>;
49
+ }): Promise<import("../../types").StartaResponse>;
45
50
  setOnboardingStepComplete(organizationLogin: any, step: any): Promise<import("../../types").StartaResponse>;
46
51
  setDescription(organizationLogin: any, description: any): Promise<import("../../types").StartaResponse>;
47
52
  getBookingWidgetSettings(organizationLogin: any): Promise<import("../../types").StartaResponse>;
@@ -88,11 +88,11 @@ var Organizations = /** @class */ (function () {
88
88
  body: { orgType: orgType },
89
89
  });
90
90
  };
91
- Organizations.prototype.setPhoneNumbersSettings = function (organizationLogin, phoneNumbersSettings) {
91
+ Organizations.prototype.setContactsSettings = function (organizationLogin, contactsSettings) {
92
92
  return this._requestRunner.performRequest({
93
- url: "accounts/".concat(organizationLogin, "/phoneNumbersSettings"),
93
+ url: "accounts/".concat(organizationLogin, "/contactsSettings"),
94
94
  method: 'PUT',
95
- body: { phoneNumbersSettings: phoneNumbersSettings },
95
+ body: { contactsSettings: contactsSettings },
96
96
  });
97
97
  };
98
98
  Organizations.prototype.setOnboardingStepComplete = function (organizationLogin, step) {
@@ -1,5 +1,4 @@
1
- import { StartaRequestRunner } from '../../types';
2
- export declare type OrderStatus = 'new' | 'inprogress' | 'canceled' | 'completed';
1
+ import { StartaRequestRunner, OrderStatus, OrderRepeatSettings } from '../../types';
3
2
  export default class Orders {
4
3
  private _requestRunner;
5
4
  constructor(requestRunner: StartaRequestRunner);
@@ -21,7 +20,7 @@ export default class Orders {
21
20
  scheduleId: any;
22
21
  }): Promise<import("../../types").StartaResponse>;
23
22
  get(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
24
- add(organizationLogin: any, { product: { type, id, executor }, starttime, endtime, customerId, scheduleId, status }: {
23
+ add(organizationLogin: any, { product: { type, id, executor }, starttime, endtime, customerId, scheduleId, status, repeatSettings }: {
25
24
  product: {
26
25
  type: any;
27
26
  id: any;
@@ -32,8 +31,9 @@ export default class Orders {
32
31
  customerId: any;
33
32
  scheduleId?: any;
34
33
  status?: OrderStatus;
34
+ repeatSettings?: OrderRepeatSettings;
35
35
  }): Promise<import("../../types").StartaResponse>;
36
- update(organizationLogin: any, orderId: any, { product: { type, id, executor }, starttime, endtime, customerId, scheduleId, status }: {
36
+ update(organizationLogin: any, orderId: any, { product: { type, id, executor }, starttime, endtime, customerId, scheduleId, status, repeatSettings }: {
37
37
  product: {
38
38
  type: any;
39
39
  id: any;
@@ -44,6 +44,7 @@ export default class Orders {
44
44
  customerId: any;
45
45
  scheduleId?: any;
46
46
  status?: OrderStatus;
47
+ repeatSettings?: OrderRepeatSettings;
47
48
  }): Promise<import("../../types").StartaResponse>;
48
49
  delete(organizationLogin: any, orderId: any): Promise<import("../../types").StartaResponse>;
49
50
  }
@@ -37,7 +37,7 @@ var Orders = /** @class */ (function () {
37
37
  });
38
38
  };
39
39
  Orders.prototype.add = function (organizationLogin, _a) {
40
- var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, scheduleId = _a.scheduleId, _c = _a.status, status = _c === void 0 ? 'new' : _c;
40
+ var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, scheduleId = _a.scheduleId, _c = _a.status, status = _c === void 0 ? 'new' : _c, repeatSettings = _a.repeatSettings;
41
41
  return this._requestRunner.performRequest({
42
42
  url: "accounts/".concat(organizationLogin, "/orders"),
43
43
  method: 'POST',
@@ -48,11 +48,12 @@ var Orders = /** @class */ (function () {
48
48
  customerId: customerId,
49
49
  scheduleId: scheduleId,
50
50
  status: status,
51
+ repeatSettings: repeatSettings,
51
52
  },
52
53
  });
53
54
  };
54
55
  Orders.prototype.update = function (organizationLogin, orderId, _a) {
55
- var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, scheduleId = _a.scheduleId, status = _a.status;
56
+ var _b = _a.product, type = _b.type, id = _b.id, executor = _b.executor, starttime = _a.starttime, endtime = _a.endtime, customerId = _a.customerId, scheduleId = _a.scheduleId, status = _a.status, repeatSettings = _a.repeatSettings;
56
57
  return this._requestRunner.performRequest({
57
58
  url: "accounts/".concat(organizationLogin, "/orders/").concat(orderId),
58
59
  method: 'PUT',
@@ -63,6 +64,7 @@ var Orders = /** @class */ (function () {
63
64
  customerId: customerId,
64
65
  scheduleId: scheduleId,
65
66
  status: status,
67
+ repeatSettings: repeatSettings,
66
68
  },
67
69
  });
68
70
  };
@@ -2,7 +2,7 @@ import { StartaRequestRunner, DraftjsObject } from '../../types';
2
2
  export default class Services {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
- add(organizationLogin: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours, disableBookingByCustomer, duration, executors, description, }: {
5
+ add(organizationLogin: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours, disableBookingByCustomer, duration, schedules, executors, description, }: {
6
6
  name: {
7
7
  default: string;
8
8
  [key: string]: string;
@@ -21,6 +21,10 @@ export default class Services {
21
21
  duration?: number;
22
22
  }
23
23
  ];
24
+ schedules?: Array<{
25
+ id: string;
26
+ enabled: boolean;
27
+ }>;
24
28
  description?: {
25
29
  default: DraftjsObject;
26
30
  'en-us'?: DraftjsObject;
@@ -28,7 +32,7 @@ export default class Services {
28
32
  'ru-ru'?: DraftjsObject;
29
33
  };
30
34
  }): Promise<import("../../types").StartaResponse>;
31
- update(organizationLogin: any, serviceId: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours, duration, executors, description, disableBookingByCustomer, }: {
35
+ update(organizationLogin: any, serviceId: any, { name, image, price, allowCancellationByCustomer, disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours, duration, executors, description, disableBookingByCustomer, schedules, }: {
32
36
  name: {
33
37
  default: string;
34
38
  [key: string]: string;
@@ -40,6 +44,10 @@ export default class Services {
40
44
  disableBookingByCustomerPriorHours?: number;
41
45
  disableBookingByCustomer?: boolean;
42
46
  duration: number;
47
+ schedules?: Array<{
48
+ id: string;
49
+ enabled: boolean;
50
+ }>;
43
51
  executors: [
44
52
  {
45
53
  login: string;
@@ -5,7 +5,7 @@ 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, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours = _a.disableBookingByCustomerPriorHours, disableBookingByCustomer = _a.disableBookingByCustomer, duration = _a.duration, executors = _a.executors, description = _a.description;
8
+ var name = _a.name, image = _a.image, price = _a.price, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours = _a.disableBookingByCustomerPriorHours, disableBookingByCustomer = _a.disableBookingByCustomer, duration = _a.duration, schedules = _a.schedules, executors = _a.executors, description = _a.description;
9
9
  return this._requestRunner.performRequest({
10
10
  url: "accounts/".concat(organizationLogin, "/services"),
11
11
  method: 'POST',
@@ -20,11 +20,12 @@ var Services = /** @class */ (function () {
20
20
  disableBookingByCustomerPriorHours: disableBookingByCustomerPriorHours,
21
21
  disableBookingByCustomer: disableBookingByCustomer,
22
22
  description: description,
23
+ schedules: schedules,
23
24
  },
24
25
  });
25
26
  };
26
27
  Services.prototype.update = function (organizationLogin, serviceId, _a) {
27
- var name = _a.name, image = _a.image, price = _a.price, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours = _a.disableBookingByCustomerPriorHours, duration = _a.duration, executors = _a.executors, description = _a.description, disableBookingByCustomer = _a.disableBookingByCustomer;
28
+ var name = _a.name, image = _a.image, price = _a.price, allowCancellationByCustomer = _a.allowCancellationByCustomer, disableCancellationByCustomerPriorHours = _a.disableCancellationByCustomerPriorHours, disableBookingByCustomerPriorHours = _a.disableBookingByCustomerPriorHours, duration = _a.duration, executors = _a.executors, description = _a.description, disableBookingByCustomer = _a.disableBookingByCustomer, schedules = _a.schedules;
28
29
  return this._requestRunner.performRequest({
29
30
  url: "accounts/".concat(organizationLogin, "/services/").concat(serviceId),
30
31
  method: 'PUT',
@@ -38,6 +39,7 @@ var Services = /** @class */ (function () {
38
39
  disableCancellationByCustomerPriorHours: disableCancellationByCustomerPriorHours,
39
40
  disableBookingByCustomerPriorHours: disableBookingByCustomerPriorHours,
40
41
  description: description,
42
+ schedules: schedules,
41
43
  disableBookingByCustomer: disableBookingByCustomer,
42
44
  },
43
45
  });
package/lib/types.d.ts CHANGED
@@ -73,3 +73,15 @@ export declare type OrganizationSchedule = {
73
73
  };
74
74
  };
75
75
  };
76
+ export declare type OrderStatus = 'new' | 'inprogress' | 'canceled' | 'completed';
77
+ export declare type OrderRepeatSettings = {
78
+ interval: {
79
+ every: number;
80
+ unit: 'day' | 'week' | 'month';
81
+ };
82
+ filter?: Array<number>;
83
+ finish: {
84
+ type: 'never' | 'date' | 'times';
85
+ value?: Date | Number;
86
+ };
87
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.949",
3
+ "version": "1.37.965",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",