starta.apiclient 1.112.12635 → 1.112.12655
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/productOperations.d.ts +4 -4
- package/lib/services/organizations/products.d.ts +2 -2
- package/lib/services/organizations/products.js +6 -4
- package/lib/services/organizations/techcards.d.ts +2 -2
- package/lib/services/organizations/techcards.js +30 -4
- package/lib/services/system.d.ts +2 -1
- package/lib/services/system.js +2 -1
- package/lib/types.d.ts +15 -25
- package/package.json +1 -1
|
@@ -9,10 +9,10 @@ export default class ProductOperations {
|
|
|
9
9
|
from?: string;
|
|
10
10
|
to?: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
operationType?: 'writeOff' | 'receiving' | 'sell' | 'reconciliation';
|
|
13
|
+
warehouseId?: string;
|
|
14
|
+
paymentStatus?: 'paid' | 'unpaid';
|
|
15
|
+
status?: '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, equals, forDisposal, 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, equals, forDisposal, 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, 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',
|
|
@@ -21,7 +21,8 @@ class Products {
|
|
|
21
21
|
category,
|
|
22
22
|
categoryId,
|
|
23
23
|
forSale,
|
|
24
|
-
|
|
24
|
+
equals,
|
|
25
|
+
forDisposal,
|
|
25
26
|
netWeight,
|
|
26
27
|
grossWeight,
|
|
27
28
|
sellPrice,
|
|
@@ -37,7 +38,7 @@ class Products {
|
|
|
37
38
|
},
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
update(organizationLogin, productId, { name, sku, category, categoryId, forSale,
|
|
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',
|
|
@@ -47,7 +48,8 @@ class Products {
|
|
|
47
48
|
category,
|
|
48
49
|
categoryId,
|
|
49
50
|
forSale,
|
|
50
|
-
|
|
51
|
+
equals,
|
|
52
|
+
forDisposal,
|
|
51
53
|
netWeight,
|
|
52
54
|
grossWeight,
|
|
53
55
|
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, { name, isEnabled, type, products, autoAttach, serviceIds, customerIds, executors, steps, numberToPrepare, customDuration, customPrice, }: 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, { name, isEnabled, type, products, autoAttach, serviceIds, customerIds, executors, steps, numberToPrepare, customDuration, customPrice, }: Techcard): Promise<import("../../types").StartaResponse>;
|
|
14
14
|
delete(organizationLogin: string, techcardId: string): Promise<import("../../types").StartaResponse>;
|
|
15
15
|
}
|
|
@@ -5,11 +5,24 @@ class Techcards {
|
|
|
5
5
|
constructor(requestRunner) {
|
|
6
6
|
this._requestRunner = requestRunner;
|
|
7
7
|
}
|
|
8
|
-
add(organizationLogin,
|
|
8
|
+
add(organizationLogin, { name, isEnabled, type, products, autoAttach, serviceIds, customerIds, executors, steps, numberToPrepare, customDuration, customPrice, }) {
|
|
9
9
|
return this._requestRunner.performRequest({
|
|
10
10
|
url: `accounts/${organizationLogin}/techcards`,
|
|
11
11
|
method: 'POST',
|
|
12
|
-
body:
|
|
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
|
+
},
|
|
13
26
|
});
|
|
14
27
|
}
|
|
15
28
|
index(organizationLogin, { customerId, serviceId, executor, isEnabled, type, } = {}) {
|
|
@@ -18,11 +31,24 @@ class Techcards {
|
|
|
18
31
|
method: 'GET',
|
|
19
32
|
});
|
|
20
33
|
}
|
|
21
|
-
update(organizationLogin, techcardId,
|
|
34
|
+
update(organizationLogin, techcardId, { name, isEnabled, type, products, autoAttach, serviceIds, customerIds, executors, steps, numberToPrepare, customDuration, customPrice, }) {
|
|
22
35
|
return this._requestRunner.performRequest({
|
|
23
36
|
url: `accounts/${organizationLogin}/techcards/${techcardId}`,
|
|
24
37
|
method: 'PUT',
|
|
25
|
-
body:
|
|
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
|
+
},
|
|
26
52
|
});
|
|
27
53
|
}
|
|
28
54
|
delete(organizationLogin, techcardId) {
|
package/lib/services/system.d.ts
CHANGED
|
@@ -30,11 +30,12 @@ export default class EmailConfirmations {
|
|
|
30
30
|
notifyAboutBirthdayOfCustomers(): Promise<import("../types").StartaResponse>;
|
|
31
31
|
assignTrialCouponsForOrganizations(): Promise<import("../types").StartaResponse>;
|
|
32
32
|
sendDailyReportEmails(organizationLogin?: string, daysShift?: number): Promise<import("../types").StartaResponse>;
|
|
33
|
-
sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, }: {
|
|
33
|
+
sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, organizationCountry, }: {
|
|
34
34
|
featureId: string;
|
|
35
35
|
ticketId: string;
|
|
36
36
|
title: string;
|
|
37
37
|
text: string;
|
|
38
38
|
organizationLogin?: string;
|
|
39
|
+
organizationCountry?: string;
|
|
39
40
|
}): Promise<import("../types").StartaResponse>;
|
|
40
41
|
}
|
package/lib/services/system.js
CHANGED
|
@@ -103,7 +103,7 @@ class EmailConfirmations {
|
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, }) {
|
|
106
|
+
sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, organizationCountry, }) {
|
|
107
107
|
return this._requestRunner.performRequest({
|
|
108
108
|
url: `system/send-new-feature-notification-to-chats`,
|
|
109
109
|
method: 'POST',
|
|
@@ -113,6 +113,7 @@ class EmailConfirmations {
|
|
|
113
113
|
title,
|
|
114
114
|
text,
|
|
115
115
|
organizationLogin,
|
|
116
|
+
organizationCountry,
|
|
116
117
|
},
|
|
117
118
|
});
|
|
118
119
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -126,10 +126,8 @@ export type Product = {
|
|
|
126
126
|
};
|
|
127
127
|
categoryId?: string;
|
|
128
128
|
forSale: MeasurementUnit;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
forDisposal: MeasurementUnit;
|
|
132
|
-
}>;
|
|
129
|
+
equals: number;
|
|
130
|
+
forDisposal: MeasurementUnit;
|
|
133
131
|
netWeight?: number;
|
|
134
132
|
grossWeight?: number;
|
|
135
133
|
sellPrice: number;
|
|
@@ -252,26 +250,20 @@ export type ServiceExecutor = {
|
|
|
252
250
|
export type Techcard = {
|
|
253
251
|
name: string;
|
|
254
252
|
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>;
|
|
255
262
|
steps?: TechcardSteps;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
autoAttach?: boolean;
|
|
261
|
-
serviceIds?: Array<string>;
|
|
262
|
-
customerIds?: Array<string>;
|
|
263
|
-
executors?: Array<string>;
|
|
264
|
-
customPrice?: number;
|
|
265
|
-
customDuration?: number;
|
|
266
|
-
};
|
|
267
|
-
} | {
|
|
268
|
-
type: 'product';
|
|
269
|
-
productData: {
|
|
270
|
-
productToPrepareId?: string;
|
|
271
|
-
calculationMethod: 'fixedAmount' | 'proportional';
|
|
272
|
-
numberToPrepare?: number;
|
|
273
|
-
};
|
|
274
|
-
});
|
|
263
|
+
numberToPrepare?: number;
|
|
264
|
+
customPrice?: number;
|
|
265
|
+
customDuration?: number;
|
|
266
|
+
};
|
|
275
267
|
export type TechcardType = 'service' | 'product';
|
|
276
268
|
export type TechcardSteps = Array<{
|
|
277
269
|
name: string;
|
|
@@ -280,12 +272,10 @@ export type TechcardSteps = Array<{
|
|
|
280
272
|
warehouseId: string;
|
|
281
273
|
productId: string;
|
|
282
274
|
amount: number;
|
|
283
|
-
unit: MeasurementUnit;
|
|
284
275
|
} | {
|
|
285
276
|
type: 'comment';
|
|
286
277
|
comment: string;
|
|
287
278
|
}>;
|
|
288
|
-
fileIds?: Array<string>;
|
|
289
279
|
}>;
|
|
290
280
|
export type ProductAvailability = 'inStock' | 'outOfStock' | 'lowStock';
|
|
291
281
|
export type OrderData = {
|