@voucherify/sdk 2.9.2 → 2.9.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.
Files changed (75) hide show
  1. package/dist/ApiLimitsHandler.d.ts +13 -10
  2. package/dist/AsyncActions.d.ts +17 -15
  3. package/dist/Balance.d.ts +15 -12
  4. package/dist/Campaigns.d.ts +66 -58
  5. package/dist/Categories.d.ts +29 -26
  6. package/dist/ClientSide.d.ts +77 -53
  7. package/dist/Consents.d.ts +13 -10
  8. package/dist/Customers.d.ts +75 -72
  9. package/dist/Distributions.d.ts +29 -22
  10. package/dist/Events.d.ts +15 -10
  11. package/dist/Exports.d.ts +25 -22
  12. package/dist/Loyalties.d.ts +171 -159
  13. package/dist/MetadataSchemas.d.ts +17 -14
  14. package/dist/Orders.d.ts +32 -27
  15. package/dist/ProductCollections.d.ts +30 -26
  16. package/dist/Products.d.ts +66 -63
  17. package/dist/PromotionTiers.d.ts +43 -34
  18. package/dist/Promotions.d.ts +30 -18
  19. package/dist/PromotionsStacks.d.ts +34 -30
  20. package/dist/Qualifications.d.ts +24 -10
  21. package/dist/Redemptions.d.ts +53 -35
  22. package/dist/RequestController.d.ts +31 -29
  23. package/dist/Rewards.d.ts +46 -43
  24. package/dist/Segments.d.ts +25 -22
  25. package/dist/ValidationRules.d.ts +47 -43
  26. package/dist/Validations.d.ts +39 -17
  27. package/dist/VoucherifyClientSide.d.ts +112 -86
  28. package/dist/VoucherifyError.d.ts +23 -20
  29. package/dist/VoucherifyServerSide.d.ts +170 -131
  30. package/dist/Vouchers.d.ts +84 -78
  31. package/dist/helpers.d.ts +20 -18
  32. package/dist/index.d.ts +63 -25
  33. package/dist/types/ApplicableTo.d.ts +32 -30
  34. package/dist/types/AsyncActions.d.ts +23 -21
  35. package/dist/types/Balance.d.ts +18 -16
  36. package/dist/types/Campaigns.d.ts +124 -120
  37. package/dist/types/Categories.d.ts +40 -38
  38. package/dist/types/ClientSide.d.ts +145 -134
  39. package/dist/types/Consents.d.ts +34 -33
  40. package/dist/types/Customers.d.ts +363 -361
  41. package/dist/types/DiscountVoucher.d.ts +94 -93
  42. package/dist/types/Distributions.d.ts +148 -144
  43. package/dist/types/Events.d.ts +21 -17
  44. package/dist/types/Exports.d.ts +151 -149
  45. package/dist/types/Gift.d.ts +5 -3
  46. package/dist/types/Loyalties.d.ts +1061 -1057
  47. package/dist/types/MetadataSchemas.d.ts +34 -33
  48. package/dist/types/Orders.d.ts +199 -195
  49. package/dist/types/ProductCollections.d.ts +99 -96
  50. package/dist/types/Products.d.ts +108 -106
  51. package/dist/types/PromotionTiers.d.ts +131 -127
  52. package/dist/types/Promotions.d.ts +113 -108
  53. package/dist/types/PromotionsStacks.d.ts +74 -71
  54. package/dist/types/Qualifications.d.ts +92 -86
  55. package/dist/types/Redemptions.d.ts +215 -205
  56. package/dist/types/Rewards.d.ts +220 -219
  57. package/dist/types/Segments.d.ts +34 -32
  58. package/dist/types/Stackable.d.ts +106 -101
  59. package/dist/types/UtilityTypes.d.ts +5 -3
  60. package/dist/types/ValidateSession.d.ts +19 -17
  61. package/dist/types/ValidationError.d.ts +9 -7
  62. package/dist/types/ValidationRules.d.ts +96 -93
  63. package/dist/types/Validations.d.ts +109 -98
  64. package/dist/types/Vouchers.d.ts +452 -364
  65. package/dist/types/index.d.ts +27 -25
  66. package/dist/voucherifysdk.cjs +2023 -0
  67. package/dist/voucherifysdk.cjs.map +1 -0
  68. package/dist/voucherifysdk.esm.js +981 -1256
  69. package/dist/voucherifysdk.esm.js.map +1 -1
  70. package/package.json +13 -9
  71. package/CHANGELOG.md +0 -663
  72. package/dist/voucherifysdk.umd.development.js +0 -2270
  73. package/dist/voucherifysdk.umd.development.js.map +0 -1
  74. package/dist/voucherifysdk.umd.production.min.js +0 -2
  75. package/dist/voucherifysdk.umd.production.min.js.map +0 -1
