idosell 0.2.2 → 0.2.5
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/gates.def.js +232 -133
- package/dist/gates.js +22 -0
- package/dist/index.js +3 -1
- package/dist/methods/getCpa.js +4 -0
- package/dist/methods/getCpaCampaign.js +4 -0
- package/dist/methods/getPackagesLabels.js +5 -0
- package/dist/methods/getResponsibilityEntities.js +4 -0
- package/dist/methods/getSnippets.js +4 -0
- package/dist/methods/getSnippetsCampaign.js +4 -0
- package/dist/methods/getSnippetsCookies.js +4 -0
- package/dist/methods/postSubscriptionsAddProduct.js +7 -0
- package/dist/methods/postSubscriptionsChangeDeliveryDates.js +7 -0
- package/dist/methods/postSubscriptionsChangePriceAutoUpdate.js +7 -0
- package/dist/methods/postSubscriptionsChangeStatus.js +7 -0
- package/dist/methods/postSubscriptionsDeleteProduct.js +7 -0
- package/dist/methods/postSubscriptionsEdit.js +7 -0
- package/dist/methods/postSubscriptionsEditProduct.js +7 -0
- package/dist/methods/postSubscriptionsItemsList.js +7 -0
- package/dist/methods/postSubscriptionsListViewFetchIds.js +7 -0
- package/dist/methods/postSubscriptionsListViewList.js +7 -0
- package/dist/methods/postSubscriptionsSetRebateCode.js +7 -0
- package/dist/methods/postSubscriptionsUnsetRebateCode.js +7 -0
- package/dist/methods/putProductsStrikethroughPrices.js +5 -0
- package/dist/params.js +7 -10
- package/dist/request.js +16 -4
- package/package.json +1 -1
- package/tests/getCpa.test.js +12 -0
- package/tests/getCpaCampaign.test.js +12 -0
- package/tests/getPackagesLabels.test.js +7 -0
- package/tests/getReturns.test.js +1 -1
- package/tests/putReturns.test.js +7 -0
- package/tests/searchClientsCrm.test.js +8 -8
- package/tests/searchClientsGiftcards.test.js +2 -2
- package/tests/searchClientsNewsletterEmail.test.js +4 -4
- package/tests/searchClientsNewsletterSms.test.js +6 -6
- package/tests/searchOrders.test.js +24 -24
- package/tests/searchOrdersUnfinished.test.js +12 -12
- package/tests/searchPackages.test.js +6 -6
- package/tests/searchProducts.test.js +32 -32
- package/tests/searchProductsCategoriesIdosell.test.js +2 -2
- package/tests/searchProductsDeliveryTime.test.js +6 -6
- package/tests/searchProductsParameters.test.js +6 -6
- package/tests/url.test.js +6 -0
- package/tests/getClientsCrm.test.js +0 -22
- package/tests/getClientsGiftcards.test.js +0 -7
- package/tests/getClientsNewsletterEmailSMS.test.js +0 -17
- package/tests/getClientsNewsletterEmailShops.test.js +0 -12
- package/tests/getOrdersOpinions.test.js +0 -32
- package/tests/getPackages.test.js +0 -17
- package/tests/getProductsCategoriesIdosell.test.js +0 -7
- package/tests/getProductsDeliveryTime.test.js +0 -17
- package/tests/getProductsParameters.test.js +0 -17
- package/tests/listOrders.test.js +0 -62
- package/tests/listOrdersUnfinished.test.js +0 -32
- package/tests/listProducts.test.js +0 -82
- package/tests/postResponsibilityEntities.test.js +0 -8
- package/tests/putResponsibilityEntities.test.js +0 -8
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().
|
|
4
|
+
test("searchPackagesOrders", () => {
|
|
5
|
+
const params = idosell().searchPackages.orders([15,16]).getParams();
|
|
6
6
|
expect(params).toEqual({"events":[{"eventType":"order","eventsIds":[15,16]}]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().
|
|
9
|
+
test("searchPackagesReturns", () => {
|
|
10
|
+
const params = idosell().searchPackages.returns([2]).getParams();
|
|
11
11
|
expect(params).toEqual({"events":[{"eventType":"return","eventsIds":[2]}]});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().
|
|
14
|
+
test("searchPackagesRma", () => {
|
|
15
|
+
const params = idosell().searchPackages.rma([1]).getParams();
|
|
16
16
|
expect(params).toEqual({"events":[{"eventType":"rma","eventsIds":[1]}]});
|
|
17
17
|
})
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().
|
|
4
|
+
test("searchProductsReturnElements", () => {
|
|
5
|
+
const params = idosell().searchProducts.returnElements(["code"]).getParams();
|
|
6
6
|
expect(params).toEqual({"returnElements":["code"]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().
|
|
9
|
+
test("searchProductsDates", () => {
|
|
10
|
+
const params = idosell().searchProducts.dates("2023-12-01", "2023-12-31", "finished").getParams();
|
|
11
11
|
expect(params).toEqual({"productDate":{"productDateBegin":"2023-12-01","productDateEnd":"2023-12-31","productDateMode":"finished"}});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().
|
|
14
|
+
test("searchProductsPage", () => {
|
|
15
|
+
const params = idosell().searchProducts.page(2,10).getParams();
|
|
16
16
|
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
test("
|
|
20
|
-
const params = idosell().
|
|
19
|
+
test("searchProductsIds", () => {
|
|
20
|
+
const params = idosell().searchProducts.ids([9,10,17]).getParams();
|
|
21
21
|
expect(params).toEqual({"productParams":[{"productId":9},{"productId":10},{"productId":17}]});
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
test("
|
|
25
|
-
const params = idosell().
|
|
24
|
+
test("searchProductsByPrice", () => {
|
|
25
|
+
const params = idosell().searchProducts.byPrice(200, 500, "retail_price").getParams();
|
|
26
26
|
expect(params).toEqual({"productSearchPriceRange":{"productSearchPriceMode":"retail_price","productSearchPriceMin":200,"productSearchPriceMax":500}});
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
test("
|
|
30
|
-
const params = idosell().
|
|
29
|
+
test("searchProductsByMenus", () => {
|
|
30
|
+
const params = idosell().searchProducts.byMenus([152]).getParams();
|
|
31
31
|
expect(params).toEqual({"productMenuItems":{"menuItemsIds":[152]}});
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
test("
|
|
35
|
-
const params = idosell().
|
|
34
|
+
test("searchProductsByShops", () => {
|
|
35
|
+
const params = idosell().searchProducts.byShops([1,2]).getParams();
|
|
36
36
|
expect(params).toEqual({"searchByShops":{"shopsIds":[1,2]}});
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
-
test("
|
|
40
|
-
const params = idosell().
|
|
39
|
+
test("searchProductsByProducers", () => {
|
|
40
|
+
const params = idosell().searchProducts.byProducers(1142347122).getParams();
|
|
41
41
|
expect(params).toEqual({"producers":[{"producerId":1142347122}]});
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
test("
|
|
45
|
-
const params = idosell().
|
|
44
|
+
test("searchProductsByCategories", () => {
|
|
45
|
+
const params = idosell().searchProducts.byCategories(1214553884).getParams();
|
|
46
46
|
expect(params).toEqual({"categories":[{"categoryId":1214553884}]});
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
-
test("
|
|
50
|
-
const params = idosell().
|
|
49
|
+
test("searchProductsByUnits", () => {
|
|
50
|
+
const params = idosell().searchProducts.byUnits(1).getParams();
|
|
51
51
|
expect(params).toEqual({"productUnits":[{"unitId":1}]});
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
test("
|
|
55
|
-
const params = idosell().
|
|
54
|
+
test("searchProductsBySeries", () => {
|
|
55
|
+
const params = idosell().searchProducts.bySeries([1]).getParams();
|
|
56
56
|
expect(params).toEqual({"productSeriesParams":[{"seriesId":1}]});
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
-
test("
|
|
60
|
-
const params = idosell().
|
|
59
|
+
test("searchProductsOnlyMainVersion", () => {
|
|
60
|
+
const params = idosell().searchProducts.onlyMainVersion().getParams();
|
|
61
61
|
expect(params).toEqual({"returnProductsVersions":"version_main"});
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
test("
|
|
65
|
-
const params = idosell().
|
|
64
|
+
test("searchProductsByWarranties", () => {
|
|
65
|
+
const params = idosell().searchProducts.byWarranties([1]).getParams();
|
|
66
66
|
expect(params).toEqual({"productWarranties":[{"warrantyId":1}]});
|
|
67
67
|
})
|
|
68
68
|
|
|
69
|
-
test("
|
|
70
|
-
const params = idosell().
|
|
69
|
+
test("searchProductsNotInStock", () => {
|
|
70
|
+
const params = idosell().searchProducts.inStock(false).getParams();
|
|
71
71
|
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"n"}});
|
|
72
72
|
})
|
|
73
73
|
|
|
74
|
-
test("
|
|
75
|
-
const params = idosell().
|
|
74
|
+
test("searchProductsInAnyStock", () => {
|
|
75
|
+
const params = idosell().searchProducts.inStock().getParams();
|
|
76
76
|
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"y"}});
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
test("
|
|
80
|
-
const params = idosell().
|
|
79
|
+
test("searchProductsInStock", () => {
|
|
80
|
+
const params = idosell().searchProducts.inStock([2,3]).getParams();
|
|
81
81
|
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"y","productAvailableInStocksIds":[2,3]}});
|
|
82
82
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().
|
|
4
|
+
test("searchProductsCategoriesIdosellPage", () => {
|
|
5
|
+
const params = idosell().searchProductsCategoriesIdosell.page(2,10).getParams();
|
|
6
6
|
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
7
7
|
})
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().
|
|
4
|
+
test("searchProductsDeliveryTimeId", () => {
|
|
5
|
+
const params = idosell().searchProductsDeliveryTime.productId(15).sizeId(4).getParams();
|
|
6
6
|
expect(params).toEqual({"products":[{"productId":15,"sizeId":4}]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().
|
|
9
|
+
test("searchProductsDeliveryTimeProductSizeQuantity", () => {
|
|
10
|
+
const params = idosell().searchProductsDeliveryTime.productId(15).sizeId(4).productSizeQuantity(3).getParams();
|
|
11
11
|
expect(params).toEqual({"products":[{"productId":15,"sizeId":4,"productSizeQuantity":3}]});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().
|
|
14
|
+
test("searchProductsDeliveryTimeProductIndex", () => {
|
|
15
|
+
const params = idosell().searchProductsDeliveryTime.productIndex("15-4").getParams();
|
|
16
16
|
expect(params).toEqual({"products":[{"productIndex":"15-4"}]});
|
|
17
17
|
})
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().
|
|
4
|
+
test("searchProductsParametersIds", () => {
|
|
5
|
+
const params = idosell().searchProductsParameters.ids([123,456,789]).getParams();
|
|
6
6
|
expect(params).toEqual({"ids":[123,456,789]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().
|
|
9
|
+
test("searchProductsParametersLanguagesIds", () => {
|
|
10
|
+
const params = idosell().searchProductsParameters.languagesIds(["pol"]).getParams();
|
|
11
11
|
expect(params).toEqual({"languagesIds":["pol"]});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().
|
|
14
|
+
test("searchProductsParametersPage", () => {
|
|
15
|
+
const params = idosell().searchProductsParameters.page(2,10).getParams();
|
|
16
16
|
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
17
17
|
})
|
package/tests/url.test.js
CHANGED
|
@@ -8,4 +8,10 @@ test("getClientsLastPurchased", () => {
|
|
|
8
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
|
+
})
|
|
12
|
+
|
|
13
|
+
test("getReturnsDates", () => {
|
|
14
|
+
const params = idosell().getReturns.dates("2025-01-01", "2025-01-31", 'date_end').getParams();
|
|
15
|
+
const search = queryfy(params);
|
|
16
|
+
expect(search).toEqual("range%5Bdate%5D%5Bdate_begin%5D=2025-01-01&range%5Bdate%5D%5Bdate_end%5D=2025-01-31&range%5Bdate%5D%5Bdates_type%5D=date_end")
|
|
11
17
|
})
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getClientsCrmClientLogin", () => {
|
|
5
|
-
const params = idosell().getClientsCrm.clientLogin("abcdefg").getParams();
|
|
6
|
-
expect(params).toEqual({"clientLogin":"abcdefg"});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getClientsCrmClientIsWholesaler", () => {
|
|
10
|
-
const params = idosell().getClientsCrm.clientIsWholesaler("yes").getParams();
|
|
11
|
-
expect(params).toEqual({"clientIsWholesaler":"yes"});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getClientsCrmRegistered", () => {
|
|
15
|
-
const params = idosell().getClientsCrm.registered("2023-01-01", 1672704000000).getParams();
|
|
16
|
-
expect(params).toEqual({"clientRegistrationDate":{"clientRegistrationDateBegin":"2023-01-01","clientRegistrationDateEnd":"2023-01-03"}});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test("getClientsCrmPage", () => {
|
|
20
|
-
const params = idosell().getClientsCrm.page(2,10).getParams();
|
|
21
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
22
|
-
})
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("searchClientsGiftcardsNumber", () => {
|
|
5
|
-
const params = idosell().searchClientsGiftcards.number([123,456,789]).getParams();
|
|
6
|
-
expect(params).toEqual({"giftCards":[{"number":123},{"number":456},{"number":789}]});
|
|
7
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getClientsNewsletterEmailSMSPage", () => {
|
|
5
|
-
const params = idosell().getClientsNewsletterEmailSMS.page(2,10).getParams();
|
|
6
|
-
expect(params).toEqual({"results_page":2,"results_limit":10});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getClientsNewsletterEmailSMSLanguage", () => {
|
|
10
|
-
const params = idosell().getClientsNewsletterEmailSMS.language("pol").getParams();
|
|
11
|
-
expect(params).toEqual({"language":"pol"});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getClientsNewsletterEmailSMSDates", () => {
|
|
15
|
-
const params = idosell().getClientsNewsletterEmailSMS.dates("2023-01-01", 1672704000000).getParams();
|
|
16
|
-
expect(params).toEqual({"date":{"from":"2023-01-01","to":"2023-01-03"}});
|
|
17
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getClientsNewsletterEmailShopsLanguage", () => {
|
|
5
|
-
const params = idosell().getClientsNewsletterEmailShops.language("pol").getParams();
|
|
6
|
-
expect(params).toEqual({"language":"pol"});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getClientsNewsletterEmailShopsPage", () => {
|
|
10
|
-
const params = idosell().getClientsNewsletterEmailShops.page(2,10).getParams();
|
|
11
|
-
expect(params).toEqual({"results_page":2,"results_limit":10});
|
|
12
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getOrdersOpinionsPage", () => {
|
|
5
|
-
const params = idosell().getOrdersOpinions.page(2,10).getParams();
|
|
6
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getOrdersOpinionsOrderBy", () => {
|
|
10
|
-
const params = idosell().getOrdersOpinions.orderBy("rating", false).getParams();
|
|
11
|
-
expect(params).toEqual({"ordersBy":[{"elementName":"rating","sortDirection":"ASC"}]});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getOrdersOpinionsDates", () => {
|
|
15
|
-
const params = idosell().getOrdersOpinions.dates("2023-01-01", 1672704000000).getParams();
|
|
16
|
-
expect(params).toEqual({"dateRange":{"begin":"2023-01-01","end":"2023-01-03"}});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test("getOrdersOpinionsOrderSerialNumber", () => {
|
|
20
|
-
const params = idosell().getOrdersOpinions.orderSerialNumber(3512).getParams();
|
|
21
|
-
expect(params).toEqual({"orders":{"type":"serialNumber","value":3512}});
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test("getOrdersOpinionsClientLogin", () => {
|
|
25
|
-
const params = idosell().getOrdersOpinions.clientLogin("user@mail.com").getParams();
|
|
26
|
-
expect(params).toEqual({"clients":{"type":"login","value":"user@mail.com"}});
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test("getOrdersOpinionsClientId", () => {
|
|
30
|
-
const params = idosell().getOrdersOpinions.clientId(3223).getParams();
|
|
31
|
-
expect(params).toEqual({"clients":{"type":"id","value":3223}});
|
|
32
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
})
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getProductsCategoriesIdosellPage", () => {
|
|
5
|
-
const params = idosell().getProductsCategoriesIdosell.page(2,10).getParams();
|
|
6
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
7
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getProductsDeliveryTimeId", () => {
|
|
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
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("getProductsParametersIds", () => {
|
|
5
|
-
const params = idosell().getProductsParameters.ids([123,456,789]).getParams();
|
|
6
|
-
expect(params).toEqual({"ids":[123,456,789]});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getProductsParametersLanguagesIds", () => {
|
|
10
|
-
const params = idosell().getProductsParameters.languagesIds(["pol"]).getParams();
|
|
11
|
-
expect(params).toEqual({"languagesIds":["pol"]});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getProductsParametersPage", () => {
|
|
15
|
-
const params = idosell().getProductsParameters.page(2,10).getParams();
|
|
16
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
17
|
-
})
|
package/tests/listOrders.test.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("listOrdersOrdersStatuses", () => {
|
|
5
|
-
const params = idosell().listOrders.ordersStatuses(["packed"]).getParams();
|
|
6
|
-
expect(params).toEqual({"ordersStatuses":["packed"]});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("listOrdersOrderType", () => {
|
|
10
|
-
const params = idosell().listOrders.orderType("wholesale").getParams();
|
|
11
|
-
expect(params).toEqual({"orderType":"wholesale"});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("listOrdersOrderBy", () => {
|
|
15
|
-
const params = idosell().listOrders.orderBy("sn", false).getParams();
|
|
16
|
-
expect(params).toEqual({"ordersBy":[{"elementName":"sn","sortDirection":"ASC"}]});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test("listOrdersLogins", () => {
|
|
20
|
-
const params = idosell().listOrders.logins(["iai_demo"]).getParams();
|
|
21
|
-
expect(params).toEqual({"clients":[{"type":"login","clientLogin":"iai_demo"}]});
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test("listOrdersPage", () => {
|
|
25
|
-
const params = idosell().listOrders.page(2,10).getParams();
|
|
26
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test("listOrdersStockIds", () => {
|
|
30
|
-
const params = idosell().listOrders.stockIds(2).getParams();
|
|
31
|
-
expect(params).toEqual({"stocks":[{"stockId":2}]});
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
test("listOrdersHasProductAnySize", () => {
|
|
35
|
-
const params = idosell().listOrders.hasProduct(13).getParams();
|
|
36
|
-
expect(params).toEqual({"products":[{"productId":13}]});
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
test("listOrdersHasProductWithSize", () => {
|
|
40
|
-
const params = idosell().listOrders.hasProduct(13,4).getParams();
|
|
41
|
-
expect(params).toEqual({"products":[{"productId":13,"sizeId":4}]});
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
test("listOrdersByPackageNumbers", () => {
|
|
45
|
-
const params = idosell().listOrders.byPackageNumbers([5003724016]).getParams();
|
|
46
|
-
expect(params).toEqual({"packages":{"orderHasPackageNumbers":"y","packagesNumbers":[5003724016]}});
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
test("listOrdersHasPackage", () => {
|
|
50
|
-
const params = idosell().listOrders.hasPackage().getParams();
|
|
51
|
-
expect(params).toEqual({"packages":{"orderHasPackageNumbers":"y"}});
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
test("listOrdersShopIds", () => {
|
|
55
|
-
const params = idosell().listOrders.shopIds([3]).getParams();
|
|
56
|
-
expect(params).toEqual({"orderSource":{"shopsIds":[3]}});
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
test("listOrdersFromAllegro", () => {
|
|
60
|
-
const params = idosell().listOrders.fromAllegro().getParams();
|
|
61
|
-
expect(params).toEqual({"orderSource":{"auctionsParams":{"auctionsServicesNames":["allegro"]}}});
|
|
62
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("listOrdersUnfinishedOrdersStatuses", () => {
|
|
5
|
-
const params = idosell().listOrdersUnfinished.ordersStatuses(["packed"]).getParams();
|
|
6
|
-
expect(params).toEqual({"ordersStatuses":["packed"]});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("listOrdersUnfinishedOrderType", () => {
|
|
10
|
-
const params = idosell().listOrdersUnfinished.orderType("wholesale").getParams();
|
|
11
|
-
expect(params).toEqual({"orderType":"wholesale"});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("listOrdersUnfinishedOrderBy", () => {
|
|
15
|
-
const params = idosell().listOrdersUnfinished.orderBy("sn", false).getParams();
|
|
16
|
-
expect(params).toEqual({"ordersBy":[{"elementName":"sn","sortDirection":"ASC"}]});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test("listOrdersUnfinishedLogins", () => {
|
|
20
|
-
const params = idosell().listOrdersUnfinished.logins(["iai_demo"]).getParams();
|
|
21
|
-
expect(params).toEqual({"clients":[{"type":"login","clientLogin":"iai_demo"}]});
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test("listOrdersUnfinishedPage", () => {
|
|
25
|
-
const params = idosell().listOrdersUnfinished.page(2,10).getParams();
|
|
26
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test("listOrdersUnfinishedStockIds", () => {
|
|
30
|
-
const params = idosell().listOrdersUnfinished.stockIds(2).getParams();
|
|
31
|
-
expect(params).toEqual({"stocks":[{"stockId":2}]});
|
|
32
|
-
})
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("listProductsReturnElements", () => {
|
|
5
|
-
const params = idosell().listProducts.returnElements(["code"]).getParams();
|
|
6
|
-
expect(params).toEqual({"returnElements":["code"]});
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("listProductsDates", () => {
|
|
10
|
-
const params = idosell().listProducts.dates("2023-12-01", "2023-12-31", "finished").getParams();
|
|
11
|
-
expect(params).toEqual({"productDate":{"productDateBegin":"2023-12-01","productDateEnd":"2023-12-31","productDateMode":"finished"}});
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("listProductsPage", () => {
|
|
15
|
-
const params = idosell().listProducts.page(2,10).getParams();
|
|
16
|
-
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test("listProductsIds", () => {
|
|
20
|
-
const params = idosell().listProducts.ids([9,10,17]).getParams();
|
|
21
|
-
expect(params).toEqual({"productParams":[{"productId":9},{"productId":10},{"productId":17}]});
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test("listProductsByPrice", () => {
|
|
25
|
-
const params = idosell().listProducts.byPrice(200, 500, "retail_price").getParams();
|
|
26
|
-
expect(params).toEqual({"productSearchPriceRange":{"productSearchPriceMode":"retail_price","productSearchPriceMin":200,"productSearchPriceMax":500}});
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test("listProductsByMenus", () => {
|
|
30
|
-
const params = idosell().listProducts.byMenus([152]).getParams();
|
|
31
|
-
expect(params).toEqual({"productMenuItems":{"menuItemsIds":[152]}});
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
test("listProductsByShops", () => {
|
|
35
|
-
const params = idosell().listProducts.byShops([1,2]).getParams();
|
|
36
|
-
expect(params).toEqual({"searchByShops":{"shopsIds":[1,2]}});
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
test("listProductsByProducers", () => {
|
|
40
|
-
const params = idosell().listProducts.byProducers(1142347122).getParams();
|
|
41
|
-
expect(params).toEqual({"producers":[{"producerId":1142347122}]});
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
test("listProductsByCategories", () => {
|
|
45
|
-
const params = idosell().listProducts.byCategories(1214553884).getParams();
|
|
46
|
-
expect(params).toEqual({"categories":[{"categoryId":1214553884}]});
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
test("listProductsByUnits", () => {
|
|
50
|
-
const params = idosell().listProducts.byUnits(1).getParams();
|
|
51
|
-
expect(params).toEqual({"productUnits":[{"unitId":1}]});
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
test("listProductsBySeries", () => {
|
|
55
|
-
const params = idosell().listProducts.bySeries([1]).getParams();
|
|
56
|
-
expect(params).toEqual({"productSeriesParams":[{"seriesId":1}]});
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
test("listProductsOnlyMainVersion", () => {
|
|
60
|
-
const params = idosell().listProducts.onlyMainVersion().getParams();
|
|
61
|
-
expect(params).toEqual({"returnProductsVersions":"version_main"});
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
test("listProductsByWarranties", () => {
|
|
65
|
-
const params = idosell().listProducts.byWarranties([1]).getParams();
|
|
66
|
-
expect(params).toEqual({"productWarranties":[{"warrantyId":1}]});
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
test("listProductsNotInStock", () => {
|
|
70
|
-
const params = idosell().listProducts.inStock(false).getParams();
|
|
71
|
-
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"n"}});
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
test("listProductsInAnyStock", () => {
|
|
75
|
-
const params = idosell().listProducts.inStock().getParams();
|
|
76
|
-
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"y"}});
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
test("listProductsInStock", () => {
|
|
80
|
-
const params = idosell().listProducts.inStock([2,3]).getParams();
|
|
81
|
-
expect(params).toEqual({"productAvailableInStocks":{"productIsAvailableInStocks":"y","productAvailableInStocksIds":[2,3]}});
|
|
82
|
-
})
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("postResponsibilityEntities", () => {
|
|
5
|
-
const params = idosell().postResponsibilityEntities.type("producer").city("Warszawa").country("PL").code("TEST").name("Testsp.zo.o.").main("test@mail.com").street("Testowa").number(12).zipcode("12-345")
|
|
6
|
-
expect(params).toEqual({"type":"producer","entities":[{"city":"Warszawa","country":"PL","code":"TEST","name":"Test sp. z o. o.","main":"test@mail.com","street":"Testowa","number":12,"zipcode":"12-345"}]});
|
|
7
|
-
})
|
|
8
|
-
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import idosell from "./dist/index.js"
|
|
2
|
-
import { expect, test } from "vitest"
|
|
3
|
-
|
|
4
|
-
test("putResponsibilityEntities", () => {
|
|
5
|
-
const params = idosell().putResponsibilityEntities.type('person').code('TEST').name('MultiTest sp. z o. o.')
|
|
6
|
-
expect(params).toEqual({"type":"person","entities":[{"code":"TEST","name":"MultiTest sp. z o. o."}]});
|
|
7
|
-
})
|
|
8
|
-
|