idosell 0.1.15 → 0.2.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/changelog.md +34 -0
- package/dist/gates.def.js +465 -363
- package/dist/gates.js +56 -26
- package/dist/helpers.js +8 -0
- package/dist/index.js +1 -1
- package/dist/methods/deleteClients.js +6 -0
- package/dist/methods/deleteResponsibilityEntities.js +6 -0
- package/dist/methods/getClientsBalance.js +1 -2
- package/dist/methods/getDiscountsGroups.js +0 -1
- package/dist/methods/getOrdersAnalytics.js +0 -4
- package/dist/methods/getProductsCodeExistence.js +2 -5
- package/dist/methods/getProductsMarketingZones.js +2 -8
- package/dist/methods/getProductsOmnibusPrices.js +2 -7
- package/dist/methods/getProductsReservations.js +2 -4
- package/dist/methods/getProductsStocks.js +2 -4
- package/dist/methods/getProductsStrikethroughPrices.js +2 -8
- package/dist/methods/getResponsibilityEntities.js +6 -0
- package/dist/methods/getShopsCurrencies.js +6 -0
- package/dist/methods/getShopsLanguages.js +6 -0
- package/dist/methods/postResponsibilityEntities.js +11 -0
- package/dist/methods/putProductsStrikethroughPrices.js +0 -5
- package/dist/methods/putResponsibilityEntities.js +11 -0
- package/dist/methods/{getClientsCrm.js → searchClientsCrm.js} +1 -1
- package/dist/methods/{getClientsGiftcards.js → searchClientsGiftcards.js} +1 -1
- package/dist/methods/{getClientsNewsletterEmailShops.js → searchClientsNewsletterEmail.js} +1 -1
- package/dist/methods/{getClientsNewsletterEmailSMS.js → searchClientsNewsletterSms.js} +1 -1
- package/dist/methods/{listOrders.js → searchOrders.js} +1 -1
- package/dist/methods/{getOrdersOpinions.js → searchOrdersOpinions.js} +1 -1
- package/dist/methods/{listOrdersUnfinished.js → searchOrdersUnfinished.js} +1 -1
- package/dist/methods/{getPackages.js → searchPackages.js} +1 -2
- package/dist/methods/{listProducts.js → searchProducts.js} +1 -1
- package/dist/methods/{getProductsCategoriesIdosell.js → searchProductsCategoriesIdosell.js} +1 -1
- package/dist/methods/{getProductsDeliveryTime.js → searchProductsDeliveryTime.js} +1 -1
- package/dist/methods/{getProductsParameters.js → searchProductsParameters.js} +1 -1
- package/dist/request.js +2 -4
- package/package.json +1 -1
- package/tests/getClientsBalance.test.js +2 -2
- package/tests/getClientsGiftcards.test.js +2 -2
- package/tests/getDiscountsGroups.test.js +1 -1
- package/tests/getOrdersAnalytics.test.js +2 -2
- package/tests/getProductsCodeExistence.test.js +5 -10
- package/tests/getProductsMarketingZones.test.js +6 -11
- package/tests/getProductsOmnibusPrices.test.js +6 -11
- package/tests/getProductsReservations.test.js +6 -11
- package/tests/getProductsStocks.test.js +6 -11
- package/tests/getProductsStrikethroughPrices.test.js +6 -11
- package/tests/getWmsStocksdocumentsDocuments.test.js +1 -1
- package/tests/getWmsStocksdocumentsOpenedDocuments.test.js +1 -1
- package/tests/postResponsibilityEntities.test.js +8 -0
- package/tests/putResponsibilityEntities.test.js +8 -0
- package/tests/searchClientsCrm.test.js +22 -0
- package/tests/searchClientsGiftcards.test.js +7 -0
- package/tests/searchClientsNewsletterEmail.test.js +12 -0
- package/tests/searchClientsNewsletterSms.test.js +17 -0
- package/tests/searchOrders.test.js +62 -0
- package/tests/searchOrdersOpinions.test.js +32 -0
- package/tests/searchOrdersUnfinished.test.js +32 -0
- package/tests/searchPackages.test.js +17 -0
- package/tests/searchProducts.test.js +82 -0
- package/tests/searchProductsCategoriesIdosell.test.js +7 -0
- package/tests/searchProductsDeliveryTime.test.js +17 -0
- package/tests/searchProductsParameters.test.js +17 -0
- package/dist/methods/deleteProductsOpinionsOpinions.js +0 -6
- package/dist/methods/deleteWmsSuppliersSuppliers.js +0 -6
- package/dist/methods/getProductsOpinionsOpinions.js +0 -6
- package/dist/methods/getWmsSuppliersSuppliers.js +0 -6
- package/dist/methods/postProductsBundlesBundles.js +0 -6
- package/dist/methods/postProductsOpinionsOpinions.js +0 -6
- package/dist/methods/putProductsOpinionsOpinions.js +0 -6
- package/dist/methods/putWmsSuppliersSuppliers.js +0 -6
package/dist/request.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
import util from 'util';
|
|
3
2
|
import { page } from "./helpers.js";
|
|
4
3
|
|
|
5
4
|
const DECODE_TABLE = [
|
|
@@ -67,10 +66,9 @@ export const sendRequest = async (request, options = {}) => {
|
|
|
67
66
|
if (options.dump) return;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
if (method === 'get') {
|
|
69
|
+
if (method === 'get' || method === 'delete') {
|
|
72
70
|
url += '?' + queryfy(request.params);
|
|
73
|
-
const response = await axios
|
|
71
|
+
const response = await axios[method](url, { headers }).then(response => response.data).catch(catchIdosellError);
|
|
74
72
|
return checkNext(request, response);
|
|
75
73
|
} else {
|
|
76
74
|
const params = request.rootparams ? request.params : { params: request.params };
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ test("getClientsBalanceActive", () => {
|
|
|
8
8
|
|
|
9
9
|
test("getClientsBalancePage", () => {
|
|
10
10
|
const params = idosell().getClientsBalance.page(2,10).getParams();
|
|
11
|
-
expect(params).toEqual({"
|
|
11
|
+
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
test("getClientsBalanceClient_numbers", () => {
|
|
@@ -18,5 +18,5 @@ test("getClientsBalanceClient_numbers", () => {
|
|
|
18
18
|
|
|
19
19
|
test("getClientsBalanceLastPurchased", () => {
|
|
20
20
|
const params = idosell().getClientsBalance.lastPurchased("2023-01-01", 1672704000000).getParams();
|
|
21
|
-
expect(params).toEqual({"
|
|
21
|
+
expect(params).toEqual({"lastPurchaseDate":{"from":"2023-01-01","to":"2023-01-03"}});
|
|
22
22
|
})
|
|
@@ -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("searchClientsGiftcardsNumber", () => {
|
|
5
|
+
const params = idosell().searchClientsGiftcards.number([123,456,789]).getParams();
|
|
6
6
|
expect(params).toEqual({"giftCards":[{"number":123},{"number":456},{"number":789}]});
|
|
7
7
|
})
|
|
@@ -8,5 +8,5 @@ test("getDiscountsGroupsGroup_numbers", () => {
|
|
|
8
8
|
|
|
9
9
|
test("getDiscountsGroupsPage", () => {
|
|
10
10
|
const params = idosell().getDiscountsGroups.page(2,10).getParams();
|
|
11
|
-
expect(params).toEqual({"
|
|
11
|
+
expect(params).toEqual({"resultsPage":2,"resultsLimit":10});
|
|
12
12
|
})
|
|
@@ -2,6 +2,6 @@ import idosell from "./dist/index.js"
|
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
test("getOrdersAnalyticsSerialNumbers", () => {
|
|
5
|
-
const params = idosell().getOrdersAnalytics.
|
|
6
|
-
expect(params).toEqual({"
|
|
5
|
+
const params = idosell().getOrdersAnalytics.orderSerialNumber([123,456,789]).getParams();
|
|
6
|
+
expect(params).toEqual({"orderSerialNumber":[123,456,789]});
|
|
7
7
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsCodeExistence.
|
|
6
|
-
expect(params).toEqual({"
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getProductsCodeExistenceProducerCodes", () => {
|
|
10
|
-
const params = idosell().getProductsCodeExistence.producerCodes(99099099099).getParams();
|
|
11
|
-
expect(params).toEqual({"products":[{"productIdentType":"codeProducer","productId":99099099099}]});
|
|
4
|
+
test("getProductsCodeExistence", () => {
|
|
5
|
+
const params = idosell().getProductsCodeExistence.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
12
7
|
})
|
|
13
8
|
|
|
14
9
|
test("getProductsCodeExistenceIds", () => {
|
|
15
|
-
const params = idosell().getProductsCodeExistence.
|
|
16
|
-
expect(params).toEqual({"
|
|
10
|
+
const params = idosell().getProductsCodeExistence.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsMarketingZones.productId(
|
|
6
|
-
expect(params).toEqual({"
|
|
4
|
+
test("getProductsMarketingZones", () => {
|
|
5
|
+
const params = idosell().getProductsMarketingZones.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().getProductsMarketingZones.
|
|
11
|
-
expect(params).toEqual({"
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getProductsMarketingZonesProducts", () => {
|
|
15
|
-
const params = idosell().getProductsMarketingZones.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
-
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
9
|
+
test("getProductsMarketingZonesIds", () => {
|
|
10
|
+
const params = idosell().getProductsMarketingZones.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsOmnibusPrices.productId(
|
|
6
|
-
expect(params).toEqual({"
|
|
4
|
+
test("getProductsOmnibusPrices", () => {
|
|
5
|
+
const params = idosell().getProductsOmnibusPrices.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().getProductsOmnibusPrices.
|
|
11
|
-
expect(params).toEqual({"
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getProductsOmnibusPricesProducts", () => {
|
|
15
|
-
const params = idosell().getProductsOmnibusPrices.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
-
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
9
|
+
test("getProductsOmnibusPricesIds", () => {
|
|
10
|
+
const params = idosell().getProductsOmnibusPrices.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsReservations.
|
|
6
|
-
expect(params).toEqual({"
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getProductsReservationsExternalCodes", () => {
|
|
10
|
-
const params = idosell().getProductsReservations.externalCodes(["pav01"]).getParams();
|
|
11
|
-
expect(params).toEqual({"productsIdents":[{"identType":"codeExtern","identValue":"pav01"}]});
|
|
4
|
+
test("getProductsReservations", () => {
|
|
5
|
+
const params = idosell().getProductsReservations.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
12
7
|
})
|
|
13
8
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().getProductsReservations.
|
|
16
|
-
expect(params).toEqual({"
|
|
9
|
+
test("getProductsReservationsIds", () => {
|
|
10
|
+
const params = idosell().getProductsReservations.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsStocks.
|
|
6
|
-
expect(params).toEqual({"
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("getProductsStocksExternalCodes", () => {
|
|
10
|
-
const params = idosell().getProductsStocks.externalCodes(["pav01"]).getParams();
|
|
11
|
-
expect(params).toEqual({"products":[{"identType":"codeExtern","identValue":"pav01"}]});
|
|
4
|
+
test("getProductsStocks", () => {
|
|
5
|
+
const params = idosell().getProductsStocks.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
12
7
|
})
|
|
13
8
|
|
|
14
|
-
test("
|
|
15
|
-
const params = idosell().getProductsStocks.
|
|
16
|
-
expect(params).toEqual({"
|
|
9
|
+
test("getProductsStocksIds", () => {
|
|
10
|
+
const params = idosell().getProductsStocks.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import idosell from "./dist/index.js"
|
|
2
2
|
import { expect, test } from "vitest"
|
|
3
3
|
|
|
4
|
-
test("
|
|
5
|
-
const params = idosell().getProductsStrikethroughPrices.productId(
|
|
6
|
-
expect(params).toEqual({"
|
|
4
|
+
test("getProductsStrikethroughPrices", () => {
|
|
5
|
+
const params = idosell().getProductsStrikethroughPrices.productId([30, 42]).getParams();
|
|
6
|
+
expect(params).toEqual({"identType":"id","products":[30,42]});
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
const params = idosell().getProductsStrikethroughPrices.
|
|
11
|
-
expect(params).toEqual({"
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test("getProductsStrikethroughPricesProducts", () => {
|
|
15
|
-
const params = idosell().getProductsStrikethroughPrices.products([{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]).getParams();
|
|
16
|
-
expect(params).toEqual({"products":[{"ident":{"type":"id","value":15},"sizes":[{"ident":{"type":"id","value":4}}]}]});
|
|
9
|
+
test("getProductsStrikethroughPricesIds", () => {
|
|
10
|
+
const params = idosell().getProductsStrikethroughPrices.identType('codeProducer').products(['1234567890123']).getParams();
|
|
11
|
+
expect(params).toEqual({"identType":"codeProducer","products":["1234567890123"]});
|
|
17
12
|
})
|
|
@@ -18,5 +18,5 @@ test("getWmsStocksdocumentsDocumentsPage", () => {
|
|
|
18
18
|
|
|
19
19
|
test("getWmsStocksdocumentsDocumentsDates", () => {
|
|
20
20
|
const params = idosell().getWmsStocksdocumentsDocuments.stockDocumentType("pz").dates("2023-12-18", "2023-12-31", "open").getParams();
|
|
21
|
-
expect(params).toEqual({"stockDocumentType":"pz","
|
|
21
|
+
expect(params).toEqual({"stockDocumentType":"pz","dateRange":{"dateBegin":"2023-12-18 00:00:00","dateEnd":"2023-12-31 23:59:59","dateType":"open"}});
|
|
22
22
|
})
|
|
@@ -18,5 +18,5 @@ test("getWmsStocksdocumentsOpenedDocumentsPage", () => {
|
|
|
18
18
|
|
|
19
19
|
test("getWmsStocksdocumentsOpenedDocumentsDates", () => {
|
|
20
20
|
const params = idosell().getWmsStocksdocumentsOpenedDocuments.stockDocumentType("pz").dates("2023-12-18", "2023-12-31", "open").getParams();
|
|
21
|
-
expect(params).toEqual({"stockDocumentType":"pz","
|
|
21
|
+
expect(params).toEqual({"stockDocumentType":"pz","dateRange":{"dateBegin":"2023-12-18 00:00:00","dateEnd":"2023-12-31 23:59:59","dateType":"open"}});
|
|
22
22
|
})
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getClientsGiftcardsNumber", () => {
|
|
5
|
+
const params = idosell().getClientsGiftcards.number([123,456,789]).getParams();
|
|
6
|
+
expect(params).toEqual({"giftCards":[{"number":123},{"number":456},{"number":789}]});
|
|
7
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import idosell from "./dist/index.js"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
|
|
4
|
+
test("getPackagesOrders", () => {
|
|
5
|
+
const params = idosell().getPackages.orders([15,16]).getParams();
|
|
6
|
+
expect(params).toEqual({"events":[{"eventType":"order","eventsIds":[15,16]}]});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("getPackagesReturns", () => {
|
|
10
|
+
const params = idosell().getPackages.returns([2]).getParams();
|
|
11
|
+
expect(params).toEqual({"events":[{"eventType":"return","eventsIds":[2]}]});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("getPackagesRma", () => {
|
|
15
|
+
const params = idosell().getPackages.rma([1]).getParams();
|
|
16
|
+
expect(params).toEqual({"events":[{"eventType":"rma","eventsIds":[1]}]});
|
|
17
|
+
})
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
})
|