@@ -1,63 +1,66 @@
1
- import * as T from './types/Products';
2
- import * as AAT from './types/AsyncActions';
3
- import type { RequestController } from './RequestController';
4
- export declare class Products {
5
- private client;
6
- constructor(client: RequestController);
7
- /**
8
- * @see https://docs.voucherify.io/reference/create-product
9
- */
10
- create(product: T.ProductsCreate): Promise<T.ProductsCreateResponse>;
11
- /**
12
- * @see https://docs.voucherify.io/reference/get-product
13
- */
14
- get(productId: string): Promise<T.ProductsGetResponse>;
15
- /**
16
- * @see https://docs.voucherify.io/reference/update-product
17
- */
18
- update(product: T.ProductsUpdate): Promise<T.ProductsCreateResponse>;
19
- /**
20
- * @see https://docs.voucherify.io/reference/async-update-products-metadata-in-bulk
21
- */
22
- bulkUpdateMetadata(products: T.ProductsBulkUpdateMetadata): Promise<T.ProductsBulkUpdateMetadataResponse>;
23
- /**
24
- * @see https://docs.voucherify.io/reference/post-products-in-bulk
25
- */
26
- bulkUpdate(products: T.ProductsBulkUpdate): Promise<T.ProductsBulkUpdateResponse>;
27
- /**
28
- * @see https://docs.voucherify.io/reference/delete-product
29
- */
30
- delete(productId: string, params?: T.ProductsDeleteParams): Promise<unknown>;
31
- /**
32
- * @see https://docs.voucherify.io/reference/list-products
33
- */
34
- list(params?: T.ProductsListParams): Promise<T.ProductsListResponse>;
35
- /**
36
- * @see https://docs.voucherify.io/reference/create-sku
37
- */
38
- createSku(productId: string, sku: T.ProductsCreateSku): Promise<T.ProductsCreateSkuResponse>;
39
- /**
40
- * @see https://docs.voucherify.io/reference/get-sku-v20210726
41
- */
42
- getSku(skuId: string): Promise<T.ProductsCreateSkuResponse>;
43
- /**
44
- * @see https://docs.voucherify.io/reference/update-sku
45
- */
46
- updateSku(productId: string, sku: T.ProductsUpdateSku): Promise<T.ProductsCreateSkuResponse>;
47
- /**
48
- * @see https://docs.voucherify.io/reference/delete-sku
49
- */
50
- deleteSku(productId: string, skuId: string, params?: T.ProductsDeleteSkuParams): Promise<unknown>;
51
- /**
52
- * @see https://docs.voucherify.io/reference/list-skus
53
- */
54
- listSkus(productId: string): Promise<T.ProductsListSkus>;
55
- /**
56
- * @see https://docs.voucherify.io/reference/import-skus-using-csv
57
- */
58
- importSkusCSV(filePath: string): Promise<AAT.AsyncActionCreateResponse>;
59
- /**
60
- * @see https://docs.voucherify.io/reference/import-products-using-csv
61
- */
62
- importCSV(filePath: string): Promise<AAT.AsyncActionCreateResponse>;
63
- }
1
+ import { ProductsCreate, ProductsCreateResponse, ProductsGetResponse, ProductsUpdate, ProductsBulkUpdateMetadata, ProductsBulkUpdateMetadataResponse, ProductsBulkUpdate, ProductsBulkUpdateResponse, ProductsDeleteParams, ProductsListParams, ProductsListResponse, ProductsCreateSku, ProductsCreateSkuResponse, ProductsUpdateSku, ProductsDeleteSkuParams, ProductsListSkus } from './types/Products.js';
2
+ import { AsyncActionCreateResponse } from './types/AsyncActions.js';
3
+ import { RequestController } from './RequestController.js';
4
+
5
+ declare class Products {
6
+ private client;
7
+ constructor(client: RequestController);
8
+ /**
9
+ * @see https://docs.voucherify.io/reference/create-product
10
+ */
11
+ create(product: ProductsCreate): Promise<ProductsCreateResponse>;
12
+ /**
13
+ * @see https://docs.voucherify.io/reference/get-product
14
+ */
15
+ get(productId: string): Promise<ProductsGetResponse>;
16
+ /**
17
+ * @see https://docs.voucherify.io/reference/update-product
18
+ */
19
+ update(product: ProductsUpdate): Promise<ProductsCreateResponse>;
20
+ /**
21
+ * @see https://docs.voucherify.io/reference/async-update-products-metadata-in-bulk
22
+ */
23
+ bulkUpdateMetadata(products: ProductsBulkUpdateMetadata): Promise<ProductsBulkUpdateMetadataResponse>;
24
+ /**
25
+ * @see https://docs.voucherify.io/reference/post-products-in-bulk
26
+ */
27
+ bulkUpdate(products: ProductsBulkUpdate): Promise<ProductsBulkUpdateResponse>;
28
+ /**
29
+ * @see https://docs.voucherify.io/reference/delete-product
30
+ */
31
+ delete(productId: string, params?: ProductsDeleteParams): Promise<unknown>;
32
+ /**
33
+ * @see https://docs.voucherify.io/reference/list-products
34
+ */
35
+ list(params?: ProductsListParams): Promise<ProductsListResponse>;
36
+ /**
37
+ * @see https://docs.voucherify.io/reference/create-sku
38
+ */
39
+ createSku(productId: string, sku: ProductsCreateSku): Promise<ProductsCreateSkuResponse>;
40
+ /**
41
+ * @see https://docs.voucherify.io/reference/get-sku-v20210726
42
+ */
43
+ getSku(skuId: string): Promise<ProductsCreateSkuResponse>;
44
+ /**
45
+ * @see https://docs.voucherify.io/reference/update-sku
46
+ */
47
+ updateSku(productId: string, sku: ProductsUpdateSku): Promise<ProductsCreateSkuResponse>;
48
+ /**
49
+ * @see https://docs.voucherify.io/reference/delete-sku
50
+ */
51
+ deleteSku(productId: string, skuId: string, params?: ProductsDeleteSkuParams): Promise<unknown>;
52
+ /**
53
+ * @see https://docs.voucherify.io/reference/list-skus
54
+ */
55
+ listSkus(productId: string): Promise<ProductsListSkus>;
56
+ /**
57
+ * @see https://docs.voucherify.io/reference/import-skus-using-csv
58
+ */
59
+ importSkusCSV(filePath: string): Promise<AsyncActionCreateResponse>;
60
+ /**
61
+ * @see https://docs.voucherify.io/reference/import-products-using-csv
62
+ */
63
+ importCSV(filePath: string): Promise<AsyncActionCreateResponse>;
64
+ }
65
+
66
+ export { Products };
@@ -1,34 +1,43 @@
1
- import * as T from './types/PromotionTiers';
2
- import type { RequestController } from './RequestController';
3
- export declare class PromotionTiers {
4
- private client;
5
- constructor(client: RequestController);
6
- /**
7
- * @see https://docs.voucherify.io/reference/list-promotion-tiers
8
- */
9
- listAll(params?: T.PromotionTiersListAllParams): Promise<T.PromotionTiersListAllResponse>;
10
- /**
11
- * @see https://docs.voucherify.io/reference/get-promotions
12
- */
13
- list(promotionId: string): Promise<T.PromotionTiersListAllResponse>;
14
- /**
15
- * @see https://docs.voucherify.io/reference/get-promotion-tier
16
- */
17
- get(tierId: string): Promise<T.PromotionTier>;
18
- /**
19
- * @see https://docs.voucherify.io/reference/add-promotion-tier-to-campaign
20
- */
21
- create(promotionId: string, params: T.PromotionTiersCreateParams): Promise<T.PromotionTier>;
22
- /**
23
- * @see https://docs.voucherify.io/reference/redeem-promotion
24
- */
25
- redeem(promotionsTierId: string, params: T.PromotionTiersRedeemParams): Promise<T.PromotionTiersRedeemResponse>;
26
- /**
27
- * @see https://docs.voucherify.io/reference/update-promotion
28
- */
29
- update(params: T.PromotionTiersUpdateParams): Promise<T.PromotionTier>;
30
- /**
31
- * @see https://docs.voucherify.io/reference/delete-promotion
32
- */
33
- delete(promotionsTierId: string): Promise<unknown>;
34
- }
1
+ import { PromotionTiersListAllParams, PromotionTiersListAllResponse, PromotionTier, PromotionTiersCreateParams, PromotionTiersRedeemParams, PromotionTiersRedeemResponse, PromotionTiersUpdateParams } from './types/PromotionTiers.js';
2
+ import { RequestController } from './RequestController.js';
3
+ import './types/DiscountVoucher.js';
4
+ import './types/Orders.js';
5
+ import './types/Customers.js';
6
+ import './types/ValidationRules.js';
7
+ import './types/ApplicableTo.js';
8
+ import './types/ValidateSession.js';
9
+
10
+ declare class PromotionTiers {
11
+ private client;
12
+ constructor(client: RequestController);
13
+ /**
14
+ * @see https://docs.voucherify.io/reference/list-promotion-tiers
15
+ */
16
+ listAll(params?: PromotionTiersListAllParams): Promise<PromotionTiersListAllResponse>;
17
+ /**
18
+ * @see https://docs.voucherify.io/reference/get-promotions
19
+ */
20
+ list(promotionId: string): Promise<PromotionTiersListAllResponse>;
21
+ /**
22
+ * @see https://docs.voucherify.io/reference/get-promotion-tier
23
+ */
24
+ get(tierId: string): Promise<PromotionTier>;
25
+ /**
26
+ * @see https://docs.voucherify.io/reference/add-promotion-tier-to-campaign
27
+ */
28
+ create(promotionId: string, params: PromotionTiersCreateParams): Promise<PromotionTier>;
29
+ /**
30
+ * @see https://docs.voucherify.io/reference/redeem-promotion
31
+ */
32
+ redeem(promotionsTierId: string, params: PromotionTiersRedeemParams): Promise<PromotionTiersRedeemResponse>;
33
+ /**
34
+ * @see https://docs.voucherify.io/reference/update-promotion
35
+ */
36
+ update(params: PromotionTiersUpdateParams): Promise<PromotionTier>;
37
+ /**
38
+ * @see https://docs.voucherify.io/reference/delete-promotion
39
+ */
40
+ delete(promotionsTierId: string): Promise<unknown>;
41
+ }
42
+
43
+ export { PromotionTiers };
@@ -1,18 +1,30 @@
1
- import * as T from './types/Promotions';
2
- import type { RequestController } from './RequestController';
3
- import type { PromotionTiers } from './PromotionTiers';
4
- import { PromotionsStacks } from './PromotionsStacks';
5
- export declare class Promotions {
6
- private client;
7
- tiers: PromotionTiers;
8
- stack: PromotionsStacks;
9
- constructor(client: RequestController, tiers: PromotionTiers, stack: PromotionsStacks);
10
- /**
11
- * @see https://docs.voucherify.io/reference/create-promotion-campaign
12
- */
13
- create(promotionCampaign: T.PromotionsCreate): Promise<T.PromotionsCreateResponse>;
14
- /**
15
- * @see https://docs.voucherify.io/reference/validate-promotions-1
16
- */
17
- validate(body: T.PromotionsValidateParams, params?: T.PromotionsValidateQueryParams): Promise<T.PromotionsValidateResponse>;
18
- }
1
+ import { PromotionsCreate, PromotionsCreateResponse, PromotionsValidateParams, PromotionsValidateQueryParams, PromotionsValidateResponse } from './types/Promotions.js';
2
+ import { RequestController } from './RequestController.js';
3
+ import { PromotionTiers } from './PromotionTiers.js';
4
+ import { PromotionsStacks } from './PromotionsStacks.js';
5
+ import './types/DiscountVoucher.js';
6
+ import './types/Orders.js';
7
+ import './types/Customers.js';
8
+ import './types/PromotionTiers.js';
9
+ import './types/ValidationRules.js';
10
+ import './types/ApplicableTo.js';
11
+ import './types/ValidateSession.js';
12
+ import './types/PromotionsStacks.js';
13
+ import './types/Categories.js';
14
+
15
+ declare class Promotions {
16
+ private client;
17
+ tiers: PromotionTiers;
18
+ stack: PromotionsStacks;
19
+ constructor(client: RequestController, tiers: PromotionTiers, stack: PromotionsStacks);
20
+ /**
21
+ * @see https://docs.voucherify.io/reference/create-promotion-campaign
22
+ */
23
+ create(promotionCampaign: PromotionsCreate): Promise<PromotionsCreateResponse>;
24
+ /**
25
+ * @see https://docs.voucherify.io/reference/validate-promotions-1
26
+ */
27
+ validate(body: PromotionsValidateParams, params?: PromotionsValidateQueryParams): Promise<PromotionsValidateResponse>;
28
+ }
29
+
30
+ export { Promotions };
@@ -1,30 +1,34 @@
1
- import * as T from './types/PromotionsStacks';
2
- import type { RequestController } from './RequestController';
3
- export declare class PromotionsStacks {
4
- private client;
5
- constructor(client: RequestController);
6
- /**
7
- * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
8
- */
9
- listInCampaign(campaignId: string): Promise<T.PromotionsStacksListInCampaignResponseBody>;
10
- /**
11
- * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
12
- */
13
- createInCampaign(campaignId: string, body: T.PromotionsStacksCreateInCampaignRequestBody): Promise<T.PromotionsStacksCreateInCampaignResponseBody>;
14
- /**
15
- * @see https://docs.voucherify.io/reference/delete-promotion-stack
16
- */
17
- delete(campaignId: string, stackId: string): Promise<{}>;
18
- /**
19
- * @see https://docs.voucherify.io/reference/get-promotion-stack
20
- */
21
- get(campaignId: string, stackId: string): Promise<T.PromotionStack>;
22
- /**
23
- * @see https://docs.voucherify.io/reference/update-promotion-stack
24
- */
25
- update(campaignId: string, stackId: string, body: T.PromotionsStacksUpdateRequestBody): Promise<T.PromotionsStacksUpdateResponseBody>;
26
- /**
27
- * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
28
- */
29
- list(params?: T.PromotionsStacksListRequestQuery): Promise<T.PromotionsStacksListResponseBody>;
30
- }
1
+ import { PromotionsStacksListInCampaignResponseBody, PromotionsStacksCreateInCampaignRequestBody, PromotionsStacksCreateInCampaignResponseBody, PromotionStack, PromotionsStacksUpdateRequestBody, PromotionsStacksUpdateResponseBody, PromotionsStacksListRequestQuery, PromotionsStacksListResponseBody } from './types/PromotionsStacks.js';
2
+ import { RequestController } from './RequestController.js';
3
+ import './types/Categories.js';
4
+
5
+ declare class PromotionsStacks {
6
+ private client;
7
+ constructor(client: RequestController);
8
+ /**
9
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
10
+ */
11
+ listInCampaign(campaignId: string): Promise<PromotionsStacksListInCampaignResponseBody>;
12
+ /**
13
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
14
+ */
15
+ createInCampaign(campaignId: string, body: PromotionsStacksCreateInCampaignRequestBody): Promise<PromotionsStacksCreateInCampaignResponseBody>;
16
+ /**
17
+ * @see https://docs.voucherify.io/reference/delete-promotion-stack
18
+ */
19
+ delete(campaignId: string, stackId: string): Promise<{}>;
20
+ /**
21
+ * @see https://docs.voucherify.io/reference/get-promotion-stack
22
+ */
23
+ get(campaignId: string, stackId: string): Promise<PromotionStack>;
24
+ /**
25
+ * @see https://docs.voucherify.io/reference/update-promotion-stack
26
+ */
27
+ update(campaignId: string, stackId: string, body: PromotionsStacksUpdateRequestBody): Promise<PromotionsStacksUpdateResponseBody>;
28
+ /**
29
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
30
+ */
31
+ list(params?: PromotionsStacksListRequestQuery): Promise<PromotionsStacksListResponseBody>;
32
+ }
33
+
34
+ export { PromotionsStacks };
@@ -1,10 +1,24 @@
1
- import * as T from './types/Qualifications';
2
- import type { RequestController } from './RequestController';
3
- export declare class Qualifications {
4
- private client;
5
- constructor(client: RequestController);
6
- /**
7
- * @see https://docs.voucherify.io/reference/check-eligibility
8
- */
9
- checkEligibility(body: T.QualificationsCheckEligibilityRequestBody): Promise<T.QualificationsCheckEligibilityResponseBody>;
10
- }
1
+ import { QualificationsCheckEligibilityRequestBody, QualificationsCheckEligibilityResponseBody } from './types/Qualifications.js';
2
+ import { RequestController } from './RequestController.js';
3
+ import './types/Customers.js';
4
+ import './types/DiscountVoucher.js';
5
+ import './types/Exports.js';
6
+ import './types/Orders.js';
7
+ import './types/ApplicableTo.js';
8
+ import './types/Categories.js';
9
+ import './types/Loyalties.js';
10
+ import './types/Products.js';
11
+ import './types/ValidationRules.js';
12
+ import './types/Vouchers.js';
13
+ import './types/Rewards.js';
14
+
15
+ declare class Qualifications {
16
+ private client;
17
+ constructor(client: RequestController);
18
+ /**
19
+ * @see https://docs.voucherify.io/reference/check-eligibility
20
+ */
21
+ checkEligibility(body: QualificationsCheckEligibilityRequestBody): Promise<QualificationsCheckEligibilityResponseBody>;
22
+ }
23
+
24
+ export { Qualifications };
@@ -1,35 +1,53 @@
1
- import * as T from './types/Redemptions';
2
- import type { RequestController } from './RequestController';
3
- export declare class Redemptions {
4
- private client;
5
- constructor(client: RequestController);
6
- /**
7
- * @see https://docs.voucherify.io/reference/redeem-voucher
8
- */
9
- redeem(code: string, body?: T.RedemptionsRedeemBody): Promise<T.RedemptionsRedeemResponse>;
10
- /**
11
- * @see https://docs.voucherify.io/reference/redeem-stacked-discounts
12
- */
13
- redeemStackable(params: T.RedemptionsRedeemStackableParams): Promise<T.RedemptionsRedeemStackableResponse>;
14
- /**
15
- * @see https://docs.voucherify.io/reference/get-redemption
16
- */
17
- get(redemptionId: string): Promise<T.Redemption>;
18
- /**
19
- * @see https://docs.voucherify.io/reference/list-redemptions
20
- */
21
- list(params?: T.RedemptionsListParams): Promise<T.RedemptionsListResponse>;
22
- /**
23
- * @see https://docs.voucherify.io/reference/vouchers-redemptions
24
- */
25
- getForVoucher(code: string): Promise<T.RedemptionsGetForVoucherResponse>;
26
- /**
27
- * @see https://docs.voucherify.io/reference/rollback-redemption
28
- */
29
- rollback(redemptionId: string, params?: T.RedemptionsRollbackParams): Promise<T.RedemptionsRollbackResponse>;
30
- /**
31
- * @see https://docs.voucherify.io/reference/rollback-stackable-redemptions
32
- * Types of params and queryParams WILL be changed in future - please do not depend on it!
33
- */
34
- rollbackStackable(parentRedemptionId: string, params?: any, queryParams?: any): Promise<T.RedemptionsRollbackStackableResponse>;
35
- }
1
+ import { RedemptionsRedeemBody, RedemptionsRedeemResponse, RedemptionsRedeemStackableParams, RedemptionsRedeemStackableResponse, Redemption, RedemptionsListParams, RedemptionsListResponse, RedemptionsGetForVoucherResponse, RedemptionsRollbackParams, RedemptionsRollbackResponse, RedemptionsRollbackStackableResponse } from './types/Redemptions.js';
2
+ import { RequestController } from './RequestController.js';
3
+ import './types/Orders.js';
4
+ import './types/Customers.js';
5
+ import './types/DiscountVoucher.js';
6
+ import './types/Rewards.js';
7
+ import './types/Vouchers.js';
8
+ import './types/Gift.js';
9
+ import './types/ValidateSession.js';
10
+ import './types/Stackable.js';
11
+ import './types/ApplicableTo.js';
12
+ import './types/Products.js';
13
+ import './types/Loyalties.js';
14
+ import './types/ValidationRules.js';
15
+ import './types/Categories.js';
16
+ import './types/ValidationError.js';
17
+ import './types/PromotionTiers.js';
18
+
19
+ declare class Redemptions {
20
+ private client;
21
+ constructor(client: RequestController);
22
+ /**
23
+ * @see https://docs.voucherify.io/reference/redeem-voucher
24
+ */
25
+ redeem(code: string, body?: RedemptionsRedeemBody): Promise<RedemptionsRedeemResponse>;
26
+ /**
27
+ * @see https://docs.voucherify.io/reference/redeem-stacked-discounts
28
+ */
29
+ redeemStackable(params: RedemptionsRedeemStackableParams): Promise<RedemptionsRedeemStackableResponse>;
30
+ /**
31
+ * @see https://docs.voucherify.io/reference/get-redemption
32
+ */
33
+ get(redemptionId: string): Promise<Redemption>;
34
+ /**
35
+ * @see https://docs.voucherify.io/reference/list-redemptions
36
+ */
37
+ list(params?: RedemptionsListParams): Promise<RedemptionsListResponse>;
38
+ /**
39
+ * @see https://docs.voucherify.io/reference/vouchers-redemptions
40
+ */
41
+ getForVoucher(code: string): Promise<RedemptionsGetForVoucherResponse>;
42
+ /**
43
+ * @see https://docs.voucherify.io/reference/rollback-redemption
44
+ */
45
+ rollback(redemptionId: string, params?: RedemptionsRollbackParams): Promise<RedemptionsRollbackResponse>;
46
+ /**
47
+ * @see https://docs.voucherify.io/reference/rollback-stackable-redemptions
48
+ * Types of params and queryParams WILL be changed in future - please do not depend on it!
49
+ */
50
+ rollbackStackable(parentRedemptionId: string, params?: any, queryParams?: any): Promise<RedemptionsRollbackStackableResponse>;
51
+ }
52
+
53
+ export { Redemptions };
@@ -1,29 +1,31 @@
1
- export interface RequestControllerOptions {
2
- baseURL: string;
3
- basePath: string;
4
- headers: Record<string, any>;
5
- exposeErrorCause: boolean;
6
- timeoutMs: number;
7
- }
8
- /**
9
- * @internal
10
- */
11
- export declare class RequestController {
12
- private baseURL;
13
- private basePath;
14
- private headers;
15
- private request;
16
- private lastResponseHeaders;
17
- private isLastResponseHeadersSet;
18
- private exposeErrorCause;
19
- private timeoutMs;
20
- constructor({ basePath, baseURL, headers, exposeErrorCause, timeoutMs }: RequestControllerOptions);
21
- isLastReponseHeadersSet(): boolean;
22
- getLastResponseHeaders(): Record<string, string>;
23
- private setLastResponseHeaders;
24
- setBaseUrl(baseURL: string): void;
25
- get<T>(path: string, params?: Record<string, any>): Promise<T>;
26
- post<T>(path: string, body: Record<string, any>, params?: Record<string, any>, headers?: Record<string, any>): Promise<T>;
27
- put<T>(path: string, body: Record<string, any>, params?: Record<string, any>): Promise<T>;
28
- delete<T>(path: string, params?: Record<string, any>): Promise<T>;
29
- }
1
+ interface RequestControllerOptions {
2
+ baseURL: string;
3
+ basePath: string;
4
+ headers: Record<string, any>;
5
+ exposeErrorCause: boolean;
6
+ timeoutMs: number;
7
+ }
8
+ /**
9
+ * @internal
10
+ */
11
+ declare class RequestController {
12
+ private baseURL;
13
+ private basePath;
14
+ private headers;
15
+ private request;
16
+ private lastResponseHeaders;
17
+ private isLastResponseHeadersSet;
18
+ private exposeErrorCause;
19
+ private timeoutMs;
20
+ constructor({ basePath, baseURL, headers, exposeErrorCause, timeoutMs }: RequestControllerOptions);
21
+ isLastReponseHeadersSet(): boolean;
22
+ getLastResponseHeaders(): Record<string, string>;
23
+ private setLastResponseHeaders;
24
+ setBaseUrl(baseURL: string): void;
25
+ get<T>(path: string, params?: Record<string, any>): Promise<T>;
26
+ post<T>(path: string, body: Record<string, any>, params?: Record<string, any>, headers?: Record<string, any>): Promise<T>;
27
+ put<T>(path: string, body: Record<string, any>, params?: Record<string, any>): Promise<T>;
28
+ delete<T>(path: string, params?: Record<string, any>): Promise<T>;
29
+ }
30
+
31
+ export { RequestController, type RequestControllerOptions };
package/dist/Rewards.d.ts CHANGED
@@ -1,43 +1,46 @@
1
- import * as T from './types/Rewards';
2
- import type { RequestController } from './RequestController';
3
- export declare class Rewards {
4
- private client;
5
- constructor(client: RequestController);
6
- /**
7
- * @see https://docs.voucherify.io/reference/list-rewards
8
- */
9
- list(params?: T.RewardsListParams): Promise<T.RewardsListResponse>;
10
- /**
11
- * @see https://docs.voucherify.io/reference/create-reward
12
- */
13
- create(reward: T.RewardsCreate): Promise<T.RewardsCreateResponse>;
14
- /**
15
- * @see https://docs.voucherify.io/reference/get-reward
16
- */
17
- get(rewardId: string): Promise<T.RewardsCreateResponse>;
18
- /**
19
- * @see https://docs.voucherify.io/reference/update-reward
20
- */
21
- update(reward: T.RewardsUpdate): Promise<T.RewardsCreateResponse>;
22
- /**
23
- * @see https://docs.voucherify.io/reference/delete-reward
24
- */
25
- delete(rewardId: string): Promise<unknown>;
26
- /**
27
- * @see https://docs.voucherify.io/reference/get-reward-assignment
28
- */
29
- getAssignment(rewardId: string, assignmentId: string): Promise<T.RewardAssignment>;
30
- /**
31
- * @see https://docs.voucherify.io/reference/list-reward-assignments
32
- */
33
- listAssignments(rewardId: string, params?: T.RewardsListAssignmentsRequestQuery): Promise<T.RewardsListAssignmentsResponseBody>;
34
- /**
35
- * @see https://docs.voucherify.io/reference/create-reward-assignment
36
- */
37
- createAssignment(rewardId: string, assignment: T.RewardsCreateAssignmentRequestBody): Promise<T.RewardAssignment>;
38
- /**
39
- * @see https://docs.voucherify.io/reference/update-reward-assignment
40
- */
41
- updateAssignment(rewardId: string, assignment: T.RewardsUpdateAssignmentRequestBody): Promise<T.RewardAssignment>;
42
- deleteAssignment(rewardId: string, assignmentId: string): Promise<unknown>;
43
- }
1
+ import { RewardsListParams, RewardsListResponse, RewardsCreate, RewardsCreateResponse, RewardsGetResponse, RewardsUpdate, RewardAssignment, RewardsListAssignmentsRequestQuery, RewardsListAssignmentsResponseBody, RewardsCreateAssignmentRequestBody, RewardsUpdateAssignmentRequestBody } from './types/Rewards.js';
2
+ import { RequestController } from './RequestController.js';
3
+
4
+ declare class Rewards {
5
+ private client;
6
+ constructor(client: RequestController);
7
+ /**
8
+ * @see https://docs.voucherify.io/reference/list-rewards
9
+ */
10
+ list(params?: RewardsListParams): Promise<RewardsListResponse>;
11
+ /**
12
+ * @see https://docs.voucherify.io/reference/create-reward
13
+ */
14
+ create(reward: RewardsCreate): Promise<RewardsCreateResponse>;
15
+ /**
16
+ * @see https://docs.voucherify.io/reference/get-reward
17
+ */
18
+ get(rewardId: string): Promise<RewardsGetResponse>;
19
+ /**
20
+ * @see https://docs.voucherify.io/reference/update-reward
21
+ */
22
+ update(reward: RewardsUpdate): Promise<RewardsCreateResponse>;
23
+ /**
24
+ * @see https://docs.voucherify.io/reference/delete-reward
25
+ */
26
+ delete(rewardId: string): Promise<unknown>;
27
+ /**
28
+ * @see https://docs.voucherify.io/reference/get-reward-assignment
29
+ */
30
+ getAssignment(rewardId: string, assignmentId: string): Promise<RewardAssignment>;
31
+ /**
32
+ * @see https://docs.voucherify.io/reference/list-reward-assignments
33
+ */
34
+ listAssignments(rewardId: string, params?: RewardsListAssignmentsRequestQuery): Promise<RewardsListAssignmentsResponseBody>;
35
+ /**
36
+ * @see https://docs.voucherify.io/reference/create-reward-assignment
37
+ */
38
+ createAssignment(rewardId: string, assignment: RewardsCreateAssignmentRequestBody): Promise<RewardAssignment>;
39
+ /**
40
+ * @see https://docs.voucherify.io/reference/update-reward-assignment
41
+ */
42
+ updateAssignment(rewardId: string, assignment: RewardsUpdateAssignmentRequestBody): Promise<RewardAssignment>;
43
+ deleteAssignment(rewardId: string, assignmentId: string): Promise<unknown>;
44
+ }
45
+
46
+ export { Rewards };