idosell 0.3.13 → 0.3.17
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/changelog.md +13 -0
- package/dist/app.d.ts +1 -1
- package/dist/enums.d.ts +14 -4
- package/dist/enums.js +14 -4
- package/dist/gateways.d.ts +28 -15
- package/dist/helpers.js +21 -0
- package/dist/index.js +1 -1
- package/dist/methods/getOrdersAuctionDetails.js +3 -3
- package/dist/methods/getProductsAuctions.js +2 -2
- package/dist/methods/postEntries.js +1 -1
- package/dist/methods/postOrdersDocuments.js +3 -0
- package/dist/methods/putClients.js +1 -1
- package/dist/methods/putProductsOmnibusPrices.js +6 -0
- package/dist/methods/putProductsStrikethroughPrices.js +8 -1
- package/dist/methods/searchOrders.js +2 -2
- package/dist/methods/searchOrdersUnfinished.js +2 -2
- package/dist/methods/searchPackages.js +2 -1
- package/dist/methods/searchProducts.js +2 -2
- package/dist/methods/searchProductsDeliveryTime.js +1 -1
- package/dist/request.js +8 -6
- package/dist/responses.d.ts +576 -278
- package/package.json +1 -1
- package/tests/getClientsPayerAddress.test.js +2 -2
- package/tests/getClientsPricelistsProducts.test.js +2 -2
- package/tests/getCouriers.test.js +3 -2
- package/tests/getCouriersPickupPoints.test.js +4 -4
- package/tests/getMenu.test.js +4 -4
- package/tests/getMenuFilter.test.js +3 -3
- package/tests/getOrdersAuctionDetails.test.js +13 -3
- package/tests/getOrdersExportdocumentsEPP.test.js +6 -16
- package/tests/getOrdersExportdocumentsJPK.test.js +2 -2
- package/tests/getOrdersOpinionsRate.test.js +3 -3
- package/tests/getOrdersPackages.test.js +5 -5
- package/tests/getPayments.test.js +4 -9
- package/tests/getProductsAuctions.test.js +8 -2
- package/tests/getProductsBrandsFilter.test.js +4 -3
- package/tests/getProductsOpinionsRate.test.js +2 -2
- package/tests/getProductsProductsToFacebookCatalog.test.js +4 -3
- package/tests/getProductsSeriesFilter.test.js +3 -2
- package/tests/getReturns.test.js +2 -2
- package/tests/getWmsLocations.test.js +2 -2
- package/tests/getWmsStocksdocumentsDocuments.test.js +9 -9
- package/tests/getWmsStocksdocumentsProducts.test.js +2 -7
- package/tests/postEntries.test.js +5 -5
- package/tests/postOrdersDocuments.test.js +5 -0
- package/tests/postProducts.test.js +2 -2
- package/tests/putOrdersDevide.test.js +3 -3
- package/tests/putProductsOmnibusPrices.test.js +15 -0
- package/tests/putProductsStrikethroughPrices.test.js +16 -1
- package/tests/putSizes.test.js +2 -2
package/package.json
CHANGED
|
@@ -7,6 +7,6 @@ test("getClientsPayerAddressClientId", () => {
|
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("getClientsPayerAddressPage", () => {
|
|
10
|
-
const params = idosell().getClientsPayerAddress.page(2,10).checkParams();
|
|
11
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
10
|
+
const params = idosell().getClientsPayerAddress.clientId("iaisystem").page(2,10).checkParams();
|
|
11
|
+
expect(params).toEqual({"resultsPage":2,"resultsLimit":10,"clientId":"iaisystem"});
|
|
12
12
|
})
|
|
@@ -7,6 +7,6 @@ test("getClientsPricelistsProductsPriceListId", () => {
|
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("getClientsPricelistsProductsPage", () => {
|
|
10
|
-
const params = idosell().getClientsPricelistsProducts.page(2,10).checkParams();
|
|
11
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
10
|
+
const params = idosell().getClientsPricelistsProducts.priceListId(4).page(2,10).checkParams();
|
|
11
|
+
expect(params).toEqual({"resultsPage":2,"resultsLimit":10,"priceListId":4});
|
|
12
12
|
})
|
|
@@ -6,7 +6,8 @@ test("getCouriersCountryCode", () => {
|
|
|
6
6
|
expect(params).toEqual({"countryCode":"PL"});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
test("getCouriersPage", () => {
|
|
10
|
-
const params = idosell().getCouriers.page(2,10).checkParams();
|
|
11
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
11
|
+
const params = idosell().getCouriers.countryCode("PL").page(2,10).checkParams();
|
|
12
|
+
expect(params).toEqual({"countryCode":"PL","resultsPage":2,"resultsLimit":10});
|
|
12
13
|
})
|
|
@@ -7,11 +7,11 @@ test("getCouriersPickupPointsCourierId", () => {
|
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("getCouriersPickupPointsPickupPointExternalId", () => {
|
|
10
|
-
const params = idosell().getCouriersPickupPoints.pickupPointExternalId("101293B").checkParams();
|
|
11
|
-
expect(params).toEqual({"pickupPointExternalId":"101293B"});
|
|
10
|
+
const params = idosell().getCouriersPickupPoints.courierId(2270020).pickupPointExternalId("101293B").checkParams();
|
|
11
|
+
expect(params).toEqual({"pickupPointExternalId":"101293B","courierId":2270020});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
test("getCouriersPickupPointsPage", () => {
|
|
15
|
-
const params = idosell().getCouriersPickupPoints.page(2,10).checkParams();
|
|
16
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
15
|
+
const params = idosell().getCouriersPickupPoints.courierId(2270020).page(2,10).checkParams();
|
|
16
|
+
expect(params).toEqual({"resultsPage":2,"resultsLimit":10,"courierId":2270020});
|
|
17
17
|
})
|
package/tests/getMenu.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import idosell from "./dist/index"
|
|
1
|
+
import idosell from "./dist/index.ts"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getMenu.lang_id("pol").checkParams();
|
|
6
|
-
expect(params).toEqual({"lang_id":"pol"});
|
|
4
|
+
test("getMenu", () => {
|
|
5
|
+
const params = idosell().getMenu.shop_id(1).menu_id(1).lang_id("pol").checkParams();
|
|
6
|
+
expect(params).toEqual({"shop_id":1,"menu_id":1,"lang_id":"pol"});
|
|
7
7
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getMenuFilter.languageId("pol").checkParams();
|
|
6
|
-
expect(params).toEqual({"languageId":"pol"});
|
|
4
|
+
test("getMenuFilterProductMenu", () => {
|
|
5
|
+
const params = idosell().getMenuFilter.shopId(1).languageId("pol").productMenuTreeId(1).productMenuNodeId(161).checkParams();
|
|
6
|
+
expect(params).toEqual({"shopId":1,"languageId":"pol","productMenuTreeId":1,"productMenuNodeId":161});
|
|
7
7
|
})
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import idosell from "./dist/index"
|
|
1
|
+
import idosell from "./dist/index.ts"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("getOrdersAuctionDetailsSerialNumbers", () => {
|
|
5
|
-
const params = idosell().getOrdersAuctionDetails.serialNumbers([
|
|
6
|
-
expect(params).toEqual({"
|
|
5
|
+
const params = idosell().getOrdersAuctionDetails.serialNumbers([1706995,1706991]).checkParams();
|
|
6
|
+
expect(params).toEqual({"identType":"order_sn","orders":[1706995,1706991]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getOrdersAuctionDetailsOrders", () => {
|
|
10
|
+
const params = idosell().getOrdersAuctionDetails.identType("orders_sn").orders([1706995]).checkParams();
|
|
11
|
+
expect(params).toEqual({"identType":"orders_sn","orders":[1706995]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getOrdersAuctionDetailsIds", () => {
|
|
15
|
+
const params = idosell().getOrdersAuctionDetails.ids("client-1").checkParams();
|
|
16
|
+
expect(params).toEqual({"identType":"order_id","orders":["client-1"]});
|
|
7
17
|
})
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import idosell from "./dist/index"
|
|
1
|
+
import idosell from "./dist/index.ts"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getOrdersExportdocumentsEPP.
|
|
6
|
-
expect(params).toEqual({"
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getOrdersExportdocumentsEPPApplicationType", () => {
|
|
10
|
-
const params = idosell().getOrdersExportdocumentsEPP.applicationType("SubiektGT").checkParams();
|
|
11
|
-
expect(params).toEqual({"applicationType":"SubiektGT"});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getOrdersExportdocumentsEPPDocumentType", () => {
|
|
15
|
-
const params = idosell().getOrdersExportdocumentsEPP.documentType("all").checkParams();
|
|
16
|
-
expect(params).toEqual({"documentType":"all"});
|
|
4
|
+
test("getOrdersExportdocuments", () => {
|
|
5
|
+
const params = idosell().getOrdersExportdocumentsEPP.dateBegin("2025-01-01").dateEnd("2025-01-31").applicationType("SubiektGT").documentType("all").checkParams();
|
|
6
|
+
expect(params).toEqual({"dateBegin":"2025-01-01","dateEnd":"2025-01-31","applicationType":"SubiektGT","documentType":"all"});
|
|
17
7
|
})
|
|
18
8
|
|
|
19
9
|
test("getOrdersExportdocumentsEPPDates", () => {
|
|
20
|
-
const params = idosell().getOrdersExportdocumentsEPP.dates("2023-01-01", 1672704000000).checkParams();
|
|
21
|
-
expect(params).toEqual({"dateBegin":"2023-01-01","dateEnd":"2023-01-03"});
|
|
10
|
+
const params = idosell().getOrdersExportdocumentsEPP.applicationType("SubiektGT").documentType("all").dates("2023-01-01", 1672704000000).checkParams();
|
|
11
|
+
expect(params).toEqual({"applicationType":"SubiektGT","documentType":"all","dateBegin":"2023-01-01","dateEnd":"2023-01-03"});
|
|
22
12
|
})
|
|
@@ -2,8 +2,8 @@ import idosell from "./dist/index"
|
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("getOrdersExportdocumentsJPK_MAG", () => {
|
|
5
|
-
const params = idosell().getOrdersExportdocumentsJPK.documentType("JPK_MAG").dateBegin("2023-12-01").dateEnd("2023-12-31").stockId([1]).checkParams();
|
|
6
|
-
expect(params).toEqual({"documentType":"JPK_MAG","dateBegin":"2023-12-01","dateEnd":"2023-12-31","stockId":[1]});
|
|
5
|
+
const params = idosell().getOrdersExportdocumentsJPK.documentType("JPK_MAG").dateBegin("2023-12-01").dateEnd("2023-12-31").stockId([1]).currency("PLN").checkParams();
|
|
6
|
+
expect(params).toEqual({"documentType":"JPK_MAG","dateBegin":"2023-12-01","dateEnd":"2023-12-31","stockId":[1],"currency":"PLN"});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("getOrdersExportdocumentsJPK", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getOrdersOpinionsRate.operation("positive").checkParams();
|
|
6
|
-
expect(params).toEqual({"operation":"positive"});
|
|
4
|
+
test("getOrdersOpinionsRateId", () => {
|
|
5
|
+
const params = idosell().getOrdersOpinionsRate.operation("positive").id(123).checkParams();
|
|
6
|
+
expect(params).toEqual({"operation":"positive","id":123});
|
|
7
7
|
})
|
|
@@ -6,12 +6,12 @@ test("getOrdersPackagesDeliveryPackageNumbers", () => {
|
|
|
6
6
|
expect(params).toEqual({"deliveryPackageNumbers":["13489301116623"]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("getOrdersPackagesReturnLabels", () => {
|
|
10
|
-
const params = idosell().getOrdersPackages.returnLabels(true).checkParams();
|
|
11
|
-
expect(params).toEqual({"returnLabels":true});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
9
|
test("getOrdersPackagesOrderNumbers", () => {
|
|
15
10
|
const params = idosell().getOrdersPackages.orderNumbers([3]).checkParams();
|
|
16
11
|
expect(params).toEqual({"orderNumbers":[3]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getOrdersPackagesReturnLabels", () => {
|
|
15
|
+
const params = idosell().getOrdersPackages.returnNumbers(3).returnLabels(true).checkParams();
|
|
16
|
+
expect(params).toEqual({"returnNumbers":3,"returnLabels":true});
|
|
17
17
|
})
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import idosell from "./dist/index"
|
|
1
|
+
import idosell from "./dist/index.ts"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getPayments.paymentNumber("3532-1").checkParams();
|
|
6
|
-
expect(params).toEqual({"paymentNumber":"3532-1"});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getPaymentsSourceType", () => {
|
|
10
|
-
const params = idosell().getPayments.sourceType("order").checkParams();
|
|
11
|
-
expect(params).toEqual({"sourceType":"order"});
|
|
4
|
+
test("getPayments", () => {
|
|
5
|
+
const params = idosell().getPayments.paymentNumber("3532-1").sourceType("order").checkParams();
|
|
6
|
+
expect(params).toEqual({"paymentNumber":"3532-1","sourceType":"order"});
|
|
12
7
|
})
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
test("getProductsAuctionsPage", () => {
|
|
5
6
|
const params = idosell().getProductsAuctions.page(2,10).checkParams();
|
|
6
7
|
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
7
8
|
})
|
|
8
9
|
|
|
9
10
|
test("getProductsAuctionsFromAllegro", () => {
|
|
10
|
-
const params = idosell().getProductsAuctions.
|
|
11
|
-
expect(params).toEqual({"
|
|
11
|
+
const params = idosell().getProductsAuctions.fromAllegro().checkParams();
|
|
12
|
+
expect(params).toEqual({"auctionSites":["allegro"]});
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test("getProductsAuctionsIds", () => {
|
|
16
|
+
const params = idosell().getProductsAuctions.ids(38204).checkParams();
|
|
17
|
+
expect(params).toEqual({"identType":"id","products":[38204]});
|
|
12
18
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
test("getProductsBrandsFilter", () => {
|
|
6
|
+
const params = idosell().getProductsBrandsFilter.producerId(1644776320).languageId("pol").shopId(1).checkParams();
|
|
7
|
+
expect(params).toEqual({"producerId":1644776320,"languageId":"pol","shopId":1});
|
|
7
8
|
})
|
|
@@ -2,6 +2,6 @@ import idosell from "./dist/index"
|
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("getProductsOpinionsRateOperation", () => {
|
|
5
|
-
const params = idosell().getProductsOpinionsRate.operation("positive").checkParams();
|
|
6
|
-
expect(params).toEqual({"operation":"positive"});
|
|
5
|
+
const params = idosell().getProductsOpinionsRate.id(1).operation("positive").checkParams();
|
|
6
|
+
expect(params).toEqual({"operation":"positive","id":1});
|
|
7
7
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
test("getProductsProductsToFacebookCatalogFacebookCatalogId", () => {
|
|
6
|
+
const params = idosell().getProductsProductsToFacebookCatalog.shopId(1).facebookCatalogId(123).checkParams();
|
|
7
|
+
expect(params).toEqual({"shopId":1,"facebookCatalogId":123});
|
|
7
8
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
test("getProductsSeriesFilterSerieId", () => {
|
|
5
|
-
const params = idosell().getProductsSeriesFilter.
|
|
6
|
-
expect(params).toEqual({"serieId":
|
|
6
|
+
const params = idosell().getProductsSeriesFilter.shopId(1).languageId("pol").serieId(9).checkParams();
|
|
7
|
+
expect(params).toEqual({"shopId":1,"languageId":"pol","serieId":9});
|
|
7
8
|
})
|
package/tests/getReturns.test.js
CHANGED
|
@@ -22,6 +22,6 @@ test("getReturnsDates", () => {
|
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
test("getReturnsPage", () => {
|
|
25
|
-
const params = idosell().getReturns.page(2,10).checkParams();
|
|
26
|
-
expect(params).toEqual({"results_page":2,"results_limit":10});
|
|
25
|
+
const params = idosell().getReturns.status(14).page(2,10).checkParams();
|
|
26
|
+
expect(params).toEqual({"status":14,"results_page":2,"results_limit":10});
|
|
27
27
|
})
|
|
@@ -7,6 +7,6 @@ test("getWmsLocationsStockId", () => {
|
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("getWmsLocationsPage", () => {
|
|
10
|
-
const params = idosell().getWmsLocations.page(2,10).checkParams();
|
|
11
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
10
|
+
const params = idosell().getWmsLocations.stockId(1).page(2,10).checkParams();
|
|
11
|
+
expect(params).toEqual({"stockId":1,"resultsPage":2,"resultsLimit":10});
|
|
12
12
|
})
|
|
@@ -6,17 +6,17 @@ test("getWmsStocksdocumentsDocumentsStockDocumentType", () => {
|
|
|
6
6
|
expect(params).toEqual({"stockDocumentType":"pz"});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().getWmsStocksdocumentsDocuments.
|
|
11
|
-
expect(params).toEqual({"
|
|
9
|
+
test("getWmsStocksdocumentsDocumentsDates", () => {
|
|
10
|
+
const params = idosell().getWmsStocksdocumentsDocuments.stockDocumentType("pz").dates("2023-12-18", "2023-12-31", "open").checkParams();
|
|
11
|
+
expect(params).toEqual({"stockDocumentType":"pz","dateRange":{"dateBegin":"2023-12-18 00:00:00","dateEnd":"2023-12-31 23:59:59","dateType":"open"}});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().getWmsStocksdocumentsDocuments.
|
|
16
|
-
expect(params).toEqual({"
|
|
14
|
+
test("getWmsStocksdocumentsDocumentsStockDocumentStatus", () => {
|
|
15
|
+
const params = idosell().getWmsStocksdocumentsDocuments.stockDocumentType("pz").stockDocumentStatus("open").checkParams();
|
|
16
|
+
expect(params).toEqual({"stockDocumentType":"pz","stockDocumentStatus":"open"});
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
test("
|
|
20
|
-
const params = idosell().getWmsStocksdocumentsDocuments.stockDocumentType("pz").
|
|
21
|
-
expect(params).toEqual({"stockDocumentType":"pz","
|
|
19
|
+
test("getWmsStocksdocumentsDocumentsPage", () => {
|
|
20
|
+
const params = idosell().getWmsStocksdocumentsDocuments.stockDocumentType("pz").page(2,10).checkParams();
|
|
21
|
+
expect(params).toEqual({"stockDocumentType":"pz","resultsPage":2,"resultsLimit":10});
|
|
22
22
|
})
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("getWmsStocksdocumentsProductsType", () => {
|
|
5
|
-
const params = idosell().getWmsStocksdocumentsProducts.type("pz").checkParams();
|
|
6
|
-
expect(params).toEqual({"type":"pz"});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
4
|
test("getWmsStocksdocumentsProductsId", () => {
|
|
10
|
-
const params = idosell().getWmsStocksdocumentsProducts.id(123).checkParams();
|
|
11
|
-
expect(params).toEqual({"id":123});
|
|
5
|
+
const params = idosell().getWmsStocksdocumentsProducts.type("pz").id(123).checkParams();
|
|
6
|
+
expect(params).toEqual({"type":"pz","id":123});
|
|
12
7
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().postEntries.langId("pol").shopId(1).shortDescription("entry").longDescription("My
|
|
6
|
-
expect(params).toEqual({"langs":[{"langId":"pol","shortDescription":"entry","longDescription":"My
|
|
4
|
+
test("postEntriesVisibleOnSitesList", () => {
|
|
5
|
+
const params = idosell().postEntries.langId("pol").shopId(1).shortDescription("entry").longDescription("My entry").visible("y").date("2025-01-01").titleLinkType("fullContentLink").title("Entry").visibleOnSitesList([{"siteId":"display_on_blog"}]).checkParams();
|
|
6
|
+
expect(params).toEqual({"langs":[{"langId":"pol","shortDescription":"entry","longDescription":"My entry","title":"Entry"}],"shopId":1,"visible":"y","date":"2025-01-01","titleLinkType":"fullContentLink","visibleOnSitesList":[{"siteId":"display_on_blog"}]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("postEntriesNews", () => {
|
|
10
|
-
const params = idosell().postEntries.blog().news().checkParams();
|
|
11
|
-
expect(params).toEqual({"langs":[{}],"visibleOnSitesList":[{"siteId":"display_on_blog"},{"
|
|
10
|
+
const params = idosell().postEntries.langId("pol").shopId(1).shortDescription("entry").longDescription("My entry").visible("y").date("2025-01-01").titleLinkType("fullContentLink").title("Entry").blog().news().checkParams();
|
|
11
|
+
expect(params).toEqual({"langs":[{"langId":"pol","shortDescription":"entry","longDescription":"My entry","title":"Entry"}],"shopId":1,"visible":"y","date":"2025-01-01","titleLinkType":"fullContentLink","visibleOnSitesList":[{"siteId":"display_on_blog"},{"siteId":"display_on_news"}]});
|
|
12
12
|
})
|
|
@@ -4,4 +4,9 @@ import { expect, test } from "vitest"
|
|
|
4
4
|
test("postOrdersDocumentsName", () => {
|
|
5
5
|
const params = idosell().postOrdersDocuments.orderSerialNumber(9).type("other").name("document").checkParams();
|
|
6
6
|
expect(params).toEqual({"documents":[{"orderSerialNumber":9,"type":"other","name":"document"}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("postOrdersDocumentsDate", () => {
|
|
10
|
+
const params = idosell().postOrdersDocuments.orderSerialNumber(33).name("FAK123").date("2025-07-01").checkParams();
|
|
11
|
+
expect(params).toEqual({"documents":[{"orderSerialNumber":33,"name":"FAK123","additionalData":{"documentIssuedDate":"2025-07-01"}}]});
|
|
7
12
|
})
|
|
@@ -2,8 +2,8 @@ import idosell from "./dist/index"
|
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("postProductsProductSizes", () => {
|
|
5
|
-
const params = idosell().postProducts.productSizes([{"sizeId":"uniw"}]).checkParams();
|
|
6
|
-
expect(params).toEqual({"products":[{"productSizes":[{"sizeId":"uniw"}]}]});
|
|
5
|
+
const params = idosell().postProducts.shopsMask(1).productSizes([{"sizeId":"uniw"}]).checkParams();
|
|
6
|
+
expect(params).toEqual({"products":[{"shopsMask":1,"productSizes":[{"sizeId":"uniw"}]}]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("postProductsShopsMask", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().putOrdersDevide.orderSerialNumber(
|
|
6
|
-
expect(params).toEqual({"orderSerialNumber":
|
|
4
|
+
test("putOrdersDevideBasketPosition", () => {
|
|
5
|
+
const params = idosell().putOrdersDevide.orderSerialNumber(241).basketPosition(1).checkParams();
|
|
6
|
+
expect(params).toEqual({"orderSerialNumber":241,"products":[{"basketPosition":1}]});
|
|
7
7
|
})
|
|
@@ -4,4 +4,19 @@ import { expect, test } from "vitest"
|
|
|
4
4
|
test("putProductsOmnibusPricesOmnibusPrices", () => {
|
|
5
5
|
const params = idosell().putProductsOmnibusPrices.ident({"type":"id","value":"33"}).omnibusPrices({"omnibusPriceRetail":299}).checkParams();
|
|
6
6
|
expect(params).toEqual({"products":[{"ident":{"type":"id","value":"33"},"omnibusPrices":{"omnibusPriceRetail":299}}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("putProductsOmnibusPricesProductId", () => {
|
|
10
|
+
const params = idosell().putProductsOmnibusPrices.productId(33).checkParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33}}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("putProductsOmnibusPricesSetPrice", () => {
|
|
15
|
+
const params = idosell().putProductsOmnibusPrices.productId(33).setPrice(299).setPrice(259, true).checkParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33},"omnibusPrices":{"omnibusPriceRetail":299,"omnibusPriceWholesale":259}}]});
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test("putProductsOmnibusPricesMode", () => {
|
|
20
|
+
const params = idosell().putProductsOmnibusPrices.productId(33).mode(true).checkParams();
|
|
21
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33},"omnibusPrices":{"omnibusPriceManagement":"manual"}}]});
|
|
7
22
|
})
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import idosell from "./dist/index"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
4
|
+
test("putProductsStrikethroughPricesRetail", () => {
|
|
5
5
|
const params = idosell().putProductsStrikethroughPrices.ident({"type":"id","value":"33"}).stp_settings({"price_change_mode":"amount_set","price_change_basevalue":"price","retail_price_change_value":199}).checkParams();
|
|
6
6
|
expect(params).toEqual({"products":[{"ident":{"type":"id","value":"33"},"stp_settings":{"price_change_mode":"amount_set","price_change_basevalue":"price","retail_price_change_value":199}}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("putProductsStrikethroughPricesProductId", () => {
|
|
10
|
+
const params = idosell().putProductsStrikethroughPrices.stp_settings({"price_change_mode":"amount_set","retail_price_change_value":249}).productId(33).checkParams();
|
|
11
|
+
expect(params).toEqual({"products":[{"stp_settings":{"price_change_mode":"amount_set","retail_price_change_value":249},"ident":{"type":"id","value":33}}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("putProductsStrikethroughPricesSetPrice", () => {
|
|
15
|
+
const params = idosell().putProductsStrikethroughPrices.productId(33).setPrice(349).checkParams();
|
|
16
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33},"stp_settings":{"price_change_mode":"amount_set","price_change_basevalue":"price","retail_price_change_value":349}}]});
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test("putProductsStrikethroughPricesAddPricePercent", () => {
|
|
20
|
+
const params = idosell().putProductsStrikethroughPrices.productId(33).addPricePercent(20).addPricePercent(5, true).checkParams();
|
|
21
|
+
expect(params).toEqual({"products":[{"ident":{"type":"id","value":33},"stp_settings":{"price_change_mode":"percent_diff","price_change_basevalue":"price","retail_price_change_value":20,"wholesale_price_change_value":5}}]});
|
|
7
22
|
})
|
package/tests/putSizes.test.js
CHANGED
|
@@ -2,8 +2,8 @@ import idosell from "./dist/index"
|
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("putSizesName", () => {
|
|
5
|
-
const params = idosell().putSizes.id("W").name("512GB").checkParams();
|
|
6
|
-
expect(params).toEqual({"sizes":[{"id":"W","name":"512GB"}]});
|
|
5
|
+
const params = idosell().putSizes.id("W").operation("add").name("512GB").checkParams();
|
|
6
|
+
expect(params).toEqual({"sizes":[{"id":"W","name":"512GB","operation":"add"}]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
test("putSizesOperation", () => {
|