starta.apiclient 1.37.7489 → 1.37.7771

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.
@@ -117,7 +117,7 @@ export default class Accounts {
117
117
  resetConfirmations(login: string): Promise<import("../types").StartaResponse>;
118
118
  assign(login: string, { assinedLogins }: AssignedRequest): Promise<import("../types").StartaResponse>;
119
119
  }
120
- export type AssignedRequest = {
120
+ export declare type AssignedRequest = {
121
121
  assinedLogins: Array<{
122
122
  login: string;
123
123
  }>;
@@ -28,7 +28,7 @@ export default class Customers {
28
28
  to?: string;
29
29
  };
30
30
  };
31
- sortColumn?: 'incrementId' | 'name' | 'lastOrder' | 'totalOrders' | 'paid' | 'discount' | 'createdAt';
31
+ sortColumn?: 'id' | 'name' | 'lastOrder' | 'totalOrders' | 'paid' | 'discount' | 'createdAt';
32
32
  sortDirection?: 'asc' | 'desc';
33
33
  skip?: number;
34
34
  limit?: number;
@@ -1,4 +1,4 @@
1
- import { StartaRequestRunner } from '../../types';
1
+ import { OrgRewardType, StartaRequestRunner } from '../../types';
2
2
  import Customers from './customers';
3
3
  import Salaries from './salaries';
4
4
  import Orders from './orders';
@@ -27,7 +27,7 @@ import Memberships from './memberships';
27
27
  import WarehouseOperations from './warehouseOperations';
28
28
  import Settlements from './settlements';
29
29
  import Resources from './resources';
30
- export type TariffDetails = {
30
+ export declare type TariffDetails = {
31
31
  tariff: 'lite' | 'pro';
32
32
  period: 'monthly' | 'yearly' | 'ltl';
33
33
  successUrl?: string;
@@ -120,6 +120,7 @@ export default class Organizations {
120
120
  setMarketplaceCriteriaManualCheckValue(organizationLogin: string, criteria: string, { approved }: {
121
121
  approved: any;
122
122
  }): Promise<import("../../types").StartaResponse>;
123
+ receiveReward(organizationLogin: string, rewardType: OrgRewardType): Promise<import("../../types").StartaResponse>;
123
124
  get orders(): Orders;
124
125
  get customers(): Customers;
125
126
  get salaries(): Salaries;
@@ -258,6 +258,13 @@ class Organizations {
258
258
  body: { approved },
259
259
  });
260
260
  }
261
+ receiveReward(organizationLogin, rewardType) {
262
+ return this._requestRunner.performRequest({
263
+ url: `accounts/${organizationLogin}/rewards/${rewardType}/receive`,
264
+ method: 'PUT',
265
+ body: {},
266
+ });
267
+ }
261
268
  get orders() {
262
269
  return new orders_1.default(this._requestRunner);
263
270
  }
package/lib/types.d.ts CHANGED
@@ -4,18 +4,18 @@ export interface StartaRequestRunner {
4
4
  setAuthHeaderToken: (token: string) => void;
5
5
  replaceBaseUrl: (newBaseUrl: (baseURL: string) => string) => StartaRequestRunner;
6
6
  }
7
- export type DraftjsObject = {
7
+ export declare type DraftjsObject = {
8
8
  blocks: any;
9
9
  entityMap: any;
10
10
  };
11
- export type StartaRequestData = {
11
+ export declare type StartaRequestData = {
12
12
  url: string;
13
13
  method: Method;
14
14
  body?: any;
15
15
  urlParams?: any;
16
16
  config?: StartaRequestConfig;
17
17
  };
18
- export type StartaResponse = {
18
+ export declare type StartaResponse = {
19
19
  httpResponse?: AxiosResponse<any, any>;
20
20
  success: boolean;
21
21
  data: any;
@@ -24,7 +24,7 @@ export type StartaResponse = {
24
24
  export interface StartaRequestConfig extends AxiosRequestConfig {
25
25
  rewriteBaseUrl?: (baseUrl: string) => string;
26
26
  }
27
- export type StartaRequestMiddlewares = {
27
+ export declare type StartaRequestMiddlewares = {
28
28
  onForbidden?: (response: StartaResponse) => void;
29
29
  onUnauthorized?: (response: StartaResponse) => void;
30
30
  logger?: (...args: any[]) => void;
@@ -32,14 +32,14 @@ export type StartaRequestMiddlewares = {
32
32
  headers?: () => AxiosRequestHeaders;
33
33
  requestSlowMoDelayMS?: number;
34
34
  };
35
- export type Interval = {
35
+ export declare type Interval = {
36
36
  from: string;
37
37
  to: string;
38
38
  };
39
- export type DaySchedule = {
39
+ export declare type DaySchedule = {
40
40
  intervals: Array<Interval>;
41
41
  };
42
- export type WeeklySchedule = {
42
+ export declare type WeeklySchedule = {
43
43
  mon?: DaySchedule;
44
44
  tue?: DaySchedule;
45
45
  wed?: DaySchedule;
@@ -48,7 +48,7 @@ export type WeeklySchedule = {
48
48
  sat?: DaySchedule;
49
49
  sun?: DaySchedule;
50
50
  };
51
- export type Schedule = {
51
+ export declare type Schedule = {
52
52
  weekly?: WeeklySchedule;
53
53
  daily?: {
54
54
  workForDays: number;
@@ -57,8 +57,8 @@ export type Schedule = {
57
57
  daySchedule: DaySchedule;
58
58
  };
59
59
  };
60
- export type MeasurementUnit = 'ampoule' | 'can' | 'gram' | 'dose' | 'other' | 'capsule' | 'kilogram' | 'box' | 'liter' | 'meter' | 'microliter' | 'milligram' | 'milliliter' | 'millimeters' | 'set' | 'unit' | 'pair' | 'bottle' | 'portion' | 'procedure' | 'roll' | 'centimeter' | 'tube' | 'pack' | 'vial' | 'syringe' | 'piece';
61
- export type Product = {
60
+ export declare type MeasurementUnit = 'ampoule' | 'can' | 'gram' | 'dose' | 'other' | 'capsule' | 'kilogram' | 'box' | 'liter' | 'meter' | 'microliter' | 'milligram' | 'milliliter' | 'millimeters' | 'set' | 'unit' | 'pair' | 'bottle' | 'portion' | 'procedure' | 'roll' | 'centimeter' | 'tube' | 'pack' | 'vial' | 'syringe' | 'piece';
61
+ export declare type Product = {
62
62
  name: string;
63
63
  sku?: string;
64
64
  category?: {
@@ -94,7 +94,7 @@ export type Product = {
94
94
  'ru-ru'?: DraftjsObject;
95
95
  };
96
96
  };
97
- export type ProductOperation = {
97
+ export declare type ProductOperation = {
98
98
  organizationLogin: string;
99
99
  date: string;
100
100
  type: 'receiving' | 'writeOff';
@@ -111,7 +111,7 @@ export type ProductOperation = {
111
111
  }>;
112
112
  comment?: string;
113
113
  };
114
- export type OrganizationSchedule = {
114
+ export declare type OrganizationSchedule = {
115
115
  name?: string;
116
116
  location: {
117
117
  isOnline: boolean;
@@ -142,8 +142,8 @@ export type OrganizationSchedule = {
142
142
  enabled: boolean;
143
143
  }>;
144
144
  };
145
- export type OrderStatus = 'new' | 'inprogress' | 'canceled' | 'completed';
146
- export type OrderRepeatSettings = {
145
+ export declare type OrderStatus = 'new' | 'inprogress' | 'canceled' | 'completed';
146
+ export declare type OrderRepeatSettings = {
147
147
  enabled: boolean;
148
148
  interval: {
149
149
  every: number;
@@ -155,8 +155,8 @@ export type OrderRepeatSettings = {
155
155
  value?: Date | number;
156
156
  };
157
157
  };
158
- export type TechcardType = 'service' | 'product';
159
- export type TechcardSteps = Array<{
158
+ export declare type TechcardType = 'service' | 'product';
159
+ export declare type TechcardSteps = Array<{
160
160
  name: string;
161
161
  items?: Array<{
162
162
  type: 'product';
@@ -168,7 +168,7 @@ export type TechcardSteps = Array<{
168
168
  comment: string;
169
169
  }>;
170
170
  }>;
171
- export type OrderData = {
171
+ export declare type OrderData = {
172
172
  products: Array<OrderItem>;
173
173
  usedMaterials?: OrderUsedMaterials;
174
174
  scheduleId: string;
@@ -177,7 +177,7 @@ export type OrderData = {
177
177
  organizationComment?: string;
178
178
  customerId?: string;
179
179
  };
180
- export type OrderItem = {
180
+ export declare type OrderItem = {
181
181
  type: 'service' | 'product' | 'roomRent' | 'seminar';
182
182
  id: string;
183
183
  starttime: string;
@@ -190,7 +190,7 @@ export type OrderItem = {
190
190
  discountType?: 'relative' | 'absolute';
191
191
  discount?: number;
192
192
  };
193
- export type OrderUsedMaterials = Array<{
193
+ export declare type OrderUsedMaterials = Array<{
194
194
  serviceId: string;
195
195
  techcardId?: string;
196
196
  steps?: Array<{
@@ -206,15 +206,16 @@ export type OrderUsedMaterials = Array<{
206
206
  }>;
207
207
  }>;
208
208
  }>;
209
- export type CriteriaCondition = {
209
+ export declare type CriteriaCondition = {
210
210
  what: 'turnover' | 'profit' | 'quantity';
211
211
  forWhat: 'all' | 'services' | 'products';
212
212
  forWho: 'employee' | 'branches';
213
213
  moreThan: number;
214
214
  withDiscounts: boolean;
215
215
  };
216
- export type CriteriaData = {
216
+ export declare type CriteriaData = {
217
217
  name: string;
218
218
  period: 'day' | 'month';
219
219
  conditions: Array<CriteriaCondition>;
220
220
  };
221
+ export declare type OrgRewardType = 'ProfileInCatalog' | 'SystemUser' | 'StartOfFame' | 'HandsFree';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.7489",
3
+ "version": "1.37.7771",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",