@emilgroup/discount-sdk-node 1.12.1-beta.18 → 1.12.1-beta.19
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/README.md +2 -2
- package/api/campaigns-api.ts +33 -88
- package/api/health-api.ts +1 -1
- package/api/policy-vouchers-api.ts +24 -64
- package/api/vouchers-api.ts +15 -40
- package/base.ts +0 -4
- package/common.ts +2 -3
- package/dist/api/campaigns-api.d.ts +11 -11
- package/dist/api/campaigns-api.js +85 -153
- package/dist/api/health-api.d.ts +1 -1
- package/dist/api/health-api.js +1 -1
- package/dist/api/policy-vouchers-api.d.ts +8 -8
- package/dist/api/policy-vouchers-api.js +62 -112
- package/dist/api/vouchers-api.d.ts +5 -5
- package/dist/api/vouchers-api.js +38 -67
- package/dist/base.d.ts +0 -1
- package/dist/base.js +0 -3
- package/dist/common.d.ts +1 -1
- package/dist/common.js +0 -1
- package/package.json +2 -2
package/api/vouchers-api.ts
CHANGED
|
@@ -71,13 +71,8 @@ export const VouchersApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
71
71
|
// http bearer authentication required
|
|
72
72
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
77
|
-
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
78
|
-
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
79
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
80
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
74
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
75
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
|
|
@@ -124,13 +119,8 @@ export const VouchersApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
124
119
|
// http bearer authentication required
|
|
125
120
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
126
121
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
130
|
-
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
131
|
-
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
132
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
133
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
122
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
123
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
134
124
|
}
|
|
135
125
|
|
|
136
126
|
|
|
@@ -179,13 +169,8 @@ export const VouchersApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
179
169
|
localVarQueryParameter['expand'] = expand;
|
|
180
170
|
}
|
|
181
171
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
185
|
-
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
186
|
-
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
187
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
188
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
172
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
173
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
189
174
|
}
|
|
190
175
|
|
|
191
176
|
|
|
@@ -260,13 +245,8 @@ export const VouchersApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
260
245
|
localVarQueryParameter['filters'] = filters;
|
|
261
246
|
}
|
|
262
247
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
266
|
-
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
267
|
-
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
268
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
269
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
248
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
249
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
270
250
|
}
|
|
271
251
|
|
|
272
252
|
|
|
@@ -313,13 +293,8 @@ export const VouchersApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
313
293
|
// http bearer authentication required
|
|
314
294
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
315
295
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
319
|
-
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
320
|
-
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
321
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
322
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
296
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
297
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
323
298
|
}
|
|
324
299
|
|
|
325
300
|
|
|
@@ -667,7 +642,7 @@ export class VouchersApi extends BaseAPI {
|
|
|
667
642
|
* @memberof VouchersApi
|
|
668
643
|
*/
|
|
669
644
|
public createVoucher(requestParameters: VouchersApiCreateVoucherRequest, options?: AxiosRequestConfig) {
|
|
670
|
-
return VouchersApiFp(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization,
|
|
645
|
+
return VouchersApiFp(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
671
646
|
}
|
|
672
647
|
|
|
673
648
|
/**
|
|
@@ -679,7 +654,7 @@ export class VouchersApi extends BaseAPI {
|
|
|
679
654
|
* @memberof VouchersApi
|
|
680
655
|
*/
|
|
681
656
|
public deleteVoucher(requestParameters: VouchersApiDeleteVoucherRequest, options?: AxiosRequestConfig) {
|
|
682
|
-
return VouchersApiFp(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization,
|
|
657
|
+
return VouchersApiFp(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
683
658
|
}
|
|
684
659
|
|
|
685
660
|
/**
|
|
@@ -691,7 +666,7 @@ export class VouchersApi extends BaseAPI {
|
|
|
691
666
|
* @memberof VouchersApi
|
|
692
667
|
*/
|
|
693
668
|
public getVoucher(requestParameters: VouchersApiGetVoucherRequest, options?: AxiosRequestConfig) {
|
|
694
|
-
return VouchersApiFp(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand,
|
|
669
|
+
return VouchersApiFp(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
695
670
|
}
|
|
696
671
|
|
|
697
672
|
/**
|
|
@@ -703,7 +678,7 @@ export class VouchersApi extends BaseAPI {
|
|
|
703
678
|
* @memberof VouchersApi
|
|
704
679
|
*/
|
|
705
680
|
public listVouchers(requestParameters: VouchersApiListVouchersRequest = {}, options?: AxiosRequestConfig) {
|
|
706
|
-
return VouchersApiFp(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters,
|
|
681
|
+
return VouchersApiFp(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
707
682
|
}
|
|
708
683
|
|
|
709
684
|
/**
|
|
@@ -715,6 +690,6 @@ export class VouchersApi extends BaseAPI {
|
|
|
715
690
|
* @memberof VouchersApi
|
|
716
691
|
*/
|
|
717
692
|
public updateVoucher(requestParameters: VouchersApiUpdateVoucherRequest, options?: AxiosRequestConfig) {
|
|
718
|
-
return VouchersApiFp(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization,
|
|
693
|
+
return VouchersApiFp(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
719
694
|
}
|
|
720
695
|
}
|
package/base.ts
CHANGED
|
@@ -92,10 +92,6 @@ export class BaseAPI {
|
|
|
92
92
|
private username?: string;
|
|
93
93
|
private password?: string;
|
|
94
94
|
|
|
95
|
-
protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig {
|
|
96
|
-
return { ...options };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
95
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
100
96
|
if (configuration) {
|
|
101
97
|
this.configuration = configuration;
|
package/common.ts
CHANGED
|
@@ -131,10 +131,9 @@ export const toPathString = function (url: URL) {
|
|
|
131
131
|
* @export
|
|
132
132
|
*/
|
|
133
133
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
134
|
-
|
|
135
|
-
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
|
|
134
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
136
135
|
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
|
|
137
|
-
return axios.request<T, R>(axiosRequestArgs)
|
|
136
|
+
return axios.request<T, R>(axiosRequestArgs);
|
|
138
137
|
};
|
|
139
138
|
}
|
|
140
139
|
|
|
@@ -714,7 +714,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
714
714
|
* @throws {RequiredError}
|
|
715
715
|
* @memberof CampaignsApi
|
|
716
716
|
*/
|
|
717
|
-
createCampaign(requestParameters: CampaignsApiCreateCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCampaignResponseClass, any, {}
|
|
717
|
+
createCampaign(requestParameters: CampaignsApiCreateCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCampaignResponseClass, any, {}>>;
|
|
718
718
|
/**
|
|
719
719
|
* Creates an account that is eligible to redeem a vouchers from a specific campaign.
|
|
720
720
|
* @summary Create the Eligible Account
|
|
@@ -723,7 +723,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
723
723
|
* @throws {RequiredError}
|
|
724
724
|
* @memberof CampaignsApi
|
|
725
725
|
*/
|
|
726
|
-
createEligibleAccount(requestParameters: CampaignsApiCreateEligibleAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEligibleAccountResponseClass, any, {}
|
|
726
|
+
createEligibleAccount(requestParameters: CampaignsApiCreateEligibleAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEligibleAccountResponseClass, any, {}>>;
|
|
727
727
|
/**
|
|
728
728
|
* Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
|
|
729
729
|
* @summary Delete the Campaign
|
|
@@ -732,7 +732,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
732
732
|
* @throws {RequiredError}
|
|
733
733
|
* @memberof CampaignsApi
|
|
734
734
|
*/
|
|
735
|
-
deleteCampaign(requestParameters: CampaignsApiDeleteCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}
|
|
735
|
+
deleteCampaign(requestParameters: CampaignsApiDeleteCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
736
736
|
/**
|
|
737
737
|
* Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
|
|
738
738
|
* @summary Delete the Eligible Account
|
|
@@ -741,7 +741,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
741
741
|
* @throws {RequiredError}
|
|
742
742
|
* @memberof CampaignsApi
|
|
743
743
|
*/
|
|
744
|
-
deleteEligibleAccount(requestParameters: CampaignsApiDeleteEligibleAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}
|
|
744
|
+
deleteEligibleAccount(requestParameters: CampaignsApiDeleteEligibleAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
745
745
|
/**
|
|
746
746
|
* Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
|
|
747
747
|
* @summary Delete the Eligible Accounts
|
|
@@ -750,7 +750,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
750
750
|
* @throws {RequiredError}
|
|
751
751
|
* @memberof CampaignsApi
|
|
752
752
|
*/
|
|
753
|
-
deleteEligibleAccounts(requestParameters: CampaignsApiDeleteEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}
|
|
753
|
+
deleteEligibleAccounts(requestParameters: CampaignsApiDeleteEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
754
754
|
/**
|
|
755
755
|
* Retrieves detailed information about a specific campaign.
|
|
756
756
|
* @summary Retrieve the Campaign
|
|
@@ -759,7 +759,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
759
759
|
* @throws {RequiredError}
|
|
760
760
|
* @memberof CampaignsApi
|
|
761
761
|
*/
|
|
762
|
-
getCampaign(requestParameters: CampaignsApiGetCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetCampaignResponseClass, any, {}
|
|
762
|
+
getCampaign(requestParameters: CampaignsApiGetCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetCampaignResponseClass, any, {}>>;
|
|
763
763
|
/**
|
|
764
764
|
* Retrieves a list of campaigns.
|
|
765
765
|
* @summary List Campaigns
|
|
@@ -768,7 +768,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
768
768
|
* @throws {RequiredError}
|
|
769
769
|
* @memberof CampaignsApi
|
|
770
770
|
*/
|
|
771
|
-
listCampaigns(requestParameters?: CampaignsApiListCampaignsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListCampaignsResponseClass, any, {}
|
|
771
|
+
listCampaigns(requestParameters?: CampaignsApiListCampaignsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListCampaignsResponseClass, any, {}>>;
|
|
772
772
|
/**
|
|
773
773
|
* Retrieves a list of eligible accounts.
|
|
774
774
|
* @summary List Eligible Accounts
|
|
@@ -777,7 +777,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
777
777
|
* @throws {RequiredError}
|
|
778
778
|
* @memberof CampaignsApi
|
|
779
779
|
*/
|
|
780
|
-
listEligibleAccounts(requestParameters?: CampaignsApiListEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListEligibleAccountsResponseClass, any, {}
|
|
780
|
+
listEligibleAccounts(requestParameters?: CampaignsApiListEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListEligibleAccountsResponseClass, any, {}>>;
|
|
781
781
|
/**
|
|
782
782
|
* Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
|
|
783
783
|
* @summary Update the Campaign
|
|
@@ -786,7 +786,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
786
786
|
* @throws {RequiredError}
|
|
787
787
|
* @memberof CampaignsApi
|
|
788
788
|
*/
|
|
789
|
-
updateCampaign(requestParameters: CampaignsApiUpdateCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateCampaignResponseClass, any, {}
|
|
789
|
+
updateCampaign(requestParameters: CampaignsApiUpdateCampaignRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateCampaignResponseClass, any, {}>>;
|
|
790
790
|
/**
|
|
791
791
|
* Updates the status of a campaign, which affects whether vouchers can be redeemed.
|
|
792
792
|
* @summary Updates the status of a campaign.
|
|
@@ -795,7 +795,7 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
795
795
|
* @throws {RequiredError}
|
|
796
796
|
* @memberof CampaignsApi
|
|
797
797
|
*/
|
|
798
|
-
updateCampaignStatus(requestParameters: CampaignsApiUpdateCampaignStatusRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}
|
|
798
|
+
updateCampaignStatus(requestParameters: CampaignsApiUpdateCampaignStatusRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
799
799
|
/**
|
|
800
800
|
* Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
|
|
801
801
|
* @summary Uploads the eligible accounts.
|
|
@@ -804,5 +804,5 @@ export declare class CampaignsApi extends BaseAPI {
|
|
|
804
804
|
* @throws {RequiredError}
|
|
805
805
|
* @memberof CampaignsApi
|
|
806
806
|
*/
|
|
807
|
-
uploadEligibleAccounts(requestParameters: CampaignsApiUploadEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}
|
|
807
|
+
uploadEligibleAccounts(requestParameters: CampaignsApiUploadEligibleAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
808
808
|
}
|