starta.apiclient 1.37.3500 → 1.37.3501
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.
|
@@ -13,6 +13,7 @@ import Schedules from './schedules';
|
|
|
13
13
|
import Worklogs from './worklogs';
|
|
14
14
|
import StartaTransactions from './startaTransactions';
|
|
15
15
|
import Warehouses from './warehouses';
|
|
16
|
+
import Products from './products';
|
|
16
17
|
import ProductCategories from './productCategories';
|
|
17
18
|
export declare type TariffDetails = {
|
|
18
19
|
tariff: 'lite' | 'pro';
|
|
@@ -90,7 +91,6 @@ export default class Organizations {
|
|
|
90
91
|
setEndOfTrial(organizationLogin: string, endOfTrialAt: string): Promise<import("../../types").StartaResponse>;
|
|
91
92
|
setForYearBonus(organizationLogin: string, bonusForYearUntil: string): Promise<import("../../types").StartaResponse>;
|
|
92
93
|
getBillingInfo(organizationLogin: string, month?: string): Promise<import("../../types").StartaResponse>;
|
|
93
|
-
getStripeClientSecret(organizationLogin: string): Promise<import("../../types").StartaResponse>;
|
|
94
94
|
setTariff(organizationLogin: string, { tariff, period, successUrl, cancelUrl }: TariffDetails): Promise<import("../../types").StartaResponse>;
|
|
95
95
|
get orders(): Orders;
|
|
96
96
|
get customers(): Customers;
|
|
@@ -105,6 +105,7 @@ export default class Organizations {
|
|
|
105
105
|
get schedules(): Schedules;
|
|
106
106
|
get worklogs(): Worklogs;
|
|
107
107
|
get warehouses(): Warehouses;
|
|
108
|
+
get products(): Products;
|
|
108
109
|
get productCategories(): ProductCategories;
|
|
109
110
|
get startaTransactions(): StartaTransactions;
|
|
110
111
|
}
|
|
@@ -14,6 +14,7 @@ const schedules_1 = require("./schedules");
|
|
|
14
14
|
const worklogs_1 = require("./worklogs");
|
|
15
15
|
const startaTransactions_1 = require("./startaTransactions");
|
|
16
16
|
const warehouses_1 = require("./warehouses");
|
|
17
|
+
const products_1 = require("./products");
|
|
17
18
|
const productCategories_1 = require("./productCategories");
|
|
18
19
|
const _helpers_1 = require("../_helpers");
|
|
19
20
|
class Organizations {
|
|
@@ -197,12 +198,6 @@ class Organizations {
|
|
|
197
198
|
method: 'GET',
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
|
-
getStripeClientSecret(organizationLogin) {
|
|
201
|
-
return this._requestRunner.performRequest({
|
|
202
|
-
url: `accounts/${organizationLogin}/stripeClientSecret`,
|
|
203
|
-
method: 'GET',
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
201
|
setTariff(organizationLogin, { tariff, period, successUrl, cancelUrl }) {
|
|
207
202
|
return this._requestRunner.performRequest({
|
|
208
203
|
url: `accounts/${organizationLogin}/tariff`,
|
|
@@ -249,6 +244,9 @@ class Organizations {
|
|
|
249
244
|
get warehouses() {
|
|
250
245
|
return new warehouses_1.default(this._requestRunner);
|
|
251
246
|
}
|
|
247
|
+
get products() {
|
|
248
|
+
return new products_1.default(this._requestRunner);
|
|
249
|
+
}
|
|
252
250
|
get productCategories() {
|
|
253
251
|
return new productCategories_1.default(this._requestRunner);
|
|
254
252
|
}
|
|
@@ -3,7 +3,7 @@ export default class Products {
|
|
|
3
3
|
private _requestRunner;
|
|
4
4
|
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
index(organizationLogin: string, categoryId: string): Promise<import("../../types").StartaResponse>;
|
|
6
|
-
add(organizationLogin: string, { name, category, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
|
|
7
|
-
update(organizationLogin: string, productId: string, { name, category, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
|
|
6
|
+
add(organizationLogin: string, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
|
|
7
|
+
update(organizationLogin: string, productId: string, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }: Product): Promise<import("../../types").StartaResponse>;
|
|
8
8
|
delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
9
9
|
}
|
|
@@ -11,13 +11,14 @@ class Products {
|
|
|
11
11
|
method: 'GET',
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
add(organizationLogin, { name, category, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
|
|
14
|
+
add(organizationLogin, { name, 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
20
|
category,
|
|
21
|
+
categoryId,
|
|
21
22
|
forSale,
|
|
22
23
|
equals,
|
|
23
24
|
forDisposal,
|
|
@@ -30,13 +31,14 @@ class Products {
|
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
update(organizationLogin, productId, { name, category, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
|
|
34
|
+
update(organizationLogin, productId, { name, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
|
|
34
35
|
return this._requestRunner.performRequest({
|
|
35
36
|
url: `accounts/${organizationLogin}/products/${productId}`,
|
|
36
37
|
method: 'PUT',
|
|
37
38
|
body: {
|
|
38
39
|
name,
|
|
39
40
|
category,
|
|
41
|
+
categoryId,
|
|
40
42
|
forSale,
|
|
41
43
|
equals,
|
|
42
44
|
forDisposal,
|
package/lib/types.d.ts
CHANGED
|
@@ -57,10 +57,15 @@ export declare type Schedule = {
|
|
|
57
57
|
daySchedule: DaySchedule;
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
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';
|
|
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
|
-
category
|
|
63
|
+
category?: {
|
|
64
|
+
name: string;
|
|
65
|
+
parentId?: string;
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
categoryId?: string;
|
|
64
69
|
forSale: MeasurementUnit;
|
|
65
70
|
equals: number;
|
|
66
71
|
forDisposal: MeasurementUnit;
|
|
@@ -115,4 +120,3 @@ export declare type OrderRepeatSettings = {
|
|
|
115
120
|
value?: Date | Number;
|
|
116
121
|
};
|
|
117
122
|
};
|
|
118
|
-
export {};
|