idosell 0.4.24 → 0.4.27

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.
Files changed (56) hide show
  1. package/changelog.md +9 -0
  2. package/dist/app.d.ts +2 -1
  3. package/dist/gates.js +51 -15
  4. package/dist/gateways.d.ts +278 -21
  5. package/dist/helpers.js +18 -0
  6. package/dist/index.js +3 -1
  7. package/dist/methods/deletePromotions.js +6 -0
  8. package/dist/methods/deletePromotionsArchive.js +6 -0
  9. package/dist/methods/deletePromotionsElements.js +13 -0
  10. package/dist/methods/getPromotions.js +6 -0
  11. package/dist/methods/getPromotionsArchive.js +6 -0
  12. package/dist/methods/getPromotionsSettings.js +5 -0
  13. package/dist/methods/postPromotions.js +8 -0
  14. package/dist/methods/postPromotionsElements.js +13 -0
  15. package/dist/methods/postPromotionsEnd.js +7 -0
  16. package/dist/methods/postPromotionsStart.js +7 -0
  17. package/dist/methods/putPromotions.js +8 -0
  18. package/dist/methods/putPromotionsSettings.js +6 -0
  19. package/dist/methods/searchPromotionsArchive.js +14 -0
  20. package/dist/methods/searchPromotionsElements.js +15 -0
  21. package/dist/methods/searchPromotionsHistory.js +13 -0
  22. package/dist/methods/searchPromotionsListView.js +21 -0
  23. package/dist/params.js +15 -1
  24. package/dist/reqparams.d.ts +165 -2
  25. package/dist/request.js +36 -10
  26. package/dist/responses.d.ts +111 -0
  27. package/package.json +1 -1
  28. package/tests/deleteProductsToFacebookCatalog.test.js +7 -0
  29. package/tests/deleteProductsToPromotion.test.js +7 -0
  30. package/tests/deletePromotions.test.js +7 -0
  31. package/tests/deletePromotionsArchive.test.js +7 -0
  32. package/tests/deletePromotionsElements.test.js +7 -0
  33. package/tests/getProductsToFacebookCatalog.test.js +8 -0
  34. package/tests/getPromotions.test.js +7 -0
  35. package/tests/getPromotionsArchive.test.js +7 -0
  36. package/tests/postProductsToFacebookCatalog.test.js +7 -0
  37. package/tests/postProductsToPromotion.test.js +7 -0
  38. package/tests/postPromotions.test.js +7 -0
  39. package/tests/postPromotionsElements.test.js +7 -0
  40. package/tests/postPromotionsEnd.test.js +7 -0
  41. package/tests/postPromotionsStart.test.js +7 -0
  42. package/tests/putPromotions.test.js +7 -0
  43. package/tests/putPromotionsSettings.test.js +7 -0
  44. package/tests/searchPromotionsArchive.test.js +12 -0
  45. package/tests/searchPromotionsElements.test.js +12 -0
  46. package/tests/searchPromotionsHistory.test.js +7 -0
  47. package/tests/searchPromotionsListView.test.js +7 -0
  48. package/tests/deleteProductsProductsToFacebookCatalog.test.js +0 -7
  49. package/tests/deleteProductsProductsToPromotion.test.js +0 -7
  50. /package/dist/methods/{deleteProductsProductsToFacebookCatalog.js → deleteProductsToFacebookCatalog.js} +0 -0
  51. /package/dist/methods/{deleteProductsProductsToPromotion.js → deleteProductsToPromotion.js} +0 -0
  52. /package/dist/methods/{getProductsProductsToFacebookCatalog.js → getProductsToFacebookCatalog.js} +0 -0
  53. /package/dist/methods/{postProductsProductsToFacebookCatalog.js → postProductsToFacebookCatalog.js} +0 -0
  54. /package/dist/methods/{postProductsProductsToPromotion.js → postProductsToPromotion.js} +0 -0
  55. /package/dist/methods/{postSubscriptionsItemsList.js → searchSubscriptionsItems.js} +0 -0
  56. /package/dist/methods/{postSubscriptionsListViewList.js → searchSubscriptionsListView.js} +0 -0
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postProductsToFacebookCatalogProducts", () => {
5
+ const params = idosell().postProductsToFacebookCatalog.facebookCatalogId(1).shopId(1).products([9]).checkParams();
6
+ expect(params).toEqual({"facebookCatalogId":1,"shopId":1,"products":[9]});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postProductsToPromotionProducts", () => {
5
+ const params = idosell().postProductsToPromotion.promotionId(2).products([11]).checkParams();
6
+ expect(params).toEqual({"promotionId":2,"products":[11]});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postPromotionsName", () => {
5
+ const params = idosell().postPromotions.activeInShops([1]).newPriceValue({ "value": "5" }).name("Promo").checkParams();
6
+ expect(params).toEqual({"activeInShops":[1],"newPriceValue":{"value":"5"},"name":"Promo"});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postPromotionsElementsPromotionId", () => {
5
+ const params = idosell().postPromotionsElements.id("179").type("product").promotionId(4).checkParams();
6
+ expect(params).toEqual({"elements":[{"id":"179","type":"product","promotionId":4}]});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postPromotionsEndPromotionId", () => {
5
+ const params = idosell().postPromotionsEnd.promotionId(123).checkParams();
6
+ expect(params).toEqual({"promotionId":123});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postPromotionsStartPromotionId", () => {
5
+ const params = idosell().postPromotionsStart.promotionId(123).checkParams();
6
+ expect(params).toEqual({"promotionId":123});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("putPromotionsName", () => {
5
+ const params = idosell().putPromotions.promotionId(4).name("Promotnion #4").checkParams();
6
+ expect(params).toEqual({"promotionId":4,"name":"Promotnion #4"});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("putPromotionsSettingsAutomaticallySuggestDefaultEndDate", () => {
5
+ const params = idosell().putPromotionsSettings.automaticallySuggestDefaultEndDate("on").checkParams();
6
+ expect(params).toEqual({"automaticallySuggestDefaultEndDate":"on"});
7
+ })
@@ -0,0 +1,12 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("searchPromotionsArchiveOrderByProperty", () => {
5
+ const params = idosell().searchPromotionsArchive.orderByProperty("id").checkParams();
6
+ expect(params).toEqual({"orderBy":{"property":"id","orderByDirection":"desc"}});
7
+ })
8
+
9
+ test("searchPromotionsArchiveShops", () => {
10
+ const params = idosell().searchPromotionsArchive.shops([1]).checkParams();
11
+ expect(params).toEqual({"filter":{"shops":[1]}});
12
+ })
@@ -0,0 +1,12 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("searchPromotionsElementsTypes", () => {
5
+ const params = idosell().searchPromotionsElements.ids(["288"]).types("product").checkParams();
6
+ expect(params).toEqual({"filter":{"ids":["288"],"types":["product"]}});
7
+ })
8
+
9
+ test("searchPromotionsElementsOrderByProperty", () => {
10
+ const params = idosell().searchPromotionsElements.orderByProperty("promotion_id").checkParams();
11
+ expect(params).toEqual({"orderBy":{"property":"promotion_id","orderByDirection":"desc"}});
12
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("searchPromotionsHistoryPage", () => {
5
+ const params = idosell().searchPromotionsHistory.promotionId(4).page(2,10).checkParams();
6
+ expect(params).toEqual({"filter":{"promotionId":4},"pagination":{"page":2,"perPage":10}});
7
+ })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.ts"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("searchPromotionsListViewOrderByProperty", () => {
5
+ const params = idosell().searchPromotionsListView.orderByProperty("id", false).checkParams();
6
+ expect(params).toEqual({"orderBy":{"property":"id","orderByDirection":"asc"}});
7
+ })
@@ -1,7 +0,0 @@
1
- import idosell from "./dist/index"
2
- import { expect, test } from "vitest"
3
-
4
- test("deleteProductsProductsToFacebookCatalogFacebookCatalogId", () => {
5
- const params = idosell().deleteProductsProductsToFacebookCatalog.shopId(1).products([9]).facebookCatalogId(123).checkParams();
6
- expect(params).toEqual({"shopId":1,"products":[9],"facebookCatalogId":123});
7
- })
@@ -1,7 +0,0 @@
1
- import idosell from "./dist/index"
2
- import { expect, test } from "vitest"
3
-
4
- test("deleteProductsProductsToPromotionProducts", () => {
5
- const params = idosell().deleteProductsProductsToPromotion.promotionId(2).products([11]).checkParams();
6
- expect(params).toEqual({"promotionId":2,"products":[11]});
7
- })