idosell 0.0.1
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 +3520 -0
- package/dist/gates.js +553 -0
- package/dist/helpers.js +204 -0
- package/dist/index.js +17 -0
- package/dist/methods/deleteClientsDeliveryAddress.js +11 -0
- package/dist/methods/deleteClientsGiftcards.js +11 -0
- package/dist/methods/deleteClientsPayerAddress.js +11 -0
- package/dist/methods/deleteClientsPricelists.js +6 -0
- package/dist/methods/deleteClientsTags.js +12 -0
- package/dist/methods/deleteClientsTagsClear.js +6 -0
- package/dist/methods/deleteCouriersPickupPoints.js +11 -0
- package/dist/methods/deleteDiscountsGroups.js +6 -0
- package/dist/methods/deleteDiscountsGroupsProducts.js +6 -0
- package/dist/methods/deleteDiscountsRebatesCard.js +7 -0
- package/dist/methods/deleteDiscountsRebatesCode.js +7 -0
- package/dist/methods/deleteEntries.js +6 -0
- package/dist/methods/deleteMenu.js +12 -0
- package/dist/methods/deleteOrdersDocuments.js +11 -0
- package/dist/methods/deleteOrdersImages.js +11 -0
- package/dist/methods/deleteProducts.js +11 -0
- package/dist/methods/deleteProductsBrands.js +6 -0
- package/dist/methods/deleteProductsBundlesProducts.js +12 -0
- package/dist/methods/deleteProductsCollectionsProducts.js +12 -0
- package/dist/methods/deleteProductsImages.js +12 -0
- package/dist/methods/deleteProductsOpinions.js +6 -0
- package/dist/methods/deleteProductsOpinionsOpinions.js +6 -0
- package/dist/methods/deleteProductsParameters.js +6 -0
- package/dist/methods/deleteProductsProductsToFacebookCatalog.js +6 -0
- package/dist/methods/deleteProductsProductsToPromotion.js +6 -0
- package/dist/methods/deleteProductsSeries.js +6 -0
- package/dist/methods/deleteProductsSizes.js +12 -0
- package/dist/methods/deleteSizecharts.js +6 -0
- package/dist/methods/deleteVouchers.js +11 -0
- package/dist/methods/deleteWarranties.js +6 -0
- package/dist/methods/deleteWmsStocksdocumentsDocuments.js +6 -0
- package/dist/methods/deleteWmsStocksdocumentsProducts.js +11 -0
- package/dist/methods/deleteWmsSuppliers.js +6 -0
- package/dist/methods/deleteWmsSuppliersSuppliers.js +6 -0
- package/dist/methods/getClients.js +12 -0
- package/dist/methods/getClientsBalance.js +12 -0
- package/dist/methods/getClientsCrm.js +13 -0
- package/dist/methods/getClientsDeliveryAddress.js +6 -0
- package/dist/methods/getClientsGiftcards.js +12 -0
- package/dist/methods/getClientsGiftcardsTypes.js +10 -0
- package/dist/methods/getClientsMembershipCards.js +6 -0
- package/dist/methods/getClientsNewsletterEmailSMS.js +12 -0
- package/dist/methods/getClientsNewsletterEmailShops.js +12 -0
- package/dist/methods/getClientsPayerAddress.js +10 -0
- package/dist/methods/getClientsPricelists.js +10 -0
- package/dist/methods/getClientsPricelistsClients.js +6 -0
- package/dist/methods/getClientsPricelistsProducts.js +10 -0
- package/dist/methods/getClientsPricesActiveCard.js +6 -0
- package/dist/methods/getClientsPricesDiscountGroups.js +10 -0
- package/dist/methods/getClientsPricesDiscounts.js +11 -0
- package/dist/methods/getClientsProfitPoints.js +11 -0
- package/dist/methods/getClientsProvinceList.js +6 -0
- package/dist/methods/getClientsTags.js +6 -0
- package/dist/methods/getCouriers.js +10 -0
- package/dist/methods/getCouriersAssignedToShippingProfiles.js +6 -0
- package/dist/methods/getCouriersPickupPoints.js +10 -0
- package/dist/methods/getDeliveriesProfiles.js +10 -0
- package/dist/methods/getDeliveriesRegions.js +6 -0
- package/dist/methods/getDiscountsGroups.js +11 -0
- package/dist/methods/getDiscountsGroupsClients.js +6 -0
- package/dist/methods/getEntries.js +6 -0
- package/dist/methods/getEntriesPagesToDisplay.js +6 -0
- package/dist/methods/getMenu.js +6 -0
- package/dist/methods/getMenuFilter.js +6 -0
- package/dist/methods/getOrders.js +6 -0
- package/dist/methods/getOrdersAnalytics.js +10 -0
- package/dist/methods/getOrdersAuctionDetails.js +11 -0
- package/dist/methods/getOrdersDocuments.js +6 -0
- package/dist/methods/getOrdersExportdocumentsEPP.js +10 -0
- package/dist/methods/getOrdersExportdocumentsJPK.js +10 -0
- package/dist/methods/getOrdersHandler.js +6 -0
- package/dist/methods/getOrdersHistory.js +6 -0
- package/dist/methods/getOrdersImages.js +6 -0
- package/dist/methods/getOrdersLabels.js +6 -0
- package/dist/methods/getOrdersOpinions.js +17 -0
- package/dist/methods/getOrdersOpinionsRate.js +6 -0
- package/dist/methods/getOrdersPackages.js +6 -0
- package/dist/methods/getOrdersPrinterDocuments.js +6 -0
- package/dist/methods/getOrdersProfitability.js +6 -0
- package/dist/methods/getOrdersWarehouse.js +6 -0
- package/dist/methods/getPackages.js +11 -0
- package/dist/methods/getPackagesLabels.js +6 -0
- package/dist/methods/getPayments.js +6 -0
- package/dist/methods/getPaymentsForms.js +6 -0
- package/dist/methods/getPaymentsProfiles.js +10 -0
- package/dist/methods/getProducts.js +6 -0
- package/dist/methods/getProductsAuctions.js +11 -0
- package/dist/methods/getProductsBrands.js +11 -0
- package/dist/methods/getProductsBrandsFilter.js +6 -0
- package/dist/methods/getProductsCategories.js +11 -0
- package/dist/methods/getProductsCategoriesIdosell.js +11 -0
- package/dist/methods/getProductsCodeExistence.js +13 -0
- package/dist/methods/getProductsDeliveryTime.js +6 -0
- package/dist/methods/getProductsDescriptions.js +6 -0
- package/dist/methods/getProductsIdBySizecode.js +6 -0
- package/dist/methods/getProductsMarketingAllFacebookCatalogIds.js +6 -0
- package/dist/methods/getProductsMarketingPromotion.js +6 -0
- package/dist/methods/getProductsMarketingZones.js +12 -0
- package/dist/methods/getProductsOmnibusPrices.js +12 -0
- package/dist/methods/getProductsOpinions.js +12 -0
- package/dist/methods/getProductsOpinionsOpinions.js +6 -0
- package/dist/methods/getProductsOpinionsRate.js +6 -0
- package/dist/methods/getProductsParameters.js +10 -0
- package/dist/methods/getProductsProductsToFacebookCatalog.js +6 -0
- package/dist/methods/getProductsQuestions.js +6 -0
- package/dist/methods/getProductsReservations.js +12 -0
- package/dist/methods/getProductsSKUbyBarcode.js +6 -0
- package/dist/methods/getProductsSeries.js +10 -0
- package/dist/methods/getProductsSeriesFilter.js +6 -0
- package/dist/methods/getProductsSizes.js +9 -0
- package/dist/methods/getProductsStocks.js +12 -0
- package/dist/methods/getProductsStrikethroughPrices.js +12 -0
- package/dist/methods/getRefundsGetPossibleAutoRefunds.js +6 -0
- package/dist/methods/getRefundsGetRefundStatus.js +6 -0
- package/dist/methods/getRefundsRetrieveRefundsList.js +10 -0
- package/dist/methods/getReturns.js +12 -0
- package/dist/methods/getReturnsStatuses.js +6 -0
- package/dist/methods/getRma.js +13 -0
- package/dist/methods/getRmaStatuses.js +6 -0
- package/dist/methods/getSizecharts.js +10 -0
- package/dist/methods/getSizes.js +6 -0
- package/dist/methods/getSystemConfig.js +6 -0
- package/dist/methods/getSystemCurrencies.js +10 -0
- package/dist/methods/getSystemProcessesAutomation.js +6 -0
- package/dist/methods/getSystemServerLoad.js +6 -0
- package/dist/methods/getSystemServerTime.js +6 -0
- package/dist/methods/getSystemShopsData.js +6 -0
- package/dist/methods/getSystemUnits.js +6 -0
- package/dist/methods/getSystemUsers.js +6 -0
- package/dist/methods/getVouchers.js +15 -0
- package/dist/methods/getVouchersTypes.js +10 -0
- package/dist/methods/getWarranties.js +11 -0
- package/dist/methods/getWarrantiesCountTotal.js +6 -0
- package/dist/methods/getWmsLocations.js +10 -0
- package/dist/methods/getWmsStocksdocumentsDocuments.js +11 -0
- package/dist/methods/getWmsStocksdocumentsOpenedDocuments.js +11 -0
- package/dist/methods/getWmsStocksdocumentsProducts.js +11 -0
- package/dist/methods/getWmsSuppliers.js +10 -0
- package/dist/methods/getWmsSuppliersSuppliers.js +6 -0
- package/dist/methods/listOrders.js +22 -0
- package/dist/methods/listOrdersUnfinished.js +17 -0
- package/dist/methods/listProducts.js +25 -0
- package/dist/methods/postClients.js +11 -0
- package/dist/methods/postClientsBalance.js +10 -0
- package/dist/methods/postClientsDeliveryAddress.js +11 -0
- package/dist/methods/postClientsGiftcards.js +11 -0
- package/dist/methods/postClientsPayerAddress.js +11 -0
- package/dist/methods/postClientsPricelists.js +6 -0
- package/dist/methods/postClientsProfitPoints.js +6 -0
- package/dist/methods/postClientsTags.js +12 -0
- package/dist/methods/postCouriersPickupPoints.js +11 -0
- package/dist/methods/postDeliveriesRegions.js +6 -0
- package/dist/methods/postDiscountsGroups.js +6 -0
- package/dist/methods/postDiscountsRebatesCard.js +7 -0
- package/dist/methods/postDiscountsRebatesCode.js +7 -0
- package/dist/methods/postEntries.js +11 -0
- package/dist/methods/postMenu.js +12 -0
- package/dist/methods/postOrders.js +11 -0
- package/dist/methods/postOrdersDocuments.js +11 -0
- package/dist/methods/postOrdersImages.js +11 -0
- package/dist/methods/postOrdersPackages.js +11 -0
- package/dist/methods/postPackages.js +11 -0
- package/dist/methods/postPackagesLabels.js +11 -0
- package/dist/methods/postPayments.js +6 -0
- package/dist/methods/postPaymentsCancel.js +6 -0
- package/dist/methods/postPaymentsCashback.js +6 -0
- package/dist/methods/postPaymentsRepayment.js +6 -0
- package/dist/methods/postProducts.js +11 -0
- package/dist/methods/postProductsBrands.js +11 -0
- package/dist/methods/postProductsBundles.js +12 -0
- package/dist/methods/postProductsBundlesBundles.js +6 -0
- package/dist/methods/postProductsBundlesProducts.js +12 -0
- package/dist/methods/postProductsCollections.js +12 -0
- package/dist/methods/postProductsCollectionsProducts.js +12 -0
- package/dist/methods/postProductsMarketingPromotion.js +11 -0
- package/dist/methods/postProductsOpinions.js +11 -0
- package/dist/methods/postProductsOpinionsOpinions.js +6 -0
- package/dist/methods/postProductsProductsToFacebookCatalog.js +6 -0
- package/dist/methods/postProductsProductsToPromotion.js +6 -0
- package/dist/methods/postProductsRestore.js +7 -0
- package/dist/methods/postProductsSynchronizationFile.js +6 -0
- package/dist/methods/postRefundsAddAutomaticRefund.js +6 -0
- package/dist/methods/postRefundsAddAutomaticRefundForOrder.js +6 -0
- package/dist/methods/postRefundsAddManualRefund.js +6 -0
- package/dist/methods/postVouchers.js +11 -0
- package/dist/methods/postWarranties.js +11 -0
- package/dist/methods/postWmsStocksdocumentsDocuments.js +6 -0
- package/dist/methods/postWmsStocksdocumentsProducts.js +11 -0
- package/dist/methods/putClients.js +11 -0
- package/dist/methods/putClientsDeliveryAddress.js +11 -0
- package/dist/methods/putClientsExternalCode.js +6 -0
- package/dist/methods/putClientsGiftcards.js +11 -0
- package/dist/methods/putClientsGiftcardsBlock.js +11 -0
- package/dist/methods/putClientsGiftcardsUnblock.js +11 -0
- package/dist/methods/putClientsMembershipCards.js +11 -0
- package/dist/methods/putClientsPayerAddress.js +11 -0
- package/dist/methods/putClientsPricelists.js +6 -0
- package/dist/methods/putClientsPricelistsClients.js +6 -0
- package/dist/methods/putClientsPricelistsProducts.js +6 -0
- package/dist/methods/putClientsPricelistsRename.js +6 -0
- package/dist/methods/putClientsPricesDiscounts.js +11 -0
- package/dist/methods/putClientsTags.js +11 -0
- package/dist/methods/putCouriersPickupPoints.js +11 -0
- package/dist/methods/putDeliveriesDefaultProfiles.js +6 -0
- package/dist/methods/putDiscountsGroups.js +6 -0
- package/dist/methods/putDiscountsGroupsProducts.js +6 -0
- package/dist/methods/putDiscountsRebatesBlockCard.js +7 -0
- package/dist/methods/putDiscountsRebatesUnblockCard.js +7 -0
- package/dist/methods/putEntries.js +6 -0
- package/dist/methods/putMenu.js +12 -0
- package/dist/methods/putMenuFilter.js +11 -0
- package/dist/methods/putMenuSort.js +12 -0
- package/dist/methods/putOrders.js +11 -0
- package/dist/methods/putOrdersClient.js +6 -0
- package/dist/methods/putOrdersCourier.js +6 -0
- package/dist/methods/putOrdersDeliveryAddress.js +6 -0
- package/dist/methods/putOrdersDevide.js +11 -0
- package/dist/methods/putOrdersHandler.js +6 -0
- package/dist/methods/putOrdersPackages.js +11 -0
- package/dist/methods/putOrdersPickupPoint.js +6 -0
- package/dist/methods/putOrdersProductsSerialNumbers.js +11 -0
- package/dist/methods/putOrdersProfitMargin.js +11 -0
- package/dist/methods/putOrdersShippingCosts.js +6 -0
- package/dist/methods/putOrdersWarehouse.js +6 -0
- package/dist/methods/putPackages.js +11 -0
- package/dist/methods/putPayments.js +6 -0
- package/dist/methods/putPaymentsConfirm.js +6 -0
- package/dist/methods/putProducts.js +15 -0
- package/dist/methods/putProductsAttachments.js +11 -0
- package/dist/methods/putProductsBrands.js +11 -0
- package/dist/methods/putProductsBrandsFilter.js +11 -0
- package/dist/methods/putProductsBundlesProductsQuantity.js +12 -0
- package/dist/methods/putProductsBundlesRenew.js +12 -0
- package/dist/methods/putProductsCategories.js +11 -0
- package/dist/methods/putProductsCollectionsProducts.js +12 -0
- package/dist/methods/putProductsCollectionsRenew.js +12 -0
- package/dist/methods/putProductsDescriptions.js +11 -0
- package/dist/methods/putProductsGroupsMainProduct.js +11 -0
- package/dist/methods/putProductsGroupsOrder.js +11 -0
- package/dist/methods/putProductsGroupsSettings.js +11 -0
- package/dist/methods/putProductsImages.js +11 -0
- package/dist/methods/putProductsMarketingPromotion.js +11 -0
- package/dist/methods/putProductsMarketingZones.js +11 -0
- package/dist/methods/putProductsOmnibusPrices.js +11 -0
- package/dist/methods/putProductsOpinions.js +6 -0
- package/dist/methods/putProductsOpinionsOpinions.js +6 -0
- package/dist/methods/putProductsParameters.js +12 -0
- package/dist/methods/putProductsQuestions.js +11 -0
- package/dist/methods/putProductsSeries.js +11 -0
- package/dist/methods/putProductsSeriesFilter.js +11 -0
- package/dist/methods/putProductsSizes.js +12 -0
- package/dist/methods/putProductsStockQuantity.js +11 -0
- package/dist/methods/putProductsStocks.js +11 -0
- package/dist/methods/putProductsStrikethroughPrices.js +11 -0
- package/dist/methods/putProductsSupplierCode.js +11 -0
- package/dist/methods/putProductsSupplierProductData.js +11 -0
- package/dist/methods/putProductsSynchronizationFinishUpload.js +6 -0
- package/dist/methods/putRefundsCancelRefund.js +6 -0
- package/dist/methods/putRefundsConfirmRefund.js +6 -0
- package/dist/methods/putRefundsUpdateRefund.js +6 -0
- package/dist/methods/putReturns.js +11 -0
- package/dist/methods/putReturnsSerialNumber.js +11 -0
- package/dist/methods/putRma.js +11 -0
- package/dist/methods/putSizecharts.js +11 -0
- package/dist/methods/putSizes.js +11 -0
- package/dist/methods/putSystemConfig.js +6 -0
- package/dist/methods/putSystemCurrencies.js +12 -0
- package/dist/methods/putSystemProcessesAutomation.js +6 -0
- package/dist/methods/putSystemUnits.js +11 -0
- package/dist/methods/putVouchers.js +11 -0
- package/dist/methods/putVouchersBlock.js +11 -0
- package/dist/methods/putVouchersUnblock.js +11 -0
- package/dist/methods/putWarranties.js +11 -0
- package/dist/methods/putWarrantiesLanguageData.js +11 -0
- package/dist/methods/putWmsStocksdocumentsAcceptMM.js +6 -0
- package/dist/methods/putWmsStocksdocumentsClose.js +6 -0
- package/dist/methods/putWmsStocksdocumentsDocuments.js +6 -0
- package/dist/methods/putWmsStocksdocumentsProducts.js +11 -0
- package/dist/methods/putWmsStocksdocumentsRejectMM.js +6 -0
- package/dist/methods/putWmsSuppliers.js +11 -0
- package/dist/methods/putWmsSuppliersSuppliers.js +6 -0
- package/dist/params.js +42 -0
- package/dist/request.js +68 -0
- package/package.json +28 -0
- package/readme.md +314 -0
- package/tests/deleteClientsDeliveryAddress.test.js +7 -0
- package/tests/deleteClientsGiftcards.test.js +7 -0
- package/tests/deleteClientsPayerAddress.test.js +7 -0
- package/tests/deleteClientsPricelists.test.js +7 -0
- package/tests/deleteClientsTags.test.js +7 -0
- package/tests/deleteClientsTagsClear.test.js +7 -0
- package/tests/deleteCouriersPickupPoints.test.js +7 -0
- package/tests/deleteDiscountsGroups.test.js +7 -0
- package/tests/deleteDiscountsGroupsProducts.test.js +7 -0
- package/tests/deleteDiscountsRebatesCard.test.js +7 -0
- package/tests/deleteDiscountsRebatesCode.test.js +7 -0
- package/tests/deleteEntries.test.js +7 -0
- package/tests/deleteMenu.test.js +7 -0
- package/tests/deleteOrdersDocuments.test.js +7 -0
- package/tests/deleteOrdersImages.test.js +7 -0
- package/tests/deleteProducts.test.js +7 -0
- package/tests/deleteProductsBrands.test.js +7 -0
- package/tests/deleteProductsCollectionsProducts.test.js +7 -0
- package/tests/deleteProductsImages.test.js +7 -0
- package/tests/deleteProductsOpinions.test.js +7 -0
- package/tests/deleteProductsParameters.test.js +7 -0
- package/tests/deleteProductsProductsToFacebookCatalog.test.js +7 -0
- package/tests/deleteProductsProductsToPromotion.test.js +7 -0
- package/tests/deleteProductsSeries.test.js +7 -0
- package/tests/deleteProductsSizes.test.js +7 -0
- package/tests/deleteSizecharts.test.js +7 -0
- package/tests/deleteVouchers.test.js +7 -0
- package/tests/deleteWarranties.test.js +7 -0
- package/tests/deleteWmsStocksdocumentsDocuments.test.js +7 -0
- package/tests/deleteWmsStocksdocumentsProducts.test.js +12 -0
- package/tests/deleteWmsSuppliers.test.js +7 -0
- package/tests/getClients.test.js +22 -0
- package/tests/getClientsBalance.test.js +22 -0
- package/tests/getClientsCrm.test.js +22 -0
- package/tests/getClientsDeliveryAddress.test.js +7 -0
- package/tests/getClientsGiftcards.test.js +7 -0
- package/tests/getClientsGiftcardsTypes.test.js +7 -0
- package/tests/getClientsMembershipCards.test.js +7 -0
- package/tests/getClientsNewsletterEmailSMS.test.js +17 -0
- package/tests/getClientsNewsletterEmailShops.test.js +12 -0
- package/tests/getClientsPayerAddress.test.js +12 -0
- package/tests/getClientsPricelists.test.js +12 -0
- package/tests/getClientsPricelistsClients.test.js +7 -0
- package/tests/getClientsPricelistsProducts.test.js +12 -0
- package/tests/getClientsPricesDiscountGroups.test.js +12 -0
- package/tests/getClientsPricesDiscounts.test.js +27 -0
- package/tests/getClientsProfitPoints.test.js +17 -0
- package/tests/getClientsProvinceList.test.js +7 -0
- package/tests/getClientsTags.test.js +7 -0
- package/tests/getCouriers.test.js +12 -0
- package/tests/getCouriersPickupPoints.test.js +17 -0
- package/tests/getDeliveriesProfiles.test.js +7 -0
- package/tests/getDeliveriesRegions.test.js +7 -0
- package/tests/getDiscountsGroups.test.js +12 -0
- package/tests/getDiscountsGroupsClients.test.js +7 -0
- package/tests/getEntries.test.js +12 -0
- package/tests/getEntriesPagesToDisplay.test.js +7 -0
- package/tests/getMenu.test.js +7 -0
- package/tests/getMenuFilter.test.js +7 -0
- package/tests/getOrders.test.js +7 -0
- package/tests/getOrdersAnalytics.test.js +7 -0
- package/tests/getOrdersAuctionDetails.test.js +7 -0
- package/tests/getOrdersDocuments.test.js +7 -0
- package/tests/getOrdersExportdocumentsEPP.test.js +22 -0
- package/tests/getOrdersExportdocumentsJPK.test.js +17 -0
- package/tests/getOrdersHandler.test.js +7 -0
- package/tests/getOrdersHistory.test.js +7 -0
- package/tests/getOrdersImages.test.js +7 -0
- package/tests/getOrdersLabels.test.js +7 -0
- package/tests/getOrdersOpinions.test.js +32 -0
- package/tests/getOrdersOpinionsRate.test.js +7 -0
- package/tests/getOrdersPackages.test.js +17 -0
- package/tests/getOrdersProfitability.test.js +7 -0
- package/tests/getOrdersWarehouse.test.js +7 -0
- package/tests/getPayments.test.js +12 -0
- package/tests/getPaymentsForms.test.js +7 -0
- package/tests/getPaymentsProfiles.test.js +7 -0
- package/tests/getProducts.test.js +7 -0
- package/tests/getProductsAuctions.test.js +7 -0
- package/tests/getProductsBrands.test.js +7 -0
- package/tests/getProductsBrandsFilter.test.js +7 -0
- package/tests/getProductsCategories.test.js +17 -0
- package/tests/getProductsCategoriesIdosell.test.js +7 -0
- package/tests/getProductsDescriptions.test.js +7 -0
- package/tests/getProductsIdBySizecode.test.js +7 -0
- package/tests/getProductsMarketingAllFacebookCatalogIds.test.js +7 -0
- package/tests/getProductsMarketingPromotion.test.js +12 -0
- package/tests/getProductsOpinions.test.js +17 -0
- package/tests/getProductsOpinionsRate.test.js +7 -0
- package/tests/getProductsParameters.test.js +17 -0
- package/tests/getProductsProductsToFacebookCatalog.test.js +7 -0
- package/tests/getProductsQuestions.test.js +12 -0
- package/tests/getProductsSKUbyBarcode.test.js +7 -0
- package/tests/getProductsSeries.test.js +22 -0
- package/tests/getProductsSeriesFilter.test.js +7 -0
- package/tests/getProductsSizes.test.js +7 -0
- package/tests/getRefundsGetPossibleAutoRefunds.test.js +7 -0
- package/tests/getRefundsGetRefundStatus.test.js +7 -0
- package/tests/getRefundsRetrieveRefundsList.test.js +7 -0
- package/tests/getReturns.test.js +27 -0
- package/tests/getRma.test.js +17 -0
- package/tests/getSizecharts.test.js +17 -0
- package/tests/getSizes.test.js +7 -0
- package/tests/getSystemCurrencies.test.js +12 -0
- package/tests/getSystemProcessesAutomation.test.js +7 -0
- package/tests/getSystemUnits.test.js +7 -0
- package/tests/getSystemUsers.test.js +7 -0
- package/tests/getVouchers.test.js +27 -0
- package/tests/getVouchersTypes.test.js +7 -0
- package/tests/getWarranties.test.js +12 -0
- package/tests/getWarrantiesCountTotal.test.js +7 -0
- package/tests/getWmsLocations.test.js +12 -0
- package/tests/getWmsStocksdocumentsDocuments.test.js +22 -0
- package/tests/getWmsStocksdocumentsOpenedDocuments.test.js +22 -0
- package/tests/getWmsStocksdocumentsProducts.test.js +12 -0
- package/tests/getWmsSuppliers.test.js +17 -0
- package/tests/listOrders.test.js +57 -0
- package/tests/listOrdersUnfinished.test.js +32 -0
- package/tests/listProducts.test.js +82 -0
- package/tests/postClients.test.js +7 -0
- package/tests/postClientsBalance.test.js +17 -0
- package/tests/postClientsDeliveryAddress.test.js +7 -0
- package/tests/postClientsGiftcards.test.js +7 -0
- package/tests/postClientsPayerAddress.test.js +7 -0
- package/tests/postClientsPricelists.test.js +12 -0
- package/tests/postClientsProfitPoints.test.js +7 -0
- package/tests/postClientsTags.test.js +7 -0
- package/tests/postCouriersPickupPoints.test.js +7 -0
- package/tests/postDeliveriesRegions.test.js +7 -0
- package/tests/postDiscountsGroups.test.js +7 -0
- package/tests/postDiscountsRebatesCard.test.js +7 -0
- package/tests/postDiscountsRebatesCode.test.js +7 -0
- package/tests/postEntries.test.js +7 -0
- package/tests/postMenu.test.js +7 -0
- package/tests/postOrders.test.js +12 -0
- package/tests/postOrdersDocuments.test.js +7 -0
- package/tests/postOrdersImages.test.js +7 -0
- package/tests/postOrdersPackages.test.js +7 -0
- package/tests/postPackages.test.js +7 -0
- package/tests/postPackagesLabels.test.js +7 -0
- package/tests/postPayments.test.js +7 -0
- package/tests/postPaymentsCancel.test.js +7 -0
- package/tests/postPaymentsCashback.test.js +7 -0
- package/tests/postPaymentsRepayment.test.js +7 -0
- package/tests/postProducts.test.js +12 -0
- package/tests/postProductsBrands.test.js +7 -0
- package/tests/postProductsCollections.test.js +7 -0
- package/tests/postProductsCollectionsProducts.test.js +7 -0
- package/tests/postProductsMarketingPromotion.test.js +7 -0
- package/tests/postProductsOpinions.test.js +7 -0
- package/tests/postProductsProductsToFacebookCatalog.test.js +7 -0
- package/tests/postProductsProductsToPromotion.test.js +7 -0
- package/tests/postProductsRestore.test.js +7 -0
- package/tests/postRefundsAddAutomaticRefund.test.js +7 -0
- package/tests/postRefundsAddAutomaticRefundForOrder.test.js +7 -0
- package/tests/postRefundsAddManualRefund.test.js +7 -0
- package/tests/postVouchers.test.js +7 -0
- package/tests/postWarranties.test.js +7 -0
- package/tests/postWmsStocksdocumentsDocuments.test.js +7 -0
- package/tests/postWmsStocksdocumentsProducts.test.js +7 -0
- package/tests/putClients.test.js +12 -0
- package/tests/putClientsDeliveryAddress.test.js +7 -0
- package/tests/putClientsExternalCode.test.js +7 -0
- package/tests/putClientsGiftcards.test.js +7 -0
- package/tests/putClientsGiftcardsBlock.test.js +7 -0
- package/tests/putClientsGiftcardsUnblock.test.js +7 -0
- package/tests/putClientsMembershipCards.test.js +7 -0
- package/tests/putClientsPayerAddress.test.js +7 -0
- package/tests/putClientsPricelists.test.js +7 -0
- package/tests/putClientsPricelistsClients.test.js +7 -0
- package/tests/putClientsPricelistsProducts.test.js +7 -0
- package/tests/putClientsPricelistsRename.test.js +7 -0
- package/tests/putClientsPricesDiscounts.test.js +7 -0
- package/tests/putClientsTags.test.js +7 -0
- package/tests/putCouriersPickupPoints.test.js +7 -0
- package/tests/putDeliveriesDefaultProfiles.test.js +7 -0
- package/tests/putDiscountsGroups.test.js +7 -0
- package/tests/putDiscountsGroupsProducts.test.js +7 -0
- package/tests/putDiscountsRebatesBlockCard.test.js +7 -0
- package/tests/putDiscountsRebatesUnblockCard.test.js +7 -0
- package/tests/putEntries.test.js +7 -0
- package/tests/putMenu.test.js +7 -0
- package/tests/putMenuFilter.test.js +12 -0
- package/tests/putMenuSort.test.js +7 -0
- package/tests/putOrders.test.js +7 -0
- package/tests/putOrdersCourier.test.js +7 -0
- package/tests/putOrdersDeliveryAddress.test.js +7 -0
- package/tests/putOrdersDevide.test.js +7 -0
- package/tests/putOrdersHandler.test.js +7 -0
- package/tests/putOrdersPackages.test.js +7 -0
- package/tests/putOrdersPickupPoint.test.js +7 -0
- package/tests/putOrdersProductsSerialNumbers.test.js +7 -0
- package/tests/putOrdersProfitMargin.test.js +7 -0
- package/tests/putOrdersShippingCosts.test.js +7 -0
- package/tests/putOrdersWarehouse.test.js +7 -0
- package/tests/putPackages.test.js +7 -0
- package/tests/putPayments.test.js +7 -0
- package/tests/putPaymentsConfirm.test.js +7 -0
- package/tests/putProducts.test.js +7 -0
- package/tests/putProductsAttachments.test.js +7 -0
- package/tests/putProductsBrands.test.js +7 -0
- package/tests/putProductsBrandsFilter.test.js +7 -0
- package/tests/putProductsCategories.test.js +7 -0
- package/tests/putProductsCollectionsProducts.test.js +7 -0
- package/tests/putProductsCollectionsRenew.test.js +7 -0
- package/tests/putProductsDescriptions.test.js +7 -0
- package/tests/putProductsGroupsMainProduct.test.js +7 -0
- package/tests/putProductsGroupsOrder.test.js +7 -0
- package/tests/putProductsGroupsSettings.test.js +7 -0
- package/tests/putProductsImages.test.js +7 -0
- package/tests/putProductsMarketingPromotion.test.js +7 -0
- package/tests/putProductsMarketingZones.test.js +7 -0
- package/tests/putProductsOmnibusPrices.test.js +7 -0
- package/tests/putProductsOpinions.test.js +7 -0
- package/tests/putProductsParameters.test.js +7 -0
- package/tests/putProductsQuestions.test.js +7 -0
- package/tests/putProductsSeries.test.js +7 -0
- package/tests/putProductsSeriesFilter.test.js +12 -0
- package/tests/putProductsSizes.test.js +7 -0
- package/tests/putProductsStockQuantity.test.js +7 -0
- package/tests/putProductsStocks.test.js +7 -0
- package/tests/putProductsStrikethroughPrices.test.js +7 -0
- package/tests/putProductsSupplierCode.test.js +7 -0
- package/tests/putProductsSupplierProductData.test.js +7 -0
- package/tests/putRefundsCancelRefund.test.js +7 -0
- package/tests/putRefundsConfirmRefund.test.js +7 -0
- package/tests/putRefundsUpdateRefund.test.js +7 -0
- package/tests/putReturnsSerialNumber.test.js +7 -0
- package/tests/putRma.test.js +7 -0
- package/tests/putSizecharts.test.js +7 -0
- package/tests/putSizes.test.js +12 -0
- package/tests/putSystemConfig.test.js +7 -0
- package/tests/putSystemCurrencies.test.js +7 -0
- package/tests/putSystemProcessesAutomation.test.js +7 -0
- package/tests/putSystemUnits.test.js +7 -0
- package/tests/putVouchers.test.js +7 -0
- package/tests/putVouchersBlock.test.js +7 -0
- package/tests/putVouchersUnblock.test.js +7 -0
- package/tests/putWarranties.test.js +7 -0
- package/tests/putWarrantiesLanguageData.test.js +7 -0
- package/tests/putWmsStocksdocumentsAcceptMM.test.js +7 -0
- package/tests/putWmsStocksdocumentsClose.test.js +7 -0
- package/tests/putWmsStocksdocumentsDocuments.test.js +7 -0
- package/tests/putWmsStocksdocumentsProducts.test.js +7 -0
- package/tests/putWmsStocksdocumentsRejectMM.test.js +7 -0
- package/tests/putWmsSuppliers.test.js +7 -0
- package/tests/rootparams.test.js +25 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { paramsProxy } from "../params.js";
|
|
2
|
+
|
|
3
|
+
export const putWarrantiesProxy = (object) => {
|
|
4
|
+
object.gate = { method: 'put', node: '/warranties/warranties' }
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: [],
|
|
7
|
+
arrayNode: "warranties",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
10
|
+
return new Proxy(object, paramsProxy);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { paramsProxy } from "../params.js";
|
|
2
|
+
|
|
3
|
+
export const putWarrantiesLanguageDataProxy = (object) => {
|
|
4
|
+
object.gate = { method: 'put', node: '/warranties/languageData' }
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: [],
|
|
7
|
+
arrayNode: "lang_data",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
10
|
+
return new Proxy(object, paramsProxy);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { paramsProxy } from "../params.js";
|
|
2
|
+
|
|
3
|
+
export const putWmsStocksdocumentsProductsProxy = (object) => {
|
|
4
|
+
object.gate = { method: 'put', node: '/wms/stocksdocuments/products' }
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: ["type","id"],
|
|
7
|
+
arrayNode: "products",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
10
|
+
return new Proxy(object, paramsProxy);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { paramsProxy } from "../params.js";
|
|
2
|
+
|
|
3
|
+
export const putWmsSuppliersProxy = (object) => {
|
|
4
|
+
object.gate = { method: 'put', node: '/wms/suppliers/suppliers' }
|
|
5
|
+
object.appendable = {
|
|
6
|
+
except: [],
|
|
7
|
+
arrayNode: "suppliers",
|
|
8
|
+
index: 0
|
|
9
|
+
}
|
|
10
|
+
return new Proxy(object, paramsProxy);
|
|
11
|
+
}
|
package/dist/params.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { sendRequest, countResults, getParams, hasNext, toString } from "./request.js";
|
|
2
|
+
|
|
3
|
+
const getAttributes = (obj) => Object.keys(obj).slice(3);
|
|
4
|
+
|
|
5
|
+
const requests = {
|
|
6
|
+
exec: sendRequest,
|
|
7
|
+
count: countResults,
|
|
8
|
+
getParams,
|
|
9
|
+
hasNext,
|
|
10
|
+
toString,
|
|
11
|
+
getAttributes
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const paramsProxy = {
|
|
15
|
+
get: (object, property) => {
|
|
16
|
+
return (...values) => {
|
|
17
|
+
if (requests[property]) {
|
|
18
|
+
return requests[property](object, values[0]);
|
|
19
|
+
}
|
|
20
|
+
else if (object.appendable && object.appendable.arrayNode !== property && !object.appendable.except.includes(property)) {
|
|
21
|
+
if (!object.params[object.appendable.arrayNode]) object.params[object.appendable.arrayNode] = [{}];
|
|
22
|
+
const item = object.params[object.appendable.arrayNode][object.appendable.index];
|
|
23
|
+
if (property === 'append') {
|
|
24
|
+
++object.appendable.index;
|
|
25
|
+
object.params[object.appendable.arrayNode].push({});
|
|
26
|
+
} else if (object.custom && typeof object.custom[property] === 'function') {
|
|
27
|
+
const param = object.custom[property](...values);
|
|
28
|
+
Object.assign(item, param);
|
|
29
|
+
} else {
|
|
30
|
+
item[property] = values[0];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (object.custom && typeof object.custom[property] === 'function') {
|
|
34
|
+
if (property === 'page') values.push(Boolean(object.snakeCase));
|
|
35
|
+
const param = object.custom[property](...values);
|
|
36
|
+
Object.assign(object.params, param);
|
|
37
|
+
}
|
|
38
|
+
else object.params[property] = values[0];
|
|
39
|
+
return new Proxy(object, paramsProxy);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/request.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import util from 'util';
|
|
3
|
+
import qs from "qs";
|
|
4
|
+
import { page } from "./helpers.js";
|
|
5
|
+
|
|
6
|
+
const DECODE_TABLE = [
|
|
7
|
+
[ 'Å\x82', "ł" ],
|
|
8
|
+
[ 'Ä\x99', 'ę']
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const catchIdosellError = (err) => {
|
|
12
|
+
if (err.response.headers['content-type'].indexOf('json') < 0) throw new Error('500: Invalid response from Api gateway');
|
|
13
|
+
let message = err.response.headers['x-error'];
|
|
14
|
+
for (const [ search, replace ] of DECODE_TABLE) {
|
|
15
|
+
message = message.replaceAll(search, replace);
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`${err.response.status}: ${message}`)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const checkNext = (request, response) => {
|
|
21
|
+
if (response.resultsNumberPage) {
|
|
22
|
+
request.next = response.resultsPage + 1 < response.resultsNumberPage;
|
|
23
|
+
request.params.resultsPage = request.params.resultsPage ? request.params.resultsPage + 1 : 1;
|
|
24
|
+
} else if (response.results_number_page) {
|
|
25
|
+
request.next = response.results_page + 1 < response.results_number_page;
|
|
26
|
+
request.params.results_page = request.params.results_page ? request.params.results_page + 1 : 1;
|
|
27
|
+
}
|
|
28
|
+
return response;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const sendRequest = async (request, options = {}) => {
|
|
32
|
+
const headers = {
|
|
33
|
+
'X-API-KEY': request.auth.apiKey,
|
|
34
|
+
Accept: 'application/json'
|
|
35
|
+
}
|
|
36
|
+
request.next = false;
|
|
37
|
+
const { method, node } = request.gate;
|
|
38
|
+
let url = `${request.auth.url}/api/admin/v${request.auth.version}${node}`;
|
|
39
|
+
if (options.log || options.dump) {
|
|
40
|
+
console.log(util.inspect({ params: request.params, method, url }, {showHidden: false, depth: null, colors: true}))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (options.dump) return;
|
|
44
|
+
|
|
45
|
+
if (method === 'get') {
|
|
46
|
+
url += '?' + qs.stringify(request.params, { arrayFormat: 'comma' });
|
|
47
|
+
const response = await axios.get(url, { headers }).then(response => response.data).catch(catchIdosellError);
|
|
48
|
+
return checkNext(request, response);
|
|
49
|
+
} else {
|
|
50
|
+
const params = request.rootparams ? request.params : { params: request.params };
|
|
51
|
+
const response = await axios[method](url, params, { headers }).then(response => response.data).catch(catchIdosellError);
|
|
52
|
+
return checkNext(request, response);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const countResults = async (request, options) => {
|
|
57
|
+
const pageData = page(0, 1, request.snakeCase);
|
|
58
|
+
Object.assign(request.params, pageData);
|
|
59
|
+
const response = await sendRequest(request, options);
|
|
60
|
+
if (request.snakeCase) return parseInt(response.results_number_all);
|
|
61
|
+
else return response.resultsNumberAll;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const getParams = (request) => request.params;
|
|
65
|
+
|
|
66
|
+
export const toString = (request) => JSON.stringify(request.params);
|
|
67
|
+
|
|
68
|
+
export const hasNext = (request) => request.next;
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "idosell",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Idosell 3 REST connector",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/ltung7/idosell.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"idosell",
|
|
15
|
+
"rest"
|
|
16
|
+
],
|
|
17
|
+
"author": "Tung Le",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/ltung7/idosell.git/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/ltung7/idosell.git",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"axios": "^1.6.2",
|
|
25
|
+
"qs": "^6.11.2"
|
|
26
|
+
},
|
|
27
|
+
"type": "module"
|
|
28
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Idosell REST API
|
|
2
|
+
|
|
3
|
+
This package wraps around the Idosell REST Api to make it easier to use by implementing chainable options, more intuitive methods and helpers to format requests more easily. [Official Idosell documentation](https://idosell.readme.io/docs) is still applicable for the most part.
|
|
4
|
+
|
|
5
|
+
## Basic use
|
|
6
|
+
|
|
7
|
+
Package translates awkward gate names into more readable method names using REST verbs and gateways. Most of the possible methods are kept as is, only changed to camel case. For example:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
import idosell from 'idosell';
|
|
11
|
+
const idosellRequest = idosell('SHOP_URL', 'API_KEY')
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**API_KEY** can be obtained in your Idosell panel.
|
|
15
|
+
**SHOP_URL** is the base URI of your shop. Here are some examples:
|
|
16
|
+
```
|
|
17
|
+
https://yourdomain.com
|
|
18
|
+
https://clientXXXX.idosell.com
|
|
19
|
+
https://yourshop.iai-shop.com
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Properties vs endpoints
|
|
23
|
+
|
|
24
|
+
After initializing the Idosell object, call one of its properties to retrieve methods concerning the endpoint you are going to use. For example:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
const categories = idosellRequest.getProductsCategories.params(parameters).exec();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
In this example, getProductCategories translates to a GET request to the *products/categories* endpoint. You can use the *params()* method to set parameters for the request as JSON object as per Idosell guidelines. Analogously, you can send a PUT request to the same endpoint by using the following code:
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
const createCategoryRequest = idosellRequest.putProductsCategories.params(parameters).exec();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Note that the method *categories()* is used to set the request body, while the *exec()* method is used to send the request and retrieve data from the endpoint.
|
|
37
|
+
|
|
38
|
+
Some less obvious gate properties include:
|
|
39
|
+
```javascript
|
|
40
|
+
idosellRequest.getProducts.exec(); // Translates to GET on /products/products endpoint
|
|
41
|
+
idosellRequest.listProducts.exec(); // Translates to POST on /products/products/get endpoint
|
|
42
|
+
idosellRequest.deleteProducts.exec(); // Translates to POST on /products/products/delete endpoint
|
|
43
|
+
idosellRequest.deleteProductsOpinions.exec() // Translates to POST on products/opinions/opinions/delete endpoint
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Chaining methods to set request parameters
|
|
47
|
+
|
|
48
|
+
Alternatively to setting parameters in an object, you can chain several methods named after top-level parameters to set their value to your request. To execute the request after setting all the parameters, run the *exec()* method.
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
const idosellRequest = idosell('SHOP_URL', 'API_KEY');
|
|
52
|
+
const categories = idosellRequest.ids([123, 456, 789]).languages(['pol', 'eng']).result_page(1).result_limit(10).getProductsCategories.exec();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This example will generate the following GET request:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
https://yourdomain.com/api/admin/v1/products/categories?ids=123,456,789&languages=pol,eng&result_page=1&result_limit=10
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
A POST request will generate a JSON body request.
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
await idosellRequest.postDiscountsRebatesCode.campaign_id(123).code_number('REBATECODE').exec();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This example will generate a POST request with the following body:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"campaign_id": 123,
|
|
72
|
+
"code_number": "REBATECODE"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Helper functions
|
|
77
|
+
|
|
78
|
+
There are several methods that are included in the methods list that are not defined by specifications, but are designed to set parameters more easily and withour relying on specifitactions for single endpoint.
|
|
79
|
+
|
|
80
|
+
### Page and Count
|
|
81
|
+
|
|
82
|
+
Several endpoints return big number of results making in neccessary to inlcude paging of the results in the form of either *results_page*/*results_limit* or *resultsPage*/*resultsLimit* parameters. These enpoints include both *page(pageNumber, limit)* and *count()* methods.
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
const categoriesCount = idosellRequest.getProductsCategories.count();
|
|
86
|
+
// use to count number of categories
|
|
87
|
+
|
|
88
|
+
const categories = idosellRequest.getProductsCategories.page(1,10).exec();
|
|
89
|
+
// is equivalent to using the following (without needing to know if this endpoint uses results_page or resultsPage parameter):
|
|
90
|
+
//const categories = idosellRequest.getProductsCategories.results_page(1).result_limit(10).exec();
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Looping through pages
|
|
94
|
+
|
|
95
|
+
The execution of the Idosell request checks for the next page and applies it. This is available for use with native loop functions using the *hasNext()* function
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
const getReturnsRequest = idosellRequest.getReturns.dates('2023-12-01').page(0, 10)
|
|
99
|
+
|
|
100
|
+
while (getReturnsRequest.hasNext()) {
|
|
101
|
+
const results = await idosellRequest.exec();
|
|
102
|
+
// do something with results
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Date, date ranges and formatting
|
|
107
|
+
|
|
108
|
+
Some endpoints require dates in either the "YYYY-MM-DD" format or the "YYYY-MM-DD HH:mm:ss" format. Many of them use a set of dates to define the range of the results, for example, listing orders dispatched between the start of the month and the end of the same month. Instead, you can use the *dates()* helper:
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
const dispatchedOrders = idosellRequest.listOrders.dates('2023-12-01', '2023-12-31', 'dispatch').exec();
|
|
112
|
+
// This function will return orders that have dispatch date betwen 2023-12-01 00:00:00 and 2023-12-31 23:59:59
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This example will translate to following request body:
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"ordersRange": {
|
|
119
|
+
"ordersDateRange": {
|
|
120
|
+
"ordersDateBegin": "2023-12-01 00:00:00",
|
|
121
|
+
"ordersDateEnd": "2023-12-31 23:59:59",
|
|
122
|
+
"ordersDateType": "dispatch"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
As an argument, you can pass anything that is accepted as a native Date constructor or leave it empty for the current timestamp. For example:
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
const orders = idosellRequest.listOrders.dates(Date.now() - 86400000).exec();
|
|
132
|
+
// This function will return orders added (default value of date type is 'add') between 24 hours ago and now
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Array of objects
|
|
136
|
+
|
|
137
|
+
Some endpoints require an array of objects. As complex as they may be, there are some helpers to make it easier.
|
|
138
|
+
|
|
139
|
+
### Simple objects
|
|
140
|
+
|
|
141
|
+
For GET requests, they are mostly simple objects with single keys that can be set with a single method with a simple array.
|
|
142
|
+
|
|
143
|
+
```javascript
|
|
144
|
+
const orderAnalytics = await idosellRequest.getOrdersAnalytics.serialNumbers([123,456,789]).exec()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This will translate to following request parameters:
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"orders": [
|
|
152
|
+
{ "orderSerialNumber": 123 },
|
|
153
|
+
{ "orderSerialNumber": 456 },
|
|
154
|
+
{ "orderSerialNumber": 789 }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Complex objects
|
|
160
|
+
|
|
161
|
+
For POST and PUT requests, there is usually a main parameter with an array of very complex objects, like a list of products to add / edit. *The append()* method allows you to use them in a more simplistic way without worrying about the array itself.
|
|
162
|
+
|
|
163
|
+
```javascript
|
|
164
|
+
const updatedProducts = idosellRequest.putProducts
|
|
165
|
+
.settings({ settingModificationType: 'edit' })
|
|
166
|
+
.productId(101).productDisplayedCode('CODE1').countryOfOrigin('PL').append()
|
|
167
|
+
.productId(102).productDisplayedCode('CODE2').productRetailPrice(99.99).append()
|
|
168
|
+
.productId(103).productDisplayedCode('CODE3').productNote('Latest product').exec()
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This request translates into the following request body:
|
|
172
|
+
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"settings":{
|
|
176
|
+
"settingModificationType":"edit"
|
|
177
|
+
},
|
|
178
|
+
"products":[
|
|
179
|
+
{
|
|
180
|
+
"productId":101,
|
|
181
|
+
"productDisplayedCode":"CODE1",
|
|
182
|
+
"countryOfOrigin":"PL"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"productId":102,
|
|
186
|
+
"productDisplayedCode":"CODE2",
|
|
187
|
+
"productRetailPrice":99.99
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"productId":103,
|
|
191
|
+
"productDisplayedCode":"CODE3",
|
|
192
|
+
"productNote":"Latest product"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This request modifies 3 products, each with their own parameters. Products are separated using the *append()* method. This method can also be used in a loop.
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
const productCodes = [
|
|
202
|
+
{ id: 202, code: 'CODE202' },
|
|
203
|
+
{ id: 203, code: 'CODE203' },
|
|
204
|
+
{ id: 204, code: 'CODE204' },
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
const updateProducts = idosellRequest.putProducts.settings({ settingModificationType: 'edit' })
|
|
208
|
+
for (const { id, code } of productCodes) {
|
|
209
|
+
updateProducts.productId(id).productDisplayedCode(code).append();
|
|
210
|
+
}
|
|
211
|
+
updateProducts.exec()
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Other formatters
|
|
215
|
+
|
|
216
|
+
Some other helpers include following methods
|
|
217
|
+
|
|
218
|
+
### OrderBy
|
|
219
|
+
|
|
220
|
+
Some endpoints have the option to customize the ordering of results. This helper simplifies the parameters by passing two parameters: elementName and if order should be descending (true by default), but does not allow ordering on multiple fields.
|
|
221
|
+
|
|
222
|
+
```javascript
|
|
223
|
+
const lowestRatings = await idosellRequest.getProductsOpinions.orderBy('rating', false).exec();
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
This will translate to following request parameters:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"ordersBy": [
|
|
231
|
+
{
|
|
232
|
+
"elementName": "rating",
|
|
233
|
+
"sortDirection": "ASC"
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Set text
|
|
240
|
+
|
|
241
|
+
This method is used specifically for updating and creating products and allows you to easily set multiple types of descriptions in different languages and different shops.
|
|
242
|
+
|
|
243
|
+
```javascript
|
|
244
|
+
setText(text, type, languageId, shopId)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| Field | Description | Default | Possible values |
|
|
248
|
+
|----------|----------|----------|----------|
|
|
249
|
+
| text | Content to be added to the product | (none) | any |
|
|
250
|
+
| type | Type of text | short | See below |
|
|
251
|
+
| languageId | Language of the text | pol | Any ISO 639-2 language installed in the panel |
|
|
252
|
+
| shopId | Shop of the text (leave blank for general description) | null | Any ID of a shop installed in the panel |
|
|
253
|
+
|
|
254
|
+
Possible text types:
|
|
255
|
+
|
|
256
|
+
| Type | Description | Limitations |
|
|
257
|
+
|----------|----------|----------|
|
|
258
|
+
| name | Name of the product | Up to 420 characters, no HTML |
|
|
259
|
+
| short | Short description of the product | Up to 255 characters, no HTML |
|
|
260
|
+
| long | Long description of the product | Preferred HTML |
|
|
261
|
+
| metatitle | Contents of the title tag, name of the product page | Up to 255 characters, no HTML |
|
|
262
|
+
| metadescription | Meta description, often used by search engines | Up to 255 characters, no HTML |
|
|
263
|
+
| metakeywords | Meta keywords, sometimes used by search engines | Up to 255 characters, no HTML |
|
|
264
|
+
| acutionname | Auction name exported to marketplaces | Depends on marketplace |
|
|
265
|
+
| auctiondescription | Auction description exported to marketplaces | Possibly HTML |
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
Example of usage:
|
|
269
|
+
|
|
270
|
+
```javascript
|
|
271
|
+
const updateProduct = await idosellRequest.putProducts.productId(202).setText('Świetny produkt').setText('Awesome product', 'short', 'eng').setText('This product is really amazing', 'long', 'eng', 1).exec();
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
This will result in following request body
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"products": [
|
|
279
|
+
{
|
|
280
|
+
"productId": 202,
|
|
281
|
+
"productParamDescriptions": {
|
|
282
|
+
"productParamDescriptionsLangData": [
|
|
283
|
+
{
|
|
284
|
+
"langId": "pol",
|
|
285
|
+
"productParamDescriptions": "Świetny produkt"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"langId": "eng",
|
|
289
|
+
"productParamDescriptions": "Awesome product"
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
"productLongDescriptions": {
|
|
294
|
+
"productLongDescriptionsLangData": [
|
|
295
|
+
{
|
|
296
|
+
"langId": "eng",
|
|
297
|
+
"shopId": 1,
|
|
298
|
+
"productLongDescription": "<p>This product is really amazing</p>"
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Debugging
|
|
308
|
+
|
|
309
|
+
You can use the *getParams()* function to retrieve request parameters as Javascript Object.
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
const orderRequest = idosellRequest.getOrders.ordersSerialNumbers([123, 456, 789]).getParams();
|
|
313
|
+
// Will return Object: { ordersSerialNumbers: [ 123, 456, 789 ] }
|
|
314
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteClientsDeliveryAddressClientDeliveryAddressId", () => {
|
|
5
|
+
const params = idosell().deleteClientsDeliveryAddress.clientLogin("iai_demo").clientDeliveryAddressId(10).getParams();
|
|
6
|
+
expect(params).toEqual({"clients":[{"clientLogin":"iai_demo","clientDeliveryAddressId":10}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteClientsPayerAddressPayerAddressId", () => {
|
|
5
|
+
const params = idosell().deleteClientsPayerAddress.clientId(3).payerAddressId(1).getParams();
|
|
6
|
+
expect(params).toEqual({"payers":[{"clientId":3,"payerAddressId":1}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteClientsTagsTagId", () => {
|
|
5
|
+
const params = idosell().deleteClientsTags.clientId(3).tagId(2).getParams();
|
|
6
|
+
expect(params).toEqual({"params":[{"clientId":3,"tagId":2}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteCouriersPickupPointsPickupPointExternalId", () => {
|
|
5
|
+
const params = idosell().deleteCouriersPickupPoints.courierId(100105).pickupPointExternalId("abcdefg").getParams();
|
|
6
|
+
expect(params).toEqual({"pickupPointDeleteRequests":[{"courierId":100105,"pickupPointExternalId":"abcdefg"}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteDiscountsGroupsDiscountGroupId", () => {
|
|
5
|
+
const params = idosell().deleteDiscountsGroups.discountGroupId(201).getParams();
|
|
6
|
+
expect(params).toEqual({"discountGroupId":201});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteDiscountsGroupsProductsProducts", () => {
|
|
5
|
+
const params = idosell().deleteDiscountsGroupsProducts.discountGroupId(206).products([9]).getParams();
|
|
6
|
+
expect(params).toEqual({"discountGroupId":206,"products":[9]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteDiscountsRebatesCardCampaign_id", () => {
|
|
5
|
+
const params = idosell().deleteDiscountsRebatesCard.campaign_id(207).getParams();
|
|
6
|
+
expect(params).toEqual({"campaign_id":207});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteDiscountsRebatesCodeCampaign_id", () => {
|
|
5
|
+
const params = idosell().deleteDiscountsRebatesCode.campaign_id(210).getParams();
|
|
6
|
+
expect(params).toEqual({"campaign_id":210});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteMenuItem_id", () => {
|
|
5
|
+
const params = idosell().deleteMenu.shop_id(1).menu_id(1).item_id(154).getParams();
|
|
6
|
+
expect(params).toEqual({"menu_list":[{"shop_id":1,"menu_id":1,"item_id":154}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("deleteOrdersDocumentsId", () => {
|
|
5
|
+
const params = idosell().deleteOrdersDocuments.orderSerialNumber(9).id(3).getParams();
|
|
6
|
+
expect(params).toEqual({"documents":[{"orderSerialNumber":9,"id":3}]});
|
|
7
|
+
})
|