@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.
- package/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { RequestController } from './RequestController';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { RequestController } from './RequestController.js';
|
|
2
|
+
|
|
3
|
+
declare class ApiLimitsHandler {
|
|
4
|
+
private readonly requestController;
|
|
5
|
+
constructor(requestController: RequestController);
|
|
6
|
+
private getLastResponseHeadersFromController;
|
|
7
|
+
areLimitsAvailable(): boolean;
|
|
8
|
+
getRateLimit(): number;
|
|
9
|
+
getRateLimitRemaining(): number;
|
|
10
|
+
getRetryAfter(): number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ApiLimitsHandler };
|
package/dist/AsyncActions.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { AsyncActionsResponse, AsyncActionsListParams, AsyncActionsListResponse } from './types/AsyncActions.js';
|
|
2
|
+
import { RequestController } from './RequestController.js';
|
|
3
|
+
|
|
4
|
+
declare class AsyncActions {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: RequestController);
|
|
7
|
+
/**
|
|
8
|
+
* @see https://docs.voucherify.io/reference/get-async-actions-1
|
|
9
|
+
*/
|
|
10
|
+
get(asyncActionId: string): Promise<AsyncActionsResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* @see https://docs.voucherify.io/reference/list-async-actions
|
|
13
|
+
*/
|
|
14
|
+
list(params: AsyncActionsListParams): Promise<AsyncActionsListResponse>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { AsyncActions };
|
package/dist/Balance.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { BalanceCreateParams, BalanceCreateResponse } from './types/Balance.js';
|
|
2
|
+
import { RequestController } from './RequestController.js';
|
|
3
|
+
|
|
4
|
+
declare class Balance {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: RequestController);
|
|
7
|
+
/**
|
|
8
|
+
* Add Gift Voucher Balance
|
|
9
|
+
* This method gives a possibility to add balance to an existing gift voucher.
|
|
10
|
+
* @see https://docs.voucherify.io/reference/add-gift-voucher-balance
|
|
11
|
+
*/
|
|
12
|
+
create(code: string, params: BalanceCreateParams): Promise<BalanceCreateResponse>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Balance };
|
package/dist/Campaigns.d.ts
CHANGED
|
@@ -1,58 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import { CampaignsQualificationsBody, CampaignsQualificationsParams, CampaignsQualificationsResponse, CampaignsCreateCampaign, CampaignResponse, CampaignsUpdateCampaign, CampaignsDeleteParams, CampaignsAddVoucherBody, CampaignsAddVoucherParams, CampaignsAddVoucherResponse, CampaignsAddCertainVoucherParams, CampaignsImportVouchers, CampaignsVouchersImportResponse, CampaignsListParams, CampaignsListResponse } from './types/Campaigns.js';
|
|
2
|
+
import { AsyncActionCreateResponse } from './types/AsyncActions.js';
|
|
3
|
+
import { RequestController } from './RequestController.js';
|
|
4
|
+
import './types/Vouchers.js';
|
|
5
|
+
import './types/Orders.js';
|
|
6
|
+
import './types/Customers.js';
|
|
7
|
+
import './types/DiscountVoucher.js';
|
|
8
|
+
import './types/ValidationRules.js';
|
|
9
|
+
import './types/ApplicableTo.js';
|
|
10
|
+
|
|
11
|
+
declare class CampaignsQualifications {
|
|
12
|
+
private client;
|
|
13
|
+
constructor(client: RequestController);
|
|
14
|
+
examine(body?: CampaignsQualificationsBody, params?: CampaignsQualificationsParams): Promise<CampaignsQualificationsResponse>;
|
|
15
|
+
}
|
|
16
|
+
declare class Campaigns {
|
|
17
|
+
private client;
|
|
18
|
+
qualifications: CampaignsQualifications;
|
|
19
|
+
constructor(client: RequestController);
|
|
20
|
+
/**
|
|
21
|
+
* @see https://docs.voucherify.io/reference/create-campaign
|
|
22
|
+
*/
|
|
23
|
+
create(campaign: CampaignsCreateCampaign): Promise<CampaignResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* @see https://docs.voucherify.io/reference/update-campaign
|
|
26
|
+
*/
|
|
27
|
+
update(nameOrId: string, campaign: CampaignsUpdateCampaign): Promise<CampaignResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* @see https://docs.voucherify.io/reference/get-campaign
|
|
30
|
+
*/
|
|
31
|
+
get(name: string): Promise<CampaignResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* @see https://docs.voucherify.io/reference/delete-campaign
|
|
34
|
+
*/
|
|
35
|
+
delete(name: string, params?: CampaignsDeleteParams): Promise<unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* @see https://docs.voucherify.io/reference/add-voucher-to-campaign
|
|
38
|
+
*/
|
|
39
|
+
addVoucher(name: string, body?: CampaignsAddVoucherBody, params?: CampaignsAddVoucherParams): Promise<{} | CampaignsAddVoucherResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* @see https://docs.voucherify.io/reference/add-voucher-with-certain-code-to-campaign
|
|
42
|
+
*/
|
|
43
|
+
addCertainVoucher(name: string, code: string, body?: CampaignsAddCertainVoucherParams): Promise<CampaignsAddVoucherResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* @see https://docs.voucherify.io/reference/import-vouchers
|
|
46
|
+
*/
|
|
47
|
+
importVouchers(campaignName: string, vouchers: CampaignsImportVouchers[]): Promise<CampaignsVouchersImportResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* @see https://docs.voucherify.io/reference/list-campaigns
|
|
50
|
+
*/
|
|
51
|
+
list(params?: CampaignsListParams): Promise<CampaignsListResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* @see https://api.voucherify.io/v1/campaigns/{campaignId}/importCSV
|
|
54
|
+
*/
|
|
55
|
+
importVouchersCSV(campaignId: string, filePath: string): Promise<AsyncActionCreateResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* @see https://docs.voucherify.io/reference/enable-campaign
|
|
58
|
+
*/
|
|
59
|
+
enable(campaignId: string): Promise<{}>;
|
|
60
|
+
/**
|
|
61
|
+
* @see https://docs.voucherify.io/reference/disable-campaign
|
|
62
|
+
*/
|
|
63
|
+
disable(campaignId: string): Promise<{}>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Campaigns };
|
package/dist/Categories.d.ts
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { CategoriesListRequestQuery, ListCategories, CreateCategory, ResponseCreateCategory, CategoryObject, UpdateCategoryRequest, ResponseUpdateCategory } from './types/Categories.js';
|
|
2
|
+
import { RequestController } from './RequestController.js';
|
|
3
|
+
|
|
4
|
+
declare class Categories {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: RequestController);
|
|
7
|
+
/**
|
|
8
|
+
* @see https://docs.voucherify.io/reference/list-categories
|
|
9
|
+
*/
|
|
10
|
+
list(params?: CategoriesListRequestQuery): Promise<ListCategories>;
|
|
11
|
+
/**
|
|
12
|
+
* @see https://docs.voucherify.io/reference/create-category
|
|
13
|
+
*/
|
|
14
|
+
create(createCategory: CreateCategory): Promise<ResponseCreateCategory>;
|
|
15
|
+
/**
|
|
16
|
+
* @see https://docs.voucherify.io/reference/get-category
|
|
17
|
+
*/
|
|
18
|
+
get(categoryId: string): Promise<CategoryObject>;
|
|
19
|
+
/**
|
|
20
|
+
* @see https://docs.voucherify.io/reference/delete-category
|
|
21
|
+
*/
|
|
22
|
+
delete(categoryId: string): Promise<{}>;
|
|
23
|
+
/**
|
|
24
|
+
* @see https://docs.voucherify.io/reference/update-category
|
|
25
|
+
*/
|
|
26
|
+
update(categoryId: string, updateCategory: UpdateCategoryRequest): Promise<ResponseUpdateCategory>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Categories };
|
package/dist/ClientSide.d.ts
CHANGED
|
@@ -1,53 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { CustomersCreateResponse } from './types/Customers.js';
|
|
2
|
+
import { ClientSideValidateParams, ClientSideValidateResponse, ClientSideRedeemPayload, ClientSideRedeemResponse, ClientSidePublishPayload, ClientSidePublishQueryParams, ClientSidePublishResponse, ClientSideTrackCustomer, ClientSideTrackReferral, ClientSideTrackLoyalty, ClientSideTrackResponse, ClientSideListVouchersParams, ClientSideListVouchersResponse, ClientSideCustomersCreateParams, ClientSideCustomersUpdateConsentsBody, ClientSideValidationsValidateStackableParams, ClientSideRedemptionsRedeemStackableParams } from './types/ClientSide.js';
|
|
3
|
+
import { RedemptionsRedeemStackableResponse } from './types/Redemptions.js';
|
|
4
|
+
import { ValidationValidateStackableResponse } from './types/Validations.js';
|
|
5
|
+
import { ConsentsListResponse } from './types/Consents.js';
|
|
6
|
+
import { QualificationsCheckEligibilityRequestBody, QualificationsCheckEligibilityResponseBody } from './types/Qualifications.js';
|
|
7
|
+
import { RequestController } from './RequestController.js';
|
|
8
|
+
import './types/DiscountVoucher.js';
|
|
9
|
+
import './types/Vouchers.js';
|
|
10
|
+
import './types/Orders.js';
|
|
11
|
+
import './types/Distributions.js';
|
|
12
|
+
import './types/PromotionTiers.js';
|
|
13
|
+
import './types/ValidationRules.js';
|
|
14
|
+
import './types/ApplicableTo.js';
|
|
15
|
+
import './types/ValidateSession.js';
|
|
16
|
+
import './types/Rewards.js';
|
|
17
|
+
import './types/Gift.js';
|
|
18
|
+
import './types/Stackable.js';
|
|
19
|
+
import './types/Products.js';
|
|
20
|
+
import './types/Loyalties.js';
|
|
21
|
+
import './types/Categories.js';
|
|
22
|
+
import './types/ValidationError.js';
|
|
23
|
+
import './types/Promotions.js';
|
|
24
|
+
import './types/Exports.js';
|
|
25
|
+
|
|
26
|
+
declare class ClientSide {
|
|
27
|
+
private client;
|
|
28
|
+
private trackingId?;
|
|
29
|
+
constructor(client: RequestController, trackingId?: string | undefined);
|
|
30
|
+
setIdentity(identity?: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* @see https://docs.voucherify.io/reference/vouchers-validate
|
|
33
|
+
*/
|
|
34
|
+
validate(params: ClientSideValidateParams | string): Promise<ClientSideValidateResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* @see https://docs.voucherify.io/reference/redeem-voucher-client-side
|
|
37
|
+
*/
|
|
38
|
+
redeem(code: string, payload?: ClientSideRedeemPayload): Promise<ClientSideRedeemResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* @see https://docs.voucherify.io/reference/create-publication
|
|
41
|
+
*/
|
|
42
|
+
publish(campaign: string, payload?: ClientSidePublishPayload, queryParams?: ClientSidePublishQueryParams): Promise<ClientSidePublishResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* @see https://docs.voucherify.io/reference/track-custom-event-client-side
|
|
45
|
+
*/
|
|
46
|
+
track(event_name: string, customer: ClientSideTrackCustomer, metadata?: Record<string, any>, referral?: ClientSideTrackReferral, loyalty?: ClientSideTrackLoyalty): Promise<ClientSideTrackResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* @see https://docs.voucherify.io/reference/list-vouchers
|
|
49
|
+
*/
|
|
50
|
+
listVouchers(params?: ClientSideListVouchersParams): Promise<ClientSideListVouchersResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* @see https://docs.voucherify.io/reference/create-customer
|
|
53
|
+
*/
|
|
54
|
+
createCustomer(customer: ClientSideCustomersCreateParams, enableDoubleOptIn?: boolean): Promise<CustomersCreateResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* @see https://docs.voucherify.io/reference/get-consent-client-side
|
|
57
|
+
*/
|
|
58
|
+
listConsents(): Promise<ConsentsListResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* @see https://docs.voucherify.io/reference/update-customers-consents-client
|
|
61
|
+
*/
|
|
62
|
+
updateConsents(idOrSourceId: string, consents: ClientSideCustomersUpdateConsentsBody): Promise<undefined>;
|
|
63
|
+
/**
|
|
64
|
+
* @see https://docs.voucherify.io/reference/validate-stackable-discounts-client-side
|
|
65
|
+
*/
|
|
66
|
+
validateStackable(params: ClientSideValidationsValidateStackableParams): Promise<ValidationValidateStackableResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* @see https://docs.voucherify.io/reference/redeem-stackable-discounts-client-side
|
|
69
|
+
*/
|
|
70
|
+
redeemStackable(params: ClientSideRedemptionsRedeemStackableParams): Promise<RedemptionsRedeemStackableResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* @see https://docs.voucherify.io/reference/check-eligibility
|
|
73
|
+
*/
|
|
74
|
+
qualifications(body: QualificationsCheckEligibilityRequestBody): Promise<QualificationsCheckEligibilityResponseBody>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { ClientSide };
|
package/dist/Consents.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ConsentsListResponse } from './types/Consents.js';
|
|
2
|
+
import { RequestController } from './RequestController.js';
|
|
3
|
+
|
|
4
|
+
declare class Consents {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: RequestController);
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
9
|
+
*/
|
|
10
|
+
list(): Promise<ConsentsListResponse>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Consents };
|
package/dist/Customers.d.ts
CHANGED
|
@@ -1,72 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
import { CustomersCreateBody, CustomersCreateResponse, CustomersGetResponse, CustomersListParams, CustomersCommonListResponse, CustomersScrollParams, CustomersScrollYield, CustomersUpdateParams, CustomersUpdateResponse, CustomersUpdateInBulkRequestBody, CustomersUpdateMetadataInBulkRequestBody, CustomersDeletePermanentlyResponseBody, CustomerActivityListQueryParams, CustomerActivityListResponse, CustomersUpdateConsentsBody, CustomerActivitiesListQueryParams, CustomerActivitiesListResponse, CustomerRedeemablesListQueryParams, CustomerRedeemablesListResponse } from './types/Customers.js';
|
|
2
|
+
import { AsyncActionCreateResponse } from './types/AsyncActions.js';
|
|
3
|
+
import { RequestController } from './RequestController.js';
|
|
4
|
+
import './types/DiscountVoucher.js';
|
|
5
|
+
|
|
6
|
+
declare class Customers {
|
|
7
|
+
private client;
|
|
8
|
+
constructor(client: RequestController);
|
|
9
|
+
/**
|
|
10
|
+
* @see https://docs.voucherify.io/reference/create-customer
|
|
11
|
+
*/
|
|
12
|
+
create(customer: CustomersCreateBody): Promise<CustomersCreateResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* @see https://docs.voucherify.io/reference/read-customer
|
|
15
|
+
*/
|
|
16
|
+
get(customerId: string): Promise<CustomersGetResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* @see https://docs.voucherify.io/reference/list-customers
|
|
19
|
+
*/
|
|
20
|
+
list(params: CustomersListParams): Promise<CustomersCommonListResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Standard list customers API has limitation of available pages to be shown equal to 100. To cover cases when you would like to fetch more, you must use scroll capabilities.
|
|
23
|
+
*
|
|
24
|
+
* ```javascript
|
|
25
|
+
* async function () {
|
|
26
|
+
* for await (const customer of voucherify.customers.scroll(params)) {
|
|
27
|
+
* console.log('Customer', customer)
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
scroll(params: CustomersScrollParams): AsyncGenerator<CustomersScrollYield, void, CustomersScrollYield>;
|
|
33
|
+
/**
|
|
34
|
+
* @see https://docs.voucherify.io/reference/update-customer
|
|
35
|
+
*/
|
|
36
|
+
update(customer: CustomersUpdateParams): Promise<CustomersUpdateResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* @see https://docs.voucherify.io/reference/update-customers-in-bulk
|
|
39
|
+
*/
|
|
40
|
+
updateInBulk(customers: CustomersUpdateInBulkRequestBody): Promise<AsyncActionCreateResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* @see https://docs.voucherify.io/reference/update-customers-metadata-in-bulk
|
|
43
|
+
*/
|
|
44
|
+
updateMetadataInBulk(sourceIdsAndMetadata: CustomersUpdateMetadataInBulkRequestBody): Promise<AsyncActionCreateResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* @see https://docs.voucherify.io/reference/delete-customer
|
|
47
|
+
*/
|
|
48
|
+
delete(customerId: string): Promise<undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* @see https://docs.voucherify.io/reference/delete-customer-permanently
|
|
51
|
+
*/
|
|
52
|
+
deletePermanently(customerId: string): Promise<CustomersDeletePermanentlyResponseBody>;
|
|
53
|
+
/**
|
|
54
|
+
* @see https://docs.voucherify.io/reference/list-customer-activity
|
|
55
|
+
*/
|
|
56
|
+
listActivity(customerIdOrSourceId: string, params?: CustomerActivityListQueryParams): Promise<CustomerActivityListResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
59
|
+
*/
|
|
60
|
+
updateConsents(idOrSourceId: string, consents: CustomersUpdateConsentsBody): Promise<undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated This method is deprecated in favor of the `listActivity` method. We’re removing this method in next major version.
|
|
63
|
+
*/
|
|
64
|
+
listActivities(customerId: string, params?: CustomerActivitiesListQueryParams): Promise<CustomerActivitiesListResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* @see https://docs.voucherify.io/reference/import-customers-using-csv
|
|
67
|
+
*/
|
|
68
|
+
importCSV(filePath: string): Promise<AsyncActionCreateResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* @see https://docs.voucherify.io/reference/list-customer-redeemables
|
|
71
|
+
*/
|
|
72
|
+
listRedeemables(id: string, params?: CustomerRedeemablesListQueryParams): Promise<CustomerRedeemablesListResponse>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { Customers };
|