starta.apiclient 1.112.12573 → 1.112.12575

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,12 +1,13 @@
1
- import { Product, StartaRequestRunner } from '../../types';
1
+ import { Product, ProductAvailability, StartaRequestRunner } from '../../types';
2
2
  export default class Products {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
- index(organizationLogin: string, { categoryId, searchQuery, withTechcard, warehouseId, }?: {
5
+ index(organizationLogin: string, { categoryId, searchQuery, withTechcard, warehouseIds, availability, }?: {
6
6
  categoryId?: string;
7
7
  searchQuery?: string;
8
8
  withTechcard?: boolean;
9
- warehouseId?: string;
9
+ warehouseIds?: string[];
10
+ availability?: ProductAvailability[];
10
11
  }): Promise<import("../../types").StartaResponse>;
11
12
  add(organizationLogin: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }: Product): Promise<import("../../types").StartaResponse>;
12
13
  update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }: Product): Promise<import("../../types").StartaResponse>;
@@ -5,9 +5,9 @@ class Products {
5
5
  constructor(requestRunner) {
6
6
  this._requestRunner = requestRunner;
7
7
  }
8
- index(organizationLogin, { categoryId, searchQuery, withTechcard, warehouseId, } = {}) {
8
+ index(organizationLogin, { categoryId, searchQuery, withTechcard, warehouseIds, availability, } = {}) {
9
9
  return this._requestRunner.performRequest({
10
- url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery, withTechcard, warehouseId })}`,
10
+ url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery, withTechcard, warehouseIds, availability })}`,
11
11
  method: 'GET',
12
12
  });
13
13
  }
package/lib/types.d.ts CHANGED
@@ -277,6 +277,7 @@ export type TechcardSteps = Array<{
277
277
  comment: string;
278
278
  }>;
279
279
  }>;
280
+ export type ProductAvailability = 'inStock' | 'outOfStock' | 'lowStock';
280
281
  export type OrderData = {
281
282
  products: Array<OrderItem>;
282
283
  usedMaterials?: OrderUsedMaterials;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.112.12573",
3
+ "version": "1.112.12575",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",