@voucherify/sdk 1.3.1 → 2.0.2

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.
@@ -14,7 +14,7 @@ export interface VoucherifyClientSideOptions {
14
14
  */
15
15
  apiUrl?: string;
16
16
  /**
17
- * [Log-in](http://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/login) to Voucherify web interface and obtain your `Client-side Keys` from [Configuration](https://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/app/configuration):
17
+ * [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Client-side Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
18
18
  *
19
19
  * ```javascript
20
20
  * const client = VoucherifyClientSide({
@@ -25,7 +25,7 @@ export interface VoucherifyClientSideOptions {
25
25
  */
26
26
  clientApplicationId: string;
27
27
  /**
28
- * [Log-in](http://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/login) to Voucherify web interface and obtain your `Client-side Keys` from [Configuration](https://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/app/configuration):
28
+ * [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Client-side Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
29
29
  *
30
30
  * ```javascript
31
31
  * const client = VoucherifyClientSide({
@@ -28,7 +28,7 @@ export interface VoucherifyServerSideOptions {
28
28
  */
29
29
  apiUrl?: string;
30
30
  /**
31
- * [Log-in](http://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/app/configuration):
31
+ * [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
32
32
  *
33
33
  * ```javascript
34
34
  * const voucherify = VoucherifyServerSide({
@@ -39,7 +39,7 @@ export interface VoucherifyServerSideOptions {
39
39
  */
40
40
  applicationId: string;
41
41
  /**
42
- * [Log-in](http://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/?utm_source=github&utm_medium=sdk&utm_campaign=acq#/app/configuration):
42
+ * [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
43
43
  *
44
44
  * ```javascript
45
45
  * const voucherify = VoucherifyServerSide({
@@ -50,7 +50,7 @@ export interface VoucherifyServerSideOptions {
50
50
  */
51
51
  secretKey: string;
52
52
  /**
53
- * Optionally, you can add `apiVersion` to the client options if you want to use a [specific API version](http://docs.voucherify.io/docs/api-version-upgrades?utm_source=github&utm_medium=sdk&utm_campaign=acq).
53
+ * Optionally, you can add `apiVersion` to the client options if you want to use a [specific API version](https://docs.voucherify.io/docs/api-version-upgrades).
54
54
  *
55
55
  * ```javascript
56
56
  * const voucherify = VoucherifyServerSide({
@@ -7,7 +7,8 @@ declare class VouchersQualification {
7
7
  /**
8
8
  * The method can be used for sending a request to display all vouchers qualified to the given customer and context (e.g., order, loyalty reward). A checking logic won't run among coupons from bulk unique codes campaigns. For campaigns with multiple unique codes, you should run a dedicated function for searching for qualified campaigns.
9
9
  * As a sample use case, you can imagine a requirement of displaying below cart the coupons eligible to a customer. The customer can take and apply the proposed voucher.
10
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#push-qualification-request
10
+ *
11
+ * @see https://docs.voucherify.io/reference/push-qualification-request
11
12
  */
12
13
  examine(body: T.VouchersQualificationExamineBody, params?: T.VouchersQualificationExamineParams): Promise<T.VouchersQualificationExamineResponse>;
13
14
  }
@@ -17,47 +18,47 @@ export declare class Vouchers {
17
18
  qualifications: VouchersQualification;
18
19
  constructor(client: RequestController, balance: Balance);
19
20
  /**
20
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-voucher
21
+ * @see https://docs.voucherify.io/reference/create-voucher
21
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
24
  /**
24
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#vouchers-get
25
+ * @see https://docs.voucherify.io/reference/vouchers-get
25
26
  */
26
27
  get(code: string): Promise<T.VouchersResponse>;
27
28
  /**
28
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-voucher
29
+ * @see https://docs.voucherify.io/reference/update-voucher
29
30
  */
30
31
  update(voucher: T.VouchersUpdate): Promise<T.VouchersResponse>;
31
32
  /**
32
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-voucher
33
+ * @see https://docs.voucherify.io/reference/delete-voucher
33
34
  */
34
35
  delete(code: string, params?: T.VouchersDeleteParams): Promise<unknown>;
35
36
  /**
36
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-vouchers
37
+ * @see https://docs.voucherify.io/reference/list-vouchers
37
38
  */
38
39
  list(params?: T.VouchersListParams): Promise<T.VouchersListResponse>;
39
40
  /**
40
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#enable-voucher
41
+ * @see https://docs.voucherify.io/reference/enable-voucher
41
42
  */
42
43
  enable(code: string): Promise<T.VouchersResponse>;
43
44
  /**
44
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#disable-voucher
45
+ * @see https://docs.voucherify.io/reference/disable-voucher
45
46
  */
46
47
  disable(code: string): Promise<T.VouchersResponse>;
47
48
  /**
48
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#import-vouchers-1
49
+ * @see https://docs.voucherify.io/reference/import-vouchers-1
49
50
  */
50
- import(vouchers: T.VouchersImport[]): Promise<unknown>;
51
+ import(vouchers: T.VouchersImport[]): Promise<T.VouchersImportResponse>;
51
52
  /**
52
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-vouchers-metadata-in-bulk
53
+ * @see https://docs.voucherify.io/reference/aaupdate-vouchers-metadata-in-bulk
53
54
  */
54
55
  bulkUpdateMetadata(params: T.VouchersBulkUpdateMetadata): Promise<T.VouchersBulkUpdateMetadataResponse>;
55
56
  /**
56
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-vouchers-in-bulk
57
+ * @see https://docs.voucherify.io/reference/aa-update-vouchers-in-bulk
57
58
  */
58
59
  bulkUpdate(vouchers: T.VouchersBulkUpdate): Promise<T.VouchersBulkUpdateResponse>;
59
60
  /**
60
- * @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#release-validation-session
61
+ * @see https://docs.voucherify.io/reference/release-validation-session
61
62
  */
62
63
  releaseValidationSession(code: string, sessionKey: string): Promise<unknown>;
63
64
  }
