@voucherify/sdk 1.2.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 +110 -0
- package/README.md +1258 -0
- package/dist/AsyncActions.d.ts +15 -0
- package/dist/Balance.d.ts +12 -0
- package/dist/Campaigns.d.ts +45 -0
- package/dist/ClientSide.d.ts +40 -0
- package/dist/Consents.d.ts +10 -0
- package/dist/Customers.d.ts +43 -0
- package/dist/Distributions.d.ts +22 -0
- package/dist/Events.d.ts +7 -0
- package/dist/Exports.d.ts +18 -0
- package/dist/Loyalties.d.ts +82 -0
- package/dist/Orders.d.ts +22 -0
- package/dist/Products.d.ts +54 -0
- package/dist/PromotionTiers.d.ts +30 -0
- package/dist/Promotions.d.ts +16 -0
- package/dist/Redemptions.d.ts +26 -0
- package/dist/RequestController.d.ts +20 -0
- package/dist/Rewards.d.ts +39 -0
- package/dist/Segments.d.ts +22 -0
- package/dist/ValidationRules.d.ts +39 -0
- package/dist/Validations.d.ts +13 -0
- package/dist/VoucherifyClientSide.d.ts +76 -0
- package/dist/VoucherifyError.d.ts +6 -0
- package/dist/VoucherifyServerSide.d.ts +111 -0
- package/dist/Vouchers.d.ts +64 -0
- package/dist/helpers.d.ts +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/types/AsyncActions.d.ts +18 -0
- package/dist/types/Balance.d.ts +14 -0
- package/dist/types/Campaigns.d.ts +117 -0
- package/dist/types/ClientSide.d.ts +135 -0
- package/dist/types/Consents.d.ts +33 -0
- package/dist/types/Customers.d.ts +113 -0
- package/dist/types/Distributions.d.ts +141 -0
- package/dist/types/Events.d.ts +17 -0
- package/dist/types/Exports.d.ts +30 -0
- package/dist/types/Loyalties.d.ts +462 -0
- package/dist/types/Orders.d.ts +61 -0
- package/dist/types/Products.d.ts +97 -0
- package/dist/types/PromotionTiers.d.ts +107 -0
- package/dist/types/Promotions.d.ts +90 -0
- package/dist/types/Redemptions.d.ts +150 -0
- package/dist/types/Rewards.d.ts +114 -0
- package/dist/types/Segments.d.ts +32 -0
- package/dist/types/ValidationRules.d.ts +74 -0
- package/dist/types/Validations.d.ts +66 -0
- package/dist/types/Vouchers.d.ts +227 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/voucherifysdk.esm.js +1567 -0
- package/dist/voucherifysdk.esm.js.map +1 -0
- package/dist/voucherifysdk.umd.development.js +1578 -0
- package/dist/voucherifysdk.umd.development.js.map +1 -0
- package/dist/voucherifysdk.umd.production.min.js +2 -0
- package/dist/voucherifysdk.umd.production.min.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as T from './types/AsyncActions';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
declare class AsyncActions {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-async-actions-1
|
|
8
|
+
*/
|
|
9
|
+
get(asyncActionId: string): Promise<T.AsyncActionsResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-async-actions
|
|
12
|
+
*/
|
|
13
|
+
list(params: T.AsyncActionsListParams): Promise<T.AsyncActionsListResponse>;
|
|
14
|
+
}
|
|
15
|
+
export { AsyncActions };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as T from './types/Balance';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Balance {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* Add Gift Voucher Balance
|
|
8
|
+
* This method gives a possibility to add balance to an existing gift voucher.
|
|
9
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq##add-gift-voucher-balance
|
|
10
|
+
*/
|
|
11
|
+
create(code: string, params: T.BalanceCreateParams): Promise<T.BalanceCreateResponse>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as T from './types/Campaigns';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
declare class CampaignsQualifications {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
examine(body?: T.CampaignsQualificationsBody, params?: T.CampaignsQualificationsParams): Promise<T.CampaignsQualificationsResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare class Campaigns {
|
|
9
|
+
private client;
|
|
10
|
+
qualifications: CampaignsQualifications;
|
|
11
|
+
constructor(client: RequestController);
|
|
12
|
+
/**
|
|
13
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-campaign
|
|
14
|
+
*/
|
|
15
|
+
create(campaign: T.CampaignsCreateCampaign): Promise<T.CampaignResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-campaign
|
|
18
|
+
*/
|
|
19
|
+
update(nameOrId: string, campaign: T.CampaignsUpdateCampaign): Promise<T.CampaignResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-campaign
|
|
22
|
+
*/
|
|
23
|
+
get(name: string): Promise<T.CampaignResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-campaign
|
|
26
|
+
*/
|
|
27
|
+
delete(name: string, params?: T.CampaignsDeleteParams): Promise<unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#add-voucher-to-campaign
|
|
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">>;
|
|
32
|
+
/**
|
|
33
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#add-voucher-with-certain-code-to-campaign
|
|
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">>;
|
|
36
|
+
/**
|
|
37
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#import-vouchers
|
|
38
|
+
*/
|
|
39
|
+
importVouchers(campaignName: string, vouchers: T.CampaignsImportVouchers[]): Promise<unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* @see https://docs.voucherify.io/v2017-04-20/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-campaigns
|
|
42
|
+
*/
|
|
43
|
+
list(params?: T.CampaignsListParams): Promise<unknown>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as T from './types/ClientSide';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class ClientSide {
|
|
4
|
+
private client;
|
|
5
|
+
private trackingId?;
|
|
6
|
+
constructor(client: RequestController, trackingId?: string | undefined);
|
|
7
|
+
setIdentity(identity?: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq##vouchers-validate
|
|
10
|
+
*/
|
|
11
|
+
validate(params: T.ClientSideValidateParams | string): Promise<T.ClientSideValidateResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#redeem-voucher-client-side
|
|
14
|
+
*/
|
|
15
|
+
redeem(code: string, payload?: T.ClientSideRedeemPayload): Promise<T.ClientSideRedeemResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-publication
|
|
18
|
+
*/
|
|
19
|
+
publish(campaign: string, payload?: T.ClientSidePublishPayload, queryParams?: T.ClientSidePublishQueryParams): Promise<T.ClientSidePublishResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#track-custom-event-client-side
|
|
22
|
+
*/
|
|
23
|
+
track(event_name: string, customer: T.ClientSideTrackCustomer, metadata?: Record<string, any>, referral?: T.ClientSideTrackReferral, loyalty?: T.ClientSideTrackLoyalty): Promise<T.ClientSideTrackResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-vouchers
|
|
26
|
+
*/
|
|
27
|
+
listVouchers(params?: T.ClientSideListVouchersParams): Promise<T.ClientSideListVouchersResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-customer
|
|
30
|
+
*/
|
|
31
|
+
createCustomer(customer: T.ClientSideCustomersCreateParams, enableDoubleOptIn?: boolean): Promise<import("./types").CustomersCreateResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-consent-client-side
|
|
34
|
+
*/
|
|
35
|
+
listConsents(): Promise<import("./types").ConsentsListResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-customers-consents-client
|
|
38
|
+
*/
|
|
39
|
+
updateConsents(idOrSourceId: string, consents: T.ClientSideCustomersUpdateConsentsBody): Promise<undefined>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as T from './types/Consents';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Consents {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-consents
|
|
8
|
+
*/
|
|
9
|
+
list(): Promise<T.ConsentsListResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as T from './types/Customers';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
declare class Customers {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-customer
|
|
8
|
+
*/
|
|
9
|
+
create(customer: T.CustomersCreateBody): Promise<T.CustomersCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#read-customer
|
|
12
|
+
*/
|
|
13
|
+
get(customerId: string): Promise<T.CustomersCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-customers
|
|
16
|
+
*/
|
|
17
|
+
list(params: T.CustomersListParams): Promise<T.CustomersCommonListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
*
|
|
21
|
+
* ```javascript
|
|
22
|
+
* async function () {
|
|
23
|
+
* for await (const customer of voucherify.customers.scroll(params)) {
|
|
24
|
+
* console.log('Customer', customer)
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
scroll(params: T.CustomersScrollParams): AsyncGenerator<T.CustomersScrollYield, void, T.CustomersScrollYield>;
|
|
30
|
+
/**
|
|
31
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-customer
|
|
32
|
+
*/
|
|
33
|
+
update(customer: T.CustomersUpdateParams): Promise<T.CustomersCreateResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-customer
|
|
36
|
+
*/
|
|
37
|
+
delete(customerId: string): Promise<undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-customers-consents
|
|
40
|
+
*/
|
|
41
|
+
updateConsents(idOrSourceId: string, consents: T.CustomersUpdateConsentsBody): Promise<undefined>;
|
|
42
|
+
}
|
|
43
|
+
export { Customers };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as T from './types/Distributions';
|
|
2
|
+
import type { Exports } from './Exports';
|
|
3
|
+
import type { RequestController } from './RequestController';
|
|
4
|
+
declare class DistributionsPublications {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: RequestController);
|
|
7
|
+
/**
|
|
8
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-publications
|
|
9
|
+
*/
|
|
10
|
+
list(params?: T.DistributionsPublicationsListParams): Promise<T.DistributionsPublicationsListResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-publication
|
|
13
|
+
*/
|
|
14
|
+
create(params: T.DistributionsPublicationsCreateParams): Promise<T.DistributionsPublicationsCreateResponse>;
|
|
15
|
+
}
|
|
16
|
+
export declare class Distributions {
|
|
17
|
+
private client;
|
|
18
|
+
exports: Exports;
|
|
19
|
+
publications: DistributionsPublications;
|
|
20
|
+
constructor(client: RequestController, exports: Exports);
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/dist/Events.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as T from './types/Events';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Events {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
create(eventName: string, params: T.EventsParams): Promise<T.EventsResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as T from './types/Exports';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Exports {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-export
|
|
8
|
+
*/
|
|
9
|
+
create(exportResource: T.ExportResource): Promise<T.ExportsCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-export
|
|
12
|
+
*/
|
|
13
|
+
get(exportResourceId: string): Promise<T.ExportsCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-export
|
|
16
|
+
*/
|
|
17
|
+
delete(exportResourceId: string): Promise<unknown>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as T from './types/Loyalties';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Loyalties {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-loyalty-programs
|
|
8
|
+
*/
|
|
9
|
+
list(params?: T.LoyaltiesListParams): Promise<T.LoyaltiesListResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-loyalty-program
|
|
12
|
+
*/
|
|
13
|
+
create(campaign: T.LoyaltiesCreateCampaign): Promise<T.LoyaltiesCreateCampaignResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-loyalty-program
|
|
16
|
+
*/
|
|
17
|
+
get(campaignId: string): Promise<T.LoyaltiesCreateCampaignResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-loyalty-program
|
|
20
|
+
*/
|
|
21
|
+
update(campaign: T.LoyaltiesUpdateCampaign): Promise<T.LoyaltiesCreateCampaignResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-loyalty-program
|
|
24
|
+
*/
|
|
25
|
+
delete(campaignId: string, params?: T.LoyaltiesDeleteCampaignParams): Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-reward-assignments-1
|
|
28
|
+
*/
|
|
29
|
+
listRewardAssignments(campaignId: string, params?: T.LoyaltiesListRewardAssignmentsParams): Promise<T.LoyaltiesListRewardAssignmentsResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-reward-assignment-1
|
|
32
|
+
*/
|
|
33
|
+
createRewardAssignments(campaignId: string, assignment: T.LoyaltiesCreateRewardAssignments[]): Promise<T.LoyaltiesCreateRewardAssignmentResponse[]>;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-reward-assignment-1
|
|
36
|
+
*/
|
|
37
|
+
updateRewardAssignment(campaignId: string, assignment: T.LoyaltiesUpdateRewardAssignment): Promise<T.LoyaltiesCreateRewardAssignmentResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-reward-assignment-1
|
|
40
|
+
*/
|
|
41
|
+
deleteRewardAssignment(campaignId: string, assignmentId: string): Promise<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-earning-rules
|
|
44
|
+
*/
|
|
45
|
+
listEarningRules(campaignId: string, params?: T.LoyaltiesListEarningRulesParams): Promise<T.LoyaltiesListEarningRulesResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-earning-rule
|
|
48
|
+
*/
|
|
49
|
+
createEarningRule(campaignId: string, earningRules: T.LoyaltiesCreateEarningRule[]): Promise<T.LoyaltiesEarningRulesResponse[]>;
|
|
50
|
+
/**
|
|
51
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-earning-rule
|
|
52
|
+
*/
|
|
53
|
+
updateEarningRule(campaignId: string, earningRule: T.LoyaltiesUpdateEarningRule): Promise<T.LoyaltiesEarningRulesResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-earning-rule
|
|
56
|
+
*/
|
|
57
|
+
deleteEarningRule(campaignId: string, earningRuleId: string): Promise<unknown>;
|
|
58
|
+
/**
|
|
59
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-members
|
|
60
|
+
*/
|
|
61
|
+
listMembers(campaignId: string, params?: T.LoyaltiesListMembersParams): Promise<T.LoyaltiesListMembersResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-member
|
|
64
|
+
*/
|
|
65
|
+
createMember(campaignId: string, member: T.LoyaltiesCreateMember): Promise<T.LoyaltiesVoucherResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-member
|
|
68
|
+
*/
|
|
69
|
+
getMember(campaignId: string, memberId: string): Promise<T.LoyaltiesVoucherResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-member-activities
|
|
72
|
+
*/
|
|
73
|
+
getMemberActivities(campaignId: string, memberId: string): Promise<T.LoyaltiesGetMemberActivitiesResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#add-loyalty-card-balance
|
|
76
|
+
*/
|
|
77
|
+
addPoints(campaignId: string, memberId: string, balance: T.LoyaltiesAddPoints): Promise<T.LoyaltiesAddPointsResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#redeem-loyalty-card
|
|
80
|
+
*/
|
|
81
|
+
redeemReward(campaignId: string, memberId: string, params: T.LoyaltiesRedeemRewardParams): Promise<T.LoyaltiesRedeemRewardResponse>;
|
|
82
|
+
}
|
package/dist/Orders.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as T from './types/Orders';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Orders {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-order
|
|
8
|
+
*/
|
|
9
|
+
create(order: T.OrdersCreate): Promise<T.OrdersCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-order
|
|
12
|
+
*/
|
|
13
|
+
get(orderId: string): Promise<T.OrdersCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-order
|
|
16
|
+
*/
|
|
17
|
+
update(order: T.OrdersUpdate): Promise<T.OrdersCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-orders
|
|
20
|
+
*/
|
|
21
|
+
list(params?: T.OrdersListParams): Promise<T.OrdersListResponse>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as T from './types/Products';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Products {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-product
|
|
8
|
+
*/
|
|
9
|
+
create(product: T.ProductsCreate): Promise<T.ProductsCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-product
|
|
12
|
+
*/
|
|
13
|
+
get(productId: string): Promise<T.ProductsGetResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-product
|
|
16
|
+
*/
|
|
17
|
+
update(product: T.ProductsUpdate): Promise<T.ProductsCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-products-metadata-in-bulk
|
|
20
|
+
*/
|
|
21
|
+
bulkMetadataUpdate(products: T.ProductsBulkMetadataUpdate): Promise<T.ProductsBulkMetadataUpdateResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-products-in-bulk
|
|
24
|
+
*/
|
|
25
|
+
bulkUpdate(products: T.ProductsBulkUpdate): Promise<T.ProductsBulkUpdateResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-product
|
|
28
|
+
*/
|
|
29
|
+
delete(productId: string, params?: T.ProductsDeleteParams): Promise<unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-products
|
|
32
|
+
*/
|
|
33
|
+
list(params?: T.ProductsListParams): Promise<T.ProductsListResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-sku
|
|
36
|
+
*/
|
|
37
|
+
createSku(productId: string, sku: T.ProductsCreateSku): Promise<T.ProductsCreateSkuResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-sku
|
|
40
|
+
*/
|
|
41
|
+
getSku(productId: string, skuId: string): Promise<T.ProductsCreateSkuResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-sku
|
|
44
|
+
*/
|
|
45
|
+
updateSku(productId: string, sku: T.ProductsUpdateSku): Promise<T.ProductsCreateSkuResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-sku
|
|
48
|
+
*/
|
|
49
|
+
deleteSku(productId: string, skuId: string, params?: T.ProductsDeleteSkuParams): Promise<unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-skus
|
|
52
|
+
*/
|
|
53
|
+
listSkus(productId: string): Promise<T.ProductsListSkus>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-promotion-tiers
|
|
8
|
+
*/
|
|
9
|
+
listAll(params?: T.PromotionTiersListAllParams): Promise<T.PromotionTiersListAllResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-promotions
|
|
12
|
+
*/
|
|
13
|
+
list(promotionId: string): Promise<T.PromotionTiersListAllResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#add-promotion-tier-to-campaign
|
|
16
|
+
*/
|
|
17
|
+
create(promotionId: string, params: T.PromotionTiersCreateParams): Promise<T.PromotionTier>;
|
|
18
|
+
/**
|
|
19
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#redeem-promotion
|
|
20
|
+
*/
|
|
21
|
+
redeem(promotionsTierId: string, params: T.PromotionTiersRedeemParams): Promise<T.PromotionTiersRedeemResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-promotion
|
|
24
|
+
*/
|
|
25
|
+
update(params: T.PromotionTiersUpdateParams): Promise<T.PromotionTier>;
|
|
26
|
+
/**
|
|
27
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-promotion
|
|
28
|
+
*/
|
|
29
|
+
delete(promotionsTierId: string): Promise<unknown>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as T from './types/Promotions';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
import type { PromotionTiers } from './PromotionTiers';
|
|
4
|
+
export declare class Promotions {
|
|
5
|
+
private client;
|
|
6
|
+
tiers: PromotionTiers;
|
|
7
|
+
constructor(client: RequestController, tiers: PromotionTiers);
|
|
8
|
+
/**
|
|
9
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-promotion-campaign
|
|
10
|
+
*/
|
|
11
|
+
create(promotionCampaign: T.PromotionsCreate): Promise<T.PromotionsCreateResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* @see http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#validate-promotions-1
|
|
14
|
+
*/
|
|
15
|
+
validate(params: T.PromotionsValidateParams): Promise<T.PromotionsValidateResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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?utm_source=github&utm_medium=sdk&utm_campaign=acq#redeem-voucher
|
|
8
|
+
*/
|
|
9
|
+
redeem(code: string, body?: T.RedemptionsRedeemBody): Promise<T.RedemptionsRedeemResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-redemption
|
|
12
|
+
*/
|
|
13
|
+
get(redemptionId: string): Promise<T.Redemption>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-redemptions
|
|
16
|
+
*/
|
|
17
|
+
list(params?: T.RedemptionsListParams): Promise<T.RedemptionsListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#vouchers-redemptions
|
|
20
|
+
*/
|
|
21
|
+
getForVoucher(code: string): Promise<T.RedemptionsGetForVoucherResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#rollback-redemption
|
|
24
|
+
*/
|
|
25
|
+
rollback(redemptionId: string, params?: T.RedemptionsRollbackParams): Promise<T.RedemptionsRollbackResponse>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface RequestControllerOptions {
|
|
2
|
+
baseURL: string;
|
|
3
|
+
basePath: string;
|
|
4
|
+
headers: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class RequestController {
|
|
10
|
+
private baseURL;
|
|
11
|
+
private basePath;
|
|
12
|
+
private headers;
|
|
13
|
+
private request;
|
|
14
|
+
constructor({ basePath, baseURL, headers }: RequestControllerOptions);
|
|
15
|
+
setBaseUrl(baseURL: string): void;
|
|
16
|
+
get<T>(path: string, params?: Record<string, any>): Promise<T>;
|
|
17
|
+
post<T>(path: string, body: Record<string, any>, params?: Record<string, any>, headers?: Record<string, any>): Promise<T>;
|
|
18
|
+
put<T>(path: string, body: Record<string, any>, params?: Record<string, any>): Promise<T>;
|
|
19
|
+
delete<T>(path: string, params?: Record<string, any>): Promise<T>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-rewards
|
|
8
|
+
*/
|
|
9
|
+
list(params?: T.RewardsListParams): Promise<T.RewardsListResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-reward
|
|
12
|
+
*/
|
|
13
|
+
create(reward: T.RewardsCreate): Promise<T.RewardsCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-reward
|
|
16
|
+
*/
|
|
17
|
+
get(rewardId: string): Promise<T.RewardsCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-reward
|
|
20
|
+
*/
|
|
21
|
+
update(reward: T.RewardsUpdate): Promise<T.RewardsCreateResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-reward
|
|
24
|
+
*/
|
|
25
|
+
delete(rewardId: string): Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-reward-assignments
|
|
28
|
+
*/
|
|
29
|
+
listAssignments(rewardId: string, params?: T.RewardsListAssignmentsParams): Promise<T.RewardsListAssignmentsResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-reward-assignment
|
|
32
|
+
*/
|
|
33
|
+
createAssignment(rewardId: string, assignment: T.RewardsCreateAssignment): Promise<T.RewardsAssignmentObject>;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-reward-assignment
|
|
36
|
+
*/
|
|
37
|
+
updateAssignment(rewardId: string, assignment: T.RewardsUpdateAssignment): Promise<T.RewardsAssignmentObject>;
|
|
38
|
+
deleteAssignment(rewardId: string, assignmentId: string): Promise<unknown>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as T from './types/Segments';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class Segments {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-segment
|
|
8
|
+
*/
|
|
9
|
+
create(segment: T.SegmentsCreate): Promise<T.SegmentsCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-segment
|
|
12
|
+
*/
|
|
13
|
+
get(segmentId: string): Promise<T.SegmentsCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-segment
|
|
16
|
+
*/
|
|
17
|
+
delete(segmentId: string): Promise<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-segments
|
|
20
|
+
*/
|
|
21
|
+
list(customerId: string): Promise<T.SegmentsListResponse>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as T from './types/ValidationRules';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
export declare class ValidationRules {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: RequestController);
|
|
6
|
+
/**
|
|
7
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-validation-rules
|
|
8
|
+
*/
|
|
9
|
+
create(validationRule: T.ValidationRulesCreate): Promise<T.ValidationRulesCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-validation-rules
|
|
12
|
+
*/
|
|
13
|
+
get(validationRuleId: string): Promise<T.ValidationRulesGetResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#update-validation-rules
|
|
16
|
+
*/
|
|
17
|
+
update(validationRule: T.ValidationRulesUpdate): Promise<T.ValidationRulesCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-validation-rules
|
|
20
|
+
*/
|
|
21
|
+
delete(validationRuleId: string): Promise<unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-validation-rules-assignment
|
|
24
|
+
*/
|
|
25
|
+
createAssignment(validationRuleId: string, assignment: T.ValidationRulesCreateAssignment): Promise<T.ValidationRulesCreateAssignmentResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-validation-rules-assignment
|
|
28
|
+
*/
|
|
29
|
+
deleteAssignment(validationRuleId: string, assignmentId: string): Promise<unknown>;
|
|
30
|
+
validate(validationRuleId: string, params?: any): Promise<T.ValidationRulesValidateResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-validation-rules
|
|
33
|
+
*/
|
|
34
|
+
list(params?: T.ValidationRulesListParams): Promise<T.ValidationRulesListResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-validation-rule-assignments
|
|
37
|
+
*/
|
|
38
|
+
listAssignments(validationRuleId: string, params?: T.ValidationRulesListAssignmentsParams): Promise<T.ValidationRulesListAssignmentsResponse>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as T from './types/Validations';
|
|
2
|
+
import type { RequestController } from './RequestController';
|
|
3
|
+
import type { Promotions } from './Promotions';
|
|
4
|
+
export declare class Validations {
|
|
5
|
+
private client;
|
|
6
|
+
private promotions;
|
|
7
|
+
constructor(client: RequestController, promotions: Promotions);
|
|
8
|
+
/**
|
|
9
|
+
* @see https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#validate-voucher
|
|
10
|
+
*/
|
|
11
|
+
validateVoucher(code: string, params?: T.ValidationsValidateVoucherParams): Promise<T.ValidationsValidateVoucherResponse>;
|
|
12
|
+
validate(code: string | T.ValidationsValidateCode, context?: T.ValidationsValidateContext): Promise<T.ValidationsValidateVoucherResponse> | Promise<import("./types").PromotionsValidateResponse>;
|
|
13
|
+
}
|