@emilgroup/discount-sdk 1.5.0 → 1.5.1

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.
Files changed (149) hide show
  1. package/index.js +99 -0
  2. package/package.json +8 -21
  3. package/scripts/deploy.js +225 -0
  4. package/.openapi-generator/FILES +0 -54
  5. package/.openapi-generator/VERSION +0 -1
  6. package/.openapi-generator-ignore +0 -23
  7. package/api/campaigns-api.ts +0 -1433
  8. package/api/default-api.ts +0 -124
  9. package/api/policy-vouchers-api.ts +0 -999
  10. package/api/vouchers-api.ts +0 -691
  11. package/api.ts +0 -33
  12. package/base.ts +0 -331
  13. package/common.ts +0 -198
  14. package/configuration.ts +0 -110
  15. package/dist/api/campaigns-api.d.ts +0 -808
  16. package/dist/api/campaigns-api.js +0 -1251
  17. package/dist/api/default-api.d.ts +0 -70
  18. package/dist/api/default-api.js +0 -200
  19. package/dist/api/policy-vouchers-api.d.ts +0 -555
  20. package/dist/api/policy-vouchers-api.js +0 -915
  21. package/dist/api/vouchers-api.d.ts +0 -393
  22. package/dist/api/vouchers-api.js +0 -642
  23. package/dist/api.d.ts +0 -15
  24. package/dist/api.js +0 -33
  25. package/dist/base.d.ts +0 -86
  26. package/dist/base.js +0 -367
  27. package/dist/common.d.ts +0 -91
  28. package/dist/common.js +0 -276
  29. package/dist/configuration.d.ts +0 -89
  30. package/dist/configuration.js +0 -52
  31. package/dist/index.d.ts +0 -15
  32. package/dist/index.js +0 -36
  33. package/dist/models/campaign-class.d.ts +0 -105
  34. package/dist/models/campaign-class.js +0 -24
  35. package/dist/models/charge-policy-voucher-request-dto.d.ts +0 -48
  36. package/dist/models/charge-policy-voucher-request-dto.js +0 -15
  37. package/dist/models/charge-policy-voucher-response-class.d.ts +0 -96
  38. package/dist/models/charge-policy-voucher-response-class.js +0 -21
  39. package/dist/models/check-account-eligibility-request-dto.d.ts +0 -48
  40. package/dist/models/check-account-eligibility-request-dto.js +0 -15
  41. package/dist/models/check-account-eligibility-response-class.d.ts +0 -57
  42. package/dist/models/check-account-eligibility-response-class.js +0 -24
  43. package/dist/models/create-campaign-request-dto.d.ts +0 -42
  44. package/dist/models/create-campaign-request-dto.js +0 -15
  45. package/dist/models/create-campaign-response-class.d.ts +0 -25
  46. package/dist/models/create-campaign-response-class.js +0 -15
  47. package/dist/models/create-eligible-account-request-dto.d.ts +0 -30
  48. package/dist/models/create-eligible-account-request-dto.js +0 -15
  49. package/dist/models/create-eligible-account-response-class.d.ts +0 -25
  50. package/dist/models/create-eligible-account-response-class.js +0 -15
  51. package/dist/models/create-policy-voucher-request-dto.d.ts +0 -48
  52. package/dist/models/create-policy-voucher-request-dto.js +0 -15
  53. package/dist/models/create-policy-voucher-response-class.d.ts +0 -25
  54. package/dist/models/create-policy-voucher-response-class.js +0 -15
  55. package/dist/models/create-product-discount-dto.d.ts +0 -48
  56. package/dist/models/create-product-discount-dto.js +0 -15
  57. package/dist/models/create-voucher-request-dto.d.ts +0 -66
  58. package/dist/models/create-voucher-request-dto.js +0 -20
  59. package/dist/models/create-voucher-response-class.d.ts +0 -25
  60. package/dist/models/create-voucher-response-class.js +0 -15
  61. package/dist/models/eligible-account-class.d.ts +0 -78
  62. package/dist/models/eligible-account-class.js +0 -15
  63. package/dist/models/get-campaign-response-class.d.ts +0 -25
  64. package/dist/models/get-campaign-response-class.js +0 -15
  65. package/dist/models/get-policy-voucher-response-class.d.ts +0 -25
  66. package/dist/models/get-policy-voucher-response-class.js +0 -15
  67. package/dist/models/get-voucher-response-class.d.ts +0 -25
  68. package/dist/models/get-voucher-response-class.js +0 -15
  69. package/dist/models/index.d.ts +0 -37
  70. package/dist/models/index.js +0 -53
  71. package/dist/models/inline-response200.d.ts +0 -54
  72. package/dist/models/inline-response200.js +0 -15
  73. package/dist/models/inline-response503.d.ts +0 -54
  74. package/dist/models/inline-response503.js +0 -15
  75. package/dist/models/list-campaigns-response-class.d.ts +0 -43
  76. package/dist/models/list-campaigns-response-class.js +0 -15
  77. package/dist/models/list-eligible-accounts-response-class.d.ts +0 -43
  78. package/dist/models/list-eligible-accounts-response-class.js +0 -15
  79. package/dist/models/list-policy-vouchers-response-class.d.ts +0 -43
  80. package/dist/models/list-policy-vouchers-response-class.js +0 -15
  81. package/dist/models/list-vouchers-response-class.d.ts +0 -43
  82. package/dist/models/list-vouchers-response-class.js +0 -15
  83. package/dist/models/policy-voucher-class.d.ts +0 -165
  84. package/dist/models/policy-voucher-class.js +0 -21
  85. package/dist/models/policy-voucher-transaction-class.d.ts +0 -126
  86. package/dist/models/policy-voucher-transaction-class.js +0 -26
  87. package/dist/models/product-discount-class.d.ts +0 -90
  88. package/dist/models/product-discount-class.js +0 -15
  89. package/dist/models/redeem-policy-voucher-request-dto.d.ts +0 -48
  90. package/dist/models/redeem-policy-voucher-request-dto.js +0 -15
  91. package/dist/models/redeem-policy-voucher-response-class.d.ts +0 -84
  92. package/dist/models/redeem-policy-voucher-response-class.js +0 -21
  93. package/dist/models/update-campaign-request-dto.d.ts +0 -42
  94. package/dist/models/update-campaign-request-dto.js +0 -15
  95. package/dist/models/update-campaign-response-class.d.ts +0 -25
  96. package/dist/models/update-campaign-response-class.js +0 -15
  97. package/dist/models/update-campaign-status-request-dto.d.ts +0 -33
  98. package/dist/models/update-campaign-status-request-dto.js +0 -24
  99. package/dist/models/update-voucher-request-dto.d.ts +0 -60
  100. package/dist/models/update-voucher-request-dto.js +0 -20
  101. package/dist/models/update-voucher-response-class.d.ts +0 -25
  102. package/dist/models/update-voucher-response-class.js +0 -15
  103. package/dist/models/voucher-class.d.ts +0 -127
  104. package/dist/models/voucher-class.js +0 -20
  105. package/dist/models/withdraw-policy-voucher-request-dto.d.ts +0 -36
  106. package/dist/models/withdraw-policy-voucher-request-dto.js +0 -15
  107. package/dist/models/withdraw-policy-voucher-response-class.d.ts +0 -78
  108. package/dist/models/withdraw-policy-voucher-response-class.js +0 -21
  109. package/git_push.sh +0 -57
  110. package/index.ts +0 -19
  111. package/models/campaign-class.ts +0 -114
  112. package/models/charge-policy-voucher-request-dto.ts +0 -54
  113. package/models/charge-policy-voucher-response-class.ts +0 -105
  114. package/models/check-account-eligibility-request-dto.ts +0 -54
  115. package/models/check-account-eligibility-response-class.ts +0 -66
  116. package/models/create-campaign-request-dto.ts +0 -48
  117. package/models/create-campaign-response-class.ts +0 -31
  118. package/models/create-eligible-account-request-dto.ts +0 -36
  119. package/models/create-eligible-account-response-class.ts +0 -31
  120. package/models/create-policy-voucher-request-dto.ts +0 -54
  121. package/models/create-policy-voucher-response-class.ts +0 -31
  122. package/models/create-product-discount-dto.ts +0 -54
  123. package/models/create-voucher-request-dto.ts +0 -75
  124. package/models/create-voucher-response-class.ts +0 -31
  125. package/models/eligible-account-class.ts +0 -84
  126. package/models/get-campaign-response-class.ts +0 -31
  127. package/models/get-policy-voucher-response-class.ts +0 -31
  128. package/models/get-voucher-response-class.ts +0 -31
  129. package/models/index.ts +0 -37
  130. package/models/inline-response200.ts +0 -48
  131. package/models/inline-response503.ts +0 -48
  132. package/models/list-campaigns-response-class.ts +0 -49
  133. package/models/list-eligible-accounts-response-class.ts +0 -49
  134. package/models/list-policy-vouchers-response-class.ts +0 -49
  135. package/models/list-vouchers-response-class.ts +0 -49
  136. package/models/policy-voucher-class.ts +0 -174
  137. package/models/policy-voucher-transaction-class.ts +0 -136
  138. package/models/product-discount-class.ts +0 -96
  139. package/models/redeem-policy-voucher-request-dto.ts +0 -54
  140. package/models/redeem-policy-voucher-response-class.ts +0 -93
  141. package/models/update-campaign-request-dto.ts +0 -48
  142. package/models/update-campaign-response-class.ts +0 -31
  143. package/models/update-campaign-status-request-dto.ts +0 -42
  144. package/models/update-voucher-request-dto.ts +0 -69
  145. package/models/update-voucher-response-class.ts +0 -31
  146. package/models/voucher-class.ts +0 -136
  147. package/models/withdraw-policy-voucher-request-dto.ts +0 -42
  148. package/models/withdraw-policy-voucher-response-class.ts +0 -87
  149. package/tsconfig.json +0 -23
