idosell 0.2.1 → 0.2.4
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 +19 -0
- package/dist/gates.def.js +60 -44
- 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/getReturns.js +1 -1
- package/dist/methods/getSnippets.js +4 -0
- package/dist/methods/getSnippetsCampaign.js +4 -0
- package/dist/methods/getSnippetsCookies.js +4 -0
- package/dist/methods/putProductsStrikethroughPrices.js +5 -0
- package/dist/params.js +8 -8
- package/dist/request.js +11 -2
- package/package.json +2 -2
- 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,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
|
-
|