starta.apiclient 1.37.3501 → 1.37.3510
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.
- package/lib/services/accounts.d.ts +1 -0
- package/lib/services/accounts.js +7 -0
- package/lib/services/organizations/index.d.ts +0 -2
- package/lib/services/organizations/index.js +0 -4
- package/lib/services/organizations/products.d.ts +2 -2
- package/lib/services/organizations/products.js +2 -4
- package/lib/types.d.ts +3 -7
- package/package.json +1 -1
|
@@ -91,6 +91,7 @@ export default class Accounts {
|
|
|
91
91
|
getAllKeys(): Promise<import("../types").StartaResponse>;
|
|
92
92
|
getAddressSuggestions(login: string, term: string, language?: string): Promise<import("../types").StartaResponse>;
|
|
93
93
|
setStatus(login: string, status: 'client' | 'potentialOrganization' | 'hasOrganization' | 'onboarding' | 'trial' | 'license'): Promise<import("../types").StartaResponse>;
|
|
94
|
+
setBillingModel(organizationLogin: string, billingModel: 'regular' | 'endlessTrial' | 'blogger' | 'promo1usd'): Promise<import("../types").StartaResponse>;
|
|
94
95
|
orders(login: string, { organizationLogin, from, to, status, products, sortColumn, sortDirection, statusOperator }: {
|
|
95
96
|
organizationLogin?: any;
|
|
96
97
|
from?: string;
|
package/lib/services/accounts.js
CHANGED
|
@@ -221,6 +221,13 @@ class Accounts {
|
|
|
221
221
|
body: { status },
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
+
setBillingModel(organizationLogin, billingModel) {
|
|
225
|
+
return this._requestRunner.performRequest({
|
|
226
|
+
url: `accounts/${organizationLogin}/billingModel`,
|
|
227
|
+
method: 'PUT',
|
|
228
|
+
body: { billingModel },
|
|
229
|
+
});
|
|
230
|
+
}
|
|
224
231
|
orders(login, { organizationLogin, from, to, status, products, sortColumn, sortDirection, statusOperator }) {
|
|
225
232
|
return this._requestRunner.performRequest({
|
|
226
233
|
url: `accounts/${login}/orders${(0, _helpers_1.buildQuery)({
|
|
@@ -13,7 +13,6 @@ 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';
|
|
17
16
|
import ProductCategories from './productCategories';
|
|
18
17
|
export declare type TariffDetails = {
|
|
19
18
|
tariff: 'lite' | 'pro';
|
|
@@ -105,7 +104,6 @@ export default class Organizations {
|
|
|
105
104
|
get schedules(): Schedules;
|
|
106
105
|
get worklogs(): Worklogs;
|
|
107
106
|
get warehouses(): Warehouses;
|
|
108
|
-
get products(): Products;
|
|
109
107
|
get productCategories(): ProductCategories;
|
|
110
108
|
get startaTransactions(): StartaTransactions;
|
|
111
109
|
}
|
|
@@ -14,7 +14,6 @@ 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");
|
|
18
17
|
const productCategories_1 = require("./productCategories");
|
|
19
18
|
const _helpers_1 = require("../_helpers");
|
|
20
19
|
class Organizations {
|
|
@@ -244,9 +243,6 @@ class Organizations {
|
|
|
244
243
|
get warehouses() {
|
|
245
244
|
return new warehouses_1.default(this._requestRunner);
|
|
246
245
|
}
|
|
247
|
-
get products() {
|
|
248
|
-
return new products_1.default(this._requestRunner);
|
|
249
|
-
}
|
|
250
246
|
get productCategories() {
|
|
251
247
|
return new productCategories_1.default(this._requestRunner);
|
|
252
248
|
}
|
|
@@ -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,
|
|
7
|
-
update(organizationLogin: string, productId: string, { name, category,
|
|
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>;
|
|
8
8
|
delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
9
9
|
}
|
|
@@ -11,14 +11,13 @@ class Products {
|
|
|
11
11
|
method: 'GET',
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
add(organizationLogin, { name, category,
|
|
14
|
+
add(organizationLogin, { name, category, 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,
|
|
22
21
|
forSale,
|
|
23
22
|
equals,
|
|
24
23
|
forDisposal,
|
|
@@ -31,14 +30,13 @@ class Products {
|
|
|
31
30
|
},
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
|
-
update(organizationLogin, productId, { name, category,
|
|
33
|
+
update(organizationLogin, productId, { name, category, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, }) {
|
|
35
34
|
return this._requestRunner.performRequest({
|
|
36
35
|
url: `accounts/${organizationLogin}/products/${productId}`,
|
|
37
36
|
method: 'PUT',
|
|
38
37
|
body: {
|
|
39
38
|
name,
|
|
40
39
|
category,
|
|
41
|
-
categoryId,
|
|
42
40
|
forSale,
|
|
43
41
|
equals,
|
|
44
42
|
forDisposal,
|
package/lib/types.d.ts
CHANGED
|
@@ -57,15 +57,10 @@ export declare type Schedule = {
|
|
|
57
57
|
daySchedule: DaySchedule;
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
|
|
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';
|
|
61
61
|
export declare type Product = {
|
|
62
62
|
name: string;
|
|
63
|
-
category
|
|
64
|
-
name: string;
|
|
65
|
-
parentId?: string;
|
|
66
|
-
id: string;
|
|
67
|
-
};
|
|
68
|
-
categoryId?: string;
|
|
63
|
+
category: string;
|
|
69
64
|
forSale: MeasurementUnit;
|
|
70
65
|
equals: number;
|
|
71
66
|
forDisposal: MeasurementUnit;
|
|
@@ -120,3 +115,4 @@ export declare type OrderRepeatSettings = {
|
|
|
120
115
|
value?: Date | Number;
|
|
121
116
|
};
|
|
122
117
|
};
|
|
118
|
+
export {};
|