@@ -111,6 +111,9 @@ export interface CampaignsListResponse {
111
111
  data_ref: 'campaigns';
112
112
  campaigns: CampaignResponse[];
113
113
  }
114
+ export declare type CampaignsVouchersImportResponse = {
115
+ async_action_id: string;
116
+ };
114
117
  export declare type CampaignsCreateCampaignResponse = CampaignResponse;
115
118
  export declare type CampaignsUpdateCampaignResponse = CampaignResponse;
116
119
  export declare type CampaignsGetCampaignResponse = CampaignResponse;
@@ -34,18 +34,17 @@ export declare type ProductsUpdate = {
34
34
  metadata?: Record<string, any>;
35
35
  };
36
36
  export declare type ProductsUpdateResponse = ProductsCreateResponse;
37
- export interface ProductsBulkMetadataUpdate {
37
+ export interface ProductsBulkUpdateMetadata {
38
38
  source_ids: string[];
39
39
  metadata: Record<string, any>;
40
40
  }
41
41
  export declare type ProductsBulkUpdate = ProductsCreate[];
42
- interface BulkUpdateResponse {
43
- source_id?: string;
44
- found: boolean;
45
- updated: boolean;
46
- }
47
- export declare type ProductsBulkUpdateResponse = BulkUpdateResponse[];
48
- export declare type ProductsBulkMetadataUpdateResponse = BulkUpdateResponse[];
42
+ export declare type ProductsBulkUpdateResponse = {
43
+ async_action_id: string;
44
+ };
45
+ export declare type ProductsBulkUpdateMetadataResponse = {
46
+ async_action_id: string;
47
+ };
49
48
  export interface ProductsDeleteParams {
50
49
  force?: boolean;
51
50
  }
@@ -94,4 +93,3 @@ export interface ProductsListSkus {
94
93
  total: number;
95
94
  skus: ProductsGetSkuResponse[];
96
95
  }
97
- export {};
@@ -69,6 +69,10 @@ export interface PromotionsValidateParams {
69
69
  };
70
70
  metadata?: Record<string, any>;
71
71
  }
72
+ export interface PromotionsValidateQueryParams {
73
+ audienceRulesOnly?: boolean;
74
+ filters?: Record<string, any>;
75
+ }
72
76
  export interface PromotionsValidateResponse {
73
77
  valid: boolean;
74
78
  promotions?: {
@@ -206,22 +206,19 @@ export interface VouchersImport {
206
206
  }
207
207
  export interface VouchersBulkUpdateObject {
208
208
  code: string;
209
- metadata?: Record<string, any>;
209
+ metadata: Record<string, any>;
210
210
  }
211
211
  export declare type VouchersBulkUpdate = VouchersBulkUpdateObject[];
212
212
  export interface VouchersBulkUpdateMetadata {
213
213
  codes: string[];
214
- metadata?: Record<string, any>;
215
- }
216
- export interface VouchersBulkUpdateMetadataObjectResponse {
217
- code: string;
218
- found: boolean;
219
- updated: boolean;
220
- }
221
- export declare type VouchersBulkUpdateMetadataResponse = VouchersBulkUpdateMetadataObjectResponse[];
222
- export interface VouchersBulkUpdateObjectResponse {
223
- code: string;
224
- found: boolean;
225
- updated: boolean;
226
- }
227
- export declare type VouchersBulkUpdateResponse = VouchersBulkUpdateObjectResponse[];
214
+ metadata: Record<string, any>;
215
+ }
216
+ export declare type VouchersImportResponse = {
217
+ async_action_id: string;
218
+ };
219
+ export declare type VouchersBulkUpdateMetadataResponse = {
220
+ async_action_id: string;
221
+ };
222
+ export declare type VouchersBulkUpdateResponse = {
223
+ async_action_id: string;
224
+ };