starta.apiclient 1.112.12588 → 1.112.12590
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/organizations/orders.d.ts +0 -1
- package/lib/services/organizations/orders.js +0 -9
- package/lib/services/organizations/products.d.ts +5 -6
- package/lib/services/organizations/products.js +4 -6
- package/lib/services/organizations/public.d.ts +2 -5
- package/lib/services/organizations/public.js +2 -2
- package/lib/services/organizations/warehouses.d.ts +0 -1
- package/lib/services/organizations/warehouses.js +0 -8
- package/lib/types.d.ts +0 -2
- package/package.json +1 -1
|
@@ -46,5 +46,4 @@ export default class Orders {
|
|
|
46
46
|
setConfirmation(organizationOrCustomerLogin: string, orderId: string, { isConfirmed }: {
|
|
47
47
|
isConfirmed: boolean;
|
|
48
48
|
}): Promise<import("../../types").StartaResponse>;
|
|
49
|
-
addPromocode(organizationLogin: string, orderId: string, promocode: string): Promise<import("../../types").StartaResponse>;
|
|
50
49
|
}
|
|
@@ -117,14 +117,5 @@ class Orders {
|
|
|
117
117
|
},
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
addPromocode(organizationLogin, orderId, promocode) {
|
|
121
|
-
return this._requestRunner.performRequest({
|
|
122
|
-
url: `accounts/${organizationLogin}/orders/${orderId}/promocodes`,
|
|
123
|
-
method: 'POST',
|
|
124
|
-
body: {
|
|
125
|
-
promocode,
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
120
|
}
|
|
130
121
|
exports.default = Orders;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Product,
|
|
1
|
+
import { Product, 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,
|
|
5
|
+
index(organizationLogin: string, { categoryId, searchQuery, withTechcard, warehouseId, }?: {
|
|
6
6
|
categoryId?: string;
|
|
7
7
|
searchQuery?: string;
|
|
8
8
|
withTechcard?: boolean;
|
|
9
|
-
|
|
10
|
-
availability?: ProductAvailability[];
|
|
9
|
+
warehouseId?: string;
|
|
11
10
|
}): Promise<import("../../types").StartaResponse>;
|
|
12
|
-
add(organizationLogin: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description,
|
|
13
|
-
update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description,
|
|
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>;
|
|
14
13
|
delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
15
14
|
get(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
16
15
|
}
|
|
@@ -5,13 +5,13 @@ class Products {
|
|
|
5
5
|
constructor(requestRunner) {
|
|
6
6
|
this._requestRunner = requestRunner;
|
|
7
7
|
}
|
|
8
|
-
index(organizationLogin, { categoryId, searchQuery, withTechcard,
|
|
8
|
+
index(organizationLogin, { categoryId, searchQuery, withTechcard, warehouseId, } = {}) {
|
|
9
9
|
return this._requestRunner.performRequest({
|
|
10
|
-
url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery, withTechcard,
|
|
10
|
+
url: `accounts/${organizationLogin}/products${(0, _helpers_1.buildQuery)({ categoryId, searchQuery, withTechcard, warehouseId })}`,
|
|
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, }) {
|
|
15
15
|
return this._requestRunner.performRequest({
|
|
16
16
|
url: `accounts/${organizationLogin}/products`,
|
|
17
17
|
method: 'POST',
|
|
@@ -34,11 +34,10 @@ class Products {
|
|
|
34
34
|
publicName,
|
|
35
35
|
image,
|
|
36
36
|
description,
|
|
37
|
-
barcode,
|
|
38
37
|
},
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
|
-
update(organizationLogin, productId, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description,
|
|
40
|
+
update(organizationLogin, productId, { name, sku, category, categoryId, forSale, equals, forDisposal, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, }) {
|
|
42
41
|
return this._requestRunner.performRequest({
|
|
43
42
|
url: `accounts/${organizationLogin}/products/${productId}`,
|
|
44
43
|
method: 'PUT',
|
|
@@ -61,7 +60,6 @@ class Products {
|
|
|
61
60
|
publicName,
|
|
62
61
|
image,
|
|
63
62
|
description,
|
|
64
|
-
barcode,
|
|
65
63
|
},
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -30,7 +30,7 @@ export default class Public {
|
|
|
30
30
|
}): Promise<import("../../types").StartaResponse>;
|
|
31
31
|
addPromocode(organizationLogin: string, promocode: string): Promise<import("../../types").StartaResponse>;
|
|
32
32
|
payForOrder(organizationLogin: string, orderId: string, certificateId: string): Promise<import("../../types").StartaResponse>;
|
|
33
|
-
createOrder(organizationLogin: any, { products, starttime, scheduleId, customerInfo, customerComment,
|
|
33
|
+
createOrder(organizationLogin: any, { products, starttime, scheduleId, customerInfo, customerComment, promocodes, comment, }: {
|
|
34
34
|
products: Array<{
|
|
35
35
|
type: 'service' | 'product';
|
|
36
36
|
id: string;
|
|
@@ -47,10 +47,7 @@ export default class Public {
|
|
|
47
47
|
phoneConfirmationCode: string;
|
|
48
48
|
};
|
|
49
49
|
customerComment?: string;
|
|
50
|
-
|
|
51
|
-
code: string;
|
|
52
|
-
type: 'certificate' | 'promocode';
|
|
53
|
-
}>;
|
|
50
|
+
promocodes?: string[];
|
|
54
51
|
comment?: string;
|
|
55
52
|
}, referer?: string | null): Promise<import("../../types").StartaResponse>;
|
|
56
53
|
getOrder(organizationOrUserLogin: string, orderId: string): Promise<import("../../types").StartaResponse>;
|
|
@@ -62,7 +62,7 @@ class Public {
|
|
|
62
62
|
body: { certificateId },
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
createOrder(organizationLogin, { products, starttime, scheduleId, customerInfo, customerComment,
|
|
65
|
+
createOrder(organizationLogin, { products, starttime, scheduleId, customerInfo, customerComment, promocodes, comment, }, referer = null) {
|
|
66
66
|
return this._requestRunner.performRequest({
|
|
67
67
|
url: `accounts/${organizationLogin}/public/orders`,
|
|
68
68
|
method: 'POST',
|
|
@@ -72,7 +72,7 @@ class Public {
|
|
|
72
72
|
scheduleId,
|
|
73
73
|
customerInfo,
|
|
74
74
|
customerComment,
|
|
75
|
-
|
|
75
|
+
promocodes,
|
|
76
76
|
comment,
|
|
77
77
|
},
|
|
78
78
|
config: referer
|
|
@@ -13,5 +13,4 @@ export default class Warehouses {
|
|
|
13
13
|
type: 'forServices' | 'forSales';
|
|
14
14
|
}): Promise<import("../../types").StartaResponse>;
|
|
15
15
|
delete(organizationLogin: string, warehouseId: string): Promise<import("../../types").StartaResponse>;
|
|
16
|
-
getPriceOfGoods(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
|
|
17
16
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _helpers_1 = require("../_helpers");
|
|
4
3
|
class Warehouses {
|
|
5
4
|
constructor(requestRunner) {
|
|
6
5
|
this._requestRunner = requestRunner;
|
|
@@ -33,12 +32,5 @@ class Warehouses {
|
|
|
33
32
|
method: 'DELETE',
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
|
-
getPriceOfGoods(organizationLogin, branchId) {
|
|
37
|
-
const queryParams = branchId ? { branchId } : {};
|
|
38
|
-
return this._requestRunner.performRequest({
|
|
39
|
-
url: `accounts/${organizationLogin}/warehouses/price-of-goods${(0, _helpers_1.buildQuery)(queryParams)}`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
35
|
}
|
|
44
36
|
exports.default = Warehouses;
|
package/lib/types.d.ts
CHANGED
|
@@ -139,7 +139,6 @@ export type Product = {
|
|
|
139
139
|
publicName?: LocalizedString;
|
|
140
140
|
description?: LocalizedString;
|
|
141
141
|
image?: string;
|
|
142
|
-
barcode?: string;
|
|
143
142
|
};
|
|
144
143
|
export type ProductOperation = {
|
|
145
144
|
organizationLogin: string;
|
|
@@ -277,7 +276,6 @@ export type TechcardSteps = Array<{
|
|
|
277
276
|
comment: string;
|
|
278
277
|
}>;
|
|
279
278
|
}>;
|
|
280
|
-
export type ProductAvailability = 'inStock' | 'outOfStock' | 'lowStock';
|
|
281
279
|
export type OrderData = {
|
|
282
280
|
products: Array<OrderItem>;
|
|
283
281
|
usedMaterials?: OrderUsedMaterials;
|