starta.apiclient 1.37.7409 → 1.37.7489

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.
@@ -1,4 +1,4 @@
1
- import { StartaRequestRunner, OrderStatus, OrderData, CreateOrderData } from '../../types';
1
+ import { StartaRequestRunner, OrderStatus, OrderData } from '../../types';
2
2
  export default class Orders {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
@@ -32,8 +32,8 @@ export default class Orders {
32
32
  resources?: Array<string>;
33
33
  }): Promise<import("../../types").StartaResponse>;
34
34
  get(organizationOrCustomerLogin: string, orderId: any): Promise<import("../../types").StartaResponse>;
35
- add(organizationLogin: string, { products, usedMaterials, customerId, scheduleId, status, repeatSettings, organizationComment, }: CreateOrderData): Promise<import("../../types").StartaResponse>;
36
- update(organizationLogin: string, orderId: string, { products, usedMaterials, scheduleId, status, repeatSettings, organizationComment, }: OrderData): Promise<import("../../types").StartaResponse>;
35
+ add(organizationLogin: string, { products, usedMaterials, customerId, scheduleId, status, repeatSettings, organizationComment, }: OrderData): Promise<import("../../types").StartaResponse>;
36
+ update(organizationLogin: string, orderId: string, { products, usedMaterials, scheduleId, status, repeatSettings, organizationComment, customerId, }: OrderData): Promise<import("../../types").StartaResponse>;
37
37
  delete(organizationLogin: string, orderId: string): Promise<import("../../types").StartaResponse>;
38
38
  setConfirmation(organizationOrCustomerLogin: string, orderId: string, { isConfirmed }: {
39
39
  isConfirmed: boolean;
@@ -61,7 +61,7 @@ class Orders {
61
61
  },
62
62
  });
63
63
  }
64
- update(organizationLogin, orderId, { products, usedMaterials, scheduleId, status, repeatSettings, organizationComment, }) {
64
+ update(organizationLogin, orderId, { products, usedMaterials, scheduleId, status, repeatSettings, organizationComment, customerId, }) {
65
65
  return this._requestRunner.performRequest({
66
66
  url: `accounts/${organizationLogin}/orders/${orderId}`,
67
67
  method: 'PUT',
@@ -72,6 +72,7 @@ class Orders {
72
72
  status,
73
73
  repeatSettings,
74
74
  organizationComment,
75
+ customerId,
75
76
  },
76
77
  });
77
78
  }
@@ -2,7 +2,7 @@ import { ProductOperation, StartaRequestRunner, TechcardSteps } from '../../type
2
2
  export default class ProductOperations {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
- index(organizationLogin: string, { searchQuery, filters, }?: {
5
+ index(organizationLogin: string, { searchQuery, filters, sortColumn, sortDirection, skip, limit, }?: {
6
6
  searchQuery?: string;
7
7
  filters?: {
8
8
  date?: {
@@ -13,6 +13,10 @@ export default class ProductOperations {
13
13
  warehouseId?: string;
14
14
  paymentStatus?: 'paid' | 'unpaid';
15
15
  };
16
+ sortColumn?: 'date' | 'incrementId' | 'employee' | 'contragent' | 'warehouse' | 'product' | 'quantity' | 'price';
17
+ sortDirection?: 'asc' | 'desc';
18
+ skip?: number;
19
+ limit?: number;
16
20
  }): Promise<import("../../types").StartaResponse>;
17
21
  add(organizationLogin: string, { date, type, supplier, warehouseId, products, comment }: ProductOperation): Promise<import("../../types").StartaResponse>;
18
22
  prepare(organizationLogin: string, { productId, quantityForSale, steps, warehouseId, executor, date, }: {
@@ -5,11 +5,15 @@ class ProductOperations {
5
5
  constructor(requestRunner) {
6
6
  this._requestRunner = requestRunner;
7
7
  }
8
- index(organizationLogin, { searchQuery, filters, } = {}) {
8
+ index(organizationLogin, { searchQuery, filters, sortColumn, sortDirection, skip, limit, } = {}) {
9
9
  return this._requestRunner.performRequest({
10
10
  url: `accounts/${organizationLogin}/productOperations${(0, _helpers_1.buildQuery)({
11
11
  searchQuery,
12
12
  filters,
13
+ sortColumn,
14
+ sortDirection,
15
+ skip,
16
+ limit,
13
17
  })}`,
14
18
  method: 'GET',
15
19
  });
package/lib/types.d.ts CHANGED
@@ -175,9 +175,7 @@ export type OrderData = {
175
175
  status?: OrderStatus;
176
176
  repeatSettings?: OrderRepeatSettings;
177
177
  organizationComment?: string;
178
- };
179
- export type CreateOrderData = OrderData & {
180
- customerId: string;
178
+ customerId?: string;
181
179
  };
182
180
  export type OrderItem = {
183
181
  type: 'service' | 'product' | 'roomRent' | 'seminar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.7409",
3
+ "version": "1.37.7489",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",