starta.apiclient 1.37.3548 → 1.37.3553

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.
@@ -6,7 +6,7 @@ export default class Products {
6
6
  categoryId?: string;
7
7
  searchQuery?: string;
8
8
  }): Promise<import("../../types").StartaResponse>;
9
- add(organizationLogin: string, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
10
- update(organizationLogin: string, productId: string, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
9
+ add(organizationLogin: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
10
+ update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
11
11
  delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
12
12
  }
@@ -7,16 +7,17 @@ class Products {
7
7
  }
8
8
  index(organizationLogin, { categoryId, searchQuery, } = {}) {
9
9
  return this._requestRunner.performRequest({
10
- url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery, })}`,
10
+ url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery })}`,
11
11
  method: 'GET',
12
12
  });
13
13
  }
14
- add(organizationLogin, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
14
+ add(organizationLogin, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
15
15
  return this._requestRunner.performRequest({
16
16
  url: `accounts/${organizationLogin}/products`,
17
17
  method: 'POST',
18
18
  body: {
19
19
  name,
20
+ sku,
20
21
  category,
21
22
  categoryId,
22
23
  forSale,
@@ -31,12 +32,13 @@ class Products {
31
32
  },
32
33
  });
33
34
  }
34
- update(organizationLogin, productId, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
35
+ update(organizationLogin, productId, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
35
36
  return this._requestRunner.performRequest({
36
37
  url: `accounts/${organizationLogin}/products/${productId}`,
37
38
  method: 'PUT',
38
39
  body: {
39
40
  name,
41
+ sku,
40
42
  category,
41
43
  categoryId,
42
44
  forSale,
package/lib/types.d.ts CHANGED
@@ -60,6 +60,7 @@ export declare type Schedule = {
60
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
61
  export declare type Product = {
62
62
  name: string;
63
+ sku?: string;
63
64
  category?: {
64
65
  name: string;
65
66
  parentId?: string;
@@ -84,6 +85,7 @@ export declare type ProductOperation = {
84
85
  warehouseId: string;
85
86
  products: Array<{
86
87
  id: string;
88
+ name: string;
87
89
  supplyPrice: number;
88
90
  quantity: number;
89
91
  discount?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.3548",
3
+ "version": "1.37.3553",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",