idosell 0.1.6 → 0.1.8
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/dist/gates.def.js +95 -53
- package/dist/gates.js +10 -8
- package/dist/helpers.js +30 -0
- package/dist/methods/getPackages.js +6 -0
- package/dist/methods/getProductsDeliveryTime.js +5 -0
- package/dist/methods/getProductsMarketingZones.js +10 -0
- package/dist/methods/getProductsOmnibusPrices.js +9 -0
- package/dist/methods/getProductsStrikethroughPrices.js +10 -0
- package/dist/methods/postProducts.js +6 -0
- package/dist/methods/postReturns.js +11 -0
- package/dist/methods/putProducts.js +5 -4
- package/dist/params.js +3 -1
- package/dist/request.js +1 -1
- package/package.json +1 -1
- package/tests/getClients.test.js +2 -2
- package/tests/getPackages.test.js +17 -0
- package/tests/getProductsDeliveryTime.test.js +17 -0
- package/tests/getProductsMarketingZones.test.js +17 -0
- package/tests/getProductsOmnibusPrices.test.js +17 -0
- package/tests/getProductsStrikethroughPrices.test.js +17 -0
- package/tests/postProducts.test.js +10 -0
- package/tests/postReturns.test.js +12 -0
- package/tests/putProducts.test.js +6 -1
- package/tests/url.test.js +2 -2
- package/dist/methods/putProducts copy.js +0 -20
package/dist/gates.def.js
CHANGED
|
@@ -1434,6 +1434,9 @@
|
|
|
1434
1434
|
* @property {(deliveryPackageNumbers: Array<String>) => GetPackagesRequest} deliveryPackageNumbers Consignments numbers.
|
|
1435
1435
|
* @property {(events: Array<Object>) => GetPackagesRequest} events Element, package is assigned to
|
|
1436
1436
|
* @property {(returnLabels: Boolean) => GetPackagesRequest} returnLabels Return parcel labels.
|
|
1437
|
+
* @property {(orderSerialNumbers: Array<Integer>) => GetPackagesRequest} orders Set type to orders with given order serial numbers
|
|
1438
|
+
* @property {(rmaIds: Array<Integer>) => GetPackagesRequest} rma Set type to rma with given rma Ids
|
|
1439
|
+
* @property {(returnIds: Array<Integer>) => GetPackagesRequest} returns Set type to returns with given return Ids
|
|
1437
1440
|
* @property {function} exec Excecute request
|
|
1438
1441
|
*/
|
|
1439
1442
|
|
|
@@ -1581,6 +1584,30 @@
|
|
|
1581
1584
|
* @property {function} exec Excecute request
|
|
1582
1585
|
*/
|
|
1583
1586
|
|
|
1587
|
+
/**
|
|
1588
|
+
* @typedef {Object} GetProductsBrandsFilterRequest
|
|
1589
|
+
* @property {(shopId: Integer) => GetProductsBrandsFilterRequest} shopId Shop Id
|
|
1590
|
+
* @property {(languageId: String) => GetProductsBrandsFilterRequest} languageId Language ID (code in ISO 639-2).
|
|
1591
|
+
* @property {(producerId: Integer) => GetProductsBrandsFilterRequest} producerId Brand ID
|
|
1592
|
+
* @property {function} exec Excecute request
|
|
1593
|
+
*/
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* @typedef {Object} PutProductsBrandsFilterRequest
|
|
1597
|
+
* @property {(shopId: Integer) => PutProductsBrandsFilterRequest} shopId Shop Id
|
|
1598
|
+
* @property {(languageId: String) => PutProductsBrandsFilterRequest} languageId Language ID (code in ISO 639-2).
|
|
1599
|
+
* @property {(producerId: Integer) => PutProductsBrandsFilterRequest} producerId Brand ID
|
|
1600
|
+
* @property {(filterForNodeIsDefault: 'y'|'n') => PutProductsBrandsFilterRequest} filterForNodeIsDefault
|
|
1601
|
+
* @property {(filtersActive: Array<Object>) => PutProductsBrandsFilterRequest} filtersActive Active filters.
|
|
1602
|
+
* @property {(filterId: String) => PutProductsBrandsFilterRequest} filterId Menu filter ID.
|
|
1603
|
+
* @property {(filterName: String) => PutProductsBrandsFilterRequest} filterName Filter name on page.
|
|
1604
|
+
* @property {(filterDisplay: 'name'|'gfx'|'namegfx') => PutProductsBrandsFilterRequest} filterDisplay Display as: "name" - text, "gfx" - graphics, "namegfx" - text and graphics.
|
|
1605
|
+
* @property {(filterValueSort: 'y'|'n'|'priority') => PutProductsBrandsFilterRequest} filterValueSort Sort by: "y" - alfabetically, "n" - by frequency and order of occurrence of indicated parameter value in found products, "priority" - according to value sequence in parameter.
|
|
1606
|
+
* @property {(filterDefaultEnabled: 'y'|'n') => PutProductsBrandsFilterRequest} filterDefaultEnabled Enabled by default .
|
|
1607
|
+
* @property {function} append Append current data to array and start modifying next row
|
|
1608
|
+
* @property {function} exec Excecute request
|
|
1609
|
+
*/
|
|
1610
|
+
|
|
1584
1611
|
/**
|
|
1585
1612
|
* @typedef {Object} GetProductsBrandsRequest
|
|
1586
1613
|
* @property {(results_page: Integer) => GetProductsBrandsRequest} results_page Result page number.
|
|
@@ -1610,30 +1637,6 @@
|
|
|
1610
1637
|
* @property {function} exec Excecute request
|
|
1611
1638
|
*/
|
|
1612
1639
|
|
|
1613
|
-
/**
|
|
1614
|
-
* @typedef {Object} GetProductsBrandsFilterRequest
|
|
1615
|
-
* @property {(shopId: Integer) => GetProductsBrandsFilterRequest} shopId Shop Id
|
|
1616
|
-
* @property {(languageId: String) => GetProductsBrandsFilterRequest} languageId Language ID (code in ISO 639-2).
|
|
1617
|
-
* @property {(producerId: Integer) => GetProductsBrandsFilterRequest} producerId Brand ID
|
|
1618
|
-
* @property {function} exec Excecute request
|
|
1619
|
-
*/
|
|
1620
|
-
|
|
1621
|
-
/**
|
|
1622
|
-
* @typedef {Object} PutProductsBrandsFilterRequest
|
|
1623
|
-
* @property {(shopId: Integer) => PutProductsBrandsFilterRequest} shopId Shop Id
|
|
1624
|
-
* @property {(languageId: String) => PutProductsBrandsFilterRequest} languageId Language ID (code in ISO 639-2).
|
|
1625
|
-
* @property {(producerId: Integer) => PutProductsBrandsFilterRequest} producerId Brand ID
|
|
1626
|
-
* @property {(filterForNodeIsDefault: 'y'|'n') => PutProductsBrandsFilterRequest} filterForNodeIsDefault
|
|
1627
|
-
* @property {(filtersActive: Array<Object>) => PutProductsBrandsFilterRequest} filtersActive Active filters.
|
|
1628
|
-
* @property {(filterId: String) => PutProductsBrandsFilterRequest} filterId Menu filter ID.
|
|
1629
|
-
* @property {(filterName: String) => PutProductsBrandsFilterRequest} filterName Filter name on page.
|
|
1630
|
-
* @property {(filterDisplay: 'name'|'gfx'|'namegfx') => PutProductsBrandsFilterRequest} filterDisplay Display as: "name" - text, "gfx" - graphics, "namegfx" - text and graphics.
|
|
1631
|
-
* @property {(filterValueSort: 'y'|'n'|'priority') => PutProductsBrandsFilterRequest} filterValueSort Sort by: "y" - alfabetically, "n" - by frequency and order of occurrence of indicated parameter value in found products, "priority" - according to value sequence in parameter.
|
|
1632
|
-
* @property {(filterDefaultEnabled: 'y'|'n') => PutProductsBrandsFilterRequest} filterDefaultEnabled Enabled by default .
|
|
1633
|
-
* @property {function} append Append current data to array and start modifying next row
|
|
1634
|
-
* @property {function} exec Excecute request
|
|
1635
|
-
*/
|
|
1636
|
-
|
|
1637
1640
|
/**
|
|
1638
1641
|
* @typedef {Object} PostProductsBundlesRequest
|
|
1639
1642
|
* @property {(params: Array<Object>) => PostProductsBundlesRequest} params Parameters transmitted to method
|
|
@@ -1774,6 +1777,12 @@
|
|
|
1774
1777
|
* @typedef {Object} GetProductsDeliveryTimeRequest
|
|
1775
1778
|
* @property {(stockId: Integer) => GetProductsDeliveryTimeRequest} stockId Stock ID
|
|
1776
1779
|
* @property {(isCollectionInPerson: Boolean) => GetProductsDeliveryTimeRequest} isCollectionInPerson Should products be prepared for personal collection?
|
|
1780
|
+
* @property {(products: Array<Object>) => GetProductsDeliveryTimeRequest} products
|
|
1781
|
+
* @property {(productId: Integer) => GetProductsDeliveryTimeRequest} productId Product Id
|
|
1782
|
+
* @property {(sizeId: Integer) => GetProductsDeliveryTimeRequest} sizeId Size identifier
|
|
1783
|
+
* @property {(sizePanelName: String) => GetProductsDeliveryTimeRequest} sizePanelName Size name
|
|
1784
|
+
* @property {(productIndex: String) => GetProductsDeliveryTimeRequest} productIndex Product IAI code
|
|
1785
|
+
* @property {(productSizeQuantity: Integer) => GetProductsDeliveryTimeRequest} productSizeQuantity Product quantity.
|
|
1777
1786
|
* @property {function} exec Excecute request
|
|
1778
1787
|
*/
|
|
1779
1788
|
|
|
@@ -1917,6 +1926,7 @@
|
|
|
1917
1926
|
/**
|
|
1918
1927
|
* @typedef {Object} GetProductsMarketingZonesRequest
|
|
1919
1928
|
* @property {(products: Array<Object>) => GetProductsMarketingZonesRequest} products Products list.
|
|
1929
|
+
* @property {(productId: Integer, sizeId: Integer|String, type: 'id'|'index'|'codeExtern'|'codeProducer') => GetProductsStrikethroughPricesRequest} productId Set product and size identifiers
|
|
1920
1930
|
* @property {function} exec Excecute request
|
|
1921
1931
|
*/
|
|
1922
1932
|
|
|
@@ -1937,6 +1947,7 @@
|
|
|
1937
1947
|
/**
|
|
1938
1948
|
* @typedef {Object} GetProductsOmnibusPricesRequest
|
|
1939
1949
|
* @property {(products: Array<Object>) => GetProductsOmnibusPricesRequest} products Products list.
|
|
1950
|
+
* @property {(productId: Integer, sizeId: Integer|String, type: 'id'|'index'|'codeExtern'|'codeProducer') => GetProductsStrikethroughPricesRequest} productId Set product and size identifiers
|
|
1940
1951
|
* @property {function} exec Excecute request
|
|
1941
1952
|
*/
|
|
1942
1953
|
|
|
@@ -2041,6 +2052,7 @@
|
|
|
2041
2052
|
* @property {(item_text_ids: Array<Object>) => PutProductsParametersRequest} item_text_ids Element text ID - can be entered instead of "id". Recognized save format: "section" (without backslash), "parameter\" (parameter without assigned value).
|
|
2042
2053
|
* @property {(names: Array<Object>) => PutProductsParametersRequest} names Names of section, parameter or value.
|
|
2043
2054
|
* @property {(descriptions: Array<Object>) => PutProductsParametersRequest} descriptions Descriptions of section, parameter or value.
|
|
2055
|
+
* @property {(search_description: Array<Object>) => PutProductsParametersRequest} search_description Search descriptions of parameter value.
|
|
2044
2056
|
* @property {(card_icons: Array<Object>) => PutProductsParametersRequest} card_icons Icons of section, parameter or value to display on the product card.
|
|
2045
2057
|
* @property {(link_icons: Array<Object>) => PutProductsParametersRequest} link_icons Icons of section, parameter or value to display on the list of products.
|
|
2046
2058
|
* @property {(context_id: String) => PutProductsParametersRequest} context_id 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_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.
|
|
@@ -2225,6 +2237,9 @@
|
|
|
2225
2237
|
* @property {(minQuantityPerOrder: Object) => PostProductsRequest} minQuantityPerOrder Minimal number of products in an order
|
|
2226
2238
|
* @property {(productDimensions: Object) => PostProductsRequest} productDimensions Dimensions and overall weight
|
|
2227
2239
|
* @property {function} append Append current data to array and start modifying next row
|
|
2240
|
+
* @property {(text: String, type: "name"|"short"|"long"|"metatitle"|"metadescription"|"metakeywords"|"acutionname"|"auctiondescription", language: String, shopId: Integer) => PostProductsRequest} setText Set various types of names or descriptions to the product
|
|
2241
|
+
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'strikethroughRetail'|'strikethroughWholesale'|'suggested'|'automaticCalculation') => PostProductsRequest} addPrice Increases product price by amount
|
|
2242
|
+
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'strikethroughRetail'|'strikethroughWholesale'|'suggested'|'automaticCalculation') => PostProductsRequest} setPrice Sets product price by amount
|
|
2228
2243
|
* @property {function} exec Excecute request
|
|
2229
2244
|
*/
|
|
2230
2245
|
|
|
@@ -2366,9 +2381,10 @@
|
|
|
2366
2381
|
* @property {(text: String, type: "name"|"short"|"long"|"metatitle"|"metadescription"|"metakeywords"|"acutionname"|"auctiondescription", language: String, shopId: Integer) => PutProductsRequest} setText Set various types of names or descriptions to the product
|
|
2367
2382
|
* @property {() => PutProductsRequest} editMode Set edit mode - disables adding new product
|
|
2368
2383
|
* @property {() => PutProductsRequest} addMode Set add mode - Api is allowed to create new products
|
|
2369
|
-
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'
|
|
2370
|
-
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'
|
|
2384
|
+
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'strikethroughRetail'|'strikethroughWholesale'|'suggested'|'automaticCalculation') => PutProductsRequest} addPrice Increases product price by amount
|
|
2385
|
+
* @property {(value: Float, type: 'retail'|'wholesale'|'pos'|'minimal'|'strikethroughRetail'|'strikethroughWholesale'|'suggested'|'automaticCalculation') => PutProductsRequest} setPrice Sets product price by amount
|
|
2371
2386
|
* @property {(shopId: Integer, menuIds: Integer) => PutProductsRequest} setMenu Sets product selected IDs
|
|
2387
|
+
* @property {(picturesArray: Array<String>) => PutProductsRequest} pictures Sets list of pictures attached to product
|
|
2372
2388
|
* @property {function} exec Excecute request
|
|
2373
2389
|
*/
|
|
2374
2390
|
|
|
@@ -2458,29 +2474,6 @@
|
|
|
2458
2474
|
* @property {function} exec Excecute request
|
|
2459
2475
|
*/
|
|
2460
2476
|
|
|
2461
|
-
/**
|
|
2462
|
-
* @typedef {Object} GetProductsSeriesRequest
|
|
2463
|
-
* @property {(return_last_changed_time: String) => GetProductsSeriesRequest} return_last_changed_time With "y" value it returns the last series modification date in YYYY-MM-DD HH:MM:SS format.
|
|
2464
|
-
* @property {(ids: Array<Integer>) => GetProductsSeriesRequest} ids IDs
|
|
2465
|
-
* @property {(names: Array<String>) => GetProductsSeriesRequest} names Names
|
|
2466
|
-
* @property {(languagesIds: Array<String>) => GetProductsSeriesRequest} languagesIds List of languages
|
|
2467
|
-
* @property {(resultsPage: Integer) => GetProductsSeriesRequest} resultsPage Page with results number. Numeration starts from 0
|
|
2468
|
-
* @property {(resultsLimit: Integer) => GetProductsSeriesRequest} resultsLimit Number of results on page. Value from 1 to 100
|
|
2469
|
-
* @property {(page: Integer, limit: Integer) => GetProductsSeriesRequest} page Define page number and maximum results per page
|
|
2470
|
-
* @property {() => Integer} count Returns total numer of results
|
|
2471
|
-
* @property {function} exec Excecute request
|
|
2472
|
-
*/
|
|
2473
|
-
|
|
2474
|
-
/**
|
|
2475
|
-
* @typedef {Object} PutProductsSeriesRequest
|
|
2476
|
-
* @property {(series: Array<Object>) => PutProductsSeriesRequest} series Series list.
|
|
2477
|
-
* @property {(id: Integer) => PutProductsSeriesRequest} id Id
|
|
2478
|
-
* @property {(nameInPanel: String) => PutProductsSeriesRequest} nameInPanel Name in panel
|
|
2479
|
-
* @property {(shopsConfigurations: Array<Object>) => PutProductsSeriesRequest} shopsConfigurations
|
|
2480
|
-
* @property {function} append Append current data to array and start modifying next row
|
|
2481
|
-
* @property {function} exec Excecute request
|
|
2482
|
-
*/
|
|
2483
|
-
|
|
2484
2477
|
/**
|
|
2485
2478
|
* @typedef {Object} GetProductsSeriesFilterRequest
|
|
2486
2479
|
* @property {(shopId: Integer) => GetProductsSeriesFilterRequest} shopId Shop Id
|
|
@@ -2505,6 +2498,29 @@
|
|
|
2505
2498
|
* @property {function} exec Excecute request
|
|
2506
2499
|
*/
|
|
2507
2500
|
|
|
2501
|
+
/**
|
|
2502
|
+
* @typedef {Object} GetProductsSeriesRequest
|
|
2503
|
+
* @property {(return_last_changed_time: String) => GetProductsSeriesRequest} return_last_changed_time With "y" value it returns the last series modification date in YYYY-MM-DD HH:MM:SS format.
|
|
2504
|
+
* @property {(ids: Array<Integer>) => GetProductsSeriesRequest} ids IDs
|
|
2505
|
+
* @property {(names: Array<String>) => GetProductsSeriesRequest} names Names
|
|
2506
|
+
* @property {(languagesIds: Array<String>) => GetProductsSeriesRequest} languagesIds List of languages
|
|
2507
|
+
* @property {(resultsPage: Integer) => GetProductsSeriesRequest} resultsPage Page with results number. Numeration starts from 0
|
|
2508
|
+
* @property {(resultsLimit: Integer) => GetProductsSeriesRequest} resultsLimit Number of results on page. Value from 1 to 100
|
|
2509
|
+
* @property {(page: Integer, limit: Integer) => GetProductsSeriesRequest} page Define page number and maximum results per page
|
|
2510
|
+
* @property {() => Integer} count Returns total numer of results
|
|
2511
|
+
* @property {function} exec Excecute request
|
|
2512
|
+
*/
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* @typedef {Object} PutProductsSeriesRequest
|
|
2516
|
+
* @property {(series: Array<Object>) => PutProductsSeriesRequest} series Series list.
|
|
2517
|
+
* @property {(id: Integer) => PutProductsSeriesRequest} id Id
|
|
2518
|
+
* @property {(nameInPanel: String) => PutProductsSeriesRequest} nameInPanel Name in panel
|
|
2519
|
+
* @property {(shopsConfigurations: Array<Object>) => PutProductsSeriesRequest} shopsConfigurations
|
|
2520
|
+
* @property {function} append Append current data to array and start modifying next row
|
|
2521
|
+
* @property {function} exec Excecute request
|
|
2522
|
+
*/
|
|
2523
|
+
|
|
2508
2524
|
/**
|
|
2509
2525
|
* @typedef {Object} DeleteProductsSizesRequest
|
|
2510
2526
|
* @property {(mode: 'delete_by_size'|'delete_all') => DeleteProductsSizesRequest} mode Edition mode
|
|
@@ -2570,6 +2586,7 @@
|
|
|
2570
2586
|
/**
|
|
2571
2587
|
* @typedef {Object} GetProductsStrikethroughPricesRequest
|
|
2572
2588
|
* @property {(products: Array<Object>) => GetProductsStrikethroughPricesRequest} products Products list.
|
|
2589
|
+
* @property {(productId: Integer, sizeId: Integer|String, type: 'id'|'index'|'codeExtern'|'codeProducer') => GetProductsStrikethroughPricesRequest} productId Set product and size identifiers
|
|
2573
2590
|
* @property {function} exec Excecute request
|
|
2574
2591
|
*/
|
|
2575
2592
|
|
|
@@ -2717,6 +2734,30 @@
|
|
|
2717
2734
|
* @property {function} exec Excecute request
|
|
2718
2735
|
*/
|
|
2719
2736
|
|
|
2737
|
+
/**
|
|
2738
|
+
* @typedef {Object} PostReturnsRequest
|
|
2739
|
+
* @property {(order_sn: Integer) => PostReturnsRequest} order_sn Order serial number
|
|
2740
|
+
* @property {(stock_id: Integer) => PostReturnsRequest} stock_id
|
|
2741
|
+
* @property {(products: Array<Object>) => PostReturnsRequest} products Products list.
|
|
2742
|
+
* @property {(status: Integer) => PostReturnsRequest} status
|
|
2743
|
+
* @property {(client_received: Boolean) => PostReturnsRequest} client_received
|
|
2744
|
+
* @property {(change_status: Boolean) => PostReturnsRequest} change_status
|
|
2745
|
+
* @property {(courier_id: Integer) => PostReturnsRequest} courier_id
|
|
2746
|
+
* @property {(return_operator: String) => PostReturnsRequest} return_operator
|
|
2747
|
+
* @property {(tryCorrectInvoice: Boolean) => PostReturnsRequest} tryCorrectInvoice
|
|
2748
|
+
* @property {(include_shipping_cost: String) => PostReturnsRequest} include_shipping_cost
|
|
2749
|
+
* @property {(additional_payment_cost: String) => PostReturnsRequest} additional_payment_cost
|
|
2750
|
+
* @property {(emptyReturn: 'n'|'y') => PostReturnsRequest} emptyReturn
|
|
2751
|
+
* @property {(id: Integer) => PostReturnsRequest} id
|
|
2752
|
+
* @property {(size: String) => PostReturnsRequest} size
|
|
2753
|
+
* @property {(quantity: Number) => PostReturnsRequest} quantity
|
|
2754
|
+
* @property {(price: Number) => PostReturnsRequest} price Price.
|
|
2755
|
+
* @property {(serialNumbers: Array<String>) => PostReturnsRequest} serialNumbers
|
|
2756
|
+
* @property {(productOrderAdditional: String) => PostReturnsRequest} productOrderAdditional Additional information.
|
|
2757
|
+
* @property {function} append Append current data to array and start modifying next row
|
|
2758
|
+
* @property {function} exec Excecute request
|
|
2759
|
+
*/
|
|
2760
|
+
|
|
2720
2761
|
/**
|
|
2721
2762
|
* @typedef {Object} PutReturnsRequest
|
|
2722
2763
|
* @property {(returns: Array<Object>) => PutReturnsRequest} returns
|
|
@@ -3399,11 +3440,11 @@
|
|
|
3399
3440
|
* @property {PutProductsAttachmentsRequest} putProductsAttachments Method that enables adding and editing product attachments.
|
|
3400
3441
|
* @property {GetProductsAuctionsRequest} getProductsAuctions Allows for downloading information about auctions and auction categories to which the product has been assigned (for a maximum of 100 products in one request)
|
|
3401
3442
|
* @property {DeleteProductsBrandsRequest} deleteProductsBrands The method allows you to remove brands from the administration panel.
|
|
3443
|
+
* @property {GetProductsBrandsFilterRequest} getProductsBrandsFilter The method allows you to download a list of filters for brands (manufacturers) available in the IdoSell administration panel.
|
|
3444
|
+
* @property {PutProductsBrandsFilterRequest} putProductsBrandsFilter The method allows you to manage filter settings for brands (manufacturers).
|
|
3402
3445
|
* @property {GetProductsBrandsRequest} getProductsBrands Method that returns information about brands available in the IdoSell Shop administration panel.
|
|
3403
3446
|
* @property {PostProductsBrandsRequest} postProductsBrands The method allows you to update brands information available in the administration panel.
|
|
3404
3447
|
* @property {PutProductsBrandsRequest} putProductsBrands The method allows you to update brands information available in the administration panel.
|
|
3405
|
-
* @property {GetProductsBrandsFilterRequest} getProductsBrandsFilter The method allows you to download a list of filters for brands (manufacturers) available in the IdoSell administration panel.
|
|
3406
|
-
* @property {PutProductsBrandsFilterRequest} putProductsBrandsFilter The method allows you to manage filter settings for brands (manufacturers).
|
|
3407
3448
|
* @property {PostProductsBundlesRequest} postProductsBundles createBundle method allows to create a new product with a type: set and to assign existing products as a set components. Products added via this gate are hidden from the shop customer by default. To change the visibility of created products use the gate setProducts or set it on a product card in the shop administration panel
|
|
3408
3449
|
* @property {DeleteProductsBundlesProductsRequest} deleteProductsBundlesProducts removeProductsFromBundle method allows to remove indicated set components
|
|
3409
3450
|
* @property {PostProductsBundlesProductsRequest} postProductsBundlesProducts addProductsToBundle method allows to add components to existing sets in the administration panel
|
|
@@ -3458,10 +3499,10 @@
|
|
|
3458
3499
|
* @property {GetProductsReservationsRequest} getProductsReservations It allows to download information about product reservations in orders (for up to 100 products in one request).
|
|
3459
3500
|
* @property {PostProductsRestoreRequest} postProductsRestore The method is used to restore deleted products
|
|
3460
3501
|
* @property {DeleteProductsSeriesRequest} deleteProductsSeries Method allows you to delete a series of products available in the IdoSell administration panel.
|
|
3461
|
-
* @property {GetProductsSeriesRequest} getProductsSeries Method returns information about the product series available in the IdoSell administration panel.
|
|
3462
|
-
* @property {PutProductsSeriesRequest} putProductsSeries Method allows you to update information about product series available in the IdoSell administration panel.
|
|
3463
3502
|
* @property {GetProductsSeriesFilterRequest} getProductsSeriesFilter Method allows you to retrieve a list of filters for a series of products available in the IdoSell administration panel..
|
|
3464
3503
|
* @property {PutProductsSeriesFilterRequest} putProductsSeriesFilter The method allows you to manage the filter settings for the series..
|
|
3504
|
+
* @property {GetProductsSeriesRequest} getProductsSeries Method returns information about the product series available in the IdoSell administration panel.
|
|
3505
|
+
* @property {PutProductsSeriesRequest} putProductsSeries Method allows you to update information about product series available in the IdoSell administration panel.
|
|
3465
3506
|
* @property {DeleteProductsSizesRequest} deleteProductsSizes The method is used to remove sizes
|
|
3466
3507
|
* @property {GetProductsSizesRequest} getProductsSizes Method that returns information about product sizes configured in the administration panel
|
|
3467
3508
|
* @property {PutProductsSizesRequest} putProductsSizes This method allows you to edit the size-dependent data
|
|
@@ -3484,6 +3525,7 @@
|
|
|
3484
3525
|
* @property {GetRefundsRetrieveRefundsListRequest} getRefundsRetrieveRefundsList Method returns a list of incomplete refunds.
|
|
3485
3526
|
* @property {PutRefundsUpdateRefundRequest} putRefundsUpdateRefund Method allows you to update refund.
|
|
3486
3527
|
* @property {GetReturnsRequest} getReturns Method that enables getting information about returns issued for orders in the administration panel.
|
|
3528
|
+
* @property {PostReturnsRequest} postReturns
|
|
3487
3529
|
* @property {PutReturnsRequest} putReturns Method that enables editing returns issued for orders in the administration panel.
|
|
3488
3530
|
* @property {PutReturnsSerialNumberRequest} putReturnsSerialNumber Method that enables setting serial numbers for products included in returns issued for orders in the administration panel.
|
|
3489
3531
|
* @property {GetReturnsStatusesRequest} getReturnsStatuses Allows to download all configurable return statuses
|
package/dist/gates.js
CHANGED
|
@@ -134,11 +134,11 @@ import getProductsSKUbyBarcode from "./methods/getProductsSKUbyBarcode.js";
|
|
|
134
134
|
import putProductsAttachments from "./methods/putProductsAttachments.js";
|
|
135
135
|
import getProductsAuctions from "./methods/getProductsAuctions.js";
|
|
136
136
|
import deleteProductsBrands from "./methods/deleteProductsBrands.js";
|
|
137
|
+
import getProductsBrandsFilter from "./methods/getProductsBrandsFilter.js";
|
|
138
|
+
import putProductsBrandsFilter from "./methods/putProductsBrandsFilter.js";
|
|
137
139
|
import getProductsBrands from "./methods/getProductsBrands.js";
|
|
138
140
|
import postProductsBrands from "./methods/postProductsBrands.js";
|
|
139
141
|
import putProductsBrands from "./methods/putProductsBrands.js";
|
|
140
|
-
import getProductsBrandsFilter from "./methods/getProductsBrandsFilter.js";
|
|
141
|
-
import putProductsBrandsFilter from "./methods/putProductsBrandsFilter.js";
|
|
142
142
|
import postProductsBundles from "./methods/postProductsBundles.js";
|
|
143
143
|
import deleteProductsBundlesProducts from "./methods/deleteProductsBundlesProducts.js";
|
|
144
144
|
import postProductsBundlesProducts from "./methods/postProductsBundlesProducts.js";
|
|
@@ -193,10 +193,10 @@ import putProductsQuestions from "./methods/putProductsQuestions.js";
|
|
|
193
193
|
import getProductsReservations from "./methods/getProductsReservations.js";
|
|
194
194
|
import postProductsRestore from "./methods/postProductsRestore.js";
|
|
195
195
|
import deleteProductsSeries from "./methods/deleteProductsSeries.js";
|
|
196
|
-
import getProductsSeries from "./methods/getProductsSeries.js";
|
|
197
|
-
import putProductsSeries from "./methods/putProductsSeries.js";
|
|
198
196
|
import getProductsSeriesFilter from "./methods/getProductsSeriesFilter.js";
|
|
199
197
|
import putProductsSeriesFilter from "./methods/putProductsSeriesFilter.js";
|
|
198
|
+
import getProductsSeries from "./methods/getProductsSeries.js";
|
|
199
|
+
import putProductsSeries from "./methods/putProductsSeries.js";
|
|
200
200
|
import deleteProductsSizes from "./methods/deleteProductsSizes.js";
|
|
201
201
|
import getProductsSizes from "./methods/getProductsSizes.js";
|
|
202
202
|
import putProductsSizes from "./methods/putProductsSizes.js";
|
|
@@ -219,6 +219,7 @@ import getRefundsGetRefundStatus from "./methods/getRefundsGetRefundStatus.js";
|
|
|
219
219
|
import getRefundsRetrieveRefundsList from "./methods/getRefundsRetrieveRefundsList.js";
|
|
220
220
|
import putRefundsUpdateRefund from "./methods/putRefundsUpdateRefund.js";
|
|
221
221
|
import getReturns from "./methods/getReturns.js";
|
|
222
|
+
import postReturns from "./methods/postReturns.js";
|
|
222
223
|
import putReturns from "./methods/putReturns.js";
|
|
223
224
|
import putReturnsSerialNumber from "./methods/putReturnsSerialNumber.js";
|
|
224
225
|
import getReturnsStatuses from "./methods/getReturnsStatuses.js";
|
|
@@ -409,11 +410,11 @@ const gates = {
|
|
|
409
410
|
putProductsAttachments,
|
|
410
411
|
getProductsAuctions,
|
|
411
412
|
deleteProductsBrands,
|
|
413
|
+
getProductsBrandsFilter,
|
|
414
|
+
putProductsBrandsFilter,
|
|
412
415
|
getProductsBrands,
|
|
413
416
|
postProductsBrands,
|
|
414
417
|
putProductsBrands,
|
|
415
|
-
getProductsBrandsFilter,
|
|
416
|
-
putProductsBrandsFilter,
|
|
417
418
|
postProductsBundles,
|
|
418
419
|
deleteProductsBundlesProducts,
|
|
419
420
|
postProductsBundlesProducts,
|
|
@@ -468,10 +469,10 @@ const gates = {
|
|
|
468
469
|
getProductsReservations,
|
|
469
470
|
postProductsRestore,
|
|
470
471
|
deleteProductsSeries,
|
|
471
|
-
getProductsSeries,
|
|
472
|
-
putProductsSeries,
|
|
473
472
|
getProductsSeriesFilter,
|
|
474
473
|
putProductsSeriesFilter,
|
|
474
|
+
getProductsSeries,
|
|
475
|
+
putProductsSeries,
|
|
475
476
|
deleteProductsSizes,
|
|
476
477
|
getProductsSizes,
|
|
477
478
|
putProductsSizes,
|
|
@@ -494,6 +495,7 @@ const gates = {
|
|
|
494
495
|
getRefundsRetrieveRefundsList,
|
|
495
496
|
putRefundsUpdateRefund,
|
|
496
497
|
getReturns,
|
|
498
|
+
postReturns,
|
|
497
499
|
putReturns,
|
|
498
500
|
putReturnsSerialNumber,
|
|
499
501
|
getReturnsStatuses,
|
package/dist/helpers.js
CHANGED
|
@@ -142,6 +142,36 @@ export const orderSource = (sourceName) => (accountName = null) => {
|
|
|
142
142
|
return params;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
const PRICE_TYPES = {
|
|
146
|
+
'advance': 'Advance',
|
|
147
|
+
'retail': 'Retail',
|
|
148
|
+
'wholesale': 'Wholesale',
|
|
149
|
+
'minimal': 'Minimal',
|
|
150
|
+
'automaticalculation': 'AutomaticCalculation',
|
|
151
|
+
'pos': "Pos",
|
|
152
|
+
'suggested': 'Suggested',
|
|
153
|
+
'strikethroughretail': 'StrikethroughRetail',
|
|
154
|
+
'strikethroughwholesale': 'StrikethroughWholesale'
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const modifyPrice = (value, type, net, priceChangeMode = 'amount_set') => {
|
|
158
|
+
const typeName = PRICE_TYPES[type.toLowerCase()];
|
|
159
|
+
if (!typeName) throw new Error(`Invalid price type: ${type}. Availible types: ${Object.values(PRICE_TYPES)}`);
|
|
160
|
+
const node = ["product", typeName, "Price"];
|
|
161
|
+
if (net) node.push("Net");
|
|
162
|
+
const params = { priceChangeMode }
|
|
163
|
+
params[node.join('')] = value;
|
|
164
|
+
return params;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const getProductIdent = (productId, sizeId, type = 'id') => {
|
|
168
|
+
const params = { ident: { type, value: productId }};
|
|
169
|
+
if (sizeId) {
|
|
170
|
+
params.sizes = [{ ident: { type, value: sizeId }}]
|
|
171
|
+
}
|
|
172
|
+
return params;
|
|
173
|
+
}
|
|
174
|
+
|
|
145
175
|
const TEXT_NODES = {
|
|
146
176
|
name: {
|
|
147
177
|
main: 'productNames',
|
|
@@ -2,6 +2,12 @@ import { paramsProxy } from "../params.js";
|
|
|
2
2
|
|
|
3
3
|
export default (object) => {
|
|
4
4
|
object.gate = { method: 'get', node: '/packages/packages' };
|
|
5
|
+
object.auth.version = 1;
|
|
6
|
+
object.custom = {
|
|
7
|
+
orders: (orderSerialNumbers) => ({ eventType: "order", eventsIds: Array.isArray(orderSerialNumbers) ? orderSerialNumbers : [orderSerialNumbers] }),
|
|
8
|
+
rma: (rmaIds) => ({ eventType: "rma", eventsIds: Array.isArray(rmaIds) ? rmaIds : [rmaIds] }),
|
|
9
|
+
returns: (returnIds) => ({ eventType: "return", eventsIds: Array.isArray(returnIds) ? returnIds : [returnIds] })
|
|
10
|
+
};
|
|
5
11
|
object.appendable = {
|
|
6
12
|
except: ["deliveryPackageNumbers","returnLabels"],
|
|
7
13
|
arrayNode: "events",
|
|
@@ -2,5 +2,10 @@ import { paramsProxy } from "../params.js";
|
|
|
2
2
|
|
|
3
3
|
export default (object) => {
|
|
4
4
|
object.gate = { method: 'get', node: '/products/deliveryTime' };
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: [],
|
|
7
|
+
arrayNode: "products",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
5
10
|
return new Proxy(object, paramsProxy);
|
|
6
11
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { paramsProxy } from "../params.js";
|
|
2
|
+
import { getProductIdent } from "../helpers.js";
|
|
2
3
|
|
|
3
4
|
export default (object) => {
|
|
4
5
|
object.gate = { method: 'get', node: '/products/marketingZones' };
|
|
6
|
+
object.auth.version = 1;
|
|
7
|
+
object.custom = {
|
|
8
|
+
productId: getProductIdent
|
|
9
|
+
};
|
|
10
|
+
object.appendable = {
|
|
11
|
+
except: [],
|
|
12
|
+
arrayNode: "products",
|
|
13
|
+
index: 0
|
|
14
|
+
}
|
|
5
15
|
return new Proxy(object, paramsProxy);
|
|
6
16
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { paramsProxy } from "../params.js";
|
|
2
|
+
import { getProductIdent } from "../helpers.js";
|
|
2
3
|
|
|
3
4
|
export default (object) => {
|
|
4
5
|
object.gate = { method: 'get', node: '/products/omnibusPrices' };
|
|
6
|
+
object.custom = {
|
|
7
|
+
productId: getProductIdent
|
|
8
|
+
};
|
|
9
|
+
object.appendable = {
|
|
10
|
+
except: [],
|
|
11
|
+
arrayNode: "products",
|
|
12
|
+
index: 0
|
|
13
|
+
}
|
|
5
14
|
return new Proxy(object, paramsProxy);
|
|
6
15
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { paramsProxy } from "../params.js";
|
|
2
|
+
import { getProductIdent } from "../helpers.js";
|
|
2
3
|
|
|
3
4
|
export default (object) => {
|
|
4
5
|
object.gate = { method: 'get', node: '/products/strikethroughPrices' };
|
|
6
|
+
object.auth.version = 1;
|
|
7
|
+
object.custom = {
|
|
8
|
+
productId: getProductIdent
|
|
9
|
+
};
|
|
10
|
+
object.appendable = {
|
|
11
|
+
except: [],
|
|
12
|
+
arrayNode: "products",
|
|
13
|
+
index: 0
|
|
14
|
+
}
|
|
5
15
|
return new Proxy(object, paramsProxy);
|
|
6
16
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { paramsProxy } from "../params.js";
|
|
2
|
+
import { setProductText, modifyPrice } from "../helpers.js";
|
|
2
3
|
|
|
3
4
|
export default (object) => {
|
|
4
5
|
object.gate = { method: 'post', node: '/products/products' };
|
|
6
|
+
object.custom = {
|
|
7
|
+
setText: setProductText(object),
|
|
8
|
+
addPrice: (value, type = "retail", net = false) => modifyPrice(value, type, net, "amount_diff"),
|
|
9
|
+
setPrice: (value, type = "retail", net = false) => modifyPrice(value, type, net, "amount_set")
|
|
10
|
+
};
|
|
5
11
|
object.appendable = {
|
|
6
12
|
except: ["settings","picturesSettings"],
|
|
7
13
|
arrayNode: "products",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { paramsProxy } from "../params.js";
|
|
2
|
+
|
|
3
|
+
export default (object) => {
|
|
4
|
+
object.gate = { method: 'post', node: '/returns/returns' };
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: ["order_sn","stock_id","status","client_received","change_status","courier_id","return_operator","tryCorrectInvoice","include_shipping_cost","additional_payment_cost","emptyReturn"],
|
|
7
|
+
arrayNode: "products",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
10
|
+
return new Proxy(object, paramsProxy);
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { paramsProxy } from "../params.js";
|
|
2
|
-
import { setProductText, getCurrentAppendableArray } from "../helpers.js";
|
|
2
|
+
import { setProductText, getCurrentAppendableArray, modifyPrice, arrayOfObjects } from "../helpers.js";
|
|
3
3
|
|
|
4
4
|
export default (object) => {
|
|
5
5
|
object.gate = { method: 'put', node: '/products/products' };
|
|
@@ -7,9 +7,10 @@ export default (object) => {
|
|
|
7
7
|
setText: setProductText(object),
|
|
8
8
|
editMode: () => { const settings = object.params.settings ?? {}; settings.settingModificationType = "edit"; return { settings } },
|
|
9
9
|
addMode: () => { const settings = object.params.settings ?? {}; settings.settingModificationType = "edit"; return { settings } },
|
|
10
|
-
addPrice: (value, type = "retail", net = false) =>
|
|
11
|
-
setPrice: (value, type = "retail", net = false) =>
|
|
12
|
-
setMenu: (shopId, menuIds) => { if (!Array.isArray(menuIds)) menuIds = [menuIds]; const productMenuItems = getCurrentAppendableArray(object, "productMenuItems"); for (const menuItemId of menuIds) { productMenuItems.push({ productMenuOperation: "add_product", shopId, menuItemId }) } return { productMenuItems}; }
|
|
10
|
+
addPrice: (value, type = "retail", net = false) => modifyPrice(value, type, net, "amount_diff"),
|
|
11
|
+
setPrice: (value, type = "retail", net = false) => modifyPrice(value, type, net, "amount_set"),
|
|
12
|
+
setMenu: (shopId, menuIds) => { if (!Array.isArray(menuIds)) menuIds = [menuIds]; const productMenuItems = getCurrentAppendableArray(object, "productMenuItems"); for (const menuItemId of menuIds) { productMenuItems.push({ productMenuOperation: "add_product", shopId, menuItemId }) } return { productMenuItems}; },
|
|
13
|
+
pictures: (picturesArray) => { if (picturesArray.length) { if (!object.params.picturesSettings) object.params.picturesSettings = {}; object.params.picturesSettings.picturesSettingInputType = picturesArray[0].indexOf("http") === 0 ? "url" : "base64" }; return arrayOfObjects("productPictures", "productPictureSource")(picturesArray)}
|
|
13
14
|
};
|
|
14
15
|
object.appendable = {
|
|
15
16
|
except: ["settings","picturesSettings","editMode","addMode"],
|
package/dist/params.js
CHANGED
|
@@ -35,7 +35,9 @@ export const paramsProxy = {
|
|
|
35
35
|
const param = object.custom[property](...values);
|
|
36
36
|
Object.assign(object.params, param);
|
|
37
37
|
}
|
|
38
|
-
else
|
|
38
|
+
else if (property === 'params') {
|
|
39
|
+
object.params = params;
|
|
40
|
+
} else object.params[property] = values[0];
|
|
39
41
|
return new Proxy(object, paramsProxy);
|
|
40
42
|
}
|
|
41
43
|
}
|
package/dist/request.js
CHANGED
|
@@ -57,9 +57,9 @@ export const sendRequest = async (request, options = {}) => {
|
|
|
57
57
|
let url = `${request.auth.url}/api/admin/v${request.auth.version}${node}`;
|
|
58
58
|
if (options.log || options.dump) {
|
|
59
59
|
console.log(util.inspect({ params: request.params, method, url }, {showHidden: false, depth: null, colors: true}))
|
|
60
|
+
if (options.dump) return;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
if (options.dump) return;
|
|
63
63
|
|
|
64
64
|
if (method === 'get') {
|
|
65
65
|
url += '?' + queryfy(request.params);
|
package/package.json
CHANGED
package/tests/getClients.test.js
CHANGED
|
@@ -11,8 +11,8 @@ test("getClientsClientHasTradeCredit", () => {
|
|
|
11
11
|
expect(params).toEqual({"clientHasTradeCredit":"nonzero"});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().getClients.
|
|
14
|
+
test("getClientsLastPurchased", () => {
|
|
15
|
+
const params = idosell().getClients.lastPurchased("2023-01-01", 1672704000000).getParams();
|
|
16
16
|
expect(params).toEqual({"clientLastPurchaseDate":{"clientLastPurchaseDateBegin":"2023-01-01","clientLastPurchaseDateEnd":"2023-01-03"}});
|
|
17
17
|
})
|
|
18
18
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getPackagesOrders", () => {
|
|
5
|
+
const params = idosell().getPackages.orders([15,16]).getParams();
|
|
6
|
+
expect(params).toEqual({"events":[{"eventType":"order","eventsIds":[15,16]}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getPackagesReturns", () => {
|
|
10
|
+
const params = idosell().getPackages.returns([2]).getParams();
|
|
11
|
+
expect(params).toEqual({"events":[{"eventType":"return","eventsIds":[2]}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getPackagesRma", () => {
|
|
15
|
+
const params = idosell().getPackages.rma([1]).getParams();
|
|
16
|
+
expect(params).toEqual({"events":[{"eventType":"rma","eventsIds":[1]}]});
|
|
17
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getProductsDeliveryTimeSizeId", () => {
|
|
5
|
+
const params = idosell().getProductsDeliveryTime.productId(15).sizeId(4).getParams();
|
|
6
|
+
expect(params).toEqual({"products":[{"productId":15,"sizeId":4}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getProductsDeliveryTimeProductSizeQuantity", () => {
|
|
10
|
+
const params = idosell().getProductsDeliveryTime.productId(15).sizeId(4).productSizeQuantity(3).getParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"productId":15,"sizeId":4,"productSizeQuantity":3}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getProductsDeliveryTimeProductIndex", () => {
|
|
15
|
+
const params = idosell().getProductsDeliveryTime.productIndex("15-4").getParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"productIndex":"15-4"}]});
|
|
17
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getProductsMarketingZonesProductOnlyId", () => {
|
|
5
|
+
const params = idosell().getProductsMarketingZones.productId(33).getParams();
|
|
6
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33}}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getProductsMarketingZonesSizeId", () => {
|
|
10
|
+
const params = idosell().getProductsMarketingZones.productId(15,4).getParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getProductsMarketingZonesProducts", () => {
|
|
15
|
+
const params = idosell().getProductsMarketingZones.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
17
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getProductsOmnibusPricesProductOnlyId", () => {
|
|
5
|
+
const params = idosell().getProductsOmnibusPrices.productId(33).getParams();
|
|
6
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33}}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getProductsOmnibusPricesProductId", () => {
|
|
10
|
+
const params = idosell().getProductsOmnibusPrices.productId(15,4).getParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getProductsOmnibusPricesProducts", () => {
|
|
15
|
+
const params = idosell().getProductsOmnibusPrices.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
17
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getProductsStrikethroughPricesProductOnlyId", () => {
|
|
5
|
+
const params = idosell().getProductsStrikethroughPrices.productId(33).getParams();
|
|
6
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33}}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getProductsStrikethroughPricesProductSizeId", () => {
|
|
10
|
+
const params = idosell().getProductsStrikethroughPrices.productId(15,4).getParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getProductsStrikethroughPricesProducts", () => {
|
|
15
|
+
const params = idosell().getProductsStrikethroughPrices.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
17
|
+
})
|
|
@@ -9,4 +9,14 @@ test("postProductsProductSizes", () => {
|
|
|
9
9
|
test("postProductsShopsMask", () => {
|
|
10
10
|
const params = idosell().postProducts.shopsMask(1).getParams();
|
|
11
11
|
expect(params).toEqual({"products":[{"shopsMask":1}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("postProductsSetPrice", () => {
|
|
15
|
+
const params = idosell().postProducts.shopsMask(1).setPrice(199).getParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"shopsMask":1,"priceChangeMode":"amount_set","productRetailPrice":199}]});
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test("postProductsSetText", () => {
|
|
20
|
+
const params = idosell().postProducts.shopsMask(1).setText("Awesome199","name").getParams();
|
|
21
|
+
expect(params).toEqual({"products":[{"shopsMask":1,"productNames":{"productNamesLangData":[{"langId":"pol","productName":"Awesome199"}]}}]});
|
|
12
22
|
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("postReturnsStock_id", () => {
|
|
5
|
+
const params = idosell().postReturns.order_sn(4).stock_id(1).getParams();
|
|
6
|
+
expect(params).toEqual({"order_sn":4,"stock_id":1});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("postReturnsQuantity", () => {
|
|
10
|
+
const params = idosell().postReturns.order_sn(4).stock_id(1).id(7).size("U").quantity(1).getParams();
|
|
11
|
+
expect(params).toEqual({"order_sn":4,"stock_id":1,"products":[{"id":7,"size":"U","quantity":1}]});
|
|
12
|
+
})
|
|
@@ -21,7 +21,7 @@ test("putProductsSetRetailPrice", () => {
|
|
|
21
21
|
expect(params).toEqual({"products":[{"productId":33,"priceChangeMode":"amount_set","productRetailPrice":219}]});
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
test("
|
|
24
|
+
test("putProductsSetWholesaleNetPrice", () => {
|
|
25
25
|
const params = idosell().putProducts.productId(33).setPrice(169, "wholesale", true).getParams();
|
|
26
26
|
expect(params).toEqual({"products":[{"productId":33,"priceChangeMode":"amount_set","productWholesalePriceNet":169}]});
|
|
27
27
|
})
|
|
@@ -29,4 +29,9 @@ test("putProductsSetWholesalePrice", () => {
|
|
|
29
29
|
test("putProductsSetMenu", () => {
|
|
30
30
|
const params = idosell().putProducts.productId(33).setMenu(1,252).getParams();
|
|
31
31
|
expect(params).toEqual({"products":[{"productId":33,"productMenuItems":[{"productMenuOperation":"add_product","shopId":1,"menuItemId":252}]}]});
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test("putProductsPictures", () => {
|
|
35
|
+
const params = idosell().putProducts.productId(77).pictures(["https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"]).getParams();
|
|
36
|
+
expect(params).toEqual({"products":[{"productId":77,"productPictures":[{"productPictureSource":"https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"}]}],"picturesSettings":{"picturesSettingInputType":"url"}});
|
|
32
37
|
})
|
package/tests/url.test.js
CHANGED
|
@@ -4,8 +4,8 @@ import { queryfy } from "../dist/request";
|
|
|
4
4
|
import idosell from "./dist/index.js"
|
|
5
5
|
import { expect, test } from "vitest"
|
|
6
6
|
|
|
7
|
-
test("
|
|
8
|
-
const params = idosell().getClients.clientsIds([123,456,789]).
|
|
7
|
+
test("getClientsLastPurchased", () => {
|
|
8
|
+
const params = idosell().getClients.clientsIds([123,456,789]).lastPurchased("2023-01-01", 1672704000000).getParams();
|
|
9
9
|
const search = queryfy(params);
|
|
10
10
|
expect(search).toEqual("clientsIds=123%2C456%2C789&clientLastPurchaseDate%5BclientLastPurchaseDateBegin%5D=2023-01-01&clientLastPurchaseDate%5BclientLastPurchaseDateEnd%5D=2023-01-03")
|
|
11
11
|
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { paramsProxy } from "../params.js";
|
|
2
|
-
import { setProductText, nestArray, getCurrentAppendableArray } from "../helpers.js";
|
|
3
|
-
|
|
4
|
-
export default (object) => {
|
|
5
|
-
object.gate = { method: 'put', node: '/products/products' };
|
|
6
|
-
object.custom = {
|
|
7
|
-
setText: setProductText(object),
|
|
8
|
-
editMode: () => { const settings = object.params.settings ?? {}; settings.settingModificationType = 'edit'; return { settings } },
|
|
9
|
-
addMode: () => { const settings = object.params.settings ?? {}; settings.settingModificationType = 'edit'; return { settings } },
|
|
10
|
-
setPrice: (value, type = 'retail', net = false) => { const node = ['product', type[0].toUpperCase() + type.substring(1).toLowerCase(), 'Price']; if (net) node.push('Net'); const params = { priceChangeMode: 'amount_set' }; params[node.join('')] = value; return params; },
|
|
11
|
-
setMenu: (shopId, menuIds) => { if (!Array.isArray(menuIds)) menuIds = [menuIds]; const productMenuItems = getCurrentAppendableArray(object, "productMenuItems"); for (const menuItemId of menuIds) { productMenuItems.push({ productMenuOperation: "add_product", shopId, menuItemId }) } return { productMenuItems}; },
|
|
12
|
-
// dimensions: (width, height, length) => ({ productDimensions: { productWidth: width, productHeight: height, productLength: length } })
|
|
13
|
-
};
|
|
14
|
-
object.appendable = {
|
|
15
|
-
except: ["settings","picturesSettings","editMode","addMode"],
|
|
16
|
-
arrayNode: "products",
|
|
17
|
-
index: 0
|
|
18
|
-
}
|
|
19
|
-
return new Proxy(object, paramsProxy);
|
|
20
|
-
}
|