@voucherify/sdk 2.5.0 → 2.6.0

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.
@@ -590,6 +590,22 @@
590
590
  form.append('file', fileStream);
591
591
  return this.client.post('/vouchers/importCSV', form);
592
592
  }
593
+ /**
594
+ * @see https://docs.voucherify.io/reference/list-voucher-transactions
595
+ */
596
+
597
+
598
+ listTransactions(code, params) {
599
+ return this.client.get(`/vouchers/${encode(code)}/transactions`, params);
600
+ }
601
+ /**
602
+ * @see https://docs.voucherify.io/reference/export-voucher-transactions
603
+ */
604
+
605
+
606
+ exportTransactions(code, body) {
607
+ return this.client.post(`/vouchers/${encode(code)}/transactions/export`, body);
608
+ }
593
609
 
594
610
  }
595
611
 
@@ -777,11 +793,13 @@
777
793
  }
778
794
 
779
795
  class Promotions {
780
- constructor(client, tiers) {
796
+ constructor(client, tiers, stack) {
781
797
  this.client = void 0;
782
798
  this.tiers = void 0;
799
+ this.stack = void 0;
783
800
  this.client = client;
784
801
  this.tiers = tiers;
802
+ this.stack = stack;
785
803
  }
786
804
  /**
787
805
  * @see https://docs.voucherify.io/reference/create-promotion-campaign
@@ -1184,6 +1202,14 @@
1184
1202
  delete(rewardId) {
1185
1203
  return this.client.delete(`/rewards/${encode(rewardId)}`);
1186
1204
  }
1205
+ /**
1206
+ * @see https://docs.voucherify.io/reference/get-reward-assignment
1207
+ */
1208
+
1209
+
1210
+ getAssignment(rewardId, assignmentId) {
1211
+ return this.client.get(`/rewards/${encode(rewardId)}/assignments/${encode(assignmentId)}`);
1212
+ }
1187
1213
  /**
1188
1214
  * @see https://docs.voucherify.io/reference/list-reward-assignments
1189
1215
  */
@@ -1292,6 +1318,14 @@
1292
1318
  deleteRewardAssignment(campaignId, assignmentId) {
1293
1319
  return this.client.delete(`/loyalties/${encode(campaignId)}/rewards/${assignmentId}`);
1294
1320
  }
1321
+ /**
1322
+ * @see https://docs.voucherify.io/reference/get-reward-assignment-2
1323
+ */
1324
+
1325
+
1326
+ getRewardAssignment(campaignId, assignmentId) {
1327
+ return this.client.get(`/loyalties/${encode(campaignId)}/rewards/${encode(assignmentId)}`);
1328
+ }
1295
1329
  /**
1296
1330
  * @see https://docs.voucherify.io/reference/list-earning-rules
1297
1331
  */
@@ -1431,6 +1465,14 @@
1431
1465
  redeemReward(campaignId, memberId, params) {
1432
1466
  return this.client.post(`/loyalties/${encode(campaignId)}/members/${encode(memberId)}/redemption`, params);
1433
1467
  }
1468
+ /**
1469
+ * @see https://docs.voucherify.io/reference/list-loyalty-tier-rewards
1470
+ */
1471
+
1472
+
1473
+ listLoyaltyTierRewards(campaignId, tierId) {
1474
+ return this.client.get(`/loyalties/${encode(campaignId)}/tiers/${encode(tierId)}/rewards`);
1475
+ }
1434
1476
  /**
1435
1477
  * @see https://docs.voucherify.io/reference/list-loyalty-card-transactions
1436
1478
  * @see https://docs.voucherify.io/reference/list-loyalty-card-transactions-1
@@ -1449,14 +1491,6 @@
1449
1491
  exportCardTransactions(memberId, campaignId, params = {}) {
1450
1492
  return this.client.post(campaignId ? `/loyalties/${encode(campaignId)}/members/${encode(memberId)}/transactions/export` : `/loyalties/members/${encode(memberId)}/transactions/export`, params);
1451
1493
  }
1452
- /**
1453
- * @see https://docs.voucherify.io/reference/get-reward-assignment-1
1454
- */
1455
-
1456
-
1457
- getRewardAssignment(campaignId, assignmentId) {
1458
- return this.client.get(`/loyalties/${encode(campaignId)}/reward-assignments/${encode(assignmentId)}`);
1459
- }
1460
1494
  /**
1461
1495
  * @see https://docs.voucherify.io/reference/get-reward-details
1462
1496
  */
@@ -1573,6 +1607,14 @@
1573
1607
  list(params = {}) {
1574
1608
  return this.client.get('/validation-rules', params);
1575
1609
  }
1610
+ /**
1611
+ * @see https://docs.voucherify.io/reference/list-validation-rules-assignments
1612
+ */
1613
+
1614
+
1615
+ listRulesAssignments(params = {}) {
1616
+ return this.client.get(`/validation-rules-assignments`, params);
1617
+ }
1576
1618
  /**
1577
1619
  * @see https://docs.voucherify.io/reference/list-validation-rule-assignments
1578
1620
  */
@@ -1695,8 +1737,8 @@
1695
1737
  */
1696
1738
 
1697
1739
 
1698
- list() {
1699
- return this.client.get('/categories');
1740
+ list(params = {}) {
1741
+ return this.client.get('/categories', params);
1700
1742
  }
1701
1743
  /**
1702
1744
  * @see https://docs.voucherify.io/reference/create-category
@@ -1733,6 +1775,62 @@
1733
1775
 
1734
1776
  }
1735
1777
 
1778
+ class PromotionsStacks {
1779
+ constructor(client) {
1780
+ this.client = void 0;
1781
+ this.client = client;
1782
+ }
1783
+ /**
1784
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
1785
+ */
1786
+
1787
+
1788
+ listInCampaign(campaignId) {
1789
+ return this.client.get(`/promotions/${campaignId}/stacks`);
1790
+ }
1791
+ /**
1792
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
1793
+ */
1794
+
1795
+
1796
+ createInCampaign(campaignId, body) {
1797
+ return this.client.post(`/promotions/${campaignId}/stacks`, body);
1798
+ }
1799
+ /**
1800
+ * @see https://docs.voucherify.io/reference/delete-promotion-stack
1801
+ */
1802
+
1803
+
1804
+ delete(campaignId, stackId) {
1805
+ return this.client.delete(`/promotions/${campaignId}/stacks/${stackId}`);
1806
+ }
1807
+ /**
1808
+ * @see https://docs.voucherify.io/reference/get-promotion-stack
1809
+ */
1810
+
1811
+
1812
+ get(campaignId, stackId) {
1813
+ return this.client.get(`/promotions/${campaignId}/stacks/${stackId}`);
1814
+ }
1815
+ /**
1816
+ * @see https://docs.voucherify.io/reference/update-promotion-stack
1817
+ */
1818
+
1819
+
1820
+ update(campaignId, stackId, body) {
1821
+ return this.client.put(`/promotions/${campaignId}/stacks/${stackId}`, body);
1822
+ }
1823
+ /**
1824
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
1825
+ */
1826
+
1827
+
1828
+ list(params) {
1829
+ return this.client.get(`/promotions/stacks`, params);
1830
+ }
1831
+
1832
+ }
1833
+
1736
1834
  class ProductCollections {
1737
1835
  constructor(client) {
1738
1836
  this.client = void 0;
@@ -1811,7 +1909,7 @@
1811
1909
  let headers = {
1812
1910
  'X-App-Id': options.applicationId,
1813
1911
  'X-App-Token': options.secretKey,
1814
- 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.5.0"}`,
1912
+ 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.6.0"}`,
1815
1913
  'Content-Type': 'application/json'
1816
1914
  };
1817
1915
 
@@ -1849,7 +1947,8 @@
1849
1947
  const events = new Events(client);
1850
1948
  const distributions = new Distributions(client, exportsNamespace);
1851
1949
  const promotionTiers = new PromotionTiers(client);
1852
- const promotions = new Promotions(client, promotionTiers);
1950
+ const promotionStack = new PromotionsStacks(client);
1951
+ const promotions = new Promotions(client, promotionTiers, promotionStack);
1853
1952
  const validations = new Validations(client, promotions);
1854
1953
  const redemptions = new Redemptions(client);
1855
1954
  const customers = new Customers(client);
@@ -2066,7 +2165,7 @@
2066
2165
  let headers = {
2067
2166
  'X-Client-Application-Id': options.clientApplicationId,
2068
2167
  'X-Client-Token': options.clientSecretKey,
2069
- 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.5.0"}`
2168
+ 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.6.0"}`
2070
2169
  };
2071
2170
 
2072
2171
  if (environment().startsWith('Node')) {