starta.apiclient 1.112.12519 → 1.112.12549

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.
@@ -8,8 +8,8 @@ export default class Products {
8
8
  withTechcard?: boolean;
9
9
  warehouseId?: string;
10
10
  }): Promise<import("../../types").StartaResponse>;
11
- add(organizationLogin: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, }: Product): Promise<import("../../types").StartaResponse>;
12
- update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, }: Product): Promise<import("../../types").StartaResponse>;
11
+ 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
+ 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>;
13
13
  delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
14
14
  get(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
15
15
  }
@@ -11,7 +11,7 @@ class Products {
11
11
  method: 'GET',
12
12
  });
13
13
  }
14
- add(organizationLogin, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, }) {
14
+ add(organizationLogin, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }) {
15
15
  return this._requestRunner.performRequest({
16
16
  url: `accounts/${organizationLogin}/products`,
17
17
  method: 'POST',
@@ -34,10 +34,11 @@ class Products {
34
34
  publicName,
35
35
  image,
36
36
  description,
37
+ barcode,
37
38
  },
38
39
  });
39
40
  }
40
- update(organizationLogin, productId, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, }) {
41
+ update(organizationLogin, productId, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }) {
41
42
  return this._requestRunner.performRequest({
42
43
  url: `accounts/${organizationLogin}/products/${productId}`,
43
44
  method: 'PUT',
@@ -60,6 +61,7 @@ class Products {
60
61
  publicName,
61
62
  image,
62
63
  description,
64
+ barcode,
63
65
  },
64
66
  });
65
67
  }
package/lib/types.d.ts CHANGED
@@ -139,6 +139,7 @@ export type Product = {
139
139
  publicName?: LocalizedString;
140
140
  description?: LocalizedString;
141
141
  image?: string;
142
+ barcode?: string;
142
143
  };
143
144
  export type ProductOperation = {
144
145
  organizationLogin: string;
@@ -334,7 +335,7 @@ export interface PromoCodeInput {
334
335
  name: string;
335
336
  code: string;
336
337
  description?: string;
337
- discountType: 'percent' | 'fixedAmount';
338
+ discountType: 'relative' | 'absolute';
338
339
  discountValue: number;
339
340
  validFrom?: string;
340
341
  validTo?: string;
@@ -343,10 +344,12 @@ export interface PromoCodeInput {
343
344
  allowMultipleUseBySingleCustomer?: boolean;
344
345
  minOrderPrice?: number;
345
346
  maxDiscountAmount?: number;
346
- applyTo: {
347
- servicesEnabled: boolean;
347
+ servicesRules: {
348
+ type: PromoCodeRuleType;
348
349
  serviceIds?: string[];
349
- productsEnabled: boolean;
350
+ };
351
+ productsRules: {
352
+ type: PromoCodeRuleType;
350
353
  productIds?: string[];
351
354
  };
352
355
  }
@@ -408,6 +411,7 @@ export type PnlPlan = {
408
411
  export type CertificateWriteOffType = 'single' | 'multiple';
409
412
  export type CertificateExpirationType = 'noLimit' | 'fixedDate' | 'fixedFromSale';
410
413
  export type CertificateRuleType = 'allowAll' | 'forbidAll' | 'allowSelected';
414
+ export type PromoCodeRuleType = 'allowAll' | 'forbidAll' | 'allowSelected';
411
415
  export interface CertificateInput {
412
416
  name: string;
413
417
  writeOffType: CertificateWriteOffType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.112.12519",
3
+ "version": "1.112.12549",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",