idosell 0.4.20 → 0.4.23
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/README.md +1 -1
- package/changelog.md +8 -0
- package/dist/app.d.ts +17 -5
- package/dist/errors.js +16 -0
- package/dist/gateways.d.ts +53 -45
- package/dist/index.js +2 -1
- package/dist/methods/putProductsStockQuantity.js +1 -1
- package/dist/params.js +6 -4
- package/dist/request.js +27 -8
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +13 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ const idosellRequest = idosell('SHOP_URL', 'API_KEY', API_VERSION)
|
|
|
15
15
|
|
|
16
16
|
**API_KEY** can be obtained in your Idosell panel.
|
|
17
17
|
**SHOP_URL** is the base URI of your shop.
|
|
18
|
-
**API_VERSION** version of the API to call, current default version is **
|
|
18
|
+
**API_VERSION** version of the API to call, current default version is **v7**
|
|
19
19
|
Here are some examples:
|
|
20
20
|
```
|
|
21
21
|
https://yourdomain.com
|
package/changelog.md
CHANGED
|
@@ -5,12 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.23] - 2025-03-11
|
|
9
|
+
### Changed
|
|
10
|
+
- Added custom error class
|
|
11
|
+
- Fixed types for ids that can be integer instead of string
|
|
12
|
+
- Changed types of execution options, this allows custom logs
|
|
13
|
+
|
|
8
14
|
## [0.4.20] - 2025-12-18
|
|
15
|
+
### Changed
|
|
9
16
|
- Added indexing option for utils functions
|
|
10
17
|
- Fixed typings and tests
|
|
11
18
|
- Added descriptions
|
|
12
19
|
|
|
13
20
|
## [0.4.18] - 2025-12-18
|
|
21
|
+
### Changed
|
|
14
22
|
- Updated to v7.10
|
|
15
23
|
- Updated utils
|
|
16
24
|
- Fixed dates helper default value
|
package/dist/app.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
export interface ExecutableDumpParams {
|
|
2
|
+
url: string;
|
|
3
|
+
method: string;
|
|
4
|
+
params: Record<string,any>;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
export interface ExecutableOptions {
|
|
2
|
-
log?: boolean,
|
|
3
|
-
dump?: boolean,
|
|
4
|
-
logPage?: boolean,
|
|
8
|
+
log?: boolean | ((obj: ExecutableDumpParams) => void),
|
|
9
|
+
dump?: boolean | ((obj: ExecutableDumpParams) => void),
|
|
10
|
+
logPage?: boolean | ((text: string) => void),
|
|
5
11
|
skipCheck?: boolean
|
|
6
12
|
}
|
|
7
13
|
|
|
@@ -32,12 +38,13 @@ export type GatewayRequestProxyObject = {
|
|
|
32
38
|
arrayNode: string,
|
|
33
39
|
except: string[]
|
|
34
40
|
},
|
|
35
|
-
custom?: Record<string,
|
|
41
|
+
custom?: Record<string,(..._: any) => false|Record<string,any>>,
|
|
36
42
|
snakeCase?: boolean,
|
|
37
43
|
next?: boolean,
|
|
38
44
|
rootparams?: string|boolean,
|
|
39
45
|
arrays?: string[],
|
|
40
46
|
req?: RequirementType[],
|
|
47
|
+
n?: Record<string,number>,
|
|
41
48
|
} & RequestProxyObject;
|
|
42
49
|
|
|
43
50
|
export interface Gateway<R = JSObject, P = JSObject> {
|
|
@@ -91,4 +98,9 @@ export interface AppendableGateway<T,R = JSObject, P = JSObject> extends Gateway
|
|
|
91
98
|
append: () => T
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
export {
|
|
101
|
+
export interface IdosellErrorFaultStructure {
|
|
102
|
+
faultCode: number;
|
|
103
|
+
faultString: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export {};
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class IdosellFaultStringError extends Error {
|
|
2
|
+
cause;
|
|
3
|
+
constructor(message, cause) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = 'IdosellFaultStringError';
|
|
6
|
+
this.cause = cause;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function catchEmptyList(defaultValue) {
|
|
10
|
+
return (err) => {
|
|
11
|
+
if (err?.cause?.faultCode === 2) {
|
|
12
|
+
return defaultValue;
|
|
13
|
+
}
|
|
14
|
+
throw err;
|
|
15
|
+
};
|
|
16
|
+
}
|
package/dist/gateways.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
2
|
-
import type { PagableGateway, AppendableGateway, Gateway, DateLike, JSObject } from "./app.d.ts"
|
|
2
|
+
import type { PagableGateway, AppendableGateway, Gateway, DateLike, JSObject, IdosellErrorFaultStructure } from "./app.d.ts"
|
|
3
3
|
import type { GetClientsBalanceResponse, BooleanStatusResponse, GetClientsResponse, PostClientsResponse, PutClientsResponse, SearchClientsCrmResponse, GetClientsDeliveryAddressResponse, PostClientsDeliveryAddressResponse, PutClientsDeliveryAddressResponse, VouchersResponse, PutVouchersResponse, SearchClientsGiftcardsResponse, GetClientsGiftcardsTypesResponse, GetClientsMembershipCardsResponse, PutClientsMembershipCardsResponse, SearchClientsNewsletterEmailResponse, SearchClientsNewsletterSmsResponse, GetClientsPayerAddressResponse, PostClientsPayerAddressResponse, PutClientsPayerAddressResponse, GetClientsPricelistsClientsResponse, PutClientsPricelistsClientsResponse, GetClientsPricelistsResponse, PostClientsPricelistsResponse, GetClientsPricelistsProductsResponse, PutClientsPricelistsProductsResponse, GetClientsPricesActiveCardResponse, GetClientsPricesDiscountGroupsResponse, GetClientsPricesDiscountsResponse, PutClientsPricesDiscountsResponse, GetClientsProfitPointsResponse, GetClientsProvinceListResponse, GetClientsTagsResponse, PostClientsTagsResponse, PutClientsTagsResponse, GetConfigVariablesResponse, PutConfigVariablesResponse, GetCouriersAssignedToShippingProfilesResponse, GetCouriersResponse, GetCouriersPickupPointsResponse, PutCouriersPickupPointsResponse, GetCpaCampaignResponse, CmsCampaignResponse, CmsResponse, GetCpaResponse, GetDeliveriesProfilesResponse, GetDeliveriesRegionsResponse, PostDeliveriesRegionsResponse, GetDiscountsGroupsClientsResponse, GetDiscountsGroupsResponse, PostDiscountsGroupsResponse, GetEntriesResponse, PostEntriesResponse, GetEntriesPagesToDisplayResponse, GetEntriesSourcesResponse, GetMenuResponse, PostMenuResponse, PutMenuResponse, PutMenuSortResponse, GetOrdersAnalyticsResponse, GetOrdersAuctionDetailsResponse, PutOrdersCourierResponse, PostOrdersDocumentsCreateResponse, GetOrdersDocumentsResponse, PostOrdersDocumentsResponse, GetOrdersHandlerResponse, GetOrdersHistoryResponse, GetOrdersImagesResponse, PostOrdersImagesResponse, GetOrdersLabelsResponse, SearchOrdersOpinionsResponse, GetOrdersOpinionsRateResponse, SearchOrdersResponse, PostOrdersResponse, PutOrdersResponse, GetOrdersPackagesResponse, PutOrdersPackagesResponse, PutOrdersProductsSerialNumbersResponse, PutOrdersProfitMarginResponse, GetOrdersProfitabilityResponse, GetOrdersStatusesResponse, GetOrdersWarehouseResponse, PostPackagesLabelsResponse, PutPackagesResponse, SearchPackagesResponse, GetPaymentsFormsResponse, GetPaymentsResponse, PostPaymentsResponse, GetPaymentsProfilesResponse, PostPaymentsRepaymentResponse, GetProductsSKUbyBarcodeResponse, PutProductsAttachmentsResponse, GetProductsAuctionsResponse, GetProductsBrandsResponse, PutProductsBrandsResponse, GetProductsCategoriesResponse, PutProductsCategoriesResponse, SearchProductsCategoriesIdosellResponse, GetProductsCodeExistenceResponse, SearchProductsDeliveryTimeResponse, GetProductsDescriptionsResponse, ProductIdentResponse, PutProductsGroupsSettingsResponse, GetProductsIdBySizecodeResponse, PutProductsImagesResponse, GetProductsMarketingPromotionResponse, PostProductsMarketingPromotionResponse, PutProductsMarketingPromotionResponse, GetProductsMarketingZonesResponse, PutProductsMarketingZonesResponse, GetProductsOmnibusPricesResponse, GetProductsOpinionsResponse, PostProductsOpinionsResponse, GetProductsOpinionsRateResponse, PutProductsParametersResponse, SearchProductsParametersResponse, SearchProductsResponse, PostProductsResponse, PutProductsResponse, GetProductsQuestionsResponse, GetProductsReservationsResponse, GetProductsSeriesResponse, PutProductsSeriesResponse, GetProductsSizesResponse, PutProductsSizesResponse, PutProductsStockQuantityResponse, GetProductsStocksResponse, PutProductsStocksResponse, GetProductsStrikethroughPricesResponse, PutProductsSupplierCodeResponse, PutProductsSupplierProductDataResponse, GetResponsibilityEntitiesResponse, PutResponsibilityEntitiesResponse, GetReturnsResponse, PostReturnsResponse, PutReturnsResponse, PutReturnsSerialNumberResponse, GetRmaResponse, PutRmaResponse, GetRmaStatusesResponse, GetShopsCurrenciesResponse, GetShopsLanguagesResponse, GetSizechartsResponse, PutSizechartsResponse, GetSizesResponse, PutSizesResponse, GetSnippetsCampaignResponse, GetSnippetsCookiesResponse, GetSnippetsResponse, GetSystemConfigResponse, GetSystemCurrenciesResponse, PutSystemCurrenciesResponse, GetSystemProcessesAutomationResponse, GetSystemServerLoadResponse, GetSystemServerTimeResponse, GetSystemShopsDataResponse, GetSystemUnitsResponse, PutSystemUnitsResponse, GetSystemUsersResponse, GetVouchersTypesResponse, GetVouchersResponse, GetWarrantiesCountTotalResponse, PutWarrantiesLanguageDataResponse, GetWarrantiesResponse, PutWarrantiesResponse, GetWmsLocationsResponse, GetWmsStocksdocumentsDocumentsResponse, PostWmsStocksdocumentsDocumentsResponse, PutWmsStocksdocumentsDocumentsResponse, GetWmsStocksdocumentsOpenedDocumentsResponse, GetWmsStocksdocumentsProductsResponse, PutWmsStocksdocumentsProductsResponse, GetWmsSuppliersResponse, PutWmsSuppliersResponse } from "./responses.d.ts"
|
|
4
4
|
import type * as RequestParams from "./reqparams.d.ts";
|
|
5
5
|
import * as ENUMS from "./enums";
|
|
6
6
|
import utils from "./utils";
|
|
7
7
|
|
|
8
|
+
export class IdosellFaultStringError extends Error {
|
|
9
|
+
cause: IdosellFaultStringError;
|
|
10
|
+
constructor(message: string, cause: IdosellErrorFaultStructure);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function catchEmptyList(): (_err: IdosellFaultStringError) => undefined;
|
|
14
|
+
export function catchEmptyList<T>(_defaultValue: T): (_err: IdosellFaultStringError) => T;
|
|
15
|
+
|
|
8
16
|
export interface GetClientsBalanceRequest extends PagableGateway<GetClientsBalanceRequest, GetClientsBalanceResponse> {
|
|
9
17
|
/** Customer Id */
|
|
10
18
|
clientNumbers: (value: number|string|number[]|string[]) => this;
|
|
@@ -67,7 +75,7 @@ export interface GetClientsRequest extends PagableGateway<GetClientsRequest, Get
|
|
|
67
75
|
/** Client Registration Date */
|
|
68
76
|
clientRegistrationDate: (value: JSObject) => this;
|
|
69
77
|
/** The ID of the shop, that client is assigned to. */
|
|
70
|
-
shopId: (value: string) => this;
|
|
78
|
+
shopId: (value: number|string) => this;
|
|
71
79
|
/** Define range of dates */
|
|
72
80
|
lastPurchased: (dateFrom: DateLike, dateTo: DateLike) => this;
|
|
73
81
|
/** Define range of dates */
|
|
@@ -163,7 +171,7 @@ export interface PutClientsRequest extends AppendableGateway<PutClientsRequest,
|
|
|
163
171
|
/** Country ID in accordance with ISO-3166. */
|
|
164
172
|
clientCountryId: (clientCountryId: string) => this
|
|
165
173
|
/** Administrative region code. */
|
|
166
|
-
clientProvinceId: (clientProvinceId: string) => this
|
|
174
|
+
clientProvinceId: (clientProvinceId: number|string) => this
|
|
167
175
|
/** Customer password (min. 8 characters). */
|
|
168
176
|
clientPassword: (clientPassword: string) => this
|
|
169
177
|
/** Date of birth. */
|
|
@@ -331,9 +339,9 @@ export interface PostClientsDeliveryAddressRequest extends AppendableGateway<Pos
|
|
|
331
339
|
/** Recipient street and number. */
|
|
332
340
|
clientDeliveryAddressStreet: (clientDeliveryAddressStreet: string) => this
|
|
333
341
|
/** Administrative region code. */
|
|
334
|
-
clientDeliveryAddressRegionId: (clientDeliveryAddressRegionId: string) => this
|
|
342
|
+
clientDeliveryAddressRegionId: (clientDeliveryAddressRegionId: number|string) => this
|
|
335
343
|
/** Administrative region code. */
|
|
336
|
-
clientDeliveryAddressProvinceId: (clientDeliveryAddressProvinceId: string) => this
|
|
344
|
+
clientDeliveryAddressProvinceId: (clientDeliveryAddressProvinceId: number|string) => this
|
|
337
345
|
/** Recipient's postal code. */
|
|
338
346
|
clientDeliveryAddressZipCode: (clientDeliveryAddressZipCode: string) => this
|
|
339
347
|
/** Recipient's country. */
|
|
@@ -348,7 +356,7 @@ export interface PutClientsDeliveryAddressRequest extends AppendableGateway<PutC
|
|
|
348
356
|
/** External system code. */
|
|
349
357
|
clientCodeExternal: (clientCodeExternal: string) => this
|
|
350
358
|
/** Delivery address ID. */
|
|
351
|
-
clientDeliveryAddressId: (clientDeliveryAddressId: string) => this
|
|
359
|
+
clientDeliveryAddressId: (clientDeliveryAddressId: number|string) => this
|
|
352
360
|
/** List of stores IDs When mask is determined, this parameter is omitted. */
|
|
353
361
|
shopsIds: (shopsIds: number|string|number[]|string[]) => this
|
|
354
362
|
/** Currency ID */
|
|
@@ -366,9 +374,9 @@ export interface PutClientsDeliveryAddressRequest extends AppendableGateway<PutC
|
|
|
366
374
|
/** Recipient street and number. */
|
|
367
375
|
clientDeliveryAddressStreet: (clientDeliveryAddressStreet: string) => this
|
|
368
376
|
/** Administrative region code. */
|
|
369
|
-
clientDeliveryAddressRegionId: (clientDeliveryAddressRegionId: string) => this
|
|
377
|
+
clientDeliveryAddressRegionId: (clientDeliveryAddressRegionId: number|string) => this
|
|
370
378
|
/** Administrative region code. */
|
|
371
|
-
clientDeliveryAddressProvinceId: (clientDeliveryAddressProvinceId: string) => this
|
|
379
|
+
clientDeliveryAddressProvinceId: (clientDeliveryAddressProvinceId: number|string) => this
|
|
372
380
|
/** Recipient's postal code. */
|
|
373
381
|
clientDeliveryAddressZipCode: (clientDeliveryAddressZipCode: string) => this
|
|
374
382
|
/** Recipient's country. */
|
|
@@ -551,7 +559,7 @@ export interface DeleteClientsPayerAddressRequest extends AppendableGateway<Dele
|
|
|
551
559
|
|
|
552
560
|
export interface GetClientsPayerAddressRequest extends PagableGateway<GetClientsPayerAddressRequest, GetClientsPayerAddressResponse> {
|
|
553
561
|
/** Unique client's number. */
|
|
554
|
-
clientId: (value: string) => this;
|
|
562
|
+
clientId: (value: number|string) => this;
|
|
555
563
|
/** Page with results number. Numeration starts from 0 */
|
|
556
564
|
resultsPage: (value: number|string) => this;
|
|
557
565
|
/** Number of results on page. Value from 1 to 100 */
|
|
@@ -585,9 +593,9 @@ export interface PostClientsPayerAddressRequest extends AppendableGateway<PostCl
|
|
|
585
593
|
export interface PutClientsPayerAddressRequest extends AppendableGateway<PutClientsPayerAddressRequest, PutClientsPayerAddressResponse, RequestParams.PutClientsPayerAddressParams> {
|
|
586
594
|
payers: (value: RequestParams.PutClientsPayerAddressParams["payers"]) => this;
|
|
587
595
|
/** Unique client's number. */
|
|
588
|
-
clientId: (clientId: string) => this
|
|
596
|
+
clientId: (clientId: number|string) => this
|
|
589
597
|
/** Buyer's address id. */
|
|
590
|
-
payerAddressId: (payerAddressId: string) => this
|
|
598
|
+
payerAddressId: (payerAddressId: number|string) => this
|
|
591
599
|
/** Buyer's first name. */
|
|
592
600
|
payerAddressFirstName: (payerAddressFirstName: string) => this
|
|
593
601
|
/** Buyer's last name. */
|
|
@@ -869,7 +877,7 @@ export interface GetCouriersRequest extends PagableGateway<GetCouriersRequest, G
|
|
|
869
877
|
export interface DeleteCouriersPickupPointsRequest extends AppendableGateway<DeleteCouriersPickupPointsRequest> {
|
|
870
878
|
pickupPointDeleteRequests: (value: Array<JSObject>) => this;
|
|
871
879
|
/** Collection point ID. */
|
|
872
|
-
pickupPointId: (pickupPointId: string) => this
|
|
880
|
+
pickupPointId: (pickupPointId: number|string) => this
|
|
873
881
|
/** external system code. */
|
|
874
882
|
pickupPointExternalId: (pickupPointExternalId: string) => this
|
|
875
883
|
/** Courier ID. */
|
|
@@ -880,7 +888,7 @@ export interface GetCouriersPickupPointsRequest extends PagableGateway<GetCourie
|
|
|
880
888
|
/** Courier ID. */
|
|
881
889
|
courierId: (value: number|string) => this;
|
|
882
890
|
/** Collection point ID. */
|
|
883
|
-
pickupPointId: (value: string) => this;
|
|
891
|
+
pickupPointId: (value: number|string) => this;
|
|
884
892
|
/** External system code. */
|
|
885
893
|
pickupPointExternalId: (value: string) => this;
|
|
886
894
|
/** Page with results number. Numeration starts from 0 */
|
|
@@ -912,7 +920,7 @@ export interface PostCouriersPickupPointsRequest extends AppendableGateway<PostC
|
|
|
912
920
|
export interface PutCouriersPickupPointsRequest extends AppendableGateway<PutCouriersPickupPointsRequest, PutCouriersPickupPointsResponse, RequestParams.PutCouriersPickupPointsParams> {
|
|
913
921
|
pickupPoints: (value: RequestParams.PutCouriersPickupPointsParams["pickupPoints"]) => this;
|
|
914
922
|
/** Collection point ID. */
|
|
915
|
-
pickupPointId: (pickupPointId: string) => this
|
|
923
|
+
pickupPointId: (pickupPointId: number|string) => this
|
|
916
924
|
/** external system code. */
|
|
917
925
|
pickupPointExternalId: (pickupPointExternalId: string) => this
|
|
918
926
|
/** Courier ID. */
|
|
@@ -1272,7 +1280,7 @@ export interface PutMenuFilterRequest extends AppendableGateway<PutMenuFilterReq
|
|
|
1272
1280
|
/** Active filters. */
|
|
1273
1281
|
menuFiltersActive: (value: Array<JSObject>) => this;
|
|
1274
1282
|
/** Menu filter ID. */
|
|
1275
|
-
menuFilterId: (menuFilterId: string) => this
|
|
1283
|
+
menuFilterId: (menuFilterId: number|string) => this
|
|
1276
1284
|
/** Filter name on page. */
|
|
1277
1285
|
menuFilterName: (menuFilterName: string) => this
|
|
1278
1286
|
/** Display as: "name" - text, "gfx" - graphics, "namegfx" - text and graphics. */
|
|
@@ -1321,7 +1329,7 @@ export interface PostMenuRequest extends AppendableGateway<PostMenuRequest, Post
|
|
|
1321
1329
|
/** Menu ID. */
|
|
1322
1330
|
menu_id: (menu_id: number|string) => this
|
|
1323
1331
|
/** Parent menu element ID. */
|
|
1324
|
-
parent_id: (parent_id: string) => this
|
|
1332
|
+
parent_id: (parent_id: number|string) => this
|
|
1325
1333
|
/** Menu element text identifier. Example: "item1\item2". */
|
|
1326
1334
|
parent_textid: (parent_textid: string) => this
|
|
1327
1335
|
/** */
|
|
@@ -1337,7 +1345,7 @@ export interface PutMenuRequest extends AppendableGateway<PutMenuRequest, PutMen
|
|
|
1337
1345
|
/** Menu ID. */
|
|
1338
1346
|
menu_id: (menu_id: number|string) => this
|
|
1339
1347
|
/** Menu element ID. */
|
|
1340
|
-
item_id: (item_id: string) => this
|
|
1348
|
+
item_id: (item_id: number|string) => this
|
|
1341
1349
|
/** Menu element text identifier. Example: "item1\item2\item3". */
|
|
1342
1350
|
item_textid: (item_textid: string) => this
|
|
1343
1351
|
/** */
|
|
@@ -1389,7 +1397,7 @@ export interface PutOrdersCourierRequest extends Gateway<PutOrdersCourierRespons
|
|
|
1389
1397
|
/** Courier ID. */
|
|
1390
1398
|
courierId: (value: number|string) => this;
|
|
1391
1399
|
/** Collection point ID. */
|
|
1392
|
-
pickupPointId: (value: string) => this;
|
|
1400
|
+
pickupPointId: (value: number|string) => this;
|
|
1393
1401
|
}
|
|
1394
1402
|
|
|
1395
1403
|
export interface PutOrdersDeliveryAddressRequest extends Gateway {
|
|
@@ -1436,7 +1444,7 @@ export interface DeleteOrdersDocumentsRequest extends AppendableGateway<DeleteOr
|
|
|
1436
1444
|
|
|
1437
1445
|
export interface GetOrdersDocumentsRequest extends Gateway<GetOrdersDocumentsResponse> {
|
|
1438
1446
|
/** Order serial number. */
|
|
1439
|
-
orderSerialNumber: (value: string|string[]) => this;
|
|
1447
|
+
orderSerialNumber: (value: number|string|number[]|string[]) => this;
|
|
1440
1448
|
/** Document type */
|
|
1441
1449
|
documentType: (value: 'sales_confirmation'|'vat_invoice'|'corrective_vat_invoice'|'advance_vat_invoice'|'final_advance_vat_invoice'|'pro_forma_invoice'|'advance_pro_forma_invoice'|'final_advance_pro_forma_invoice'|'delivery_note'|'fiscal_receipt'|'fiscal_invoice'|'other') => this;
|
|
1442
1450
|
/** Elements returned by api */
|
|
@@ -1629,7 +1637,7 @@ export interface PostOrdersRequest extends AppendableGateway<PostOrdersRequest,
|
|
|
1629
1637
|
/** Courier ID. */
|
|
1630
1638
|
courierId: (courierId: number|string) => this
|
|
1631
1639
|
/** Collection point ID. */
|
|
1632
|
-
pickupPointId: (pickupPointId: string) => this
|
|
1640
|
+
pickupPointId: (pickupPointId: number|string) => this
|
|
1633
1641
|
/** Delivery cost. */
|
|
1634
1642
|
deliveryCost: (deliveryCost: number) => this
|
|
1635
1643
|
/** Delivery address data. */
|
|
@@ -1662,7 +1670,7 @@ export interface PutOrdersRequest extends AppendableGateway<PutOrdersRequest, Pu
|
|
|
1662
1670
|
/** Orders. */
|
|
1663
1671
|
orders: (value: RequestParams.PutOrdersParams["orders"]) => this;
|
|
1664
1672
|
/** Order ID. */
|
|
1665
|
-
orderId: (orderId: string) => this
|
|
1673
|
+
orderId: (orderId: number|string) => this
|
|
1666
1674
|
/** Order serial number. */
|
|
1667
1675
|
orderSerialNumber: (orderSerialNumber: number|string) => this
|
|
1668
1676
|
/** Order status. Allowed values: "finished_ext" - order status: completed in FA application, "finished" - completed, "new" - not handled, "payment_waiting" - awaiting payment, "delivery_waiting" - awaiting delivery, "on_order" - in progress, "packed" - being picked, "packed_fulfillment" - being picked - fulfilment, "packed_ready" - packed, "ready" - ready, "wait_for_dispatch" - awaiting dispatch date, "suspended" - on hold, "joined" - merged, "missing" - missing, "lost" - lost, "false" - false, "canceled" - Customer canceled. */
|
|
@@ -1722,7 +1730,7 @@ export interface SearchOrdersRequest extends PagableGateway<SearchOrdersRequest,
|
|
|
1722
1730
|
orderType: (value: 'wholesale'|'retail'|'dropshipping'|'deliverer') => this;
|
|
1723
1731
|
dropshippingOrderStatus: (value: 'all'|'finished'|'canceled'|'notCanceled') => this;
|
|
1724
1732
|
/** Orders IDs. */
|
|
1725
|
-
ordersIds: (value: string|string[]) => this;
|
|
1733
|
+
ordersIds: (value: number|string|number[]|string[]) => this;
|
|
1726
1734
|
/** Order serial numbers. */
|
|
1727
1735
|
ordersSerialNumbers: (value: number|string|number[]|string[]) => this;
|
|
1728
1736
|
/** Customer data. */
|
|
@@ -1816,7 +1824,7 @@ export interface PostOrdersPackagesRequest extends AppendableGateway<PostOrdersP
|
|
|
1816
1824
|
/** List of parcels assigned to the order Maximum default number: 100 parcels. */
|
|
1817
1825
|
orderPackages: (value: RequestParams.PostOrdersPackagesParams["orderPackages"]) => this;
|
|
1818
1826
|
/** Id. */
|
|
1819
|
-
eventId: (eventId: string) => this
|
|
1827
|
+
eventId: (eventId: number|string) => this
|
|
1820
1828
|
/** Type. */
|
|
1821
1829
|
eventType: (eventType: 'order'|'rma'|'return') => this
|
|
1822
1830
|
/** Information on consignments. */
|
|
@@ -1827,7 +1835,7 @@ export interface PutOrdersPackagesRequest extends AppendableGateway<PutOrdersPac
|
|
|
1827
1835
|
/** List of parcels assigned to the order Maximum default number: 100 parcels. */
|
|
1828
1836
|
orderPackages: (value: RequestParams.PutOrdersPackagesParams["orderPackages"]) => this;
|
|
1829
1837
|
/** Id. */
|
|
1830
|
-
eventId: (eventId: string) => this
|
|
1838
|
+
eventId: (eventId: number|string) => this
|
|
1831
1839
|
/** Type. */
|
|
1832
1840
|
eventType: (eventType: 'order'|'rma'|'return') => this
|
|
1833
1841
|
/** Information on consignments. */
|
|
@@ -1838,7 +1846,7 @@ export interface PutOrdersPickupPointRequest extends Gateway<PutOrdersCourierRes
|
|
|
1838
1846
|
/** Order serial number. */
|
|
1839
1847
|
orderSerialNumber: (value: number|string) => this;
|
|
1840
1848
|
/** Collection point ID. */
|
|
1841
|
-
pickupPointId: (value: string) => this;
|
|
1849
|
+
pickupPointId: (value: number|string) => this;
|
|
1842
1850
|
}
|
|
1843
1851
|
|
|
1844
1852
|
export interface GetOrdersPrinterDocumentsRequest extends Gateway {
|
|
@@ -1904,7 +1912,7 @@ export interface SearchOrdersUnfinishedRequest extends PagableGateway<SearchOrde
|
|
|
1904
1912
|
/** Dropshipping order status in the supplier's system. Allowed values: "all" - all, "finished" - sent, "canceled" - canceled, "notCanceled" - failed to cancel. */
|
|
1905
1913
|
dropshippingOrderStatus: (value: 'all'|'finished'|'canceled'|'notCanceled') => this;
|
|
1906
1914
|
/** Orders IDs. */
|
|
1907
|
-
ordersIds: (value: string|string[]) => this;
|
|
1915
|
+
ordersIds: (value: number|string|number[]|string[]) => this;
|
|
1908
1916
|
/** Order serial numbers. */
|
|
1909
1917
|
ordersSerialNumbers: (value: number|string|number[]|string[]) => this;
|
|
1910
1918
|
/** Customer data. */
|
|
@@ -2008,7 +2016,7 @@ export interface PostPackagesLabelsRequest extends AppendableGateway<PostPackage
|
|
|
2008
2016
|
/** Shipment configuration options available for Inpost Smile courier */
|
|
2009
2017
|
parcelParametersByPackages: (value: RequestParams.PostPackagesLabelsParams["parcelParametersByPackages"]) => this;
|
|
2010
2018
|
/** Package ID in system. */
|
|
2011
|
-
packageId: (packageId: string) => this
|
|
2019
|
+
packageId: (packageId: number|string) => this
|
|
2012
2020
|
/** Set order serial number */
|
|
2013
2021
|
orderSn: (orderSn: number |string) => this;
|
|
2014
2022
|
/** Set default parcel size */
|
|
@@ -2220,7 +2228,7 @@ export interface PutProductsBrandsFilterRequest extends AppendableGateway<PutPro
|
|
|
2220
2228
|
/** Active filters. */
|
|
2221
2229
|
filtersActive: (value: Array<JSObject>) => this;
|
|
2222
2230
|
/** Menu filter ID. */
|
|
2223
|
-
filterId: (filterId: string) => this
|
|
2231
|
+
filterId: (filterId: number|string) => this
|
|
2224
2232
|
/** Filter name on page. */
|
|
2225
2233
|
filterName: (filterName: string) => this
|
|
2226
2234
|
/** Display as: "name" - text, "gfx" - graphics, "namegfx" - text and graphics. */
|
|
@@ -2356,7 +2364,7 @@ export interface GetProductsCodeExistenceRequest extends Gateway<GetProductsCode
|
|
|
2356
2364
|
identType: (value: 'id'|'index'|'codeExtern'|'codeProducer'|'codeDeliverer') => this;
|
|
2357
2365
|
/** Products list. */
|
|
2358
2366
|
products: (value: string|string[]) => this;
|
|
2359
|
-
delivererId: (value: string) => this;
|
|
2367
|
+
delivererId: (value: number|string) => this;
|
|
2360
2368
|
/** Set product identifiers */
|
|
2361
2369
|
productId: (productId: number|string|number|string|number[]|string[], type?: 'id'|'index'|'codeExtern'|'codeProducer') => this;
|
|
2362
2370
|
}
|
|
@@ -2413,7 +2421,7 @@ export interface SearchProductsDeliveryTimeRequest extends AppendableGateway<Sea
|
|
|
2413
2421
|
/** Product Id */
|
|
2414
2422
|
productId: (productId: number|string) => this
|
|
2415
2423
|
/** Size identifier */
|
|
2416
|
-
sizeId: (sizeId: string) => this
|
|
2424
|
+
sizeId: (sizeId: number|string) => this
|
|
2417
2425
|
/** Size name */
|
|
2418
2426
|
sizePanelName: (sizePanelName: string) => this
|
|
2419
2427
|
/** Product IAI code */
|
|
@@ -2492,7 +2500,7 @@ export interface DeleteProductsImagesRequest extends AppendableGateway<DeletePro
|
|
|
2492
2500
|
/** Shop Id */
|
|
2493
2501
|
shopId: (shopId: number|string) => this
|
|
2494
2502
|
/** */
|
|
2495
|
-
productImagesId: (productImagesId: string|string[]) => this
|
|
2503
|
+
productImagesId: (productImagesId: number|string|number[]|string[]) => this
|
|
2496
2504
|
}
|
|
2497
2505
|
|
|
2498
2506
|
export interface PutProductsImagesRequest extends AppendableGateway<PutProductsImagesRequest, PutProductsImagesResponse, RequestParams.PutProductsImagesParams> {
|
|
@@ -2558,12 +2566,12 @@ export interface PostProductsMarketingPromotionRequest extends AppendableGateway
|
|
|
2558
2566
|
/** */
|
|
2559
2567
|
elementType: (elementType: 'product'|'series'|'producer'|'category'|'menu') => this
|
|
2560
2568
|
/** Identifier of the element affected by the promotion (in the case of a menu in the format: storeId-menuId-itemId) */
|
|
2561
|
-
elementId: (elementId: string) => this
|
|
2569
|
+
elementId: (elementId: number|string) => this
|
|
2562
2570
|
}
|
|
2563
2571
|
|
|
2564
2572
|
export interface PutProductsMarketingPromotionRequest extends AppendableGateway<PutProductsMarketingPromotionRequest, PutProductsMarketingPromotionResponse, RequestParams.PutProductsMarketingPromotionParams> {
|
|
2565
2573
|
/** Promotion ID */
|
|
2566
|
-
promotionId: (value: string) => this;
|
|
2574
|
+
promotionId: (value: number|string) => this;
|
|
2567
2575
|
/** Promotion name */
|
|
2568
2576
|
promotionName: (value: string) => this;
|
|
2569
2577
|
/** List of stores IDs When mask is determined, this parameter is omitted. */
|
|
@@ -2593,7 +2601,7 @@ export interface PutProductsMarketingPromotionRequest extends AppendableGateway<
|
|
|
2593
2601
|
/** */
|
|
2594
2602
|
elementType: (elementType: 'product'|'series'|'producer'|'category'|'menu') => this
|
|
2595
2603
|
/** Identifier of the element affected by the promotion (in the case of a menu in the format: storeId-menuId-itemId) */
|
|
2596
|
-
elementId: (elementId: string) => this
|
|
2604
|
+
elementId: (elementId: number|string) => this
|
|
2597
2605
|
}
|
|
2598
2606
|
|
|
2599
2607
|
export interface GetProductsMarketingZonesRequest extends Gateway<GetProductsMarketingZonesResponse> {
|
|
@@ -2750,9 +2758,9 @@ export interface PutProductsParametersRequest extends AppendableGateway<PutProdu
|
|
|
2750
2758
|
/** Icons of section, parameter or value to display on the list of products. */
|
|
2751
2759
|
link_icons: (link_icons: RequestParams.PutProductsParametersParams["items"][number]["link_icons"]) => this
|
|
2752
2760
|
/** Parameter's additional feature. 1. Status: context_id = "CONTEXT_STATE" Takes values context_value_id: - CONTEXT_STATE_NEW - New, - CONTEXT_STATE_USED - Used, - CONTEXT_STATE_USED_EXCELLENT - Used - excellent condition - CONTEXT_STATE_USED_VERYGOOD - Used - very good condition - CONTEXT_STATE_USED_CORRECT - Used - good condition - CONTEXT_STATE_USED_ACCEPTABLE - Used - acceptable condition - CONTEXT_STATE_REFURBISHED_EXCELLENT - Refurbished - excellent condition - CONTEXT_STATE_REFURBISHED_VERYGOOD - Refurbished - very good condition - CONTEXT_STATE_REFURBISHED_CORRECT - Refurbished - good condition - CONTEXT_STATE_NEW_OTHERS - New other (see details) - CONTEXT_STATE_NEW_WITH_DEFECTS - New with defects - CONTEXT_STATE_NEW_OEM - New - OEM - CONTEXT_STATE_NEW_OPEN_BOX - New - open box - CONTEXT_STATE_REFURBISHED_BY_PRODUCER - Renewed by a manufacturer, - CONTEXT_STATE_REFURBISHED_BY_SELLER - Renewed by a seller, - CONTEXT_STATE_FOR_PARTS_OR_BROKEN - In parts or damaged. 2. Product weight in grams: context_id = "CONTEXT_STD_UNIT_WEIGHT" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 3. A product's value in milliliters: context_id = "CONTEXT_STD_UNIT_VOLUME" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 4. Sex: context_id = "CONTEXT_SEX" Takes values context_value_id: - CONTEXT_SEX_MAN - Man, - CONTEXT_SEX_WOMAN - Woman, - CONTEXT_SEX_UNISEX - Unisex. 5. Age group: context_id = "CONTEXT_AGE_GROUP" Takes values context_value_id: - CONTEXT_AGE_GROUP_ADULT - Adults, - CONTEXT_AGE_GROUP_MINOR - Children. 6. Maximum number of products in an order: context_id = "CONTEXT_MAX_QUANTITY_PER_RETAIL_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 7. Maximum number of products in a wholesale order: context_id = "CONTEXT_MAX_QUANTITY_PER_WHOLESALE_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 8. Minimal number of products in an order: context_id = "CONTEXT_MIN_QUANTITY_PER_RETAIL_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 9. Minimum number of products in a wholesale order: context_id = "CONTEXT_MIN_QUANTITY_PER_WHOLESALE_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 10. Maximal number of a single size in an order: context_id = "CONTEXT_MAX_SIZE_QUANTITY_PER_RETAIL_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 11. Maximal number of a single size in a wholesale order: context_id = "CONTEXT_MAX_SIZE_QUANTITY_PER_WHOLESALE_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 12. Minimal number of a single size in an order: context_id = "CONTEXT_MIN_SIZE_QUANTITY_PER_RETAIL_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 13. Minimal number of a single size in a wholesale order: context_id = "CONTEXT_MIN_SIZE_QUANTITY_PER_WHOLESALE_ORDER" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 14. Net weight: context_id = "CONTEXT_WEIGHT_NET" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 15. Color: context_id = "CONTEXT_COLOR" Takes values context_value_id: - Value of additional feature is set automatically basing on the parameter's value. 16. #!TylkoDlaDoroslych!#: context_id = "CONTEXT_ONLY_ADULTS" Takes values context_value_id: - CONTEXT_ONLY_ADULTS_YES - yes, - CONTEXT_ONLY_ADULTS_NO - no. 17. Prescription drug: context_id = "CONTEXT_PRESCRIPTION_MEDICINE" Takes values context_value_id: - CONTEXT_PRESCRIPTION_MEDICINE_YES - yes, - CONTEXT_PRESCRIPTION_MEDICINE_NO - no. 18. Season Rate: context_id = "CONTEXT_SEASON" Takes values context_value_id: - CONTEXT_SEASON_SPRING - Spring, - CONTEXT_SEASON_SUMMER - Summer, - CONTEXT_SEASON_FALL - Autumn, - CONTEXT_SEASON_WINTER - Winter, - CONTEXT_SEASON_SPRING_SUMMER - Spring/Summer, - CONTEXT_SEASON_FALL_WINTER - Autumn/Winter 19. Risk - signal word: context_id = \"CONTEXT_HAZMAT_SIGNAL\" Takes values context_value_id: - CONTEXT_HAZMAT_SIGNAL_DANGER - danger, - CONTEXT_HAZMAT_SIGNAL_WARNING - warnging, - CONTEXT_HAZMAT_SIGNAL_CAUTION - caution, - CONTEXT_HAZMAT_SIGNAL_NOTICE - notice, 20. Risk - warning pictogram context_id = \"CONTEXT_HAZMAT_PICTOGRAM\" Takes values context_value_id: - GHS01, GHS02, GHS03, GHS04, GHS05, GHS06, GHS07, GHS08, GHS09 21. Risk - type of hazard: context_id = \"CONTEXT_HAZMAT_STATEMENT\" Takes values context_value_id: - H200, H201, H202, H203, H204, H205, H220, H221, H222, H223, H224, H225, H226, H228, H240, H241, H242, H250, H251, H252, H260, H261, H270, H271, H272, H280, H281, H290, H300, H301, H302, H304, H310, H311, H312, H314, H315, H317, H318, H319, H330, H331, H332, H334, H335, H336, H340, H341, H350, H351, H360, H361, H362, H370, H371, H372, H373, H400, H410, H411, H412, H413, EUH 001, EUH 014, EUH 018, EUH 019, EUH 044, EUH 029, EUH 031, EUH 032, EUH 066, EUH 070, EUH 071, EUH 201, EUH 201A, EUH 202, EUH 203, EUH 204, EUH 205, EUH 206, EUH 207, EUH 208, EUH 209, EUH 209A, EUH 210, EUH 401 22. Repair score: context_id = \"CONTEXT_REPAIR_SCORE\" Takes values context_value_id: - The value of the additional feature is set automatically based on the parameter's value 23. Safety - information pictogram: context_id = \"CONTEXT_SAFETY_PICTOGRAM\" Takes values context_value_id: - 1 (Not suitable for small children) - 2 (CE mark) 24. Safety - type of warning: context_id = \"CONTEXT_SAFETY_STATEMENT\" Takes values context_value_id: - 1 (Not suitable for children under 3 years) - 2 (Keep out of the reach of children) - 3 (Product contains a button cell or coin battery) - 4 (Use under the direct supervision of adults) - 5 (Required protective gear. Do not use in public traffic) - 6 (Contains toy. Adult supervision recommended) - 7 (To prevent possible injury from entanglement, remove this toy as soon as the child begins to crawl) - 8 (Use only in shallow water under adult supervision) - 9 (Only use under adult supervision) - 10 (This toy does not provide protection) - 11 (Contains fragrances that may cause allergies) - 12 (For household use only). */
|
|
2753
|
-
context_id: (context_id: string) => this
|
|
2761
|
+
context_id: (context_id: number|string) => this
|
|
2754
2762
|
/** value of additional feature - Values described in context_id. */
|
|
2755
|
-
context_value_id: (context_value_id: string) => this
|
|
2763
|
+
context_value_id: (context_value_id: number|string) => this
|
|
2756
2764
|
}
|
|
2757
2765
|
|
|
2758
2766
|
export interface SearchProductsParametersRequest extends PagableGateway<SearchProductsParametersRequest, SearchProductsParametersResponse, RequestParams.SearchProductsParametersParams> {
|
|
@@ -2781,7 +2789,7 @@ export interface DeleteProductsRequest extends AppendableGateway<DeleteProductsR
|
|
|
2781
2789
|
|
|
2782
2790
|
export interface GetProductsRequest extends Gateway<SearchProductsResponse> {
|
|
2783
2791
|
/** List of the unique, indexed product codes (IAI code / External system code / Producer code). You can transfer a maximum of 100 products IDs in one request. */
|
|
2784
|
-
productIds: (value: string|string[]) => this;
|
|
2792
|
+
productIds: (value: number|string|number[]|string[]) => this;
|
|
2785
2793
|
}
|
|
2786
2794
|
|
|
2787
2795
|
export interface PostProductsRequest extends AppendableGateway<PostProductsRequest, PostProductsResponse, RequestParams.PostProductsParams> {
|
|
@@ -3520,7 +3528,7 @@ export interface PutProductsSeriesFilterRequest extends AppendableGateway<PutPro
|
|
|
3520
3528
|
/** Active filters. */
|
|
3521
3529
|
filtersActive: (value: Array<JSObject>) => this;
|
|
3522
3530
|
/** Menu filter ID. */
|
|
3523
|
-
filterId: (filterId: string) => this
|
|
3531
|
+
filterId: (filterId: number|string) => this
|
|
3524
3532
|
/** Filter name on page. */
|
|
3525
3533
|
filterName: (filterName: string) => this
|
|
3526
3534
|
/** Display as: "name" - text, "gfx" - graphics, "namegfx" - text and graphics. */
|
|
@@ -3963,7 +3971,7 @@ export interface GetRmaRequest extends PagableGateway<GetRmaRequest, GetRmaRespo
|
|
|
3963
3971
|
/** Login of the user handling the complaint */
|
|
3964
3972
|
operatorLogin: (value: string) => this;
|
|
3965
3973
|
/** Unique client's number. */
|
|
3966
|
-
clientId: (value: string) => this;
|
|
3974
|
+
clientId: (value: number|string) => this;
|
|
3967
3975
|
/** Complaint creation date in the YYYY-MM-DD format */
|
|
3968
3976
|
creationDate: (value: JSObject) => this;
|
|
3969
3977
|
/** Complaint modification date in the YYYY-MM-DD format */
|
|
@@ -4044,7 +4052,7 @@ export interface PutSizesRequest extends AppendableGateway<PutSizesRequest, PutS
|
|
|
4044
4052
|
/** Size group ID. */
|
|
4045
4053
|
group_id: (group_id: number|string) => this
|
|
4046
4054
|
/** Size identifier. */
|
|
4047
|
-
id: (id: string) => this
|
|
4055
|
+
id: (id: number|string) => this
|
|
4048
4056
|
/** Category plural name. */
|
|
4049
4057
|
name: (name: string) => this
|
|
4050
4058
|
/** Size description. */
|
|
@@ -4546,23 +4554,23 @@ export interface PutVouchersRequest extends AppendableGateway<PutVouchersRequest
|
|
|
4546
4554
|
}
|
|
4547
4555
|
|
|
4548
4556
|
export interface GetWarrantiesCountTotalRequest extends Gateway<GetWarrantiesCountTotalResponse> {
|
|
4549
|
-
warranty_ids: (value: string|string[]) => this;
|
|
4557
|
+
warranty_ids: (value: number|string|number[]|string[]) => this;
|
|
4550
4558
|
}
|
|
4551
4559
|
|
|
4552
4560
|
export interface PutWarrantiesLanguageDataRequest extends AppendableGateway<PutWarrantiesLanguageDataRequest, PutWarrantiesLanguageDataResponse, RequestParams.PutWarrantiesLanguageDataParams> {
|
|
4553
4561
|
lang_data: (value: RequestParams.PutWarrantiesLanguageDataParams["lang_data"]) => this;
|
|
4554
4562
|
/** Warranty ID (numeric or text based). */
|
|
4555
|
-
warranty_id: (warranty_id: string) => this
|
|
4563
|
+
warranty_id: (warranty_id: number|string) => this
|
|
4556
4564
|
/** */
|
|
4557
4565
|
lang: (lang: RequestParams.PutWarrantiesLanguageDataParams["lang_data"][number]["lang"]) => this
|
|
4558
4566
|
}
|
|
4559
4567
|
|
|
4560
4568
|
export interface DeleteWarrantiesRequest extends Gateway {
|
|
4561
|
-
warranty_ids: (value: string|string[]) => this;
|
|
4569
|
+
warranty_ids: (value: number|string|number[]|string[]) => this;
|
|
4562
4570
|
}
|
|
4563
4571
|
|
|
4564
4572
|
export interface GetWarrantiesRequest extends PagableGateway<GetWarrantiesRequest, GetWarrantiesResponse> {
|
|
4565
|
-
warranty_ids: (value: string|string[]) => this;
|
|
4573
|
+
warranty_ids: (value: number|string|number[]|string[]) => this;
|
|
4566
4574
|
/** Number of results on page. */
|
|
4567
4575
|
results_limit: (value: number|string) => this;
|
|
4568
4576
|
/** Result page number. */
|
|
@@ -4587,7 +4595,7 @@ export interface PostWarrantiesRequest extends AppendableGateway<PostWarrantiesR
|
|
|
4587
4595
|
export interface PutWarrantiesRequest extends AppendableGateway<PutWarrantiesRequest, PutWarrantiesResponse, RequestParams.PutWarrantiesParams> {
|
|
4588
4596
|
warranties: (value: RequestParams.PutWarrantiesParams["warranties"]) => this;
|
|
4589
4597
|
/** Warranty ID (numeric or text based). */
|
|
4590
|
-
id: (id: string) => this
|
|
4598
|
+
id: (id: number|string) => this
|
|
4591
4599
|
/** Name. */
|
|
4592
4600
|
name: (name: string) => this
|
|
4593
4601
|
/** */
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ENUMS from "./enums.js";
|
|
2
2
|
import utils from "./utils.js";
|
|
3
3
|
import { gateProxy } from "./gates.js";
|
|
4
|
+
import { IdosellFaultStringError, catchEmptyList } from "./errors.js";
|
|
4
5
|
export const DEFAULT_VERSION = 7;
|
|
5
6
|
const idosell = (url, apiKey, version = DEFAULT_VERSION) => {
|
|
6
7
|
const auth = { url, apiKey, version, apikey: apiKey ? apiKey.slice(0, 6) + '*'.repeat(20) : "" };
|
|
@@ -9,4 +10,4 @@ const idosell = (url, apiKey, version = DEFAULT_VERSION) => {
|
|
|
9
10
|
return new Proxy(element, gateProxy);
|
|
10
11
|
};
|
|
11
12
|
export default idosell;
|
|
12
|
-
export { ENUMS, utils };
|
|
13
|
+
export { ENUMS, utils, IdosellFaultStringError, catchEmptyList };
|
|
@@ -6,7 +6,7 @@ export default (object) => {
|
|
|
6
6
|
arrayNode: "products",
|
|
7
7
|
index: 0
|
|
8
8
|
};
|
|
9
|
-
object.req = ["productSizeCodeExternal", "stockId"];
|
|
9
|
+
object.req = [{ "any": ["productSizeCodeExternal", "productIndex", "productSizeCodeProducer"] }, "stockId"];
|
|
10
10
|
object.arrays = ["products"];
|
|
11
11
|
return new Proxy(object, paramsProxy);
|
|
12
12
|
};
|
package/dist/params.js
CHANGED
|
@@ -32,10 +32,12 @@ export const paramsProxy = {
|
|
|
32
32
|
}
|
|
33
33
|
else if (object.custom && typeof object.custom[property] === 'function') {
|
|
34
34
|
const param = object.custom[property](...values);
|
|
35
|
-
if (param
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
if (param) {
|
|
36
|
+
if (param.root)
|
|
37
|
+
Object.assign(object.params, param.root);
|
|
38
|
+
else
|
|
39
|
+
Object.assign(item, param);
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
else {
|
|
41
43
|
item[property] = values[0];
|
package/dist/request.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { page } from "./helpers.js";
|
|
3
|
-
import {
|
|
3
|
+
import { IdosellFaultStringError } from "./errors.js";
|
|
4
4
|
const DECODE_TABLE = [
|
|
5
5
|
['Å\x82', "ł"],
|
|
6
6
|
['Ä\x99', 'ę']
|
|
7
7
|
];
|
|
8
|
+
const DEFAULT_LOG_FUNCTION = console.log;
|
|
8
9
|
const catchIdosellError = (err) => {
|
|
9
10
|
if (!err.response) {
|
|
10
11
|
if (err.cause)
|
|
@@ -29,21 +30,28 @@ const catchIdosellError = (err) => {
|
|
|
29
30
|
throw new Error(`${err.response.status}: ${message}`, { cause: err.response.status });
|
|
30
31
|
};
|
|
31
32
|
const checkNext = (request, response, logPage) => {
|
|
33
|
+
if (logPage === true)
|
|
34
|
+
logPage = DEFAULT_LOG_FUNCTION;
|
|
32
35
|
if (!response)
|
|
33
36
|
return;
|
|
34
|
-
if (response?.errors?.
|
|
35
|
-
|
|
37
|
+
if (response?.errors?.faultString) {
|
|
38
|
+
const faultStructure = {
|
|
39
|
+
faultCode: response?.errors?.faultCode ?? 999,
|
|
40
|
+
faultString: response.errors.faultString,
|
|
41
|
+
};
|
|
42
|
+
throw new IdosellFaultStringError(response.errors.faultString, faultStructure);
|
|
43
|
+
}
|
|
36
44
|
if (response.resultsNumberPage) {
|
|
37
45
|
request.next = response.resultsPage + 1 < response.resultsNumberPage;
|
|
38
46
|
request.params.resultsPage = request.params.resultsPage ? request.params.resultsPage + 1 : 1;
|
|
39
47
|
if (logPage)
|
|
40
|
-
|
|
48
|
+
logPage('Page: ' + response.resultsPage + ' / ' + response.resultsNumberPage);
|
|
41
49
|
}
|
|
42
50
|
else if (response.results_number_page) {
|
|
43
51
|
request.next = response.results_page + 1 < response.results_number_page;
|
|
44
52
|
request.params.results_page = request.params.results_page ? request.params.results_page + 1 : 1;
|
|
45
53
|
if (logPage)
|
|
46
|
-
|
|
54
|
+
logPage('Page: ' + response.results_page + ' / ' + response.results_page);
|
|
47
55
|
}
|
|
48
56
|
return response;
|
|
49
57
|
};
|
|
@@ -141,10 +149,21 @@ export const sendRequest = async (request, options = {}) => {
|
|
|
141
149
|
request.next = false;
|
|
142
150
|
const { method, node } = request.gate;
|
|
143
151
|
let url = `${request.auth.url}/api/admin/v${request.auth.version}${node}`;
|
|
144
|
-
if (options.
|
|
145
|
-
|
|
146
|
-
if (options.dump)
|
|
152
|
+
if (options.dump || options.log) {
|
|
153
|
+
const dumpData = { params: request.params, method, url };
|
|
154
|
+
if (options.dump) {
|
|
155
|
+
if (options.dump === true)
|
|
156
|
+
DEFAULT_LOG_FUNCTION(dumpData);
|
|
157
|
+
else
|
|
158
|
+
options.dump(dumpData);
|
|
147
159
|
return {};
|
|
160
|
+
}
|
|
161
|
+
else if (options.log) {
|
|
162
|
+
if (options.log === true)
|
|
163
|
+
DEFAULT_LOG_FUNCTION(dumpData);
|
|
164
|
+
else
|
|
165
|
+
options.log(dumpData);
|
|
166
|
+
}
|
|
148
167
|
}
|
|
149
168
|
if (method === 'get' || method === 'delete') {
|
|
150
169
|
url += '?' + queryfy(request.params);
|
package/dist/utils.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type MapProductLocationsFunction = (product: IdosellProduct, stockId?: nu
|
|
|
17
17
|
|
|
18
18
|
export type GetLangDataFunction = <T extends { langId: string}>(array: T[], langId?: string) => T|undefined;
|
|
19
19
|
|
|
20
|
-
export type ClearParametersLangDataFunction = (products: SearchProductsResponse['results'], langId
|
|
20
|
+
export type ClearParametersLangDataFunction = (products: SearchProductsResponse['results'], langId?: string) => SearchProductsResponse['results'];
|
|
21
21
|
|
|
22
22
|
declare namespace utils {
|
|
23
23
|
/** @description The method allows you to build an IAI code from the product ID and size ID. */
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PRODUCE_SIZE_INDEX } from "./enums.d.js";
|
|
2
1
|
import ENUMS from "./enums.js";
|
|
3
2
|
const getIaiCode = (productId, sizeId) => {
|
|
4
3
|
if (sizeId === 'uniw')
|
|
@@ -136,9 +135,9 @@ const sumProductQuantities = (productStocksData, nodeName = ENUMS.PRODUCT_SIZE_C
|
|
|
136
135
|
};
|
|
137
136
|
const getProductIndexFunction = (type, product) => {
|
|
138
137
|
switch (type) {
|
|
139
|
-
case PRODUCE_SIZE_INDEX.ID: return (obj) => obj.sizeId;
|
|
140
|
-
case PRODUCE_SIZE_INDEX.IAI_CODE: return (obj) => getIaiCode(product.productId, obj.sizeId);
|
|
141
|
-
case PRODUCE_SIZE_INDEX.NAME: {
|
|
138
|
+
case ENUMS.PRODUCE_SIZE_INDEX.ID: return (obj) => obj.sizeId;
|
|
139
|
+
case ENUMS.PRODUCE_SIZE_INDEX.IAI_CODE: return (obj) => getIaiCode(product.productId, obj.sizeId);
|
|
140
|
+
case ENUMS.PRODUCE_SIZE_INDEX.NAME: {
|
|
142
141
|
return (obj) => {
|
|
143
142
|
if (obj.sizePanelName)
|
|
144
143
|
return obj.sizePanelName;
|
|
@@ -263,6 +262,13 @@ const clearParametersLangData = (products, langId = 'pol') => {
|
|
|
263
262
|
}
|
|
264
263
|
return products;
|
|
265
264
|
};
|
|
265
|
+
const removeRmaAttachments = (rmaResponse) => {
|
|
266
|
+
for (const rma of rmaResponse.rmas) {
|
|
267
|
+
for (const product of rma.products)
|
|
268
|
+
product.attachments = [];
|
|
269
|
+
}
|
|
270
|
+
return rmaResponse;
|
|
271
|
+
};
|
|
266
272
|
export default {
|
|
267
273
|
/** @description The method allows you to build an IAI code from the product ID and size ID. */
|
|
268
274
|
getIaiCode,
|
|
@@ -279,5 +285,7 @@ export default {
|
|
|
279
285
|
/** @description Get first item (description, series, parameter name or value) with the selected langId */
|
|
280
286
|
getLangData,
|
|
281
287
|
/** @description Modifies product response by removing all parameter names nad values that are not in selected langId */
|
|
282
|
-
clearParametersLangData
|
|
288
|
+
clearParametersLangData,
|
|
289
|
+
/** @description Removes attachments to RMA that are returned by default, helps to reduce data if serialized or forwarded */
|
|
290
|
+
removeRmaAttachments
|
|
283
291
|
};
|