@voucherify/sdk 2.0.16 → 2.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @voucherify/sdk
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`eb0f4b1`](https://github.com/voucherifyio/voucherify-js-sdk/commit/eb0f4b164b056018e4e3131c6f9df81fb20098bb) [#160](https://github.com/voucherifyio/voucherify-js-sdk/pull/160) Thanks [@Irene350](https://github.com/Irene350)! - VoucherType input correct enum value DISCOUNT_VOUCHER and GIFT_VOUCHER
8
+
9
+ ## 2.0.17
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8bb9bb5`](https://github.com/voucherifyio/voucherify-js-sdk/commit/8bb9bb5f48ee2a9b00038c192c39431567f34309) [#156](https://github.com/voucherifyio/voucherify-js-sdk/pull/156) Thanks [@Davies-Owen](https://github.com/Davies-Owen)! - add missing created_at property to VouchersResponse, LoyaltiesRedeemRewardResponse, CampaignsAddVoucherResponse, and ClientSideVoucherListing interfaces
14
+
3
15
  ## 2.0.16
4
16
 
5
17
  ### Patch Changes
@@ -28,11 +28,11 @@ export declare class Campaigns {
28
28
  /**
29
29
  * @see https://docs.voucherify.io/reference/add-voucher-to-campaign
30
30
  */
31
- addVoucher(name: string, body?: T.CampaignsAddVoucherBody, params?: T.CampaignsAddVoucherParams): Promise<{} | Pick<import("./types").VouchersResponse, "object" | "active" | "type" | "category" | "start_date" | "expiration_date" | "metadata" | "redemption" | "additional_info" | "code" | "discount" | "campaign" | "gift" | "publish">>;
31
+ addVoucher(name: string, body?: T.CampaignsAddVoucherBody, params?: T.CampaignsAddVoucherParams): Promise<{} | Pick<import("./types").VouchersResponse, "object" | "created_at" | "active" | "type" | "category" | "start_date" | "expiration_date" | "metadata" | "redemption" | "additional_info" | "code" | "discount" | "campaign" | "gift" | "publish">>;
32
32
  /**
33
33
  * @see https://docs.voucherify.io/reference/add-voucher-with-certain-code-to-campaign
34
34
  */
35
- addCertainVoucher(name: string, code: string, body?: T.CampaignsAddCertainVoucherParams): Promise<Pick<import("./types").VouchersResponse, "object" | "active" | "type" | "category" | "start_date" | "expiration_date" | "metadata" | "redemption" | "additional_info" | "code" | "discount" | "campaign" | "gift" | "publish">>;
35
+ addCertainVoucher(name: string, code: string, body?: T.CampaignsAddCertainVoucherParams): Promise<Pick<import("./types").VouchersResponse, "object" | "created_at" | "active" | "type" | "category" | "start_date" | "expiration_date" | "metadata" | "redemption" | "additional_info" | "code" | "discount" | "campaign" | "gift" | "publish">>;
36
36
  /**
37
37
  * @see https://docs.voucherify.io/reference/import-vouchers
38
38
  */
@@ -20,7 +20,7 @@ export declare class Vouchers {
20
20
  /**
21
21
  * @see https://docs.voucherify.io/reference/create-voucher
22
22
  */
23
- create(voucher: T.VouchersCreate): Promise<Pick<T.VouchersResponse, "object" | "type" | "discount" | "gift" | "category" | "additional_info" | "start_date" | "expiration_date" | "metadata" | "id" | "code" | "campaign" | "loyalty_card" | "validity_timeframe" | "validity_day_of_week" | "publish" | "redemption" | "active" | "assets" | "is_referral_code" | "referrer_id" | "holder_id" | "updated_at">>;
23
+ create(voucher: T.VouchersCreate): Promise<Pick<T.VouchersResponse, "object" | "type" | "discount" | "gift" | "category" | "additional_info" | "start_date" | "expiration_date" | "metadata" | "id" | "code" | "campaign" | "loyalty_card" | "validity_timeframe" | "validity_day_of_week" | "publish" | "redemption" | "active" | "assets" | "is_referral_code" | "referrer_id" | "holder_id" | "updated_at" | "created_at">>;
24
24
  /**
25
25
  * @see https://docs.voucherify.io/reference/vouchers-get
26
26
  */
@@ -93,7 +93,7 @@ export interface CampaignsAddVoucherParams {
93
93
  vouchers_count?: number;
94
94
  }
95
95
  export declare type CampaignsAddCertainVoucherParams = Pick<Partial<VouchersImport>, 'category' | 'redemption' | 'metadata' | 'additional_info'>;
96
- export declare type CampaignsAddVoucherResponse = Pick<VouchersResponse, 'code' | 'object' | 'campaign' | 'category' | 'type' | 'discount' | 'gift' | 'start_date' | 'expiration_date' | 'publish' | 'redemption' | 'active' | 'additional_info' | 'metadata'>;
96
+ export declare type CampaignsAddVoucherResponse = Pick<VouchersResponse, 'code' | 'object' | 'campaign' | 'category' | 'created_at' | 'type' | 'discount' | 'gift' | 'start_date' | 'expiration_date' | 'publish' | 'redemption' | 'active' | 'additional_info' | 'metadata'>;
97
97
  export declare type CampaignsAddCertainVoucherResponse = CampaignsAddVoucherResponse;
98
98
  export declare type CampaignsImportVouchers = Pick<VouchersImport, 'code' | 'redemption' | 'metadata' | 'additional_info' | 'active'>;
99
99
  export interface CampaignsListParams {
@@ -30,7 +30,7 @@ export interface ClientSideValidateParams {
30
30
  session_ttl_unit?: 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS';
31
31
  }
32
32
  export declare type ClientSideListVouchersParams = VouchersListParams;
33
- export declare type ClientSideVoucherListing = Pick<VouchersResponse, 'active' | 'code' | 'metadata' | 'assets' | 'object' | 'expiration_date' | 'start_date'>;
33
+ export declare type ClientSideVoucherListing = Pick<VouchersResponse, 'active' | 'code' | 'metadata' | 'assets' | 'object' | 'expiration_date' | 'start_date' | 'created_at'>;
34
34
  export interface ClientSideListVouchersResponse {
35
35
  object: 'list';
36
36
  total: number;
@@ -436,6 +436,7 @@ export interface LoyaltiesRedeemRewardResponse {
436
436
  is_referral_code: boolean;
437
437
  referrer_id: string;
438
438
  holder_id: string;
439
+ created_at: string;
439
440
  updated_at: string;
440
441
  holder: {
441
442
  id: string;
@@ -1,7 +1,7 @@
1
1
  import { OrdersGetResponse } from './Orders';
2
2
  import { SimpleCustomer } from './Customers';
3
3
  import { DiscountUnit, DiscountAmount, DiscountPercent } from './DiscountVoucher';
4
- export declare type VoucherType = 'GIFT' | 'DISCOUNT' | 'LOYALTY_CARD' | 'LUCKY_DRAW';
4
+ export declare type VoucherType = 'GIFT_VOUCHER' | 'DISCOUNT_VOUCHER' | 'LOYALTY_CARD' | 'LUCKY_DRAW';
5
5
  export interface SimpleVoucher {
6
6
  code_config?: {
7
7
  length?: number;
@@ -75,6 +75,7 @@ export interface VouchersResponse {
75
75
  referrer_id?: string;
76
76
  holder_id?: string;
77
77
  updated_at?: string;
78
+ created_at: string;
78
79
  object: 'voucher';
79
80
  validation_rules_assignments: {
80
81
  object: 'list';
@@ -1427,7 +1427,7 @@ function VoucherifyServerSide(options) {
1427
1427
  let headers = {
1428
1428
  'X-App-Id': options.applicationId,
1429
1429
  'X-App-Token': options.secretKey,
1430
- 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.0.16"}`,
1430
+ 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.1.0"}`,
1431
1431
  'Content-Type': 'application/json'
1432
1432
  };
1433
1433
 
@@ -1676,7 +1676,7 @@ function VoucherifyClientSide(options) {
1676
1676
  let headers = {
1677
1677
  'X-Client-Application-Id': options.clientApplicationId,
1678
1678
  'X-Client-Token': options.clientSecretKey,
1679
- 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.0.16"}`
1679
+ 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.1.0"}`
1680
1680
  };
1681
1681
 
1682
1682
  if (environment().startsWith('Node')) {