@@ -1,691 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
- import { Configuration } from '../configuration';
18
- // Some imports not used depending on template conditions
19
- // @ts-ignore
20
- import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
- // @ts-ignore
22
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
- // @ts-ignore
24
- import { CreateVoucherRequestDto } from '../models';
25
- // @ts-ignore
26
- import { CreateVoucherResponseClass } from '../models';
27
- // @ts-ignore
28
- import { GetVoucherResponseClass } from '../models';
29
- // @ts-ignore
30
- import { ListVouchersResponseClass } from '../models';
31
- // @ts-ignore
32
- import { UpdateVoucherRequestDto } from '../models';
33
- // @ts-ignore
34
- import { UpdateVoucherResponseClass } from '../models';
35
- /**
36
- * VouchersApi - axios parameter creator
37
- * @export
38
- */
39
- export const VouchersApiAxiosParamCreator = function (configuration?: Configuration) {
40
- return {
41
- /**
42
- * This will create a voucher.
43
- * @summary Create the Voucher
44
- * @param {CreateVoucherRequestDto} createVoucherRequestDto
45
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
46
- * @param {*} [options] Override http request option.
47
- * @throws {RequiredError}
48
- */
49
- createVoucher: async (createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
50
- // verify required parameter 'createVoucherRequestDto' is not null or undefined
51
- assertParamExists('createVoucher', 'createVoucherRequestDto', createVoucherRequestDto)
52
- const localVarPath = `/discountservice/v1/vouchers`;
53
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
54
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
55
- let baseOptions;
56
- let baseAccessToken;
57
- if (configuration) {
58
- baseOptions = configuration.baseOptions;
59
- baseAccessToken = configuration.accessToken;
60
- }
61
-
62
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
63
- const localVarHeaderParameter = {} as any;
64
- const localVarQueryParameter = {} as any;
65
-
66
- // authentication bearer required
67
- // http bearer authentication required
68
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
69
-
70
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
71
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
72
- }
73
-
74
-
75
-
76
- localVarHeaderParameter['Content-Type'] = 'application/json';
77
-
78
- setSearchParams(localVarUrlObj, localVarQueryParameter);
79
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
80
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
81
- localVarRequestOptions.data = serializeDataIfNeeded(createVoucherRequestDto, localVarRequestOptions, configuration)
82
-
83
- return {
84
- url: toPathString(localVarUrlObj),
85
- options: localVarRequestOptions,
86
- };
87
- },
88
- /**
89
- * This will delete a voucher.
90
- * @summary Delete the Voucher
91
- * @param {string} code Unique identifier for the object.
92
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
93
- * @param {*} [options] Override http request option.
94
- * @throws {RequiredError}
95
- */
96
- deleteVoucher: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
97
- // verify required parameter 'code' is not null or undefined
98
- assertParamExists('deleteVoucher', 'code', code)
99
- const localVarPath = `/discountservice/v1/vouchers/{code}`
100
- .replace(`{${"code"}}`, encodeURIComponent(String(code)));
101
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
102
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
103
- let baseOptions;
104
- let baseAccessToken;
105
- if (configuration) {
106
- baseOptions = configuration.baseOptions;
107
- baseAccessToken = configuration.accessToken;
108
- }
109
-
110
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
111
- const localVarHeaderParameter = {} as any;
112
- const localVarQueryParameter = {} as any;
113
-
114
- // authentication bearer required
115
- // http bearer authentication required
116
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
117
-
118
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
119
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
120
- }
121
-
122
-
123
-
124
- setSearchParams(localVarUrlObj, localVarQueryParameter);
125
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
126
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
127
-
128
- return {
129
- url: toPathString(localVarUrlObj),
130
- options: localVarRequestOptions,
131
- };
132
- },
133
- /**
134
- * This will get a voucher.
135
- * @summary Retrieve the Voucher
136
- * @param {string} code Unique identifier for the object.
137
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
138
- * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
139
- * @param {*} [options] Override http request option.
140
- * @throws {RequiredError}
141
- */
142
- getVoucher: async (code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
143
- // verify required parameter 'code' is not null or undefined
144
- assertParamExists('getVoucher', 'code', code)
145
- const localVarPath = `/discountservice/v1/vouchers/{code}`
146
- .replace(`{${"code"}}`, encodeURIComponent(String(code)));
147
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
148
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
149
- let baseOptions;
150
- let baseAccessToken;
151
- if (configuration) {
152
- baseOptions = configuration.baseOptions;
153
- baseAccessToken = configuration.accessToken;
154
- }
155
-
156
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
157
- const localVarHeaderParameter = {} as any;
158
- const localVarQueryParameter = {} as any;
159
-
160
- // authentication bearer required
161
- // http bearer authentication required
162
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
163
-
164
- if (expand !== undefined) {
165
- localVarQueryParameter['expand'] = expand;
166
- }
167
-
168
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
169
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
170
- }
171
-
172
-
173
-
174
- setSearchParams(localVarUrlObj, localVarQueryParameter);
175
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
176
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
177
-
178
- return {
179
- url: toPathString(localVarUrlObj),
180
- options: localVarRequestOptions,
181
- };
182
- },
183
- /**
184
- * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
185
- * @summary List Vouchers
186
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
187
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
188
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
189
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
190
- * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
191
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
192
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
193
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
194
- * @param {*} [options] Override http request option.
195
- * @throws {RequiredError}
196
- */
197
- listVouchers: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
198
- const localVarPath = `/discountservice/v1/vouchers`;
199
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
200
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
201
- let baseOptions;
202
- let baseAccessToken;
203
- if (configuration) {
204
- baseOptions = configuration.baseOptions;
205
- baseAccessToken = configuration.accessToken;
206
- }
207
-
208
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
209
- const localVarHeaderParameter = {} as any;
210
- const localVarQueryParameter = {} as any;
211
-
212
- // authentication bearer required
213
- // http bearer authentication required
214
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
215
-
216
- if (pageSize !== undefined) {
217
- localVarQueryParameter['pageSize'] = pageSize;
218
- }
219
-
220
- if (pageToken !== undefined) {
221
- localVarQueryParameter['pageToken'] = pageToken;
222
- }
223
-
224
- if (filter !== undefined) {
225
- localVarQueryParameter['filter'] = filter;
226
- }
227
-
228
- if (search !== undefined) {
229
- localVarQueryParameter['search'] = search;
230
- }
231
-
232
- if (order !== undefined) {
233
- localVarQueryParameter['order'] = order;
234
- }
235
-
236
- if (expand !== undefined) {
237
- localVarQueryParameter['expand'] = expand;
238
- }
239
-
240
- if (filters !== undefined) {
241
- localVarQueryParameter['filters'] = filters;
242
- }
243
-
244
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
245
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
246
- }
247
-
248
-
249
-
250
- setSearchParams(localVarUrlObj, localVarQueryParameter);
251
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
252
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
253
-
254
- return {
255
- url: toPathString(localVarUrlObj),
256
- options: localVarRequestOptions,
257
- };
258
- },
259
- /**
260
- * This will update a voucher.
261
- * @summary Update the Voucher
262
- * @param {string} code Unique identifier for the object.
263
- * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
264
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
265
- * @param {*} [options] Override http request option.
266
- * @throws {RequiredError}
267
- */
268
- updateVoucher: async (code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
269
- // verify required parameter 'code' is not null or undefined
270
- assertParamExists('updateVoucher', 'code', code)
271
- // verify required parameter 'updateVoucherRequestDto' is not null or undefined
272
- assertParamExists('updateVoucher', 'updateVoucherRequestDto', updateVoucherRequestDto)
273
- const localVarPath = `/discountservice/v1/vouchers/{code}`
274
- .replace(`{${"code"}}`, encodeURIComponent(String(code)));
275
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
276
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
277
- let baseOptions;
278
- let baseAccessToken;
279
- if (configuration) {
280
- baseOptions = configuration.baseOptions;
281
- baseAccessToken = configuration.accessToken;
282
- }
283
-
284
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
285
- const localVarHeaderParameter = {} as any;
286
- const localVarQueryParameter = {} as any;
287
-
288
- // authentication bearer required
289
- // http bearer authentication required
290
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
291
-
292
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
293
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
294
- }
295
-
296
-
297
-
298
- localVarHeaderParameter['Content-Type'] = 'application/json';
299
-
300
- setSearchParams(localVarUrlObj, localVarQueryParameter);
301
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
302
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
303
- localVarRequestOptions.data = serializeDataIfNeeded(updateVoucherRequestDto, localVarRequestOptions, configuration)
304
-
305
- return {
306
- url: toPathString(localVarUrlObj),
307
- options: localVarRequestOptions,
308
- };
309
- },
310
- }
311
- };
312
-
313
- /**
314
- * VouchersApi - functional programming interface
315
- * @export
316
- */
317
- export const VouchersApiFp = function(configuration?: Configuration) {
318
- const localVarAxiosParamCreator = VouchersApiAxiosParamCreator(configuration)
319
- return {
320
- /**
321
- * This will create a voucher.
322
- * @summary Create the Voucher
323
- * @param {CreateVoucherRequestDto} createVoucherRequestDto
324
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
325
- * @param {*} [options] Override http request option.
326
- * @throws {RequiredError}
327
- */
328
- async createVoucher(createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateVoucherResponseClass>> {
329
- const localVarAxiosArgs = await localVarAxiosParamCreator.createVoucher(createVoucherRequestDto, authorization, options);
330
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
331
- },
332
- /**
333
- * This will delete a voucher.
334
- * @summary Delete the Voucher
335
- * @param {string} code Unique identifier for the object.
336
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
337
- * @param {*} [options] Override http request option.
338
- * @throws {RequiredError}
339
- */
340
- async deleteVoucher(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
341
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteVoucher(code, authorization, options);
342
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
343
- },
344
- /**
345
- * This will get a voucher.
346
- * @summary Retrieve the Voucher
347
- * @param {string} code Unique identifier for the object.
348
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
349
- * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
350
- * @param {*} [options] Override http request option.
351
- * @throws {RequiredError}
352
- */
353
- async getVoucher(code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetVoucherResponseClass>> {
354
- const localVarAxiosArgs = await localVarAxiosParamCreator.getVoucher(code, authorization, expand, options);
355
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
356
- },
357
- /**
358
- * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
359
- * @summary List Vouchers
360
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
361
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
362
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
363
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
364
- * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
365
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
366
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
367
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
368
- * @param {*} [options] Override http request option.
369
- * @throws {RequiredError}
370
- */
371
- async listVouchers(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListVouchersResponseClass>> {
372
- const localVarAxiosArgs = await localVarAxiosParamCreator.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
373
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
374
- },
375
- /**
376
- * This will update a voucher.
377
- * @summary Update the Voucher
378
- * @param {string} code Unique identifier for the object.
379
- * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
380
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
381
- * @param {*} [options] Override http request option.
382
- * @throws {RequiredError}
383
- */
384
- async updateVoucher(code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateVoucherResponseClass>> {
385
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateVoucher(code, updateVoucherRequestDto, authorization, options);
386
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
387
- },
388
- }
389
- };
390
-
391
- /**
392
- * VouchersApi - factory interface
393
- * @export
394
- */
395
- export const VouchersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
396
- const localVarFp = VouchersApiFp(configuration)
397
- return {
398
- /**
399
- * This will create a voucher.
400
- * @summary Create the Voucher
401
- * @param {CreateVoucherRequestDto} createVoucherRequestDto
402
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
403
- * @param {*} [options] Override http request option.
404
- * @throws {RequiredError}
405
- */
406
- createVoucher(createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options?: any): AxiosPromise<CreateVoucherResponseClass> {
407
- return localVarFp.createVoucher(createVoucherRequestDto, authorization, options).then((request) => request(axios, basePath));
408
- },
409
- /**
410
- * This will delete a voucher.
411
- * @summary Delete the Voucher
412
- * @param {string} code Unique identifier for the object.
413
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
414
- * @param {*} [options] Override http request option.
415
- * @throws {RequiredError}
416
- */
417
- deleteVoucher(code: string, authorization?: string, options?: any): AxiosPromise<void> {
418
- return localVarFp.deleteVoucher(code, authorization, options).then((request) => request(axios, basePath));
419
- },
420
- /**
421
- * This will get a voucher.
422
- * @summary Retrieve the Voucher
423
- * @param {string} code Unique identifier for the object.
424
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
425
- * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
426
- * @param {*} [options] Override http request option.
427
- * @throws {RequiredError}
428
- */
429
- getVoucher(code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options?: any): AxiosPromise<GetVoucherResponseClass> {
430
- return localVarFp.getVoucher(code, authorization, expand, options).then((request) => request(axios, basePath));
431
- },
432
- /**
433
- * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
434
- * @summary List Vouchers
435
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
436
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
437
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
438
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
439
- * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
440
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
441
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
442
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
443
- * @param {*} [options] Override http request option.
444
- * @throws {RequiredError}
445
- */
446
- listVouchers(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListVouchersResponseClass> {
447
- return localVarFp.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
448
- },
449
- /**
450
- * This will update a voucher.
451
- * @summary Update the Voucher
452
- * @param {string} code Unique identifier for the object.
453
- * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
454
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
455
- * @param {*} [options] Override http request option.
456
- * @throws {RequiredError}
457
- */
458
- updateVoucher(code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateVoucherResponseClass> {
459
- return localVarFp.updateVoucher(code, updateVoucherRequestDto, authorization, options).then((request) => request(axios, basePath));
460
- },
461
- };
462
- };
463
-
464
- /**
465
- * Request parameters for createVoucher operation in VouchersApi.
466
- * @export
467
- * @interface VouchersApiCreateVoucherRequest
468
- */
469
- export interface VouchersApiCreateVoucherRequest {
470
- /**
471
- *
472
- * @type {CreateVoucherRequestDto}
473
- * @memberof VouchersApiCreateVoucher
474
- */
475
- readonly createVoucherRequestDto: CreateVoucherRequestDto
476
-
477
- /**
478
- * Bearer Token: provided by the login endpoint under the name accessToken.
479
- * @type {string}
480
- * @memberof VouchersApiCreateVoucher
481
- */
482
- readonly authorization?: string
483
- }
484
-
485
- /**
486
- * Request parameters for deleteVoucher operation in VouchersApi.
487
- * @export
488
- * @interface VouchersApiDeleteVoucherRequest
489
- */
490
- export interface VouchersApiDeleteVoucherRequest {
491
- /**
492
- * Unique identifier for the object.
493
- * @type {string}
494
- * @memberof VouchersApiDeleteVoucher
495
- */
496
- readonly code: string
497
-
498
- /**
499
- * Bearer Token: provided by the login endpoint under the name accessToken.
500
- * @type {string}
501
- * @memberof VouchersApiDeleteVoucher
502
- */
503
- readonly authorization?: string
504
- }
505
-
506
- /**
507
- * Request parameters for getVoucher operation in VouchersApi.
508
- * @export
509
- * @interface VouchersApiGetVoucherRequest
510
- */
511
- export interface VouchersApiGetVoucherRequest {
512
- /**
513
- * Unique identifier for the object.
514
- * @type {string}
515
- * @memberof VouchersApiGetVoucher
516
- */
517
- readonly code: string
518
-
519
- /**
520
- * Bearer Token: provided by the login endpoint under the name accessToken.
521
- * @type {string}
522
- * @memberof VouchersApiGetVoucher
523
- */
524
- readonly authorization?: string
525
-
526
- /**
527
- * You can expand voucher in this endpoint.
528
- * @type {'campaign' | 'productDiscounts'}
529
- * @memberof VouchersApiGetVoucher
530
- */
531
- readonly expand?: 'campaign' | 'productDiscounts'
532
- }
533
-
534
- /**
535
- * Request parameters for listVouchers operation in VouchersApi.
536
- * @export
537
- * @interface VouchersApiListVouchersRequest
538
- */
539
- export interface VouchersApiListVouchersRequest {
540
- /**
541
- * Bearer Token: provided by the login endpoint under the name accessToken.
542
- * @type {string}
543
- * @memberof VouchersApiListVouchers
544
- */
545
- readonly authorization?: string
546
-
547
- /**
548
- * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
549
- * @type {number}
550
- * @memberof VouchersApiListVouchers
551
- */
552
- readonly pageSize?: number
553
-
554
- /**
555
- * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
556
- * @type {string}
557
- * @memberof VouchersApiListVouchers
558
- */
559
- readonly pageToken?: string
560
-
561
- /**
562
- * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
563
- * @type {string}
564
- * @memberof VouchersApiListVouchers
565
- */
566
- readonly filter?: string
567
-
568
- /**
569
- * Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
570
- * @type {string}
571
- * @memberof VouchersApiListVouchers
572
- */
573
- readonly search?: string
574
-
575
- /**
576
- * Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
577
- * @type {string}
578
- * @memberof VouchersApiListVouchers
579
- */
580
- readonly order?: string
581
-
582
- /**
583
- * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
584
- * @type {string}
585
- * @memberof VouchersApiListVouchers
586
- */
587
- readonly expand?: string
588
-
589
- /**
590
- * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
591
- * @type {string}
592
- * @memberof VouchersApiListVouchers
593
- */
594
- readonly filters?: string
595
- }
596
-
597
- /**
598
- * Request parameters for updateVoucher operation in VouchersApi.
599
- * @export
600
- * @interface VouchersApiUpdateVoucherRequest
601
- */
602
- export interface VouchersApiUpdateVoucherRequest {
603
- /**
604
- * Unique identifier for the object.
605
- * @type {string}
606
- * @memberof VouchersApiUpdateVoucher
607
- */
608
- readonly code: string
609
-
610
- /**
611
- *
612
- * @type {UpdateVoucherRequestDto}
613
- * @memberof VouchersApiUpdateVoucher
614
- */
615
- readonly updateVoucherRequestDto: UpdateVoucherRequestDto
616
-
617
- /**
618
- * Bearer Token: provided by the login endpoint under the name accessToken.
619
- * @type {string}
620
- * @memberof VouchersApiUpdateVoucher
621
- */
622
- readonly authorization?: string
623
- }
624
-
625
- /**
626
- * VouchersApi - object-oriented interface
627
- * @export
628
- * @class VouchersApi
629
- * @extends {BaseAPI}
630
- */
631
- export class VouchersApi extends BaseAPI {
632
- /**
633
- * This will create a voucher.
634
- * @summary Create the Voucher
635
- * @param {VouchersApiCreateVoucherRequest} requestParameters Request parameters.
636
- * @param {*} [options] Override http request option.
637
- * @throws {RequiredError}
638
- * @memberof VouchersApi
639
- */
640
- public createVoucher(requestParameters: VouchersApiCreateVoucherRequest, options?: AxiosRequestConfig) {
641
- return VouchersApiFp(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
642
- }
643
-
644
- /**
645
- * This will delete a voucher.
646
- * @summary Delete the Voucher
647
- * @param {VouchersApiDeleteVoucherRequest} requestParameters Request parameters.
648
- * @param {*} [options] Override http request option.
649
- * @throws {RequiredError}
650
- * @memberof VouchersApi
651
- */
652
- public deleteVoucher(requestParameters: VouchersApiDeleteVoucherRequest, options?: AxiosRequestConfig) {
653
- return VouchersApiFp(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
654
- }
655
-
656
- /**
657
- * This will get a voucher.
658
- * @summary Retrieve the Voucher
659
- * @param {VouchersApiGetVoucherRequest} requestParameters Request parameters.
660
- * @param {*} [options] Override http request option.
661
- * @throws {RequiredError}
662
- * @memberof VouchersApi
663
- */
664
- public getVoucher(requestParameters: VouchersApiGetVoucherRequest, options?: AxiosRequestConfig) {
665
- return VouchersApiFp(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
666
- }
667
-
668
- /**
669
- * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
670
- * @summary List Vouchers
671
- * @param {VouchersApiListVouchersRequest} requestParameters Request parameters.
672
- * @param {*} [options] Override http request option.
673
- * @throws {RequiredError}
674
- * @memberof VouchersApi
675
- */
676
- public listVouchers(requestParameters: VouchersApiListVouchersRequest = {}, options?: AxiosRequestConfig) {
677
- 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));
678
- }
679
-
680
- /**
681
- * This will update a voucher.
682
- * @summary Update the Voucher
683
- * @param {VouchersApiUpdateVoucherRequest} requestParameters Request parameters.
684
- * @param {*} [options] Override http request option.
685
- * @throws {RequiredError}
686
- * @memberof VouchersApi
687
- */
688
- public updateVoucher(requestParameters: VouchersApiUpdateVoucherRequest, options?: AxiosRequestConfig) {
689
- return VouchersApiFp(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
690
- }
691
- }