starta.apiclient 1.112.12655 → 1.112.12683
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 +4 -0
- package/lib/services/organizations/orders.js +7 -0
- package/lib/services/organizations/productOperations.d.ts +4 -4
- package/lib/services/organizations/products.d.ts +2 -2
- package/lib/services/organizations/products.js +4 -6
- package/lib/services/organizations/techcards.d.ts +2 -2
- package/lib/services/organizations/techcards.js +4 -30
- package/lib/types.d.ts +31 -15
- package/package.json +1 -1
|
@@ -47,4 +47,8 @@ export default class Orders {
|
|
|
47
47
|
isConfirmed: boolean;
|
|
48
48
|
}): Promise<import("../../types").StartaResponse>;
|
|
49
49
|
addPromocode(organizationLogin: string, orderId: string, promocode: string): Promise<import("../../types").StartaResponse>;
|
|
50
|
+
replyFeedback(organizationLogin: any, orderId: any, { text, fileIds }: {
|
|
51
|
+
text: string;
|
|
52
|
+
fileIds: Array<string>;
|
|
53
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
50
54
|
}
|
|
@@ -126,5 +126,12 @@ class Orders {
|
|
|
126
126
|
},
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
+
replyFeedback(organizationLogin, orderId, { text, fileIds }) {
|
|
130
|
+
return this._requestRunner.performRequest({
|
|
131
|
+
url: `accounts/${organizationLogin}/orders/${orderId}/feedback/reply`,
|
|
132
|
+
method: 'PUT',
|
|
133
|
+
body: { text, fileIds },
|
|
134
|
+
});
|
|
135
|
+
}
|
|
129
136
|
}
|
|
130
137
|
exports.default = Orders;
|
|
@@ -9,10 +9,10 @@ export default class ProductOperations {
|
|
|
9
9
|
from?: string;
|
|
10
10
|
to?: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
operationTypes?: Array<'writeOff' | 'receiving' | 'sell' | 'reconciliation'>;
|
|
13
|
+
warehouseIds?: Array<string>;
|
|
14
|
+
paymentStatuses?: Array<'paid' | 'partially_paid' | 'unpaid'>;
|
|
15
|
+
statuses?: Array<'planned' | 'finished' | 'cancelled'>;
|
|
16
16
|
};
|
|
17
17
|
sortColumn?: 'date' | 'incrementId' | 'employee' | 'contragent' | 'warehouse' | 'product' | 'quantity' | 'price';
|
|
18
18
|
sortDirection?: 'asc' | 'desc';
|
|
@@ -9,8 +9,8 @@ export default class Products {
|
|
|
9
9
|
warehouseIds?: string[];
|
|
10
10
|
availability?: ProductAvailability[];
|
|
11
11
|
}): Promise<import("../../types").StartaResponse>;
|
|
12
|
-
add(organizationLogin: string, { name, sku, category, categoryId, forSale,
|
|
13
|
-
update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale,
|
|
12
|
+
add(organizationLogin: string, { name, sku, category, categoryId, forSale, conversions, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }: Product): Promise<import("../../types").StartaResponse>;
|
|
13
|
+
update(organizationLogin: string, productId: string, { name, sku, category, categoryId, forSale, conversions, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }: Product): Promise<import("../../types").StartaResponse>;
|
|
14
14
|
delete(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
15
15
|
get(organizationLogin: string, productId: string): Promise<import("../../types").StartaResponse>;
|
|
16
16
|
}
|
|
@@ -11,7 +11,7 @@ class Products {
|
|
|
11
11
|
method: 'GET',
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
add(organizationLogin, { name, sku, category, categoryId, forSale,
|
|
14
|
+
add(organizationLogin, { name, sku, category, categoryId, forSale, conversions, 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',
|
|
@@ -21,8 +21,7 @@ class Products {
|
|
|
21
21
|
category,
|
|
22
22
|
categoryId,
|
|
23
23
|
forSale,
|
|
24
|
-
|
|
25
|
-
forDisposal,
|
|
24
|
+
conversions,
|
|
26
25
|
netWeight,
|
|
27
26
|
grossWeight,
|
|
28
27
|
sellPrice,
|
|
@@ -38,7 +37,7 @@ class Products {
|
|
|
38
37
|
},
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
|
-
update(organizationLogin, productId, { name, sku, category, categoryId, forSale,
|
|
40
|
+
update(organizationLogin, productId, { name, sku, category, categoryId, forSale, conversions, netWeight, grossWeight, sellPrice, costPrice, criticalStock, desiredStock, allowSell, allowPublicBooking, publicName, image, description, barcode, }) {
|
|
42
41
|
return this._requestRunner.performRequest({
|
|
43
42
|
url: `accounts/${organizationLogin}/products/${productId}`,
|
|
44
43
|
method: 'PUT',
|
|
@@ -48,8 +47,7 @@ class Products {
|
|
|
48
47
|
category,
|
|
49
48
|
categoryId,
|
|
50
49
|
forSale,
|
|
51
|
-
|
|
52
|
-
forDisposal,
|
|
50
|
+
conversions,
|
|
53
51
|
netWeight,
|
|
54
52
|
grossWeight,
|
|
55
53
|
sellPrice,
|
|
@@ -2,7 +2,7 @@ import { StartaRequestRunner, Techcard, TechcardType } from '../../types';
|
|
|
2
2
|
export default class Techcards {
|
|
3
3
|
private _requestRunner;
|
|
4
4
|
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
-
add(organizationLogin: string,
|
|
5
|
+
add(organizationLogin: string, techcard: Techcard): Promise<import("../../types").StartaResponse>;
|
|
6
6
|
index(organizationLogin: string, { customerId, serviceId, executor, isEnabled, type, }?: {
|
|
7
7
|
customerId?: string;
|
|
8
8
|
serviceId?: string;
|
|
@@ -10,6 +10,6 @@ export default class Techcards {
|
|
|
10
10
|
isEnabled?: boolean;
|
|
11
11
|
type?: TechcardType;
|
|
12
12
|
}): Promise<import("../../types").StartaResponse>;
|
|
13
|
-
update(organizationLogin: string, techcardId: string,
|
|
13
|
+
update(organizationLogin: string, techcardId: string, techcard: Techcard): Promise<import("../../types").StartaResponse>;
|
|
14
14
|
delete(organizationLogin: string, techcardId: string): Promise<import("../../types").StartaResponse>;
|
|
15
15
|
}
|
|
@@ -5,24 +5,11 @@ class Techcards {
|
|
|
5
5
|
constructor(requestRunner) {
|
|
6
6
|
this._requestRunner = requestRunner;
|
|
7
7
|
}
|
|
8
|
-
add(organizationLogin,
|
|
8
|
+
add(organizationLogin, techcard) {
|
|
9
9
|
return this._requestRunner.performRequest({
|
|
10
10
|
url: `accounts/${organizationLogin}/techcards`,
|
|
11
11
|
method: 'POST',
|
|
12
|
-
body: {
|
|
13
|
-
name,
|
|
14
|
-
isEnabled,
|
|
15
|
-
type,
|
|
16
|
-
products,
|
|
17
|
-
autoAttach,
|
|
18
|
-
serviceIds,
|
|
19
|
-
customerIds,
|
|
20
|
-
executors,
|
|
21
|
-
steps,
|
|
22
|
-
numberToPrepare,
|
|
23
|
-
customDuration,
|
|
24
|
-
customPrice,
|
|
25
|
-
},
|
|
12
|
+
body: Object.assign({}, techcard),
|
|
26
13
|
});
|
|
27
14
|
}
|
|
28
15
|
index(organizationLogin, { customerId, serviceId, executor, isEnabled, type, } = {}) {
|
|
@@ -31,24 +18,11 @@ class Techcards {
|
|
|
31
18
|
method: 'GET',
|
|
32
19
|
});
|
|
33
20
|
}
|
|
34
|
-
update(organizationLogin, techcardId,
|
|
21
|
+
update(organizationLogin, techcardId, techcard) {
|
|
35
22
|
return this._requestRunner.performRequest({
|
|
36
23
|
url: `accounts/${organizationLogin}/techcards/${techcardId}`,
|
|
37
24
|
method: 'PUT',
|
|
38
|
-
body: {
|
|
39
|
-
name,
|
|
40
|
-
isEnabled,
|
|
41
|
-
type,
|
|
42
|
-
products,
|
|
43
|
-
autoAttach,
|
|
44
|
-
serviceIds,
|
|
45
|
-
customerIds,
|
|
46
|
-
executors,
|
|
47
|
-
steps,
|
|
48
|
-
numberToPrepare,
|
|
49
|
-
customDuration,
|
|
50
|
-
customPrice,
|
|
51
|
-
},
|
|
25
|
+
body: Object.assign({}, techcard),
|
|
52
26
|
});
|
|
53
27
|
}
|
|
54
28
|
delete(organizationLogin, techcardId) {
|
package/lib/types.d.ts
CHANGED
|
@@ -126,8 +126,10 @@ export type Product = {
|
|
|
126
126
|
};
|
|
127
127
|
categoryId?: string;
|
|
128
128
|
forSale: MeasurementUnit;
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
conversions?: Array<{
|
|
130
|
+
equals: number;
|
|
131
|
+
forDisposal: MeasurementUnit;
|
|
132
|
+
}>;
|
|
131
133
|
netWeight?: number;
|
|
132
134
|
grossWeight?: number;
|
|
133
135
|
sellPrice: number;
|
|
@@ -250,20 +252,28 @@ export type ServiceExecutor = {
|
|
|
250
252
|
export type Techcard = {
|
|
251
253
|
name: string;
|
|
252
254
|
isEnabled: boolean;
|
|
253
|
-
type: TechcardType;
|
|
254
|
-
products?: Array<{
|
|
255
|
-
id: any;
|
|
256
|
-
quantityForSale: any;
|
|
257
|
-
}>;
|
|
258
|
-
autoAttach?: boolean;
|
|
259
|
-
serviceIds?: Array<string>;
|
|
260
|
-
customerIds?: Array<string>;
|
|
261
|
-
executors?: Array<string>;
|
|
262
255
|
steps?: TechcardSteps;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
256
|
+
files?: Array<{
|
|
257
|
+
id: string;
|
|
258
|
+
}>;
|
|
259
|
+
} & ({
|
|
260
|
+
type: 'service';
|
|
261
|
+
serviceData: {
|
|
262
|
+
autoAttach?: boolean;
|
|
263
|
+
serviceIds?: Array<string>;
|
|
264
|
+
customerIds?: Array<string>;
|
|
265
|
+
executors?: Array<string>;
|
|
266
|
+
customPrice?: number;
|
|
267
|
+
customDuration?: number;
|
|
268
|
+
};
|
|
269
|
+
} | {
|
|
270
|
+
type: 'product';
|
|
271
|
+
productData: {
|
|
272
|
+
productToPrepareId?: string;
|
|
273
|
+
calculationMethod: 'fixedAmount' | 'proportional';
|
|
274
|
+
numberToPrepare?: number;
|
|
275
|
+
};
|
|
276
|
+
});
|
|
267
277
|
export type TechcardType = 'service' | 'product';
|
|
268
278
|
export type TechcardSteps = Array<{
|
|
269
279
|
name: string;
|
|
@@ -272,10 +282,16 @@ export type TechcardSteps = Array<{
|
|
|
272
282
|
warehouseId: string;
|
|
273
283
|
productId: string;
|
|
274
284
|
amount: number;
|
|
285
|
+
unit: MeasurementUnit;
|
|
275
286
|
} | {
|
|
276
287
|
type: 'comment';
|
|
277
288
|
comment: string;
|
|
278
289
|
}>;
|
|
290
|
+
files?: [
|
|
291
|
+
{
|
|
292
|
+
id: string;
|
|
293
|
+
}
|
|
294
|
+
];
|
|
279
295
|
}>;
|
|
280
296
|
export type ProductAvailability = 'inStock' | 'outOfStock' | 'lowStock';
|
|
281
297
|
export type OrderData = {
|